Skip to content

Commit

Permalink
Merge pull request #143 from RyoichiNakai/develop
Browse files Browse the repository at this point in the history
本番反映 リリース
  • Loading branch information
RyoichiNakai authored Jan 16, 2022
2 parents 73a1d7e + d5d3a07 commit 918ba1a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 8 deletions.
9 changes: 9 additions & 0 deletions components/admin/dialogs/AccountPlus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ export default {
student.point,
this.teachers.map((obj) => obj.id)
)
if (student.rank == null) {
student.rank = 0
}
if (student.group == null) {
student.group = 0
}
if (student.password == null) {
student.password = ''
}
createUser(student).then((result) => {
if (result.statusCode === 400) {
alert('以下の学生の登録に失敗しました。\nemail: ' + result.email + '\nname:' + result.name)
Expand Down
21 changes: 16 additions & 5 deletions components/layouts/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,24 @@
<v-list-item-title>ようこそ、{{ userName }}さん</v-list-item-title>
<v-list-item-subtitle class="grey--text">{{ userEmail }}</v-list-item-subtitle>
</div>

<LogOutDialog :open="signOutConfirm" @close="close" />
</v-app-bar>
</template>

<script>
import { mapMutations, mapGetters } from 'vuex'
import LogOutDialog from './LogOutDialog'
export default {
name: 'Header',
components: {
LogOutDialog,
},
data() {
return {}
return {
signOutConfirm: false,
}
},
computed: {
...mapGetters({
Expand All @@ -61,16 +69,19 @@ export default {
},
},
methods: {
...mapMutations({
toggle: 'drawer/toggle',
}),
redirectPage(path) {
if (path === '/signout') {
this.$store.dispatch('auth/signOut')
this.signOutConfirm = true
} else {
this.$router.push({ path })
}
},
...mapMutations({
toggle: 'drawer/toggle',
}),
close(e) {
this.signOutConfirm = e
},
},
}
</script>
Expand Down
49 changes: 49 additions & 0 deletions components/layouts/LogOutDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<v-dialog :value="open" width="600px" @input="close">
<v-card>
<v-card-title>
{{ cardTitle }}
</v-card-title>

<v-card-text>
<p>{{ cardText }}</p>
</v-card-text>

<v-card-actions>
<v-spacer></v-spacer>
<v-btn text @click="close"> 閉じる </v-btn>
<v-btn color="accent" text @click="signOut"> ログアウト </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>

<script>
export default {
name: 'LogOutDialog',
props: {
open: {
type: Boolean,
default: false,
required: true,
},
},
data() {
return {
cardTitle: 'ログアウトの確認',
cardText: '本当にログアウトしますか?',
}
},
methods: {
close() {
this.$emit('close', false)
},
signOut() {
this.$store.dispatch('auth/signOut')
this.close()
},
},
}
</script>

<style></style>
15 changes: 13 additions & 2 deletions components/layouts/NavDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,24 @@
</v-list-item>
</v-list-item-group>
</v-list>

<LogOutDialog :open="signOutConfirm" @close="signOutConfirmClose" />
</v-navigation-drawer>
</template>

<script>
import { mapGetters } from 'vuex'
import LogOutDialog from './LogOutDialog'
export default {
name: 'NavDrawer',
components: {
LogOutDialog,
},
data() {
return {}
return {
signOutConfirm: false,
}
},
computed: {
...mapGetters({
Expand Down Expand Up @@ -85,7 +93,7 @@ export default {
methods: {
redirectPage(path) {
if (path === '/signout') {
this.$store.dispatch('auth/signOut')
this.signOutConfirm = true
} else {
this.$router.push({ path })
}
Expand All @@ -94,6 +102,9 @@ export default {
close() {
this.$store.commit('drawer/close')
},
signOutConfirmClose(e) {
this.signOutConfirm = e
},
},
}
</script>
Expand Down
3 changes: 2 additions & 1 deletion components/layouts/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Header from './Header'
import NavDrawer from './NavDrawer'
import LogOutDialog from './LogOutDialog'

export { Header, NavDrawer }
export { Header, NavDrawer, LogOutDialog }

0 comments on commit 918ba1a

Please sign in to comment.