Skip to content

Commit

Permalink
#1911 Enable QTs to be set up while exercise is still open (#1920)
Browse files Browse the repository at this point in the history
* #1911 Enable QTs to be set up whilst exercise is still open

* Tidy up wording and font size
  • Loading branch information
warrensearle authored Feb 28, 2023
1 parent cff9d0a commit 374c4bb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 40 deletions.
70 changes: 39 additions & 31 deletions src/views/Exercise/Tasks/Task/New/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,32 @@
</h1>

<p
class="govuk-body-l"
class="govuk-body"
>
Please check the following details before continuing
Please confirm the following
</p>

<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<div class="panel govuk-!-margin-bottom-5 govuk-!-padding-4 background-light-grey">
<div class="govuk-caption-m">
Applications <span v-if="entryStatus">({{ entryStatus | lookup }})</span>
</div>
<h2
class="govuk-heading-m govuk-!-margin-bottom-0"
>
{{ totalApplications }}
</h2>
</div>
</div>
<Checkbox
v-for="(timelineTask, index) in timelineTasks"
:id="`timelineTask-${index}`"
:key="`timelineTask-${index}`"
v-model="formData.timelineTasks[index]"
>
{{ timelineTask.entry }} will happen on {{ timelineTask.dateString }}
</Checkbox>

<div
v-for="(timelineTask, index) in timelineTasks"
:key="`timelineTask-${index}`"
class="govuk-grid-column-one-half"
>
<div class="panel govuk-!-margin-bottom-5 govuk-!-padding-4 background-light-grey">
<span class="govuk-caption-m">{{ timelineTask.entry }}</span>
<h2
class="govuk-heading-m govuk-!-margin-bottom-0"
>
{{ timelineTask.dateString }}
</h2>
</div>
</div>
</div>
<Checkbox
v-if="entryStatus"
id="entryStatus"
v-model="formData.entryStatus"
>
Only '{{ entryStatus | lookup }}' applications will be included
</Checkbox>

<ActionButton
class="govuk-!-margin-bottom-0"
type="primary"
:disabled="!totalApplications"
:disabled="!isFormCompleted"
@click="btnInitialise"
>
Continue
Expand All @@ -56,18 +43,28 @@ import { btnNext } from '../helper';
import { TASK_TYPE } from '@/helpers/constants';
import { taskEntryStatus, previousTaskType, getTimelineTasks } from '@/helpers/exerciseHelper';
import ActionButton from '@jac-uk/jac-kit/draftComponents/ActionButton';
import Checkbox from '@jac-uk/jac-kit/draftComponents/Form/Checkbox';
import { functions } from '@/firebase';
export default {
components: {
ActionButton,
Checkbox,
},
props: {
type: {
required: true,
type: String,
},
},
data() {
return {
formData: {
entryStatus: null,
timelineTasks: [],
},
};
},
computed: {
exercise() {
return this.$store.state.exerciseDocument.record;
Expand Down Expand Up @@ -97,6 +94,17 @@ export default {
}
return 0;
},
isFormCompleted() {
let expectedLength = 0;
let actualLength = 0;
if (this.entryStatus) {
expectedLength += 1;
if (this.formData.entryStatus === true) actualLength += 1;
}
expectedLength += this.timelineTasks.length;
actualLength += this.formData.timelineTasks.length;
return expectedLength === actualLength;
},
},
methods: {
btnNext,
Expand Down
8 changes: 5 additions & 3 deletions src/views/Exercise/Tasks/Task/TestActivated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
<h1 class="govuk-heading-l">
{{ type | lookup }}
</h1>
<p class="govuk-body-l govuk-!-margin-bottom-4">
This test is hosted on the
<p class="govuk-body govuk-!-margin-bottom-4">
Please log in to the
<a
:href="testAdminURL"
target="_blank"
>
QT Platform</a>.
QT Platform</a> to run and manage the {{ type | lookup }}.
</p>
<p class="govuk-body govuk-!-margin-bottom-4">
When the test and mop-ups have been completed you may continue.
</p>
<ActionButton
Expand Down
14 changes: 8 additions & 6 deletions src/views/Exercise/Tasks/Task/TestInitialised.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
<h1 class="govuk-heading-l">
{{ type | lookup }}
</h1>
<p class="govuk-body-l govuk-!-margin-bottom-4">
This test is hosted on the
<p class="govuk-body govuk-!-margin-bottom-4">
Please log in to the
<a
:href="testAdminURL"
target="_blank"
>
QT Platform</a>.
QT Platform</a> to set up the {{ type | lookup }}.
</p>
<p class="govuk-body govuk-!-margin-bottom-4">
When all applications are ready please transfer them to the QT Platform.
</p>
<ActionButton
type="primary"
@click="updateTask"
>
Transfer {{ totalApplications }} applications to the QT Platform
Transfer applications to the QT Platform
</ActionButton>
<div class="panel govuk-!-margin-top-6 govuk-!-margin-bottom-6 govuk-!-padding-4 background-light-grey">
<!-- <div class="panel govuk-!-margin-top-6 govuk-!-margin-bottom-6 govuk-!-padding-4 background-light-grey">
<div class="govuk-caption-m">
URL for candidates to take this test
</div>
Expand All @@ -33,7 +35,7 @@
>
Copy URL to clipboard
</ActionButton>
</div>
</div> -->
</div>
</template>

Expand Down

0 comments on commit 374c4bb

Please sign in to comment.