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

Allow assessments to be in the future #4503

Merged
merged 7 commits into from
Oct 11, 2023

Conversation

og-simsoft
Copy link

@og-simsoft og-simsoft commented Sep 29, 2023

ANET now allows assessments to be in the future, which will be quite useful when planning for upcoming dates.

Closes AB#888

User changes

  • Users were allowed to select past dates only, now they are also able to select future dates.

Superuser changes

  • None

Admin changes

  • None

System admin changes

  • anet.yml or anet-dictionary.yml needs change
  • db needs migration
  • documentation has changed
  • graphql schema has changed

Checklist

  • Described the user behavior in PR body
  • Referenced/updated all related issues
  • commits follow a repo#issue: Title title format and these 7 rules
  • commits have a clean history, otherwise PR may be squash-merged
  • Added and/or updated unit tests
  • Added and/or updated e2e tests
  • Added and/or updated data migrations
  • Updated documentation
  • Resolved all build errors and warnings
  • Opened debt issues for anything not resolved here

@gjvoosten gjvoosten changed the title Allow to assess future dates Allow assessments to be in the future Oct 3, 2023
Orcun Gurer and others added 6 commits October 11, 2023 10:13
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.
Copy link
Collaborator

@gjvoosten gjvoosten left a 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.

@@ -61,6 +61,7 @@ fields:
topTaskOnceReport:
label: Engagement assessment of objective
recurrence: once
allowFutureAssesments: true
Copy link
Collaborator

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.

// only allow assessments for past periods
periodDetails.allowNewAssessments = offset + i > 0
// allow new assessments
periodDetails.allowNewAssessments = true
Copy link
Collaborator

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() => {
Copy link
Collaborator

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")
Copy link
Collaborator

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"
Copy link
Collaborator

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"

Comment on lines 241 to 245
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.
Copy link
Collaborator

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.
@gjvoosten gjvoosten force-pushed the AB-888-Allow-to-assess-future-dates branch from 5eaf1b2 to 73ceeae Compare October 11, 2023 09:46
Copy link
Contributor

@midmarch midmarch left a comment

Choose a reason for hiding this comment

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

LGTM

@midmarch midmarch merged commit f529088 into main Oct 11, 2023
@midmarch midmarch deleted the AB-888-Allow-to-assess-future-dates branch October 11, 2023 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants