Skip to content

Commit 2bcf89f

Browse files
committed
Merge branch 'development' of https://github.com/codeforjapan/StudyAtHome into feature/147-make-user-register-flow
2 parents c139737 + f8063c2 commit 2bcf89f

30 files changed

+1620
-550
lines changed

nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
/*
4949
** Customize the progress-bar color
5050
*/
51-
loading: { color: '#fff' },
51+
loading: { color: '#000000' },
5252
/*
5353
** Global CSS
5454
*/

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131
}
3232
},
3333
"dependencies": {
34-
"@babel/runtime-corejs3": "^7.9.6",
35-
"@nuxt/typescript-runtime": "^0.4.6",
36-
"@nuxtjs/axios": "^5.10.3",
34+
"@babel/runtime-corejs3": "^7.10.2",
35+
"@nuxt/typescript-runtime": "^0.4.10",
36+
"@nuxtjs/axios": "^5.11.0",
3737
"@nuxtjs/dotenv": "^1.4.1",
3838
"@nuxtjs/pwa": "^3.0.0-0",
3939
"@types/js-cookie": "^2.2.6",
4040
"@types/jwt-decode": "^2.2.1",
41-
"@types/node": "^14.0.5",
41+
"@types/node": "^14.0.13",
4242
"cookieparser": "^0.1.0",
4343
"core-js": "3.6.5",
4444
"cross-env": "^7.0.2",
4545
"date-fns": "^2.14.0",
4646
"dayjs": "^1.8.26",
4747
"express": "^4.17.1",
48-
"firebase": "7.14.6",
48+
"firebase": "7.15.1",
4949
"firebase-admin": "^8.12.0",
5050
"js-cookie": "^2.2.1",
5151
"jwt-decode": "^2.2.0",
@@ -60,24 +60,24 @@
6060
"vuex-persistedstate": "^3.0.1"
6161
},
6262
"devDependencies": {
63-
"@nuxt/typescript-build": "^0.6.6",
63+
"@nuxt/typescript-build": "^1.0.3",
6464
"@nuxtjs/eslint-config-typescript": "^2.0.0",
65-
"@nuxtjs/stylelint-module": "^3.2.2",
65+
"@nuxtjs/stylelint-module": "^4.0.0",
6666
"@nuxtjs/vuetify": "^1.11.2",
67-
"@types/jest": "^25.2.3",
67+
"@types/jest": "^26.0.0",
6868
"@vue/test-utils": "^1.0.3",
6969
"babel-core": "^6.26.3",
7070
"babel-eslint": "^10.1.0",
7171
"babel-jest": "^26.0.1",
7272
"cpx": "^1.5.0",
73-
"eslint": "^7.0.0",
73+
"eslint": "^7.2.0",
7474
"eslint-config-prettier": "^6.11.0",
7575
"eslint-loader": "^4.0.2",
7676
"eslint-plugin-prettier": "^3.1.3",
7777
"eslint-plugin-tsdoc": "^0.2.4",
7878
"husky": "^4.2.5",
7979
"jest": "^26.0.1",
80-
"lint-staged": "^10.2.2",
80+
"lint-staged": "^10.2.10",
8181
"nodemon": "^2.0.3",
8282
"prettier": "^1.19.1",
8383
"rimraf": "^3.0.2",
@@ -86,7 +86,7 @@
8686
"stylelint-config-prettier": "^8.0.1",
8787
"stylelint-config-standard": "^20.0.0",
8888
"stylelint-scss": "^3.17.2",
89-
"ts-jest": "^26.0.0",
89+
"ts-jest": "^26.1.0",
9090
"vue-jest": "^3.0.5"
9191
}
9292
}

src/components/ActionButton.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@click="$emit('click')"
88
>
99
<span>{{ text }}</span>
10+
<v-icon v-if="icon">{{ icon }}</v-icon>
1011
</v-btn>
1112
</template>
1213

@@ -28,6 +29,9 @@ export default class ActionButton extends Vue {
2829
2930
@Prop({ default: false })
3031
isLoading?: boolean
32+
33+
@Prop({ default: '' })
34+
icon?: string
3135
}
3236
</script>
3337

src/components/AddButton.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:color="buttonColor"
55
:width="buttonSize"
66
:height="buttonSize"
7-
@click="onClick"
7+
@click="$emit('clickAddButton')"
88
>
99
<v-icon :size="iconSize" :color="iconColor">{{ iconName }}</v-icon>
1010
</v-btn>
@@ -41,11 +41,6 @@ export default Vue.extend({
4141
required: false,
4242
default: '40'
4343
}
44-
},
45-
methods: {
46-
onClick(): void {
47-
this.$emit('addButtonClicked')
48-
}
4944
}
5045
})
5146
</script>

