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

#720 Added a message if vacancy was unpublished #732

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 50 additions & 40 deletions src/views/Applications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,43 +58,50 @@

<div class="moj-button-menu">
<div class="moj-button-menu__wrapper">
<RouterLink
v-if="isOpen(application.dateExtension, application.exerciseId) && application.status == 'draft'"
:class="`govuk-button moj-button-menu__item info-link--applications--continue-with-application-${application.exerciseId}`"
:to="{ name: 'task-list', params: { id: application.exerciseId } }"
role="button"
data-module="govuk-button"
<div
v-if="!vacancyExists(application.exerciseId)"
class="govuk-body govuk-!-margin-top-3 govuk-!-margin-bottom-0"
>
Continue with application
</RouterLink>
<RouterLink
v-else
:class="`govuk-button govuk-button--secondary moj-button-menu__item info-link--applications--view-sent-application-${application.exerciseId}`"
:to="{ name: 'review', params: { id: application.exerciseId } }"
role="button"
data-module="govuk-button"
>
<span v-if="application.status == 'draft'">View draft application</span>
<span v-else>View sent application</span>
</RouterLink>
<RouterLink
:class="`govuk-button govuk-button--secondary moj-button-menu__item info-link--applications--view-advert-${application.exerciseId}`"
role="button"
data-module="govuk-button"
:to="{ name: 'vacancy-details', params: { id: application.exerciseId } }"
>
View advert
</RouterLink>

<RouterLink
v-if="application.characterChecks && application.characterChecks.declaration === true"
:class="`govuk-button govuk-button--secondary moj-button-menu__item float-right info-link--applications--view-good-character-checks-consent-${application.exerciseId}`"
:to="{ name: 'character-checks-review', params: { id: application.exerciseId } }"
role="button"
data-module="govuk-button"
>
View good character checks consent
</RouterLink>
Data is temporarily unavailable.
</div>
<div v-else>
<RouterLink
v-if="isOpen(application.dateExtension, application.exerciseId) && application.status == 'draft'"
:class="`govuk-button moj-button-menu__item info-link--applications--continue-with-application-${application.exerciseId}`"
:to="{ name: 'task-list', params: { id: application.exerciseId } }"
role="button"
data-module="govuk-button"
>
Continue with application
</RouterLink>
<RouterLink
v-else
:class="`govuk-button govuk-button--secondary moj-button-menu__item info-link--applications--view-sent-application-${application.exerciseId}`"
:to="{ name: 'review', params: { id: application.exerciseId } }"
role="button"
data-module="govuk-button"
>
<span v-if="application.status == 'draft'">View draft application</span>
<span v-else>View sent application</span>
</RouterLink>
<RouterLink
:class="`govuk-button govuk-button--secondary moj-button-menu__item info-link--applications--view-advert-${application.exerciseId}`"
role="button"
data-module="govuk-button"
:to="{ name: 'vacancy-details', params: { id: application.exerciseId } }"
>
View advert
</RouterLink>
<RouterLink
v-if="application.characterChecks && application.characterChecks.declaration === true"
:class="`govuk-button govuk-button--secondary moj-button-menu__item float-right info-link--applications--view-good-character-checks-consent-${application.exerciseId}`"
:to="{ name: 'character-checks-review', params: { id: application.exerciseId } }"
role="button"
data-module="govuk-button"
>
View good character checks consent
</RouterLink>
</div>
</div>
</div>
</li>
Expand Down Expand Up @@ -145,9 +152,10 @@ import isVacancyOpen from '@/helpers/isVacancyOpen';

export default {
computed: {
...mapState('applications', [
'records',
]),
...mapState('applications', ['records']),
vacancies() {
return this.$store.getters['vacancies/vacancies'];
},
},
created() {
this.$store.dispatch('applications/bind');
Expand All @@ -162,7 +170,9 @@ export default {
} else {
return false;
}

},
vacancyExists(exerciseId) {
return this.vacancies.find(vacancy => vacancy.id === exerciseId) !== undefined;
},
},
};
Expand Down