-
Notifications
You must be signed in to change notification settings - Fork 34
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
[regression] fix to display the date correctly fails #823
Comments
git revert 465f917a4b02a8d0c5a50eca16867052a2c96a55 (e-mission/e-mission-phone#897) fixes it. But then we don't have the changes to fix the date. Let's spend some time seeing if we can fix it. Through experimenting with removing code, I can confirm that
works and
does not Not sure why setting the previous trip fails |
For now, I have this as the following, which doesn't crash and shows the date above each trip.
@sebastianbarry this is your highest priority issue now. |
Since it breaks for a single day (only July 22) e-mission/e-mission-docs#823 Testing done: Loaded previously breaking day and it worked
[Yesterday 10:33 AM] Shankari, K. |
A solution may be to get rid of the date label header entirely, since this was a new design added by Tyler in the Unified Label/Diary screens PR he made We have 3 options to solve this:
|
Yes the
The list also has an |
I would also suggest looking at the scroll element and the |
infinite_scroll_list.js - Removing prevTrip, because this was causing issues in the regression e-mission/e-mission-docs#823 and we will replace it with another way to display the date to come infinite_scroll_list.html - Commenting out the hr-lines style that displays the trip date above the list of trips trip_list_item.html - Displaying the date from within the trip item - Removed the previous styling that was unnecessary for this div since it previously didn't have any text inside it
For now, I am choosing to go with option 3: Get rid of the date label entirely and write the date over each trip box Easiest, but no place for the date picker buttonI addressed this in e-mission/e-mission-phone#904 Sidenote: I am still having troubles with my pipeline running on my test data, which was taking me a while to look into, so my testing is ONLY conclusive for 1 DAYS WORTH OF DATA, I did not test with multiple days worth of dataMy thoughts:
Next steps:
|
@sebastianbarry I don't know that we need to have a floating text bubble. Why can't it just be a button in the header?
wrt
It is 3 lines above the line highlighted in your screenshot.
I put a screenshot showing it so not sure why that would be confusing... |
Please finish testing ASAP. I do not want to merge untested code, and I don't want to be responsible for testing everything |
With the help of @shankari I was able to figure out this KeyError issue on my e-mission-server, and finish the testing with multiple days: It displays well, testing is completed for this change |
<div collection-repeat="trip in data.displayTrips" style="transform: translate3d(0px, 1560px, 0px); height: 391px; width: 414px;">
<div collection-repeat="trip in data.displayTrips" style="transform: translate3d(0px, 1950px, 0px); height: 391px; width: 414px;"> for example, has attribute |
infinite_scroll_list.js - Removing prevTrip, because this was causing issues in the regression e-mission/e-mission-docs#823 and we will replace it with another way to display the date to come infinite_scroll_list.html - Commenting out the hr-lines style that displays the trip date above the list of trips trip_list_item.html - Displaying the date from within the trip item - Removed the previous styling that was unnecessary for this div since it previously didn't have any text inside it
@shankari Here is the cherry-picked PR for these changes for the |
I am currently working on:
I am able to restructure the header just a bit so that we can account for the However, I am getting stuck on dynamically knowing what the scroll position is. I have it right now, so that whenever you click the "refresh" button, THAT is when it updates the scroll position. Screen.Recording.2022-11-01.at.11.11.14.AM.movA solution idea I have for this, is that we can find out where/when this HTML element dynamic updating is happening, we can input our @shankari do you know if this is a viable solution? Am I on the right track? Could you explain why or how the HTML page is dynamically changing as I scroll on the page? |
@sebastianbarry it is dynamically changing because we use I don't think there is a hook into the |
I am not sure how to do this with ionic v1, though, I found some random issues complaining about the scrolling
I think we have to go to the source code. |
Looking at the v1 source code for scroll, I can find the unit test for the scroll controller, which looks like it triggers on |
and searching for the corresponding
Having said that, if this takes more than the end of today to experiment with, I would drop this approach and just keep the date in the trip item. The date selector at the top can be static and set to today. |
I found this guide online, to get the scroll updating dynamically: Screen.Recording.2022-11-02.at.10.52.00.AM.movI was able to get the page to respond to scrolling using the native JavaScript Screen.Recording.2022-11-02.at.10.59.32.AM.movThe only problem with doing it this way, is that I can't call an angular I tried putting this into the code but it is giving console errors I looked up this error but while it is the same error message, the thread is about a slightly different subject: https://stackoverflow.com/questions/12494825/error-unknown-provider-elementprovider-element @shankari do you know if I'm on the right path? I see that I strayed a bit from the ionic |
@sebastianbarry unfortunately, you didn't add a link to the stackoverflow so I had to search for it again 😄 But note that we are not using standard angularjs; we are using ionic and ionic already has a directive for the scroll controller. Again, we are now at the point where you can no longer rely on stackoverflow for answers, it is easiest to look at the source code. The linked source code You know (or should know from prior directives that you wrote) how to pass in functions to directives (e.g. how to pass in a function to the So have you tried the basic and obvious
Note also the documentation for ion-content, which says the same thing |
The Screen.Recording.2022-11-03.at.12.28.57.PM.movThe way I implemented this is a bit interesting, and may not be the best way of doing it. When the list of $scope.updateScrollDisplayDate = function() {
$scope.scrollPosition = $ionicScrollDelegate.getScrollPosition();
let scrollpos = Math.floor($scope.scrollPosition.top);
if(scrollpos < 0) {scrollpos = 0;}
let heightOffset = 391;
let ind = Math.floor(scrollpos/heightOffset);
$scope.scrollDisplayDate = $scope.tripsPosition[ind].display_date;
} $scope.recomputeDisplayTrips = function() {
...
if ($scope.data.displayTrips[0]) {
let heightOffset = 391;
let height = 0;
$scope.data.displayTrips.forEach((t) => {
let display_date = t.display_date
let thisTripPosition = { display_date, height }
height += heightOffset;
$scope.tripsPosition.push(thisTripPosition)
});
}
} issues
<select class="row buttons labelfilterlist">
<option ng-repeat="selF in filterInputs" ng-click="select(selF)" class="{{selF.width}} button labelfilter" ng-class="{on:selF.state}" style="text-align: center;font-size: 13px;font-weight: 600; border-radius: 10px;" translate>
{{selF.text}}
</option>
<option ng-click="resetSelection()" class="col-33 button labelfilter last" ng-class="{on:allTrips}" style="text-align: center;font-size: 13px;font-weight: 600; border-radius: 10px;" translate>
{{'.show-all'}}
</option>
</select> |
@sebastianbarry how do you know that the heightOffset is exactly 391? Would that be true even if you had the replaced mode button? Have you actually tested with the replaced mode as requested earlier |
@sebastianbarry yes, the replaced mode shows up, but it is cut off and it looks ugly. |
Worked around by displaying the date in the trip |
#819 (comment)
or
where the related line is
The text was updated successfully, but these errors were encountered: