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

Show "Worked, Pending" status #45

Merged
merged 5 commits into from
Jun 15, 2021
Merged

Show "Worked, Pending" status #45

merged 5 commits into from
Jun 15, 2021

Conversation

gregtyler
Copy link
Contributor

When a case is pending—but worked—then the status should be shown as "Worked, Pending" instead of Pending.

This is done through a new template called status-tag which, when passed a case, will show the status with the appropriate colour.

Fixes VEGA-866

@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2021

Codecov Report

Merging #45 (c3ed4a4) into main (3c1204b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #45   +/-   ##
=======================================
  Coverage   89.80%   89.80%           
=======================================
  Files          22       22           
  Lines         569      569           
=======================================
  Hits          511      511           
  Misses         31       31           
  Partials       27       27           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c1204b...c3ed4a4. Read the comment docs.

{{ define "status-tag" }}
<strong class="govuk-tag govuk-tag--{{ statusColour .Status }}">
{{ if and (eq .Status "Pending") (.Worked) }}
Worked, {{ .Status }}
Copy link
Contributor

Choose a reason for hiding this comment

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

it will only ever be "Worked, Pending" so better to be explicit?

Copy link
Contributor

Choose a reason for hiding this comment

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

or you could have done this as

{{ if and (eq .Status "Pending") (.Worked) }}Worked, {{ end }{{ .Status }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took the simpler first option

@gregtyler gregtyler merged commit fb993ac into main Jun 15, 2021
@gregtyler gregtyler deleted the VEGA-866-worked-pending branch June 15, 2021 09:33
gregtyler added a commit that referenced this pull request Jun 15, 2021
* Add status-tag template

* Use status-tag template

* Set "Worked, Pending" text explicitly
gregtyler added a commit that referenced this pull request Jun 15, 2021
* Add `User()` endpoint to sirius package

To get user details by ID

* Add userPendingCases handler

To show a user's pending cases, based on their ID

* Link to user's pending cases from team dashboard

* Add userPendingCases cypress tests

And rename existing file

* Add jQuery and expose on `window`

`MOJFrontend` requires this to initialise the Multi select component

There's [an issue in moj-frontend](ministryofjustice/moj-frontend#134) to remove the jQuery dependency, but it's dependent on unit tests

* Restrict userPendingCases to Managers

Other users shouldn't be able to see each others' dashboards

* Add all caseworker info pages

Adds all cases and tasks pages, with inter-linking and tests

* Remove unused CSS classes

* Expect API user details to include a team

* Add back links to team

* Re-enable codecov-action

They claim to have fixed the issue now

* Add `User()` endpoint to sirius package

To get user details by ID

* Add userPendingCases handler

To show a user's pending cases, based on their ID

* Link to user's pending cases from team dashboard

* Add userPendingCases cypress tests

And rename existing file

* Add jQuery and expose on `window`

`MOJFrontend` requires this to initialise the Multi select component

There's [an issue in moj-frontend](ministryofjustice/moj-frontend#134) to remove the jQuery dependency, but it's dependent on unit tests

* Restrict userPendingCases to Managers

Other users shouldn't be able to see each others' dashboards

* Bump cypress from 7.4.0 to 7.5.0 (#35)

Bumps [cypress](https://github.com/cypress-io/cypress) from 7.4.0 to 7.5.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](cypress-io/cypress@v7.4.0...v7.5.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* VEGA-867 Sort pending cases by workedDate (#44)

* Use CanRequestCase on all caseworker pages (#43)

Wherever the "Request next cases" button appears, only show it to users with the "Self Allocation User" role

* Show "Worked, Pending" status (#45)

* Add status-tag template

* Use status-tag template

* Set "Worked, Pending" text explicitly

* Use status-tag template

So that we see "Worked, Pending" everywhere

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joshua Hawxwell <m@hawx.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants