forked from e-mission/e-mission-phone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Labeling code: infinite scroll list -> directive
Move all the labeling code from the infinite scroll list to the directive Concretely: - remove the input detail initialization - move out the code which initializes the inputs and replace it with the nextTrip link - move the manual input population code as well. this is now a separate implementation from the diary initialization code; we will need to unify it later - move related functions to the directive: - `populateInput`, - `populateManualInputs`, - `updateVisibilityAfterDelay`, - `updateTripProperties`, - `inferFinalLabels`, - `updateVerifiability` - delete functions that were already copied from the diary, with minor modifications as necessary: - create `$scope.popovers`, - `$scope.openPopover` - `$scope.choose` - `closePopover` - `$scope.verifyTrip` also copied `trip.properties.*_ts` into `trip.*_ts` so we can have the same implementation for both data structures (e-mission/e-mission-docs#674 (comment)) In addition, in the directive, we do the following: - add functions to find the view element, its state and scope. - We will use this state to indicate which view we are working with, given that we plan to support labeling assist in the diary view as well (e-mission/e-mission-docs#674 (comment)) - We will use the scope to callback to the view and filter the trips accordingly (e-mission/e-mission-docs#674 (comment)) This almost works. The one pending issue is that of filtering to set `$scope.displayTrips`. In `$scope.setupInfScroll`, we read entries from the server (`$scope.readDataFromServer`), which sets `$scope.data.allTrips`. It then calls `$scope.recomputeDisplayTrip` which uses the userInputs to decide which trips should be in `$scope.displayTrips`. The problem is that we set the userInputs in the directive. However, the directives are not executed until they are displayed. So until we compute which trips go into `displayTrips`, we will not execute the directives, which means that we will not have the fields we need to compute the directives. We need to resolve this circular dependency.
- Loading branch information
Showing
4 changed files
with
282 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.