-
Notifications
You must be signed in to change notification settings - Fork 699
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
Fix Mismatch between coach Reports and generated CSV #12628
Fix Mismatch between coach Reports and generated CSV #12628
Conversation
301abaa
to
e36a1a2
Compare
Build Artifacts
|
Thanks @AlexVelezLl - I confirm that the issues are addressed and fixed as specified above.
cc @radinamatic |
Thank you @pcenov! I have pushed new changes fixing these issues too. |
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.
Thanks @AlexVelezLl - I confirm that the latest issues are fixed and there are no new issues after the regression testing - good to go!
@@ -216,10 +228,10 @@ export function tally() { | |||
]; | |||
} | |||
|
|||
export function timeSpent(key, label = 'timeSpentLabel') { | |||
export function timeSpent(key, label = coreStrings.$tr('timeSpentLabel')) { |
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.
I'd prefer to still invoke the $tr method in function scope rather than module scope (which it will for a default) - just in case there's a race condition here between i18n setup and execution of this module code.
It's possible that I am remembering a gotcha that I have since fixed, but out of abundance of caution let's keep the invocation in function scope for now.
Thank you @rtibbles! I have pushed the required changes 👐. |
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.
I see that @rtibbles feedback has been addressed, calling the i18n in the function scope and gave things a look myself. This all LGTM
@@ -271,8 +271,8 @@ | |||
.reduce((entries, groupEntries) => entries.concat(groupEntries), []); | |||
|
|||
if (this.ungroupedEntries.length) { | |||
data.concat( | |||
this.ungroupedEntries.map(entry => { | |||
data.push( |
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.
I don't recall having seen using arr.push(...someArray)
in place of arr.concat(someArray)
before but I like it!
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.
Did you make this change as a style change or do you know if this improves performance or something?
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.
Playing with it a little bit I realize that the push
version mutates the object itself whereas concat
returns a whole new array so was the previous code an issue because of that?
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.
Yeees!! The error why ungrouped learners didnt appear in the report was because the concat
method doesnt work in-place, and we werent reassigning the result, but as data
was a constant, and we couldnt reassign I preferred to use the push(...array)
instead of defining the constant as variable.
Thank you @nucleogenesis and @pcenov! |
aa6eaf2
into
learningequality:release-v0.17.x
Summary
Fix mismatch between coach Reports and generated CSV.
Fixes:
ReportsLessonExerciseLearnerListPage
andReportsLessonResourceLearnerListPage
show ungrouped learners if "view by groups" checkbox is toggled.ReportsLessonExerciseLearnerListPage
andReportsLessonResourceLearnerListPage
to show groups names if we download a report without checking "view by groups".ReportsLessonExerciseLearnerListPage
,ReportsGroupReportLessonExerciseLearnerListPage
,ReportsGroupReportLessonResourceLearnerListPage
,ReportsLessonResourceLearnerListPage
.ReportsQuizListPage
andReportsLessonListPage
.ReportsGroupReportLessonExerciseLearnerListPage
,ReportsGroupReportLessonResourceLearnerListPage
,ReportsLearnerReportLessonPage
,ReportsLessonExerciseLearnerListPage
,ReportsLessonLearnerBase
,ReportsLessonResourceLearnerListPage
.Things that have already been fixed in the past:
References
Closes #6642
Reviewer guidance
…
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)