Skip to content

Commit

Permalink
#1212 Enable leadership judge assessment (#1239)
Browse files Browse the repository at this point in the history
* #1212 Enable leadership judge assessment
* #1212 Amend timeline and downloads
* Include preview urls
* Include helpersTMP for local working copy helpers
* Include npm scope for jac-uk
* Use jac-kit@0.0.25
  • Loading branch information
warrensearle authored Mar 31, 2021
1 parent dd9dcbb commit 10188af
Show file tree
Hide file tree
Showing 17 changed files with 819 additions and 92 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,49 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
# Builds and deploys to firebase hosting preview channel.

name: Deploy to Firebase Hosting on PR
name: Preview pull request
'on': pull_request
jobs:
build_and_preview:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: potiuk/cancel-workflow-runs@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@master
- name: Installing project dependencies
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc && npm ci
- name: Create env file
run: |
touch .env.develop
echo "NODE_ENV=production" > .env.develop
echo "VUE_APP_FIREBASE_API_KEY=${{ secrets.DEVELOP_FIREBASE_API_KEY }}" >> .env.develop
echo "VUE_APP_FIREBASE_AUTH_DOMAIN=${{ secrets.DEVELOP_FIREBASE_AUTH_DOMAIN }}" >> .env.develop
echo "VUE_APP_FIREBASE_DATABASE_URL=${{ secrets.DEVELOP_FIREBASE_DATABASE_URL }}" >> .env.develop
echo "VUE_APP_FIREBASE_PROJECT_ID=${{ secrets.DEVELOP_FIREBASE_PROJECT_ID }}" >> .env.develop
echo "VUE_APP_FIREBASE_STORAGE_BUCKET=${{ secrets.DEVELOP_FIREBASE_STORAGE_BUCKET }}" >> .env.develop
echo "VUE_APP_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.DEVELOP_FIREBASE_MESSAGING_SENDER_ID }}" >> .env.develop
echo "VUE_APP_FIREBASE_APP_ID=${{ secrets.DEVELOP_FIREBASE_APP_ID }}" >> .env.develop
cat .env.develop
- name: Building the project
run: npm run build-develop
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DIGITAL_PLATFORM_DEVELOP }}'
firebaseServiceAccount: '${{ secrets.DEVELOP_FIREBASE_SERVICE_ACCOUNT }}'
projectId: digital-platform-develop
target: develop-admin-app
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
registry=https://npm.pkg.github.com/jac-uk
@jac-uk:registry=https://npm.pkg.github.com
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^16.0.0",
"@ckeditor/ckeditor5-vue": "^1.0.3",
"@jac-uk/jac-kit": "latest",
"@jac-uk/jac-kit": "0.0.25",
"@ministryofjustice/frontend": "0.0.17-alpha",
"@sentry/browser": "^5.30.0",
"@sentry/integrations": "^5.30.0",
Expand Down
3 changes: 3 additions & 0 deletions src/components/ModalViews/IndependentAssessorChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@ export default {
padding: 0;
margin: 0;
}
.modal__title {
color: white;
}
</style>
119 changes: 119 additions & 0 deletions src/components/ModalViews/LeadershipJudgeDetails.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<template>
<div>
<div class="modal__title govuk-!-padding-2 govuk-heading-m">
Leadership Judge Details
</div>
<div class="modal__content govuk-!-margin-6">
<div class="govuk-grid-row">
<form
ref="formRef"
@submit.prevent="save"
>
<fieldset>
<TextField
id="full-name"
v-model="fullName"
label="Full name"
required
/>
<TextField
id="title"
v-model="title"
label="Title or position"
required
/>
<TextField
id="email"
v-model="email"
label="Email"
type="email"
required
/>
<TextField
id="phone"
v-model="phone"
label="Phone"
type="tel"
required
/>
</fieldset>
<button
class="govuk-button govuk-!-margin-right-3"
@click="save"
>
Save
</button>
<button
class="govuk-button govuk-button--secondary govuk-!-margin-right-3"
@click="closeModal"
>
Cancel
</button>
</form>
</div>
</div>
</div>
</template>

<script>
import TextField from '@jac-uk/jac-kit/draftComponents/Form/TextField';
export default {
name: 'LeadershipJudgeDetails',
components: {
TextField,
},
data() {
return {
email: null,
fullName: null,
phone: null,
title: null,
};
},
computed: {
applicationId() {
return this.$attrs['application-id'];
},
},
created() {
this.email = this.$attrs.email;
this.fullName = this.$attrs.fullName;
this.phone = this.$attrs.phone;
this.title = this.$attrs.title;
},
methods: {
closeModal() {
this.$emit('close');
},
confirmModal() {
this.modalOpen = false;
this.$emit('confirmed');
document.body.style.overflow = '';
},
async save() {
const data = {
leadershipJudgeDetails: {
email: this.email,
fullName: this.fullName,
phone: this.phone,
title: this.title,
},
};
await this.$store.dispatch('application/update', { data: data, id: this.applicationId });
this.closeModal();
},
},
};
</script>

<style scoped>
fieldset {
border: none;
padding: 0;
margin: 0;
}
.modal__title {
color: white;
}
</style>
Loading

0 comments on commit 10188af

Please sign in to comment.