Skip to content

Commit b19ab5a

Browse files
- CHG: Updated Vue CLI to 5.0.4.
- CHG: Made required changes to make it build again. - ADD: Added bootswatch theme to align appearance with Germinate.
1 parent f4fc209 commit b19ab5a

23 files changed

+7781
-10218
lines changed

.eslintrc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ module.exports = {
33
env: {
44
node: true
55
},
6-
'extends': [
6+
extends: [
77
'plugin:vue/essential',
88
'@vue/standard'
99
],
1010
rules: {
1111
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
12+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13+
'vue/no-mutating-props': 'off',
14+
'vue/multi-word-component-names': 0
1315
},
1416
parserOptions: {
15-
parser: 'babel-eslint'
17+
parser: '@babel/eslint-parser'
1618
}
1719
}

babel.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
module.exports = {
22
presets: [
3-
['@vue/app',
4-
{
5-
useBuiltIns: 'entry'
3+
// '@vue/cli-plugin-babel/preset',
4+
[
5+
'@babel/preset-env', {
6+
'useBuiltIns': 'usage',
7+
'corejs': 3
68
}
79
]
810
]

package-lock.json

Lines changed: 7576 additions & 10023 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
"version": "4.2.1",
44
"description": "",
55
"author": "Sebastian Raubach",
6-
"homepage": "https://ics.hutton.ac.uk/get-germinate",
7-
"copyright": "Copyright 2019 The James Hutton Institute",
8-
"license": "Apache-2.0",
9-
"repository": {
10-
"type": "git",
11-
"url": "https://github.com/germinateplatform/gatekeeper-vue.git"
12-
},
136
"scripts": {
147
"serve": "vue-cli-service serve",
158
"build": "vue-cli-service build",
@@ -20,27 +13,33 @@
2013
"axios": "^0.26.1",
2114
"bootstrap": "^4.6.1",
2215
"bootstrap-vue": "^2.22.0",
23-
"core-js": "~2.6.5",
24-
"vue": "~2.6.10",
16+
"bootswatch": "^4.6.1",
17+
"core-js": "^3.8.3",
18+
"vue": "^2.6.14",
2519
"vue-flag-icon": "~1.0.6",
2620
"vue-i18n": "^8.27.1",
2721
"vue-material-design-icons": "~3.2.0",
28-
"vue-router": "~3.0.6",
29-
"vuex": "~3.1.1",
30-
"vuex-persistedstate": "~2.5.4",
22+
"vue-router": "^3.5.1",
23+
"vuex": "^3.6.2",
24+
"vuex-persistedstate": "^4.1.0",
3125
"zxcvbn": "~4.4.2"
3226
},
3327
"devDependencies": {
34-
"@vue/cli-plugin-babel": "~4.5.11",
35-
"@vue/cli-plugin-eslint": "~4.5.11",
36-
"@vue/cli-service": "~4.5.11",
37-
"@vue/eslint-config-standard": "~4.0.0",
38-
"babel-eslint": "~10.0.1",
39-
"eslint": "~7.19.0",
40-
"eslint-plugin-vue": "~7.5.0",
41-
"node-sass": "~4.14.1",
42-
"sass-loader": "~7.1.0",
43-
"vue-template-compiler": "~2.6.10"
28+
"@babel/core": "^7.12.16",
29+
"@babel/eslint-parser": "^7.12.16",
30+
"@vue/cli-plugin-babel": "^5.0.4",
31+
"@vue/cli-plugin-eslint": "^5.0.4",
32+
"@vue/cli-service": "^5.0.4",
33+
"@vue/eslint-config-standard": "^6.1.0",
34+
"eslint": "^7.32.0",
35+
"eslint-plugin-import": "^2.25.3",
36+
"eslint-plugin-node": "^11.1.0",
37+
"eslint-plugin-promise": "^5.1.0",
38+
"eslint-plugin-vue": "^8.0.3",
39+
"path-browserify": "^1.0.1",
40+
"sass": "^1.32.7",
41+
"sass-loader": "^12.0.0",
42+
"vue-template-compiler": "^2.6.14"
4443
},
4544
"eslintConfig": {
4645
"root": true,
@@ -64,5 +63,12 @@
6463
"browserslist": [
6564
"> 1%",
6665
"last 2 versions"
67-
]
66+
],
67+
"copyright": "Copyright 2019 The James Hutton Institute",
68+
"homepage": "https://ics.hutton.ac.uk/get-germinate",
69+
"license": "Apache-2.0",
70+
"repository": {
71+
"type": "git",
72+
"url": "https://github.com/germinateplatform/gatekeeper-vue.git"
73+
}
6874
}

src/App.vue

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<b-navbar-nav class="ml-auto mr-2">
88
<b-nav-item :to="token ? '/about' : '/gk/about'">{{ $t('navbarActionAbout') }}</b-nav-item>
99
<b-nav-item-dropdown text="Lang" right>
10-
<template slot="button-content"><TranslateIcon class="form-icon" /></template>
10+
<template slot="button-content"><MdiIcon :path="mdiTranslate" /></template>
1111
<b-dropdown-item v-for="language in languages" :key="language.locale" @click="onLocaleChanged(language)"><flag :squared="false" :iso="language.flag" class="flag-icon" /> {{ language.name }}</b-dropdown-item>
1212
</b-nav-item-dropdown>
1313
<b-nav-item to="/" @click="signOut" :title="$t('navbarActionSignOut')" v-if="token">
14-
<LogoutVariantIcon class="form-icon" :title="$t('navbarActionSignOut')" />
14+
<MdiIcon :path="mdiLogoutVariant" />
1515
</b-nav-item>
1616
</b-navbar-nav>
1717
</b-navbar>
@@ -40,15 +40,18 @@
4040
</template>
4141

4242
<script>
43-
import LogoutVariantIcon from 'vue-material-design-icons/LogoutVariant'
44-
import TranslateIcon from 'vue-material-design-icons/Translate'
43+
import MdiIcon from '@/components/MdiIcon'
4544
import { mapState } from 'vuex'
4645
import { EventBus } from './event-bus.js'
4746
47+
import { mdiLogoutVariant, mdiTranslate } from '@mdi/js'
48+
4849
export default {
4950
name: 'app',
5051
data: function () {
5152
return {
53+
mdiLogoutVariant,
54+
mdiTranslate,
5255
languages: [{
5356
locale: 'en_GB',
5457
flag: 'gb',
@@ -67,32 +70,28 @@ export default {
6770
])
6871
},
6972
components: {
70-
LogoutVariantIcon,
71-
TranslateIcon
73+
MdiIcon
7274
},
7375
methods: {
7476
onLocaleChanged: function (language) {
7577
this.$i18n.locale = language.locale
7678
this.$store.dispatch('ON_LOCALE_CHANGED', language.locale)
7779
},
7880
signOut: function () {
79-
var vm = this
80-
81-
var user = {
81+
const user = {
8282
email: this.token.username,
8383
password: this.token.token
8484
}
8585
86-
this.apiDeleteToken(user, function (result) {
87-
console.log(result)
86+
this.apiDeleteToken(user, result => {
8887
// If it's successful, delete token, then redirect
89-
vm.$store.dispatch('ON_TOKEN_CHANGED', null)
90-
vm.$router.push('/gk/login')
88+
this.$store.dispatch('ON_TOKEN_CHANGED', null)
89+
this.$router.push('/gk/login')
9190
}, {
9291
codes: [],
93-
callback: function () {
92+
callback: () => {
9493
// If they're wrong, remove
95-
vm.$store.dispatch('ON_TOKEN_CHANGED', null)
94+
this.$store.dispatch('ON_TOKEN_CHANGED', null)
9695
}
9796
})
9897
},
@@ -108,22 +107,60 @@ export default {
108107
EventBus.$off('show-loading', this.toggleLoading)
109108
},
110109
mounted: function () {
111-
var vm = this
112-
113110
EventBus.$on('show-loading', this.toggleLoading)
114111
115112
if (this.locale) {
116-
this.$i18n.locale = this.languages.map(function (l) {
117-
return l.locale
118-
}).filter(function (l) {
119-
return vm.locale === l
120-
})
113+
this.$i18n.locale = this.languages.map(l => l.locale).filter(l => this.locale === l)
121114
}
122115
}
123116
}
124117
</script>
125118

126-
<style>
119+
<style lang="scss">
120+
$font-size-base: 1rem;
121+
$primary: #23a1d7;
122+
$dark: #36363b;
123+
$secondary: #bdc3c7;
124+
$success: #27ae60;
125+
$info: #3498db;
126+
$warning: #f39c12;
127+
$danger: #e74c3c;
128+
$indigo: #6610f2;
129+
$purple: #6f42c1;
130+
$pink: #e83e8c;
131+
$red: #dc3545;
132+
$orange: #fd7e14;
133+
$yellow: #ffc107;
134+
$green: #28a745;
135+
$teal: #20c997;
136+
$cyan: #17a2b8;
137+
$headings-font-weight: 400;
138+
$badge-font-size: 85%;
139+
$small-font-size: 70%;
140+
141+
$container-max-widths: (
142+
sm: 540px,
143+
md: 720px,
144+
lg: 960px,
145+
xl: 1140px,
146+
xxl: 1400px
147+
);
148+
149+
$grid-breakpoints: (
150+
xs: 0,
151+
sm: 576px,
152+
md: 768px,
153+
lg: 992px,
154+
xl: 1200px,
155+
xxl: 1500px
156+
);
157+
158+
@import '~bootswatch/dist/cosmo/variables';
159+
@import '~bootstrap/scss/bootstrap';
160+
@import '~bootstrap-vue/src/index.scss';
161+
@import '~bootswatch/dist/cosmo/bootswatch';
162+
@import '@/assets/css/custom.scss';
163+
127164
#app {
128165
flex: 1 0 auto;
129166
min-height: calc(100vh - 37px);

src/assets/css/custom.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@import "../../../node_modules/bootstrap/scss/bootstrap.scss";
2-
@import "../../../node_modules/bootstrap-vue/dist/bootstrap-vue.css";
3-
41
body {
52
font-size: .875rem;
63
}

src/auth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import store from './store/store'
22

33
export default {
44
loggedIn () {
5-
var token = store.getters.token
5+
const token = store.getters.token
66
return token && this.tokenStillValid()
77
},
88
tokenStillValid () {
9-
var token = store.getters.token
9+
const token = store.getters.token
1010
if (token) {
1111
return new Date().getTime() - token.createdOn <= token.lifetime
1212
} else {

src/components/UserRequestTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export default {
164164
this.$nextTick(() => this.$refs.feedbackModal.show())
165165
} else {
166166
EventBus.$emit('show-loading', true)
167-
var decision = {
167+
const decision = {
168168
requestId: this.currentRow.id,
169169
decision: 'REJECT',
170170
feedback: this.rejectionReason
@@ -188,7 +188,7 @@ export default {
188188
},
189189
onApprove: function (row) {
190190
EventBus.$emit('show-loading', true)
191-
var decision = {
191+
const decision = {
192192
requestId: row.id,
193193
decision: 'APPROVE'
194194
}

src/components/modal/AddDatabaseModal.vue

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ export default {
5252
},
5353
methods: {
5454
show () {
55-
var vm = this
56-
this.$nextTick(function () {
57-
vm.$refs.addDatabaseModal.show()
58-
})
55+
this.$nextTick(() => this.$refs.addDatabaseModal.show())
5956
},
6057
onAddDatabaseClicked: function (event) {
6158
event.preventDefault()
@@ -66,11 +63,10 @@ export default {
6663
}
6764
6865
// Send the new database to the server
69-
var vm = this
70-
this.apiPostDatabase(this.database, function (result) {
71-
vm.$refs.addDatabaseModal.hide()
72-
vm.$emit('databases-updated')
73-
vm.resetDatabase()
66+
this.apiPostDatabase(this.database, result => {
67+
this.$refs.addDatabaseModal.hide()
68+
this.$emit('databases-updated')
69+
this.resetDatabase()
7470
EventBus.$emit('stats-count-changed')
7571
})
7672
},

src/components/modal/AddInstitutionModal.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ export default {
4242
},
4343
methods: {
4444
show () {
45-
var vm = this
46-
this.$nextTick(function () {
47-
vm.$refs.addInstitutionModal.show()
48-
})
45+
this.$nextTick(() => this.$refs.addInstitutionModal.show())
4946
},
5047
onAddInstitutionClicked: function (event) {
5148
event.preventDefault()
@@ -56,10 +53,9 @@ export default {
5653
}
5754
5855
// Send the new institution to the server
59-
var vm = this
60-
this.apiPostInstitution(this.institution, function (result) {
61-
vm.$refs.addInstitutionModal.hide()
62-
vm.$emit('institutions-updated')
56+
this.apiPostInstitution(this.institution, result => {
57+
this.$refs.addInstitutionModal.hide()
58+
this.$emit('institutions-updated')
6359
})
6460
}
6561
}

0 commit comments

Comments
 (0)