-
-
Notifications
You must be signed in to change notification settings - Fork 326
feat(#10318): display previous month's targets when selected #10436
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
base: 10140_previous-month-targets
Are you sure you want to change the base?
feat(#10318): display previous month's targets when selected #10436
Conversation
|
Thanks for your submission @Edwin-Rugoogamu ! While I'll leave the larger, more formal code review to the previous performance squad, you can get a jump on improving this PR by fixing the failing CI with the linting and build errors. Please click into the failing checks to see the specific errors and ask questions here if you get stuck! |
Hi @mrjones-plip The fixes for the eslint have been worked on. as reflected in the new commit (eslint fixes) |
|
Thanks @Edwin-Rugoogamu ! That's helpful to smooth out before a formal code review. Your new challenge is to resolve the conflicts in this branch 😅 As with the linting - please let us know if you need a hand! This too will be nice to smooth out before a formal code review. |
Thanks @mrjones-plip . I have accepted all the incoming changes and adjusted variable(relevantInterval). Am also looking into the linting. Which had failled in the github actions pipeline |
|
Nice work - thank you @Edwin-Rugoogamu ! It looks like just the title of the PR needs to pass lint now. Can you look into fixing that? As well, I'll reach out back on Slack for someone to look at the actual code itself. |
Well noted |
jkuester
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so when this is all boiled down, it seems possible that the only real change will be to pass the param through in the analytics-targets component. That is pretty much expected given the other sub-issues that we have. 👍
@Edwin-Rugoogamu I think you said that Timothy was working on the test changes. Is he going to add those in a commit to this PR or in a separate PR? (Would be best for them to end up in this PR before we merge to the base branch just so we can keep everything straight...)
We can update the unit tests in analytics-targets.component.spec.ts:
- In the existing tests, assert the value of the parameter passed to the
fetchTargetsfunction (it is stubbed with sinon, so it should be easy to assert the args).- Would be nice to update one of the existing tests (if there is not one already) to set the
reportingPeriodFiltervalue on the component and then assert that value is passed tofetchTargets.
- Would be nice to update one of the existing tests (if there is not one already) to set the
- Add another test that calls
getTargetsdirectly with a reporting period param and assert that value is passed tofetchTargetsand is set as thereportingPeriodFilter.
In the e2e tests, we can expand the filter test in analytics.wdio-spec.js to actually select the previous month and assert the targets display the expected values for the previous month. In the test setup, we will probably need to write some docs for the previous month so it gives us some target values.
Regarding the tests that are currently failing in the CI, I think that rolling back the UI changes (as I suggested) will resolve the problems in the ci-webdriver-default-workflows CI job. I think the ci-webdriver-default-core-minimum-browser test is just flaking out for some reason. 🤷 I cannot come up with any way your changes here would cause that test to fail. 🤔 I have triggered a re-run and will keep an eye on things and see if it ends up passing...
|
|
||
| <!-- 🔹 Show “Current month” when current filter is selected --> | ||
| <ng-container *ngIf="reportingPeriodFilter === 'current'; else previousSubtitle"> | ||
| {{ 'targets.this_month.subtitle' | translate }} | ||
| </ng-container> | ||
|
|
||
| <!-- 🔹 Show “All time” when previous month is selected --> | ||
| <ng-template #previousSubtitle> | ||
| {{ 'targets.all_time.subtitle' | translate }} | ||
| <!-- Inline note: only show when previous period --> | ||
|
|
||
| </ng-template> | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets roll this back for now and wait for #10439 to make any changes to the UI.
| <!-- 🔹 Show “Current month” when current filter is selected --> | |
| <ng-container *ngIf="reportingPeriodFilter === 'current'; else previousSubtitle"> | |
| {{ 'targets.this_month.subtitle' | translate }} | |
| </ng-container> | |
| <!-- 🔹 Show “All time” when previous month is selected --> | |
| <ng-template #previousSubtitle> | |
| {{ 'targets.all_time.subtitle' | translate }} | |
| <!-- Inline note: only show when previous period --> | |
| </ng-template> | |
| {{ target.subtitle_translation_key | translate }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the label being static, The filtering does the sorting by date but leaves the labels constant. So when you click this month or last month the labels remain constant. So we decided to change the label according to what has been chosen . Though now differently as indicated in the new PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed at the squad meeting this week, we want to go ahead and leave this html as it is for now. We are continuing to discuss what the best approach will be for the UI changes. These will be implemented in r #10439.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am changing it first think tomorrow. Just got abit engaged.
9e91431 to
d3744b1
Compare
cfa7fe8 to
43250d3
Compare
5920428 to
ed02692
Compare
Description
Closes #10318
Core Functionality Implemented
Analytics Targets Component (
analytics-targets.component.ts):Dynamic UI (
analytics-targets.component.html):Rules Engine Integration (
rules-engine.service.ts):fetchTargets()method that accepts 'current' or 'previous' reporting periodsCalendar Interval Service (
calendar-interval.service.ts):getPrevious()method specifically for previous month reporting periodsInternationalization (
messages-en.properties):Key Features Delivered