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

fix(case/ui): fixes case page to show escalation #5462

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

whitdog47
Copy link
Contributor

This pull request addresses an issue on the case page where the escalation status was not being displayed correctly after the Escalate Case dialog completed. It also ensures that the user cannot try to escalate a case that has already been escalated.

Key Changes

  1. Conditional Dialog Display:

    • Updated the CaseStatusSelectGroup.vue component to ensure the escalation dialog is only opened if the case is not already in an "Escalated" status.
  2. Nullish Coalescing Operator:

    • Modified the EscalateDialog.vue component to use the nullish coalescing operator (?.) for safer access to incident_type, preventing potential errors when caseType is undefined.
  3. Page Reload for Status Update:

    • Added a page reload in the store.js actions to ensure the case page reflects the updated status after an escalation, providing immediate feedback to the user.

Files Changed

  • src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue:

    • Adjusted the condition for opening the escalation dialog.
  • src/dispatch/static/dispatch/src/case/EscalateDialog.vue:

    • Implemented the nullish coalescing operator for safer property access.
  • src/dispatch/static/dispatch/src/case/store.js:

    • Added a window reload to update the case status on the page.

Fixes DISDEV-317

@whitdog47 whitdog47 added bug Something isn't working techdebt labels Nov 13, 2024
@whitdog47 whitdog47 requested a review from wssheldon November 13, 2024 05:02
@whitdog47 whitdog47 self-assigned this Nov 13, 2024
@whitdog47 whitdog47 marked this pull request as ready for review November 13, 2024 05:10
@wssheldon
Copy link
Contributor

Couple things I think are worth updating here before shipping:

  • We should provide some feedback to the user when they try to escalate an already escalated case. Right now (AFACIT) the button will just appear to not work. My preference would be to put the button in some kind of disabled state with a tooltip that explains why you can't click the button.

  • Reloading the page feels a bit heavy, is it necessary? I think we should be able to do an optimistic update for the case status.

A meta note, I think a screencast would come in really handy here, to show the before / after for these changes. I've been using: https://screen.studio/

@wssheldon
Copy link
Contributor

I would also be curious if we could have caught this issue with a more solid set of component level tests. We have one for this component actually in tests/ directory: CaseStatusSelectGroup.spec

Copy link
Contributor

@wssheldon wssheldon left a comment

Choose a reason for hiding this comment

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

I don't think anything I mentioned is blocking. But, I do think we should do them, the optimistic update and button feedback, specifically.

@whitdog47 whitdog47 merged commit f42ce77 into master Nov 14, 2024
8 checks passed
@whitdog47 whitdog47 deleted the bugfix/reflect-case-escalation-in-ui branch November 14, 2024 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working techdebt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants