-
Notifications
You must be signed in to change notification settings - Fork 16
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
Update and fix handling of disabling new report button #309
Conversation
this will take in consideration all reports, published and unpublished
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.
Not trying to be a critic here, but this is not so intuitive imho
!!data.reports.filter((report) => report.moderationStatus.indexOf("Publisert")).length
A filter callback should return true or false. This will return -1 or the index of "Publisert", so I'm not sure how this filter function will work?
If the filtered array returns 0
for length this will yield !!0
, if the length is 2
it will yield !!2
.
Skal denne PR tagges mot 1.2.3 og ikke 1.3 som det står nå? |
Viktigste er vel at issues kobles mot riktig milepæl. |
Var feilsatt, har oppdatert nå med conditional operator som det jeg begynte på. |
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.
Looks good!
Tested in console, and seems to work just fine!
Your checklist for this pull request
Description
Disable the button "Ny statusrapport" when a report is unpublished. Also when navigating between other reports while having an unpublished report.
How to test:
Related issues
Closed #295