Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
warrensearle committed Jul 20, 2020
2 parents 4b081ea + 05768a7 commit 3abf819
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 1%
last 2 versions
75 changes: 71 additions & 4 deletions package-lock.json

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

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assessment-uploader",
"version": "0.2.0",
"version": "0.3.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode develop",
Expand All @@ -19,6 +19,8 @@
"dependencies": {
"@firebase/app": "^0.6.2",
"@firebase/storage": "^0.3.32",
"@sentry/browser": "^5.18.1",
"@sentry/integrations": "^5.18.1",
"core-js": "^3.6.5",
"firebase": "^7.14.2",
"govuk-frontend": "^3.6.0",
Expand All @@ -39,9 +41,5 @@
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
}
Binary file modified public/favicon.ico
Binary file not shown.
16 changes: 10 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ import * as filters from '@/filters';
import router from '@/router';
import store from '@/store';
import { auth } from '@/firebase';
//import firebase from '@firebase';
import * as Sentry from '@sentry/browser';
import * as Integrations from '@sentry/integrations';

if (process.env.NODE_ENV !== 'development') {
Sentry.init({
dsn: 'https://23ac92825117451eb421535be7e4c334@o323827.ingest.sentry.io/5301649',
environment: process.env.NODE_ENV,
release: process.env.npm_package_version,
integrations: [new Integrations.Vue({ Vue, attachProps: true })],
});
}
Vue.config.productionTip = false;

// Register global filters
Expand All @@ -19,11 +28,6 @@ let vueInstance = false;
auth().onAuthStateChanged(async (user) => {
// Bind Firebase auth state to the vuex auth state store
await store.dispatch('auth/setCurrentUser', user);
if (store.getters['auth/isSignedIn']) {
if (window.location.pathname == '/sign-in') {
router.push('/assessments');
}
}
// Create the Vue instance, but only once
if (!vueInstance) {
vueInstance = new Vue({
Expand Down
7 changes: 7 additions & 0 deletions src/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ const module = {
isSignedIn(state) {
return (state.currentUser !== null);
},
currentUserId(state) {
if (state.currentUser !== null) {
return state.currentUser.uid;
} else {
return '';
}
},
},
};

Expand Down
5 changes: 4 additions & 1 deletion src/views/Assessment/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,13 @@ export default {
fileName() {
return this.assessmentId;
},
assessorId() {
return this.$store.getters['auth/currentUserId'];
},
uploadPath() {
const exerciseId = this.assessment.exercise.id;
const applicationId = this.assessment.application.id;
const assessorId = this.$store.state.auth.currentUser.uid;
const assessorId = this.assessorId;
return `/exercise/${exerciseId}/application/${applicationId}/assessor/${assessorId}`;
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/views/Assessments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@
<td class="govuk-table__cell">
<router-link
v-if="canEdit(assessment)"
class="govuk-button govuk-button--secondary"
class="govuk-button govuk-button--primary"
:to="{ name: 'assessment-edit', params: { id: assessment.id }}"
>
Upload
View Incomplete Assessment
</router-link>
<router-link
v-else
class="govuk-button govuk-button--secondary"
:to="{ name: 'assessment-view', params: { id: assessment.id }}"
>
Review
Review Completed Assessment
</router-link>
</td>
</tr>
Expand Down
2 changes: 2 additions & 0 deletions src/views/SignIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export default {
window.localStorage.setItem('emailForSignIn', email);
window.localStorage.setItem('signInDestination', ref + '/upload');
return window.location.replace(response.data.result);
} else {
// console.log('mal-formed request');
}
} else if (this.$route.query.return) {
// we have 'return' flag set so try to complete sign in
Expand Down

0 comments on commit 3abf819

Please sign in to comment.