Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUIN-269] Reduce effects of question loading lagging and add loading spinner on question form #176

Closed
wants to merge 8 commits into from

Conversation

18chowdhary
Copy link
Collaborator

Description

Previously, the questions on the question form took an extremely long time to load, which was frustrating. This change attempts to reduce some of this lagging by reducing the repetitive computation needed to load questions. However, the change in lag was not significant after this, so additionally, I have added a loading spinner to the question form to visually communicate to the user that the questions are loading. While still frustrating, the loading spinner makes the wait less confusing. Regardless, in the future, we should try to address the underlying lag issue.

Testing

  1. Open the app and create a new report.
  2. Add one vehicle and one non-motorist.
  3. Click on each form section in the Home screen. Each section should initially render with a loading spinner, and then with the questions.

Copy link
Collaborator

@KristinAoki KristinAoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address the comments then it will be good to merge! Everything works perfectly!

@@ -14,6 +14,7 @@ const MultiButtonSelectorQuickSurvey = (props) => {
// obtained as inputs to component made in QuickSurvey
const {data, quickSurveyReducer, submitFunction, updateResponse, dependencyID} = props;
let currId = data.humanReadableId
console.log(data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove log statement

@@ -10,7 +10,7 @@ import QuestionSection from '../QuestionSection';

const NumberButtonSelectorQuickSurvey = (props) => {
const [selection, setSelection] = React.useState('')
// console.log(selection)
console.log('numerbuttonselectorquicksurvey selection:', selection)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@@ -122,7 +122,7 @@ const DropDownMultiSelect = (props) => {
setSelectedOptions([]);
return;
}
// console.log(selectedOptions)
console.log('dropdownmultiselect selectedoptions:', selectedOptions)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

} else {
this.setState({ autoSavedSession: false, filePickerDialogBoxVisible: false });
console.log('No unfinished report!');
// console.log('No unfinished report!');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@@ -58,10 +58,10 @@ class Welcome extends Component {
checkAutoSavedSession(){
if (this.stateManager.filePaths != null) {
this.setState({autoSavedSession : true, filePickerDialogBoxVisible: true});
console.log('Detect unfinished reports!');
// console.log('Detect unfinished reports!');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@KristinAoki
Copy link
Collaborator

Do you know what the trace.html file is for?

@KristinAoki KristinAoki changed the base branch from master to dev April 13, 2022 14:12
@18chowdhary 18chowdhary linked an issue Apr 16, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement loading spinner in question form
2 participants