Skip to content

Commit

Permalink
Merge branch 'main' into feature/equal-merit-tie-breakers
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonJAC committed Jul 29, 2021
2 parents beab9db + a057cc1 commit 851ac37
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "admin",
"version": "0.69.0",
"version": "0.71.0",
"private": true,
"scripts": {
"preinstall": "npx npm-force-resolutions",
Expand Down
6 changes: 4 additions & 2 deletions src/store/qualifyingTest/qualifyingTestResponses.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,15 @@ export default {
await context.dispatch('update', { data: data, id: qualifyingTestResponse.id });
},
resetTest: async (context) => {
const timestamp = firebase.firestore.FieldValue.serverTimestamp();
const email = firebase.auth().currentUser.email;
const canReset = await authorisedToPerformAction(email);
if (canReset) {
const rec = context.state.record;
const data = {
'status': 'activated',
};
'status': 'activated',
'statusLog.reset': timestamp,
};
if (rec.isOutOfTime === true) {
data.isOutOfTime = false;
}
Expand Down
15 changes: 7 additions & 8 deletions src/views/Exercise/Details/Timeline/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<BackLink class="govuk-!-margin-top-0 govuk-!-margin-bottom-0" />
</div>

<h2 class="govuk-heading-l">
<h2 class="govuk-heading-l govuk-!-margin-bottom-2">
Timeline
</h2>

Expand All @@ -19,11 +19,10 @@
@save="save"
/>

<p class="govuk-body-l">
You can return to this page later to add or change dates.
</p>

<p class="govuk_body">
<div class="govuk_body govuk-!-margin-bottom-2">
<p class="govuk-body-l govuk-!-margin-bottom-2">
You can return to this page later to add or change dates.
</p>
<a
href="#"
class="govuk-link"
Expand All @@ -33,7 +32,7 @@
<span class="govuk-hint">
This can help you plan your own key dates (opens in a new tab).
</span>
</p>
</div>

<h2 class="govuk-heading-l">
Application dates
Expand Down Expand Up @@ -433,7 +432,7 @@ export default {
return this.$store.getters['exerciseCreateJourney/hasJourney'];
},
iaHardLimitTime() {
return formatDate(this.exercise.independentAssessmentsHardLimitDate, 'time');
return this.exercise.independentAssessmentsHardLimitDate ? formatDate(this.exercise.independentAssessmentsHardLimitDate, 'time') : false;
},
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
</dt>
<dd class="govuk-summary-list__value">
{{ response.status | lookup }} {{ response.isOutOfTime ? 'DNF' : '' }}
<ActionButton
<button
v-if="authorisedToPerformAction"
:disabled="hasActivated"
type="secondary"
class="float-right govuk-!-margin-bottom-1"
class="govuk-button govuk-button--secondary float-right govuk-!-margin-bottom-1"
@click="resetTest"
>
Reset
</ActionButton>
</button>
<ActionButton
v-if="authorisedToPerformAction"
:disabled="hasCompleted"
Expand Down Expand Up @@ -172,7 +172,38 @@
</dd>
</div>
</dl>
<Modal
ref="confirmResetModal"
>
<div class="container">
<div class="modal__title govuk-!-padding-2 govuk-heading-m">
Caution
</div>
<div class="modal__content govuk-!-padding-4">
<p class="modal__message govuk-body-l">
Reseting this candidate's test will overwrite their
'started', 'completed' and 'time taken' fields.
<br>
Please ensure there is a record of these before continuing.
</p>

<span>
<button
class="govuk-button govuk-button--secondary govuk-!-margin-right-3 deny info-btn--modal--cancel"
@click="$refs['confirmResetModal'].closeModal()"
>
Cancel
</button>
</span>
<ActionButton
class="govuk-button govuk-button--warning"
@click="confirmReset"
>
Reset Test
</ActionButton>
</div>
</div>
</Modal>
<div v-if="hasStarted">
<TabsList
:tabs="tabs"
Expand Down Expand Up @@ -334,12 +365,14 @@ import TabsList from '@jac-uk/jac-kit/draftComponents/TabsList';
import QuestionDuration from '@/components/Micro/QuestionDuration';
import ActionButton from '@jac-uk/jac-kit/draftComponents/ActionButton';
import { authorisedToPerformAction } from '@/helpers/authUsers';
import Modal from '@jac-uk/jac-kit/components/Modal/Modal';
export default {
components: {
EditableField,
Select,
TabsList,
Modal,
QuestionDuration,
ActionButton,
},
Expand Down Expand Up @@ -504,11 +537,15 @@ export default {
this.authorisedToPerformAction = await authorisedToPerformAction(email);
},
methods: {
resetTest() {
confirmReset() {
if (this.authorisedToPerformAction && this.authorisedToPerformAction === true) {
this.$store.dispatch('qualifyingTestResponses/resetTest');
this.$refs['confirmResetModal'].closeModal();
}
},
resetTest() {
this.$refs['confirmResetModal'].openModal();
},
markAsCompleted() {
if (this.authorisedToPerformAction && this.authorisedToPerformAction === true) {
this.$store.dispatch('qualifyingTestResponses/markAsCompleted');
Expand Down Expand Up @@ -622,7 +659,10 @@ export default {
};
</script>

<style scoped>
<style lang="scss" scoped>
.deny {
background-color: #f3f2f1;
}
.answer--right {
font-weight: bold;
text-decoration: underline;
Expand Down

0 comments on commit 851ac37

Please sign in to comment.