Skip to content

Commit f3ec7eb

Browse files
authored
Merge branch 'development' into fix/eslintignore-setting
2 parents feb0632 + 6c07679 commit f3ec7eb

23 files changed

+1520
-1574
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ dist
8383
# Service worker
8484
sw.*
8585
*/static/*sw.*
86+
*/static/swenv.*
8687

8788
# macOS
8889
.DS_Store

nuxt.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ export default {
135135
APPID: process.env.APPID,
136136
MEASUREMENTID: process.env.MEASUREMENTID
137137
},
138+
workbox: {
139+
importScripts: [
140+
'https://www.gstatic.com/firebasejs/7.14.6/firebase-app.js',
141+
'https://www.gstatic.com/firebasejs/7.14.6/firebase-auth.js',
142+
'swenv.js',
143+
'sw-firebase-auth.js'
144+
],
145+
dev: process.env.MODE !== 'production'
146+
},
138147
/*
139148
** Build configuration
140149
*/

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"private": true,
77
"scripts": {
88
"dev": "cross-env NODE_ENV=development nuxt-ts",
9-
"build": "nuxt-ts build",
9+
"build": "yarn prebuild && nuxt-ts build",
10+
"prebuild": "cross-env NODE_ENV=development node pre_build_script/swEnvBuild.js",
1011
"test:unit": "jest --config jest.config.js",
1112
"start": "cross-env NODE_ENV=production nuxt-ts",
1213
"generate": "nuxt-ts generate",
@@ -36,14 +37,15 @@
3637
"@nuxtjs/dotenv": "^1.4.1",
3738
"@nuxtjs/pwa": "^3.0.0-0",
3839
"@types/js-cookie": "^2.2.6",
40+
"@types/jwt-decode": "^2.2.1",
3941
"@types/node": "^14.0.5",
4042
"cookieparser": "^0.1.0",
4143
"core-js": "3.6.5",
4244
"cross-env": "^7.0.2",
4345
"date-fns": "^2.14.0",
4446
"dayjs": "^1.8.26",
4547
"express": "^4.17.1",
46-
"firebase": "^7.14.3",
48+
"firebase": "7.14.6",
4749
"firebase-admin": "^8.12.0",
4850
"js-cookie": "^2.2.1",
4951
"jwt-decode": "^2.2.0",

pre_build_script/swEnvBuild.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const fs = require('fs')
2+
const environment = process.env.NODE_ENV || 'development'
3+
require('dotenv').config({ path: `./src/.env.${environment}` })
4+
5+
fs.writeFileSync(
6+
'./src/static/swenv.js',
7+
`
8+
const swEnv = {
9+
apiKey: '${process.env.APIKEY}',
10+
authDomain: '${process.env.AUTHDOMAIN}',
11+
databaseURL: '${process.env.DATABASEURL}',
12+
projectId: '${process.env.PROJECTID}',
13+
storageBucket: '${process.env.STORAGEBUCKET}',
14+
messagingSenderId: '${process.env.MESSAGINGSENDERID}',
15+
appId: '${process.env.APPID}',
16+
measurementId: '${process.env.MEASUREMENTID}'
17+
}
18+
`
19+
)

src/components/AddButton.vue

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,7 @@
66
:height="buttonSize"
77
@click="onClick"
88
>
9-
<span v-if="iconSize === 'x-small'">
10-
<v-icon :color="iconColor" x-small>{{ iconName }}</v-icon>
11-
</span>
12-
<span v-if="iconSize === 'small'">
13-
<v-icon :color="iconColor" small>{{ iconName }}</v-icon>
14-
</span>
15-
<span v-if="iconSize === 'medium'">
16-
<v-icon :color="iconColor" small>{{ iconName }}</v-icon>
17-
</span>
18-
<span v-if="iconSize === 'large'">
19-
<v-icon :color="iconColor" small>{{ iconName }}</v-icon>
20-
</span>
21-
<span v-if="iconSize === 'x-large'">
22-
<v-icon :color="iconColor" x-large>{{ iconName }}</v-icon>
23-
</span>
9+
<v-icon :size="iconSize" :color="iconColor">{{ iconName }}</v-icon>
2410
</v-btn>
2511
</template>
2612

@@ -51,14 +37,9 @@ export default Vue.extend({
5137
default: '#004170'
5238
},
5339
iconSize: {
54-
type: String,
40+
type: [String, Number],
5541
required: false,
56-
default: 'medium',
57-
validator(value: string): boolean {
58-
return ['x-small', 'small', 'medium', 'large', 'x-large'].includes(
59-
value
60-
)
61-
}
42+
default: '40'
6243
}
6344
},
6445
methods: {

src/components/CommentButton.vue

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/components/InputField.vue

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
v-model="value"
55
:color="textFieldColor"
66
:type="show ? 'text' : 'password'"
7+
:hint="hint"
78
:label="label"
89
background-color="white"
910
class="elevation-0"
@@ -27,6 +28,7 @@
2728
v-model="value"
2829
:color="textFieldColor"
2930
type="text"
31+
:hint="hint"
3032
:label="label"
3133
background-color="white"
3234
class="elevation-0"
@@ -43,6 +45,7 @@
4345
v-model="value"
4446
:color="textFieldColor"
4547
type="text"
48+
:hint="hint"
4649
:label="label"
4750
background-color="white"
4851
class="elevation-0"
@@ -59,6 +62,7 @@
5962
v-model="value"
6063
:color="textFieldColor"
6164
type="text"
65+
:hint="hint"
6266
:label="label"
6367
background-color="white"
6468
class="elevation-0"
@@ -115,11 +119,16 @@ export default Vue.extend({
115119
},
116120
computed: {
117121
prependIconColor(): string {
122+
const classIdPattern = /^[あ-ん]{6}$/
118123
if (this.type === 'classId') {
119-
if (!this.value || this.value.length !== 6) return '#C01B61'
124+
if (!this.value || !classIdPattern.test(this.value)) return '#C01B61'
120125
}
121126
if (this.type === 'email') {
122-
if (!this.value || !this.value.match(/.+@.+\..+/)) return '#C01B61'
127+
if (
128+
!this.value ||
129+
!this.value.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
130+
)
131+
return '#C01B61'
123132
}
124133
if (this.require) {
125134
if (!this.value) return '#C01B61'
@@ -130,23 +139,33 @@ export default Vue.extend({
130139
return '#BDBDBD'
131140
},
132141
textFieldColor(): string {
142+
const classIdPattern = /^[あ-ん]{6}$/
133143
if (this.type === 'classId') {
134-
if (!this.value || this.value.length !== 6) return '#C01B61'
144+
if (!this.value || !classIdPattern.test(this.value)) return '#C01B61'
135145
}
136146
if (this.type === 'email') {
137-
if (!this.value || !this.value.match(/.+@.+\..+/)) return '#C01B61'
147+
if (
148+
!this.value ||
149+
!this.value.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
150+
)
151+
return '#C01B61'
138152
}
139153
if (this.require) {
140154
if (!this.value) return '#C01B61'
141155
}
142156
return '#0071C2'
143157
},
144158
prependIcon(): string {
159+
const classIdPattern = /^[あ-ん]{6}$/
145160
if (this.type === 'classId') {
146-
if (!this.value || this.value.length !== 6) return 'mdi-alert-circle'
161+
if (!this.value || !classIdPattern.test(this.value))
162+
return 'mdi-alert-circle'
147163
}
148164
if (this.type === 'email') {
149-
if (!this.value || !this.value.match(/.+@.+\..+/))
165+
if (
166+
!this.value ||
167+
!this.value.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
168+
)
150169
return 'mdi-alert-circle'
151170
}
152171
if (this.require) {

src/components/LessonCaption.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export default Vue.extend({
5252
})
5353
</script>
5454

55-
<style scoped>
55+
<style lang="scss" scoped>
5656
.lessoncaption-title {
5757
display: flex;
5858
flex-direction: column;
59-
background: #015998;
60-
color: #fff;
59+
background: $color-base-color-07;
60+
color: $color-white;
6161
height: 66px;
6262
border-radius: 22px !important;
6363
margin: 0 8px;
@@ -71,7 +71,7 @@ export default Vue.extend({
7171
font-size: 28px;
7272
padding: 10px 2px 0 2px;
7373
display: flex;
74-
color: #fff !important;
74+
color: $color-white !important;
7575
align-items: center;
7676
text-align: center;
7777
}
@@ -80,7 +80,7 @@ export default Vue.extend({
8080
font-size: 8px;
8181
margin-top: 0;
8282
display: flex;
83-
color: #fff !important;
83+
color: $color-white !important;
8484
align-items: center;
8585
text-align: center;
8686
}
@@ -91,7 +91,7 @@ export default Vue.extend({
9191
font-weight: normal;
9292
font-size: 10px;
9393
text-align: center;
94-
color: #fff;
94+
color: $color-white;
9595
flex: none;
9696
order: 4;
9797
align-self: center;

src/components/MovieButton.vue

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)