diff --git a/.changeset/shiny-lobsters-check.md b/.changeset/shiny-lobsters-check.md
new file mode 100644
index 00000000..9a2a6ed5
--- /dev/null
+++ b/.changeset/shiny-lobsters-check.md
@@ -0,0 +1,5 @@
+---
+'@smartcontractkit/operator-ui': patch
+---
+
+Add revoked jobs tab in feeds manager
diff --git a/src/screens/FeedsManager/JobProposalsCard.test.tsx b/src/screens/FeedsManager/JobProposalsCard.test.tsx
index fa245e1a..53910636 100644
--- a/src/screens/FeedsManager/JobProposalsCard.test.tsx
+++ b/src/screens/FeedsManager/JobProposalsCard.test.tsx
@@ -9,6 +9,7 @@ import {
buildCancelledJobProposal,
buildRejectedJobProposal,
buildDeletedJobProposal,
+ buildRevokedJobProposal,
} from 'support/factories/gql/fetchFeedsManagersWithProposals'
import { JobProposalsCard } from './JobProposalsCard'
@@ -33,6 +34,7 @@ describe('JobProposalsCard', () => {
buildCancelledJobProposal({ pendingUpdate: true }),
buildDeletedJobProposal({ pendingUpdate: true }),
buildDeletedJobProposal({ pendingUpdate: false }),
+ buildRevokedJobProposal({ pendingUpdate: false }),
]
renderWithRouter()
@@ -92,4 +94,15 @@ describe('JobProposalsCard', () => {
const rows = await findAllByRole('row')
expect(rows).toHaveLength(2)
})
+
+ it('renders the revoked job proposals', async () => {
+ const proposals = buildJobProposals()
+
+ renderWithRouter()
+
+ userEvent.click(getByRole('tab', { name: /revoked/i }))
+
+ const rows = await findAllByRole('row')
+ expect(rows).toHaveLength(2)
+ })
})
diff --git a/src/screens/FeedsManager/JobProposalsCard.tsx b/src/screens/FeedsManager/JobProposalsCard.tsx
index 8dd9601c..0560a408 100644
--- a/src/screens/FeedsManager/JobProposalsCard.tsx
+++ b/src/screens/FeedsManager/JobProposalsCard.tsx
@@ -24,6 +24,7 @@ const tabToStatus: { [key: number]: string } = {
3: 'REJECTED',
4: 'CANCELLED',
5: 'DELETED',
+ 6: 'REVOKED',
}
const styles = (theme: Theme) => {
@@ -86,6 +87,7 @@ export const JobProposalsCard = withStyles(styles)(
REJECTED: number
CANCELLED: number
DELETED: number
+ REVOKED: number
} = React.useMemo(() => {
const tabBadgeCounts = {
PENDING: 0,
@@ -94,6 +96,7 @@ export const JobProposalsCard = withStyles(styles)(
REJECTED: 0,
CANCELLED: 0,
DELETED: 0,
+ REVOKED: 0,
}
proposals.forEach((p) => {
@@ -118,6 +121,10 @@ export const JobProposalsCard = withStyles(styles)(
case 'DELETED':
tabBadgeCounts['DELETED']++
+ break
+ case 'REVOKED':
+ tabBadgeCounts['REVOKED']++
+
break
default:
break
@@ -167,6 +174,8 @@ export const JobProposalsCard = withStyles(styles)(
return
case 'DELETED':
return
+ case 'REVOKED':
+ return
default:
return null
}
@@ -260,6 +269,18 @@ export const JobProposalsCard = withStyles(styles)(
}
/>
+
+ Revoked
+
+ }
+ />
{renderTable(filteredProposals)}
diff --git a/src/screens/JobProposal/SpecsView.test.tsx b/src/screens/JobProposal/SpecsView.test.tsx
index bea5e1a1..9ea34ece 100644
--- a/src/screens/JobProposal/SpecsView.test.tsx
+++ b/src/screens/JobProposal/SpecsView.test.tsx
@@ -242,4 +242,22 @@ describe('SpecsView', () => {
expect(queryByText('Cancel')).not.toBeInTheDocument()
})
})
+
+ describe('revoked proposal with pending spec', () => {
+ let specs: ReadonlyArray
+ let proposal: JobProposalPayloadFields
+
+ beforeEach(() => {
+ proposal = buildJobProposal({ status: 'REVOKED' })
+ specs = [buildJobProposalSpec({ status: 'PENDING' })]
+ })
+
+ it('renders a revoked job proposal', async () => {
+ renderComponent(specs, proposal)
+
+ expect(getByTestId('codeblock')).toHaveTextContent(specs[0].definition)
+ expect(queryByText(/edit/i)).toBeNull()
+ expect(queryByText('Cancel')).not.toBeInTheDocument()
+ })
+ })
})
diff --git a/src/screens/JobProposal/SpecsView.tsx b/src/screens/JobProposal/SpecsView.tsx
index b32bf039..0e54d71e 100644
--- a/src/screens/JobProposal/SpecsView.tsx
+++ b/src/screens/JobProposal/SpecsView.tsx
@@ -141,15 +141,17 @@ export const SpecsView = withStyles(styles)(
Reject
- {latestSpec.id === specID && proposal.status !== 'DELETED' && (
-
- )}
+ {latestSpec.id === specID &&
+ proposal.status !== 'DELETED' &&
+ proposal.status !== 'REVOKED' && (
+
+ )}
{latestSpec.id === specID &&
proposal.status === 'DELETED' &&
@@ -190,7 +192,11 @@ export const SpecsView = withStyles(styles)(
>
)
case 'CANCELLED':
- if (latestSpec.id === specID && proposal.status !== 'DELETED') {
+ if (
+ latestSpec.id === specID &&
+ proposal.status !== 'DELETED' &&
+ proposal.status !== 'REVOKED'
+ ) {
return (