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

Solved the page title Error #11338

Closed

Conversation

ShivangRawat30
Copy link
Contributor

This PR solves the overly aggressive errors from page title logic as state is changing in Coach.

WhatsApp.Video.2023-09-30.at.12.37.00.AM.mp4

References

This PR fixes #11291

Reviewer guidance

on the lesson's Summary page, Options > Delete lesson & confirm choice in the modal
should be automatically navigated back to class's Plan > Lessons page


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

Signed-off-by: shivangrawat30 <[email protected]>
@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) SIZE: very small labels Sep 29, 2023
this.$router.replace(
this.$router.getRoute('PLAN_LESSONS_ROOT', { classId: this.classId }),
this.$router.replace(
this.$router.getRoute('PLAN_LESSONS_ROOT'),
Copy link
Contributor

@thanksameeelian thanksameeelian Sep 29, 2023

Choose a reason for hiding this comment

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

thank you for your contribution, @ShivangRawat30 - we appreciate your work on this!

i believe a different approach to solving this problem will have to be explored. the code removed by this PR on line 119, { classId: this.classId }), was only recently added to our codebase (also, see here for the initial implementation of the change elsewhere in Coach) and it serves a specific and important purpose. this code shares the relevant classId with the PLAN_LESSONS_ROOT page, and the page needs that information to render correctly.

in specific use cases, if the page does not know classId, PLAN_LESSONS_ROOT has no awareness of which list of lessons to show the user. lessons are tied to a specific classId and in cases where a facility has multiple classes or a user is an admin of more than one facility, ensuring we have the correct classId is more complicated than it is for users who belong to a single facility that has one class.

since it would result in broken functionality, we aren't able to incorporate this suggested change, but if you're interested in continuing to work on it, i think it's worth exploring alternate solutions! :)

Copy link
Contributor Author

@ShivangRawat30 ShivangRawat30 Sep 29, 2023

Choose a reason for hiding this comment

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

I'm keen on persisting with the issue and exploring alternative solutions.

Copy link
Contributor

Choose a reason for hiding this comment

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

excellent - please feel free to re-request my review when you have an update!

@ShivangRawat30
Copy link
Contributor Author

@thanksameeelian Please review the changes, I think now there won't be any issue with PLAN_LESSONS_ROOT

@thanksameeelian
Copy link
Contributor

@ShivangRawat30 thanks for your persistence here!

your solution here would ultimately lead to the same effects as the solution you initially put forth - effectively, the classId would never be attached as a param during navigation because we're checking for the existence of an id that we are in the midst of deleting. this would break newly-added functionality that especially helps users who have more than one class and/or are admins of multiple facilities - see details mentioned above for more in-depth info about the recent changes.

we would like to introduce a fix for this issue that addresses the reasons the error is being thrown, rather than suppressing that error.

it may help to investigate where the error is being thrown, because we are throwing an error when none should be occurring, as seen in the screen recording for this issue. with our current code, navigation is happening successfully and without any notable delay or unexpected UI effects, but we are seeing errors in the console because we are calling the pageTitle code at a time when it does not need to be called, during the midst of navigation.

@MisRob
Copy link
Member

MisRob commented Nov 10, 2023

I will close this due to long time of inactivity. Thank you, @ShivangRawat30. In case you'd like to return to it, let us know.

@MisRob MisRob closed this Nov 10, 2023
@ShivangRawat30
Copy link
Contributor Author

I will look into this PR, my exams were going so I couldn't look into it.

@MisRob
Copy link
Member

MisRob commented Nov 10, 2023

@ShivangRawat30 Sure! Let us know and we can re-open, but perhaps it'd be simpler to open a new PR since it seems that a different approach will be needed. It's up to you. You can just post a comment in the issue again and we will assign you. Good luck with your exams :)

@ShivangRawat30
Copy link
Contributor Author

@MisRob I'll make a new pull request for it.

@MisRob
Copy link
Member

MisRob commented Nov 14, 2023

Okay, thank you @ShivangRawat30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) SIZE: very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coach - overly aggressive errors from page title logic as state is changing
3 participants