-
Notifications
You must be signed in to change notification settings - Fork 114
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
🏗️ Major Refactor to Remove Label Button Services #1086
🏗️ Major Refactor to Remove Label Button Services #1086
Commits on Oct 9, 2023
-
Merge branch 'master' of https://github.com/e-mission/e-mission-phone …
…into rewrite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for 3b5e169 - Browse repository at this point
Copy the full SHA 3b5e169View commit details
Commits on Oct 25, 2023
-
Merge branch 'input-matcher-rewrite' of https://github.com/jiji14/e-m…
…ission-phone into rewrite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for dc28f99 - Browse repository at this point
Copy the full SHA dc28f99View commit details -
Merge branch 'input-matcher-rewrite' of https://github.com/jiji14/e-m…
…ission-phone into rewrite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for 8f76ecf - Browse repository at this point
Copy the full SHA 8f76ecfView commit details -
use section summary for getDetectedModes
e-mission#1014 (comment) Confirmed and composite trips have section summaries that are computed on the server. We can use these here instead of using the raw 'sections'. Let's also add type definitions for the section summaries.
Configuration menu - View commit details
-
Copy full SHA for 8712380 - Browse repository at this point
Copy the full SHA 8712380View commit details
Commits on Oct 29, 2023
-
refactor filters: prep to remove buttons services
Preparing to remove the buttons services (e-mission#1086), the filter functions need to be tweaked. `user_input` will no longer be stored on the trip object, it will be accessible in the LabelTabContext, not from these functions, so it will be passed in as a second param to these functions as userInputForTrip. Also, we'll remove the surveyOpt variable from LabelTabContext since (i) it can just be read directly from appConfig and (ii) we don't want to keep more variables than necessary in LabelTabContext to keep it from getting too cluttered. - the INVALID_EBIKE filter (along with invalidCheck) was removed as it is not used - logic for toLabelCheck was written more concisely - 'width' is no longer needed on the configuredFilters - this was for the old UI
Configuration menu - View commit details
-
Copy full SHA for f7716cf - Browse repository at this point
Copy the full SHA f7716cfView commit details
Commits on Oct 30, 2023
-
map user inputs instead of populating tlEntry objs
This is a major refactor of how we handle user inputs that removes the need for having separate button services (e-mission#1086) Instead of populating fields called "userInput" and "additionsList" on trip/place objects, we will store all inputs of each kind in a single object mapping trip/place IDs to inputs. These will be the single source of truth for what inputs are matched to what trips/places and will remove the need for populating/repopulating trips. These maps will be accessible in LabelTabContext and read downstream wherever user inputs need to be read. Specific notes on the changes: - In LabelTab, matching inputs now happens not as a part of 'populating' trips/places, but in a useEffect so that whenever timelineMap is updated, timelineLabelMap and timelineNotesMap are also updated. - in timelineHelper, we read unprocessedInputs from local and/or server and instead of returning them from 'get' methods, we'll cache them here in timelineHelper and update those caches with 'update' methods. - Type definition for UserInput renamed to UnprocessedUserInput to avoid confusion - this only applies to unprocessed inputs and is not necessarily the structure that processed user inputs will have - in diaryHelper, getBaseModeOfLabeledTrip was removed since it was basically just a shortcut to getBaseModeByValue with a trip as param instead of its userInput. All usages replaced with getBaseModeByValue
Configuration menu - View commit details
-
Copy full SHA for 4d48aee - Browse repository at this point
Copy the full SHA 4d48aeeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3855a03 - Browse repository at this point
Copy the full SHA 3855a03View commit details -
add back verifiability with verifiabilityForTrip()
As a result of 4d48aee, trips are not populated with the 'verifiability' property. We can handle this with a function call
Configuration menu - View commit details
-
Copy full SHA for 40d3f75 - Browse repository at this point
Copy the full SHA 40d3f75View commit details -
remove populateCompositeTrips; update types
The last property on the trip/place objects that differs between phone and server is 'getNextEntry' called from the input matching function. We can instead pass 'nextEntry' as a second parameter to the input matching functions. This allows us to significantly simplify our typings and ensure that 'CompositeTrip' and 'ConfirmedPlace' here will be the same as they are on the server. Hooray! -- While adjusting inputMatcher, I also renamed 'getUserInputForTrip' to 'getUserInputForTimelineEntry' (i) to be more consistent and (ii) in case we support a 'place user input' in the future
Configuration menu - View commit details
-
Copy full SHA for 49ff385 - Browse repository at this point
Copy the full SHA 49ff385View commit details -
TripCard: don't show footer if no notes
On trips with no notes/additions, an empty <View> was being rendered (causing a 10px gap due to padding) If there were no notes, `timelineNotesMap[trip._id.$oid]` would be `undefined`, which does not equal 0. We should only show notes if it is defined AND the length is not 0, so we can just say `timelineNotesMap[trip._id.$oid]?.length`.
Configuration menu - View commit details
-
Copy full SHA for a34c219 - Browse repository at this point
Copy the full SHA a34c219View commit details -
remove unused vars in LabelTab
Replaced one use of `Logger` with `displayError`. Now we don't need to use these Angular services here anymore. The only Angular service still used in this file is TimelineHelper.
Configuration menu - View commit details
-
Copy full SHA for c262f6a - Browse repository at this point
Copy the full SHA c262f6aView commit details
Commits on Oct 31, 2023
-
fix label button showing before appConfig loaded
Before appConfig is loaded, we we are unsure whether MultilabelButtonGroup or UserInputButton should be shown neither. As long as appConfig is undefined we want to show neither. So a simple if/else is not sufficient here, we should specifically check for the presence of either MULTILABEL or ENKETO
Configuration menu - View commit details
-
Copy full SHA for 9009517 - Browse repository at this point
Copy the full SHA 9009517View commit details -
combine processed+unprocessed survey responses
In inputMatcher -> mapInputsToTimelineEntries, adds back the logic for handling processed survey response inputs that are already matched to the trip/place on the server. For user_input, we only use it if there is no unprocessed user input (since unprocessed entries will be newer). For additions, we have to merge processed+unprocessed and then from this, get the non-deleted, unique entries. in timelineHelper, when storing unprocessedNotes we should remove duplicates according to their write_ts, not by getUniqueEntries(getNotDeletedCandidates(...)), because we need to retain the "DELETED" entries so they can be matched to any processed entries that they may refer to
Configuration menu - View commit details
-
Copy full SHA for fb46586 - Browse repository at this point
Copy the full SHA fb46586View commit details -
Configuration menu - View commit details
-
Copy full SHA for af5948b - Browse repository at this point
Copy the full SHA af5948bView commit details -
-added type def for ConfirmedPlace -create ObjectId instead of repeating `{ $oid: string }` -expanded user input typings: -- this was tricky because the structure of the user input received from the server differs by key. For labels, we just get a string value for the label chosen. For survey responses, we get a actual raw data entry. For the purpose of typing these, I am differentiating them based on whether the key ends in 'user_input' (used for surveys) or if it ends in 'confirm' (used for labels) -use these new typings in LabelTab and inputMatcher
Configuration menu - View commit details
-
Copy full SHA for d96ff8d - Browse repository at this point
Copy the full SHA d96ff8dView commit details -
Since 8712380, the getDetectedModes function no longer goes through the sections of a trip and sums up distances to get percentages. We now use cleaned_section_summary and inferred_section_summary which are computed on the server for us. Updating the test to reflect this causes it to pass again.
Configuration menu - View commit details
-
Copy full SHA for 22b80f9 - Browse repository at this point
Copy the full SHA 22b80f9View commit details
Commits on Nov 1, 2023
-
Merge branch 'input-matcher-rewrite' of https://github.com/jiji14/e-m…
…ission-phone into rewrite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for 081b142 - Browse repository at this point
Copy the full SHA 081b142View commit details
Commits on Nov 2, 2023
-
Merge remote-tracking branch 'upstream/service_rewrite_2023' into rew…
…rite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for 956f2d9 - Browse repository at this point
Copy the full SHA 956f2d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5110845 - Browse repository at this point
Copy the full SHA 5110845View commit details
Commits on Nov 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1f952f7 - Browse repository at this point
Copy the full SHA 1f952f7View commit details -
fix syntax errors and apply prettier
Prettier was not running on these files because they had syntax errors from bad merge conflicts. Fixes syntax on these and runs Prettier to clean up
Configuration menu - View commit details
-
Copy full SHA for 1b01692 - Browse repository at this point
Copy the full SHA 1b01692View commit details -
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
…-mission-phone into rewrite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for 5eb8d8f - Browse repository at this point
Copy the full SHA 5eb8d8fView commit details -
-add labelOptionByValue function to make it easier to lookup a labelOption by a label value; use it in other functions that need to perform this lookup -type getFakeEntry, return undefined if falsy input -verifiabilityForTrip should only consider 'inferred' true if it has any truthy values; not if all values are undefined -inferFinalLabels: if no usable inferences, return empty object rather than object with undefined values
Configuration menu - View commit details
-
Copy full SHA for 24b34ee - Browse repository at this point
Copy the full SHA 24b34eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55c313d - Browse repository at this point
Copy the full SHA 55c313dView commit details
Commits on Nov 10, 2023
-
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
…-mission-phone into rewrite-label-btn-services
Configuration menu - View commit details
-
Copy full SHA for a60b1e2 - Browse repository at this point
Copy the full SHA a60b1e2View commit details -
Something got jumbled when pulling in upstream changes + resolving conflicts
Configuration menu - View commit details
-
Copy full SHA for d3e6af2 - Browse repository at this point
Copy the full SHA d3e6af2View commit details -
remove duplicate 'verifiability' check
This was also likely due to bad merging from upstream changes
Configuration menu - View commit details
-
Copy full SHA for 69b18cb - Browse repository at this point
Copy the full SHA 69b18cbView commit details