Adding_Multi_Players - MukeshKumar101/IPL_Auction GitHub Wiki
Problem statement:
To create a page to add multiple players from local files consisting of new player's data.
Events required:
- onSearchFileFromLocal()
- onSelectFileFromLocal()
- onUpload()
- onMappingInputValue()
- onSubmit()
onSearchFileFromLocal():
This event will be triggered when the browse file button is selected from the player's page
Possibilities:
- cancelledWithoutSelectingAnyFile()
- desiredFileIsFound()
- desiredFileIsNotFound()
Jobs to be done:
- Open the user's local machine directory.
onSelectFileFromLocal():
This event will be triggered once a file is been selected from the local directory (proceeded from onSearchFileFromLocal())
Supported file extensions: .xlxs, .xls, .cvv
Possiblities:
- selectedFileWithUnsupportedFormat()
- Jobs to be done:
- Display error with message "file is unsupported" in the player's page
- Jobs to be done:
- selectedFileWithSupportedFormat()
- Jobs to be done:
- The path of the file must be set in the file-path-input
- Jobs to be done:
onUpload()
This event will be triggered when the user confirms the path in the file-path-input and clicks upload
Pre-requisite: A valid file-path must be provided in the file-path-input
Possibilities:
-
invalidPathIsProvided() (hard-coded by user)
- Jobs to be done:
- Display error with message "Provide a valid path"
- Jobs to be done:
-
providedPathWithUnsupportedFile() (hard-coded by user)
- Jobs to be done:
- Display error with message "file is unsupported"
- Jobs to be done:
-
uploadsWithValidPath()
- Jobs to be done:
- Make a post-api-call to convert the raw fetched data to a prepared list of players data
- Set the prepared data to the player's input(can be random)
- Jobs to be done:
-
uploadsWithoutInternet()
- Jobs to be done:
- Display error with the message "Connection could not be established, please check the internet!"
- Jobs to be done:
onMappingInputValue()
This event will is used to map the player's details(input-name) with the column of the prepared/fetched data (output of the upload())
Pre-requisite: input values should have been set(positive scenerio of onUpload() should have occured)
Possiblities:
-
mappedWithWrongColumn()
- Jobs to be done:
- Display error with message "unsupported input value"
- Jobs to be done:
-
mappedWithMatchingColumn()
- Jobs to be done:
- Set the selected column value to the corresponding input field
- Jobs to be done:
onSubmit()
This event will be triggered to store the player details(data) to the database.
Pre-requisite: All player-input-fields must be filled (onMappingInputValue() with positive scenerio)
Possibilities:
-
submitWithoutInternet()
- Jobs to be done:
- Display an error with the message "Connection could not be established, please check the internet!"
- Jobs to be done:
-
submitWithoutInternet()
- Jobs to be done:
- Request a post-API-call to store the player's details.
- clear all the input fields
- Jobs to be done: