-
Notifications
You must be signed in to change notification settings - Fork 12
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
Allow assessments to be in the future #4503
Conversation
client/src/components/assessments/instant/InstantAssessmentResultsTable.js
Show resolved
Hide resolved
client/src/components/assessments/periodic/PeriodicAssessmentResultsTable.js
Outdated
Show resolved
Hide resolved
Move the new prop to the correct assessment definition (it only applies to periodic assessments, and the test checks subTaskMonthly). Correct typo in new dictionary property allowFutureAssessments. Change the title/description a bit Add the new prop also to the test dictionary.
It only applies to periodic assessments; reflect this in getPeriodsConfig.
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.
Needs quite some changes, which I am going to address myself.
anet-dictionary.yml
Outdated
@@ -61,6 +61,7 @@ fields: | |||
topTaskOnceReport: | |||
label: Engagement assessment of objective | |||
recurrence: once | |||
allowFutureAssesments: true |
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.
This prop applies only to periodic assessments, yet you add it to an instant assessment. You also forgot to add it to the test dictionary.
client/src/periodUtils.js
Outdated
// only allow assessments for past periods | ||
periodDetails.allowNewAssessments = offset + i > 0 | ||
// allow new assessments | ||
periodDetails.allowNewAssessments = true |
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.
In the context of periodic assessments, this should at least check the assessment configuration to see if future assessments are allowed.
@@ -87,6 +87,21 @@ describe("For the periodic task assessments", () => { | |||
"monthly", | |||
ADVISOR_1_TASK_EDIT_DETAILS | |||
) | |||
}) | |||
|
|||
it("Should allow seeing add button for the assessments in the future", async() => { |
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.
The test description should probably also mention the assessment key for which you are testing this.
).click() | ||
|
||
await ( | ||
await ShowTask.getFutureAddAssessmentButton("subTaskMonthly", "monthly") |
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.
You are testing this against subTaskMonthly, yet you have not set allowFutureAssessments: true
for that assessment definition.
|
||
async getFutureAddAssessmentButton(assessmentKey, recurrence) { | ||
return (await this.getAssessmentsTable(assessmentKey, recurrence)).$( | ||
"tbody tr:last-child td:last-child" |
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.
This table cell always exists, so this doesn't really test anything. The selector should include the button, so:
"tbody tr:last-child td:last-child button"
src/main/resources/anet-schema.yml
Outdated
allowFutureAssesments: | ||
type: boolean | ||
default: false | ||
title: allow assesments to be in the future | ||
description: allow assesment dates to be in the future in order to be able to plan future. |
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.
Misspelling in "assessment".
And add a test to verify that you can't add future assessments if this has not been configured in the dictionary.
5eaf1b2
to
73ceeae
Compare
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.
LGTM
ANET now allows assessments to be in the future, which will be quite useful when planning for upcoming dates.
Closes AB#888
User changes
Superuser changes
Admin changes
System admin changes
Checklist
repo#issue: Title
title format and these 7 rules