src/components/BaseDialog.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template>
2-
<v-dialog :value="value" :persistent="modal" @input="$emit('input', $event)">
2+
<v-dialog
3+
max-width="320px"
4+
:value="value"
5+
:persistent="modal"
6+
@input="$emit('input', $event)"
7+
>
38
<v-card class="DialogCard">
49
<v-card-title class="DialogCardTitle">
510
<v-icon class="DialogCardTitleIcon" size="48">{{ iconName }}</v-icon>
@@ -13,6 +18,8 @@
1318
v-for="(action, i) in actions"
1419
:key="i"
1520
class="my-3"
21+
:theme="action.theme"
22+
:icon="action.iconName"
1623
:text="action.buttonLabel"
1724
@click="doDialogAction(i)"
1825
/>
@@ -34,6 +41,8 @@ import ActionButton from '@/components/ActionButton.vue'
3441
3542
export type DialogAction = {
3643
buttonLabel: string
44+
iconName: string
45+
theme: string
3746
/**
3847
* ボタン押下時に実行する処理。実行後に BaseModalDialog を閉じないようにするには true を返す。
3948
*/

src/components/BottomSheetLayer.vue

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<template>
22
<v-bottom-sheet
3-
v-model="layer"
3+
:value="value"
44
persistent
55
scrollable
66
no-click-animation
77
:fullscreen="fullscreen"
8+
@input="$emit('input', $event)"
89
>
910
<v-card class="Layer">
1011
<v-card-title class="Layer-CardElements Layer-CardTitle">
@@ -32,13 +33,9 @@
3233
<script lang="ts">
3334
import Vue from 'vue'
3435
35-
type DataType = {
36-
layer: boolean
37-
}
38-
3936
export default Vue.extend({
4037
props: {
41-
expanded: {
38+
value: {
4239
type: Boolean,
4340
required: false,
4441
default: true
@@ -56,16 +53,6 @@ export default Vue.extend({
5653
required: false,
5754
default: false
5855
}
59-
},
60-
data(): DataType {
61-
return {
62-
layer: this.expanded
63-
}
64-
},
65-
watch: {
66-
expanded(newValue) {
67-
this.layer = newValue
68-
}
6956
}
7057
})
7158
</script>

src/components/CalendarBar.vue

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export type CalendarBarConfig = {
6565
export interface DateListWindow {
6666
list: Array<Date>
6767
currentDate: Date
68+
inputHandler: (value: Date) => Date
6869
selectDate(date: Date): DateListWindow
6970
nextDay(): DateListWindow
7071
prevDay(): DateListWindow
@@ -79,11 +80,13 @@ class DateListWindowImpl implements DateListWindow {
7980
startWeekOn: StartWeekOn
8081
currentDate: Date
8182
list: Array<Date>
83+
inputHandler: (value: Date) => Date
8284
8385
constructor(
8486
view: View = 'Week',
8587
startWeekOn: StartWeekOn = 'Monday',
86-
date: Date = new Date()
88+
date: Date = new Date(),
89+
inputHandler: (value: Date) => Date
8790
) {
8891
this.view = view
8992
this.startWeekOn = view === 'Weekday' ? 'Monday' : startWeekOn
@@ -96,6 +99,7 @@ class DateListWindowImpl implements DateListWindow {
9699
this.startWeekOn,
97100
this.currentDate
98101
)
102+
this.inputHandler = inputHandler
99103
}
100104
101105
nextDay(): DateListWindow {
@@ -128,6 +132,9 @@ class DateListWindowImpl implements DateListWindow {
128132
isValid(date) ? date : new Date()
129133
)
130134
this.list = this.generateDateList()
135+
136+
// CalendarBar を経由して変更を通知
137+
this.inputHandler(this.currentDate)
131138
return this
132139
}
133140
@@ -211,28 +218,18 @@ export default class CalendarBar extends Vue {
211218
dateListWindow: DateListWindow = new DateListWindowImpl(
212219
this.config?.view ?? 'Week',
213220
this.config?.startWeekOn ?? 'Monday',
214-
this.date ?? new Date()
221+
this.value ?? new Date(),
222+
this.input
215223
)
216224
217-
@Emit('changeCurrentDate')
218-
changeCurrentDate(): Date {
219-
return this.dateListWindow.currentDate
220-
}
221-
222-
private get date(): Date {
223-
return this.value
224-
}
225-
226225
@Emit()
227226
public input(value: Date) {
228227
return value
229228
}
230229
231-
@Watch('dateListWindow.currentDate', { immediate: true })
232-
// @Watch('dateListWindow.currentDate')
233-
onChangeCurrentDate() {
234-
this.input(this.dateListWindow.currentDate)
235-
this.changeCurrentDate()
230+
@Watch('value', { immediate: true })
231+
onValueChanged(newValue: Date) {
232+
this.dateListWindow.selectDate(newValue)
236233
}
237234
238235
get currentMonthString(): string {

src/components/ContentCard.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="ContentCard-Outer">
3-
<v-card class="ContentCard elevation-4">
3+
<v-card class="ContentCard elevation-4" @click="toLessonDetail">
44
<v-card-actions class="ContentCard-Actions">
55
<subject-tag
66
class="ContentCard-SubjectTag"
@@ -50,6 +50,7 @@ import Vue from 'vue'
5050
import SubjectTag from '@/components/SubjectTag.vue'
5151
import ContentCardEditorButton from '@/components/ContentCardEditorButton.vue'
5252
import { classData } from '~/types/store/classData'
53+
import LessonWithId = classData.LessonWithId
5354
5455
export default Vue.extend({
5556
components: {
@@ -65,6 +66,12 @@ export default Vue.extend({
6566
type: Boolean,
6667
default: false
6768
}
69+
},
70+
methods: {
71+
toLessonDetail() {
72+
const lesson = this.lesson as LessonWithId
73+
this.$router.push('/lesson/?lessonId=' + lesson.docId)
74+
}
6875
}
6976
})
7077
</script>
@@ -73,30 +80,37 @@ export default Vue.extend({
7380
.ContentCard-Outer {
7481
display: flex;
7582
}
83+
7684
.ContentCard-Button-Outer {
7785
display: flex;
7886
flex-direction: column;
7987
flex: 0 1 auto;
8088
margin-left: 12px;
89+
8190
.ContentCard-Button {
8291
margin-bottom: 12px;
8392
}
8493
}
94+
8595
.ContentCard {
8696
flex: 1 1 auto;
8797
color: $color-gray;
8898
border-radius: 14px !important;
99+
89100
.ContentCard-Actions {
90101
padding: 16px 16px 0;
91102
}
103+
92104
.ContentCard-SubjectTag {
93105
margin-right: 4px;
94106
}
107+
95108
.ContentCard-Title {
96109
font-weight: bold;
97110
font-size: 14px;
98111
line-height: 1.75;
99112
}
113+
100114
.ContentCard-Description {
101115
font-size: 12px;
102116
color: $color-gray;

src/components/EditingScreen.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<v-bottom-sheet v-model="screen" no-click-animation persistent scrollable>
2+
<v-bottom-sheet :value="expanded" no-click-animation persistent scrollable>
33
<v-card class="EditingScreen">
44
<v-card-title class="EditingScreen-CardElements">
55
<v-container class="EditingScreen-Container">
@@ -56,7 +56,7 @@
5656
</v-container>
5757
</v-card-actions>
5858
</v-card>
59-
<v-snackbar :timeout="5000" :value="error" absolute top color="#C01B61">
59+
<v-snackbar v-model="error" :timeout="5000" absolute top color="#C01B61">
6060
エラーにより授業の追加に失敗しました。時間をおいて再度お試しください。
6161
</v-snackbar>
6262
</v-bottom-sheet>
@@ -100,7 +100,6 @@ type FourthPageDataType = {
100100
}
101101
102102
type DataType = {
103-
screen: boolean
104103
page: number
105104
error: boolean
106105
lessonId: string
@@ -158,7 +157,6 @@ export default Vue.extend({
158157
},
159158
data(): DataType {
160159
return {
161-
screen: this.expanded,
162160
page: 1,
163161
error: false,
164162
isHidden: this.value.isHidden,
@@ -199,9 +197,6 @@ export default Vue.extend({
199197
}
200198
},
201199
watch: {
202-
expanded(newValue) {
203-
this.screen = newValue
204-
},
205200
value(value) {
206201
this.isHidden = value.isHidden
207202
this.lessonId = value.lessonId

0 commit comments

Comments
 (0)