This repository has been archived by the owner on May 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 178
/
Settings.vue
146 lines (140 loc) · 3.73 KB
/
Settings.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<template>
<div v-if="user">
<KFormContainer>
<QCardSection>
<div class="text-h6">
{{ $t('USERDATA.PROFILE_TITLE') }}
</div>
</QCardSection>
<QCardSection>
<ChangePhoto
:value="user"
:status="profileEditStatus"
:label="$t('USERDATA.PHOTO')"
:hint="$t('USERDATA.SET_PHOTO')"
mime-type="image/jpeg"
@save="saveUser({ photo: arguments[0] })"
/>
<QSeparator />
<ProfileEdit
:value="user"
:status="profileEditStatus"
@save="saveUser"
/>
</QCardSection>
</KFormContainer>
<KFormContainer>
<QCardSection>
<div class="text-h6">
{{ $t('LANGUAGECHOOSER.SWITCH') }}
</div>
</QCardSection>
<QCardSection>
<div class="edit-box row justify-end">
<LocaleSelect />
</div>
</QCardSection>
</KFormContainer>
<KFormContainer>
<QCardSection>
<div class="text-h6">
{{ $t('USERDATA.ACCOUNT') }}
</div>
</QCardSection>
<QCardSection>
<ChangeEmail
:user="user"
:status="changeEmailStatus"
@save="changeEmail"
/>
<QSeparator />
<ChangePassword
:status="changePasswordStatus"
@save="changePassword"
/>
<QCardActions>
<RequestDeleteAccount
:status="requestDeleteAccountStatus"
@requestDeleteAccount="requestDeleteAccount"
/>
</QCardActions>
</QCardSection>
</KFormContainer>
<GroupSettings />
<KFormContainer
v-if="!$q.platform.is.cordova"
>
<QCardSection>
<div class="text-h6">
{{ $t('USERDATA.PUSH') }}
</div>
</QCardSection>
<QCardSection>
<Push
:value="pushEnabled"
:pending="pushPending"
@enable="enablePush"
@disable="disablePush"
/>
</QCardSection>
</KFormContainer>
</div>
</template>
<script>
import {
QCardSection,
QSeparator,
QCardActions,
} from 'quasar'
import { mapGetters, mapActions } from 'vuex'
import ProfileEdit from '@/authuser/components/Settings/ProfileEdit'
import ChangePassword from '@/authuser/components/Settings/ChangePassword'
import ChangeEmail from '@/authuser/components/Settings/ChangeEmail'
import ChangePhoto from '@/authuser/components/Settings/ChangePhoto'
import RequestDeleteAccount from '@/authuser/components/Settings/RequestDeleteAccount'
import Push from '@/authuser/components/Settings/Push'
import LocaleSelect from '@/utils/components/LocaleSelect'
import GroupSettings from '@/group/pages/Settings'
import KFormContainer from '@/base/components/KFormContainer'
export default {
name: 'Settings',
components: {
QCardSection,
QSeparator,
QCardActions,
ProfileEdit,
ChangePassword,
ChangeEmail,
ChangePhoto,
RequestDeleteAccount,
Push,
LocaleSelect,
GroupSettings,
KFormContainer,
},
computed: {
...mapGetters({
user: 'auth/user',
profileEditStatus: 'auth/saveStatus',
changePasswordStatus: 'auth/changePasswordStatus',
changeEmailStatus: 'auth/changeEmailStatus',
requestDeleteAccountStatus: 'users/requestDeleteAccountStatus',
pushEnabled: 'auth/push/enabled',
pushPending: 'auth/push/pending',
}),
},
methods: {
...mapActions({
saveUser: 'auth/save',
changeEmail: 'auth/changeEmail',
changePassword: 'auth/changePassword',
requestDeleteAccount: 'users/requestDeleteAccount',
enablePush: 'auth/push/enable',
disablePush: 'auth/push/disable',
}),
},
}
</script>
<style scoped lang="stylus">
@import '~editbox'
</style>