Closed ijlee2 closed 3 years ago
Hi @ijlee2! quick question
when a user clicks on the link to the survey page
By survey page link you mean passed @surveyRoute
(/ember-community-survey-2020
in the example above)?
@czikarito Yep, that's correct.
I was thinking of the case, when a user enters the URL https://emberjs.com/ember-community-survey-2020
in their browser (and assuming that we passed the argument @surveyRoute="ember-community-survey-2020"
to the component in app/templates/application.hbs
), we shouldn't show them the survey reminder since they are already on the survey page.
(As an aside, the <EmberSurvey>
component took a slightly different approach by showing a different message when the user is on the survey page.)
Background
Over the next month or so, we'll upgrade
ember-source
fromv3.20
tov3.24
and ensure that we follow recommended practices in Ember Octane.Description
Parts 1 and 2, together, involve creating a component called
<CtaEmberCommunitySurvey>
. This is a Glimmer component that will eventually replace<EmberSurvey>
(a classic component).Motivation
Please see the Motivation section in Part 1.
TODOs
Note, this issue is blocked by Part 1.
To help with code review, please create 1 commit for each TODO item (a total of 4 commits).
[ ] Update the template of
<CtaEmberCommunitySurvey>
so that, when a user clicks on the link to the survey page, we don't show the survey reminder anymore. Add a rendering test that asserts this behavior.[ ] Update the component so that, when a user lands on the route
@surveyRoute
directly, we don't show the survey reminder. Note, this will involve injecting therouter
service and looking atthis.router.currentRouteName
.You may try to add a rendering test. (It's not easy, and may not be considered a good practice, to mock the
router
service.) I think it's enough to check the behavior by running the app locally. You can temporarily add the following code, for example:[ ] By now, the
<CtaEmberCommunitySurvey>
component should meet feature parity with<EmberSurvey>
. Use the Ember CLI to remove the<EmberSurvey>
component. Don't forget to remove any references to<EmberSurvey>
component.[ ] Now that
<EmberSurvey>
component is gone, we can tidy the project a little. In.eslintrc.js
, we can remove the lint exceptionember/no-actions-hash
. We can also runyarn remove ember-inflector
to uninstall the addon.