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

Update and fix handling of disabling new report button #309

Merged
merged 3 commits into from
Sep 18, 2020
Merged

Conversation

Remi749
Copy link
Collaborator

@Remi749 Remi749 commented Sep 18, 2020

Your checklist for this pull request

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the dev branch (left side). Also you should start your branch off dev.
  • Check the commit's or even all commits' message
  • Check your code additions will fail linting checks
  • Remember: After/before PR is closed, add PR description to Changelog

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:

  • 1. Create a new report.
  • 2. The button "Ny statusrapport" will stay disabled until you publish the report.
  • 3. The button will also be disabled if you navigate between other reports while having an unpublished report
  • 4. Create a new report and the button should be disabeled once again
  • 5. Select an older published report.
  • 6. Verify that the button "Ny statusrapport" stays disabled

Related issues

Closed #295

this will take in consideration all reports, published and unpublished
@Remi749 Remi749 added enhancement Request that will enhance the product complexity: small Issue/PR with small complexity frontend Related to frontend labels Sep 18, 2020
@Remi749 Remi749 added this to the Version 1.3 milestone Sep 18, 2020
@Remi749 Remi749 requested a review from olemp September 18, 2020 11:35
@Remi749 Remi749 self-assigned this Sep 18, 2020
@Remi749 Remi749 changed the title Issues/295 Update and fix handling of disabling new report button Sep 18, 2020
Copy link
Collaborator

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

@pzljanb
Copy link
Contributor

pzljanb commented Sep 18, 2020

Skal denne PR tagges mot 1.2.3 og ikke 1.3 som det står nå?

@olemp
Copy link
Collaborator

olemp commented Sep 18, 2020

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.

@olemp olemp removed this from the Version 1.3 milestone Sep 18, 2020
@Remi749 Remi749 added this to the Version 1.2.3 milestone Sep 18, 2020
@Remi749
Copy link
Collaborator Author

Remi749 commented Sep 18, 2020

Var feilsatt, har oppdatert nå med conditional operator som det jeg begynte på.

Copy link
Collaborator

@olemp olemp left a 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!

@olemp olemp merged commit 5a08e46 into dev Sep 18, 2020
@olemp olemp deleted the Issues/295 branch September 18, 2020 12:03
This was referenced Sep 29, 2020
@pzljanb pzljanb mentioned this pull request Apr 13, 2021
18 tasks
@pzljanb pzljanb mentioned this pull request Sep 3, 2021
27 tasks
@pzljanb pzljanb mentioned this pull request Oct 5, 2021
26 tasks
@pzljanb pzljanb mentioned this pull request Jan 31, 2022
19 tasks
@pzljanb pzljanb mentioned this pull request Jun 23, 2022
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: small Issue/PR with small complexity enhancement Request that will enhance the product frontend Related to frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of unpublished reports should be improved
3 participants