-
Notifications
You must be signed in to change notification settings - Fork 9
feat: allow approval of previous versions of job specs #102
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
Conversation
8b097ba
to
6b2650d
Compare
Display the "Approve" button on all versions of a job spec in the "job proposal details" page that have the "cancelled" status. This allows users to approve older versions of a job spec. This PR must be deployed along with PR # from the core repo. [DX-534](https://smartcontract-it.atlassian.net/browse/DX-534)
90b4068
to
ab9474d
Compare
779893d
to
5d06377
Compare
5d06377
to
8dab59c
Compare
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.
Pull Request Overview
This PR enables users to approve up to two previous cancelled versions of a job spec by introducing a new approvePrevious
action and updating the UI and tests accordingly.
- Add
approvePrevious
toConfirmationDialogArgs
, dialog text, and handler logic - Compute
approvableCancelledJobSpecs
to show approve buttons only on the two most recent cancelled specs - Add
data-testid
to panels and extend tests for button visibility across statuses
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/screens/JobProposal/SpecsView.tsx | Add approvePrevious action, confirmation dialog text, approval logic, and data-testid |
src/screens/JobProposal/SpecsView.test.tsx | Expand tests to cover Approve button visibility for pending, cancelled, deleted, and revoked |
.changeset/flat-toys-roll.md | Add changeset entry for allowing approval of previous job spec versions |
Comments suppressed due to low confidence (2)
src/screens/JobProposal/SpecsView.tsx:253
- [nitpick] Consider using a more specific
data-testid
(e.g.,spec-expansion-panel
) to clearly identify these panels in tests and prevent collisions with other components.
data-testid="expansion-panel"
src/screens/JobProposal/SpecsView.test.tsx:409
- [nitpick] Add a test to verify that clicking the "Approve" button on a previous version opens the confirmation dialog with the correct title (
Approve Previous Version of Job Proposal
) and body content, ensuring the newapprovePrevious
variant is displayed as intended.
})
fix spec id comparison Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Description
Display the "Approve" button on the latest two versions of a job spec in the "job proposal details" page that have the "cancelled" status. This allows users to approve older versions of a job spec.
This PR must be deployed along with PR # from the core repo.
DX-534
Steps to Test
yarn && yarn setup
yarn start
Approve
buttonChecklist
Screenshots
operator-ui-approve-old-job-spec-version.mp4
Update after Sebastian's suggestion to limit the set of cancelled specs that can be approved to the last two versions:
(error returned by backend attempting to approve an older spec using the previous patch)

(new UI version; only the last 2 cancelled proposals are "approvable"; a different message is displayed when approving an older spec version)
operator-ui-approve-old-job-spec-version-v3.mp4