-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#453 move back option for shortlisted
- Loading branch information
Showing
6 changed files
with
135 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<template> | ||
<form @submit.prevent="validateAndSave"> | ||
<ErrorSummary | ||
:errors="errors" | ||
/> | ||
<RadioGroup | ||
id="selected-status" | ||
v-model="newSelectedStatus" | ||
label="Move back to the review stage?" | ||
hint="" | ||
required | ||
> | ||
<RadioItem | ||
v-for="item in availableStatuses" | ||
:key="item" | ||
:value="item" | ||
:label="item | lookup" | ||
/> | ||
</RadioGroup> | ||
<button class="govuk-button"> | ||
Save and continue | ||
</button> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
import Form from '@/components/Form/Form'; | ||
import ErrorSummary from '@/components/Form/ErrorSummary'; | ||
import RadioGroup from '@/components/Form/RadioGroup'; | ||
import RadioItem from '@/components/Form/RadioItem'; | ||
import { DEFAULT, EXERCISE_STAGE } from '@/helpers/constants'; | ||
export default { | ||
components: { | ||
ErrorSummary, | ||
RadioGroup, | ||
RadioItem, | ||
}, | ||
extends: Form, | ||
data() { | ||
return { | ||
newSelectedStatus: null, | ||
}; | ||
}, | ||
computed: { | ||
applicationId() { | ||
return this.$route.params.applicationId; | ||
}, | ||
availableStatuses() { | ||
const myStatus = [ | ||
DEFAULT.YES, | ||
DEFAULT.NO, | ||
]; | ||
return myStatus; | ||
}, | ||
}, | ||
methods: { | ||
async save() { | ||
let stageValue = EXERCISE_STAGE.SHORTLISTED; | ||
if (this.newSelectedStatus === DEFAULT.YES) { | ||
stageValue = EXERCISE_STAGE.REVIEW; | ||
} | ||
await this.$store.dispatch('stageShortlisted/updateStatus', { | ||
applicationId: this.applicationId, | ||
status: '', | ||
nextStage: stageValue, | ||
}); | ||
this.$router.push({ name: 'exercise-stages-shortlist-list' }); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters