Skip to content

Commit

Permalink
feat(income-plan): Remove edit function after submission (#17246)
Browse files Browse the repository at this point in the history
* remove edit function after submission

* format

* remove unit test

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
ylfahfa and kodiakhq[bot] authored Dec 16, 2024
1 parent 0c7df8f commit 65767dc
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,6 @@ export const Review: FC<ReviewScreenProps> = ({
</Box>
</Box>
<Box display="flex" columnGap={2} alignItems="center">
{state === `${States.TRYGGINGASTOFNUN_SUBMITTED}` && (
<Button
colorScheme="default"
iconType="filled"
size="small"
type="button"
variant="text"
icon="pencil"
loading={loadingSubmit}
disabled={loadingSubmit}
onClick={() => handleSubmit('EDIT')}
>
{formatMessage(incomePlanFormMessage.confirm.buttonEdit)}
</Button>
)}
<Button
variant="utility"
icon="print"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,6 @@ describe('Income Plan Template', () => {
})
})

describe('state transitions', () => {
it('should transition from tryggingastofnunSubmitted to draft on edit', () => {
const helper = new ApplicationTemplateHelper(
buildApplication({
state: 'tryggingastofnunSubmitted',
}),
IncomePlanTemplate,
)

const [hasChanged, newState] = helper.changeState({
type: DefaultEvents.EDIT,
})
expect(hasChanged).toBe(true)
expect(newState).toBe('draft')
})
})

describe('Income plan table', () => {
describe('equalForeignIncomePerMonth', () => {
it('should unset equalForeignIncomePerMonth if income is MONTHLY and unevenIncomePerYear is YES', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,6 @@ const IncomePlanTemplate: ApplicationTemplate<
import('../forms/InReview').then((val) =>
Promise.resolve(val.InReview),
),
actions: [
{
event: DefaultEvents.EDIT,
name: incomePlanFormMessage.confirm.buttonEdit,
type: 'primary',
},
],
read: 'all',
write: 'all',
},
Expand All @@ -223,7 +216,6 @@ const IncomePlanTemplate: ApplicationTemplate<
],
},
on: {
[DefaultEvents.EDIT]: { target: States.DRAFT },
INREVIEW: {
target: States.TRYGGINGASTOFNUN_IN_REVIEW,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,6 @@ export const incomePlanFormMessage: MessageDir = {
'Vinsamlegast farðu yfir tekjuáætlunina áður en þú sendir hana inn.',
description: 'Please review the application before submitting.',
},
buttonEdit: {
id: 'ip.application:button.edit',
defaultMessage: 'Breyta tekjuáætlun',
description: 'Edit application',
},
}),

conclusionScreen: defineMessages({
Expand Down Expand Up @@ -336,10 +331,8 @@ export const statesMessages = defineMessages({
},
tryggingastofnunSubmittedContent: {
id: 'ip.application:tryggingastofnunSubmittedContent',
defaultMessage:
'Tekjuáætlunin þín er í bið eftir yfirferð. Hægt er að breyta tekjuáætlun þar til hún er komin í yfirferð.',
description:
'Your income plan is awaiting review. It is possible to edit the income plan until it is under review.',
defaultMessage: 'Tekjuáætlunin þín er í bið eftir yfirferð.',
description: 'Your income plan is awaiting review.',
},
incomePlanEdited: {
id: 'ip.application:incomePlanEdited',
Expand Down

0 comments on commit 65767dc

Please sign in to comment.