-
Notifications
You must be signed in to change notification settings - Fork 3
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
NAAAR analysis methods statusing: more custom logic! #12018
base: naaar-am-plans
Are you sure you want to change the base?
Conversation
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.
works like a charm! ❇️
@@ -257,6 +257,18 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => { | |||
const isCustomEntity = | |||
canAddEntities && !getDefaultAnalysisMethodIds().includes(entity.id); | |||
const calculateEntityCompletion = () => { | |||
// logic to ensure analysis methods always have a plan selected |
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'm a little confused about what calculateEntityCompletion
is supposed to return. An array of field ids?
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.
It returns a boolean. The final return call ends with .every()
, so these shortcuts are just returning false early.
This function is called a few lines below its definition as such
const isEntityCompleted = reportingOnIlos
? calculateEntityCompletion() &&
isIlosCompleted(reportingOnIlos, entity)
: calculateEntityCompletion();
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. I would vote for changing calculateEntityCompletion()
to something more boolean-sounding though isEntityCompleted
is already taken...
Description
Open to improvements :)
I ran into a few issues that got me here:
The solution I landed on does a simple check against the only offending field: plans. This is the only one that can be edited outside of the drawer (by deleting a plan on the plans page).
Related ticket(s)
CMDCT-4253
How to test
Pre-review checklist
Pre-merge checklist
Review