@dracul/customize-frontend 1.14.0 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/components/TitleToolbar/TitleToolbar.vue +4 -4
- package/src/i18n/messages.js +7 -3
- package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationColors/ColorsPreview.vue +2 -2
- package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationColors/CustomizationColors.vue +19 -2
- package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationLang/CustomizationLang.vue +58 -57
- package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationLogo/CustomizationLogo.vue +2 -1
- package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationManagement.vue +4 -2
- package/src/plugins/vuetify.js +24 -6
- package/src/providers/gql/colorsUpdate.graphql +2 -0
- package/src/providers/gql/customization.graphql +2 -0
- package/src/providers/gql/customizationUpdate.graphql +4 -0
- package/src/storage/CustomizationStore.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dracul/customize-frontend",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"description": "vue custom logo, custom theme, custom colors, i18n configuration}",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
],
|
|
19
19
|
"author": "Cristian Incarnato",
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "d27d732678ef5b1051295b3b2e448d067f2a9075",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@dracul/common-frontend": "^1.14.
|
|
24
|
-
"@dracul/user-frontend": "^1.14.
|
|
23
|
+
"@dracul/common-frontend": "^1.14.2",
|
|
24
|
+
"@dracul/user-frontend": "^1.14.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"apollo-cache-inmemory": "^1.6.6",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<router-link to="/">
|
|
4
|
-
<v-toolbar-title class="
|
|
5
|
-
<b>{{getLogo.title}}</b>
|
|
3
|
+
<router-link to="/" class="text-decoration-none">
|
|
4
|
+
<v-toolbar-title class="primary--text ml-2" >
|
|
5
|
+
<b >{{getLogo.title}}</b>
|
|
6
6
|
</v-toolbar-title>
|
|
7
7
|
</router-link>
|
|
8
8
|
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
...mapGetters(['getLogo'])
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
</script>
|
|
20
|
+
</script>
|
package/src/i18n/messages.js
CHANGED
|
@@ -15,7 +15,9 @@ const messages = {
|
|
|
15
15
|
onPrimary: 'On Primary',
|
|
16
16
|
secondary: 'Secondary',
|
|
17
17
|
onSecondary: 'On Secondary',
|
|
18
|
-
background: '
|
|
18
|
+
background: 'Background',
|
|
19
|
+
appBar: 'AppBar'
|
|
20
|
+
|
|
19
21
|
|
|
20
22
|
},
|
|
21
23
|
lang: {
|
|
@@ -69,7 +71,8 @@ const messages = {
|
|
|
69
71
|
onPrimary: 'En Primario',
|
|
70
72
|
secondary: 'Secundario',
|
|
71
73
|
onSecondary: 'En Secundario',
|
|
72
|
-
background: 'Fondo'
|
|
74
|
+
background: 'Fondo',
|
|
75
|
+
appBar: 'AppBar'
|
|
73
76
|
},
|
|
74
77
|
lang: {
|
|
75
78
|
title: 'Idioma',
|
|
@@ -121,7 +124,8 @@ const messages = {
|
|
|
121
124
|
onPrimary: 'No primário',
|
|
122
125
|
secondary: 'Secundário',
|
|
123
126
|
onSecondary: 'No secundário',
|
|
124
|
-
background: 'Fondo'
|
|
127
|
+
background: 'Fondo',
|
|
128
|
+
appBar: 'AppBar'
|
|
125
129
|
},
|
|
126
130
|
lang: {
|
|
127
131
|
title: 'Linguagem',
|
package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationColors/ColorsPreview.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-row justify="center" align-content="center">
|
|
2
|
+
<v-row no-gutters justify="center" align-content="center">
|
|
3
3
|
<v-col cols="12" md="4" lg="4">
|
|
4
|
-
<v-card class="pa-
|
|
4
|
+
<v-card class="pa-3" :style="{backgroundColor: background}">
|
|
5
5
|
<v-card-title class="mb-3 justify-center" :style="{color: primary}">
|
|
6
6
|
<div v-t="'customization.preview'"></div>
|
|
7
7
|
</v-card-title>
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
/>
|
|
20
20
|
</v-col>
|
|
21
21
|
|
|
22
|
+
<v-col cols="12" sm="4" md="2" class="pb-0">
|
|
23
|
+
<color-input v-model="formColors.lightTheme.appBar"
|
|
24
|
+
:label="$t('customization.colors.appBar')"
|
|
25
|
+
color="secondary"
|
|
26
|
+
:rules="[rules.required]"
|
|
27
|
+
/>
|
|
28
|
+
</v-col>
|
|
29
|
+
|
|
22
30
|
<v-col cols="12" sm="4" md="2" class="pb-0">
|
|
23
31
|
<color-input v-model="formColors.lightTheme.primary"
|
|
24
32
|
:label="$t('customization.colors.primary')"
|
|
@@ -90,6 +98,14 @@
|
|
|
90
98
|
/>
|
|
91
99
|
</v-col>
|
|
92
100
|
|
|
101
|
+
<v-col cols="12" sm="4" md="2" class="pb-0">
|
|
102
|
+
<color-input v-model="formColors.darkTheme.appBar"
|
|
103
|
+
:label="$t('customization.colors.appBar')"
|
|
104
|
+
color="secondary"
|
|
105
|
+
:rules="[rules.required]"
|
|
106
|
+
/>
|
|
107
|
+
</v-col>
|
|
108
|
+
|
|
93
109
|
<v-col cols="12" sm="4" md="2" class="pb-0">
|
|
94
110
|
<color-input v-model="formColors.darkTheme.primary"
|
|
95
111
|
:label="$t('customization.colors.primary')"
|
|
@@ -140,9 +156,10 @@
|
|
|
140
156
|
|
|
141
157
|
</v-card>
|
|
142
158
|
|
|
143
|
-
<v-card>
|
|
159
|
+
<v-card outlined class="mt-4">
|
|
144
160
|
<v-card-actions>
|
|
145
|
-
<v-
|
|
161
|
+
<v-spacer></v-spacer>
|
|
162
|
+
<v-btn @click="saveColors" large color="primary onPrimary--text" v-t="'customization.applyButton'"></v-btn>
|
|
146
163
|
</v-card-actions>
|
|
147
164
|
</v-card>
|
|
148
165
|
</v-container>
|
package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationLang/CustomizationLang.vue
CHANGED
|
@@ -1,64 +1,65 @@
|
|
|
1
1
|
<template>
|
|
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
|
-
|
|
2
|
+
<v-card>
|
|
3
|
+
<v-card-title outlined>
|
|
4
|
+
<div v-t="'customization.lang.title'"></div>
|
|
5
|
+
<br>
|
|
6
|
+
</v-card-title>
|
|
7
|
+
<v-card-subtitle v-t="'customization.lang.subtitle'">
|
|
8
|
+
</v-card-subtitle>
|
|
9
|
+
<v-card-text>
|
|
10
|
+
<v-form ref="langForm" autocomplete="off" @submit.prevent="saveLang">
|
|
11
|
+
<v-row>
|
|
12
|
+
<v-col cols="12" md="3" lg="3">
|
|
13
|
+
<v-select
|
|
14
|
+
prepend-icon="language"
|
|
15
|
+
class="pa-3"
|
|
16
|
+
:items="langs"
|
|
17
|
+
:item-text="'text'"
|
|
18
|
+
:item-value="'value'"
|
|
19
|
+
color="secondary"
|
|
20
|
+
item-color="secondary"
|
|
21
|
+
v-model="formLang.language"
|
|
22
|
+
:label="$t('customization.lang.form.lang')"
|
|
23
|
+
required
|
|
24
|
+
></v-select>
|
|
25
|
+
</v-col>
|
|
26
|
+
</v-row>
|
|
27
|
+
</v-form>
|
|
28
|
+
</v-card-text>
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
<v-divider></v-divider>
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</v-card>
|
|
32
|
+
<v-card-actions>
|
|
33
|
+
<v-spacer></v-spacer>
|
|
34
|
+
<v-btn @click="saveLang" large color="primary onPrimary--text" v-t="'customization.applyButton'"></v-btn>
|
|
35
|
+
</v-card-actions>
|
|
36
|
+
</v-card>
|
|
36
37
|
</template>
|
|
37
38
|
<script>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
import CustomizationProvider from "../../../../providers/CustomizationProvider";
|
|
40
|
+
import {ClientError} from "@dracul/user-frontend";
|
|
41
|
+
import {mapMutations} from "vuex";
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
export default {
|
|
44
|
+
name: 'customization-lang',
|
|
45
|
+
props: {
|
|
46
|
+
formLang: {type: Object},
|
|
47
|
+
langs: {type: Array},
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
...mapMutations([
|
|
51
|
+
'setLanguage'
|
|
52
|
+
]),
|
|
53
|
+
saveLang() {
|
|
54
|
+
CustomizationProvider.updateLanguage(this.formLang).then(r => {
|
|
55
|
+
this.$root.$i18n.locale = r.data.langUpdate.language
|
|
56
|
+
this.setLanguage(r.data.langUpdate.language)
|
|
57
|
+
}).catch(error => {
|
|
58
|
+
let clientError = new ClientError(error)
|
|
59
|
+
this.inputErrors = clientError.inputErrors
|
|
60
|
+
this.errorMessage = clientError.showMessage
|
|
61
|
+
})
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
}
|
|
64
65
|
</script>
|
package/src/pages/CustomConfigPage/CustomizationManagement/CustomizationLogo/CustomizationLogo.vue
CHANGED
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
<v-divider></v-divider>
|
|
85
85
|
|
|
86
86
|
<v-card-actions>
|
|
87
|
-
<v-
|
|
87
|
+
<v-spacer></v-spacer>
|
|
88
|
+
<v-btn :loading="loading" @click="saveLogo" large color="primary onPrimary--text" v-t="'customization.applyButton'"></v-btn>
|
|
88
89
|
</v-card-actions>
|
|
89
90
|
|
|
90
91
|
</v-card>
|
|
@@ -82,14 +82,16 @@ export default {
|
|
|
82
82
|
onPrimary: null,
|
|
83
83
|
secondary: null,
|
|
84
84
|
onSecondary: null,
|
|
85
|
-
background: null
|
|
85
|
+
background: null,
|
|
86
|
+
appBar: null,
|
|
86
87
|
},
|
|
87
88
|
darkTheme: {
|
|
88
89
|
primary: null,
|
|
89
90
|
onPrimary: null,
|
|
90
91
|
secondary: null,
|
|
91
92
|
onSecondary: null,
|
|
92
|
-
background: null
|
|
93
|
+
background: null,
|
|
94
|
+
appBar: null,
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
},
|
package/src/plugins/vuetify.js
CHANGED
|
@@ -91,13 +91,23 @@ Vue.use(Vuetify, {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
const LIGHT_THEME = {
|
|
95
95
|
primary: '#3F51B5',
|
|
96
96
|
onPrimary: '#FFFFFF',
|
|
97
97
|
secondary: '#1565C0',
|
|
98
|
-
onSecondary: '#FFFFFF'
|
|
98
|
+
onSecondary: '#FFFFFF',
|
|
99
|
+
background: '#F5F5F5'
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
const DARK_THEME = {
|
|
103
|
+
primary : "#71DDC7",
|
|
104
|
+
onPrimary : "#000000",
|
|
105
|
+
secondary : "#E57FFB",
|
|
106
|
+
onSecondary : "#010101",
|
|
107
|
+
background : "#121212"
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
101
111
|
|
|
102
112
|
const vuetify = new Vuetify({
|
|
103
113
|
lang: {
|
|
@@ -109,10 +119,18 @@ const vuetify = new Vuetify({
|
|
|
109
119
|
theme: {
|
|
110
120
|
themes: {
|
|
111
121
|
light: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
background: LIGHT_THEME.background,
|
|
123
|
+
primary: LIGHT_THEME.primary,
|
|
124
|
+
secondary: LIGHT_THEME.secondary,
|
|
125
|
+
onPrimary: LIGHT_THEME.onPrimary,
|
|
126
|
+
onSecondary: LIGHT_THEME.onSecondary
|
|
127
|
+
},
|
|
128
|
+
dark: {
|
|
129
|
+
background: DARK_THEME.background,
|
|
130
|
+
primary: DARK_THEME.primary,
|
|
131
|
+
secondary: DARK_THEME.secondary,
|
|
132
|
+
onPrimary: DARK_THEME.onPrimary,
|
|
133
|
+
onSecondary: DARK_THEME.onSecondary
|
|
116
134
|
}
|
|
117
135
|
}
|
|
118
136
|
},
|
|
@@ -6,6 +6,7 @@ mutation colorsUpdate($input: ColorsUpdateInput ){
|
|
|
6
6
|
secondary
|
|
7
7
|
onSecondary
|
|
8
8
|
background
|
|
9
|
+
appBar
|
|
9
10
|
}
|
|
10
11
|
darkTheme{
|
|
11
12
|
primary
|
|
@@ -13,6 +14,7 @@ mutation colorsUpdate($input: ColorsUpdateInput ){
|
|
|
13
14
|
secondary
|
|
14
15
|
onSecondary
|
|
15
16
|
background
|
|
17
|
+
appBar
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -89,12 +89,14 @@ const customizationStore = {
|
|
|
89
89
|
state.lightTheme.secondary = lightTheme.secondary
|
|
90
90
|
state.lightTheme.onSecondary = lightTheme.onSecondary
|
|
91
91
|
state.lightTheme.background = lightTheme.background
|
|
92
|
+
state.lightTheme.appBar = lightTheme.appBar
|
|
92
93
|
|
|
93
94
|
state.darkTheme.primary = darkTheme.primary
|
|
94
95
|
state.darkTheme.onPrimary = darkTheme.onPrimary
|
|
95
96
|
state.darkTheme.secondary = darkTheme.secondary
|
|
96
97
|
state.darkTheme.onSecondary = darkTheme.onSecondary
|
|
97
98
|
state.darkTheme.background = darkTheme.background
|
|
99
|
+
state.darkTheme.appBar = darkTheme.appBar
|
|
98
100
|
|
|
99
101
|
if (state.vuetifyInstance) {
|
|
100
102
|
state.vuetifyInstance.framework.theme.themes.light.primary = lightTheme.primary
|
|
@@ -102,12 +104,14 @@ const customizationStore = {
|
|
|
102
104
|
state.vuetifyInstance.framework.theme.themes.light.secondary = lightTheme.secondary
|
|
103
105
|
state.vuetifyInstance.framework.theme.themes.light.onSecondary = lightTheme.onSecondary
|
|
104
106
|
state.vuetifyInstance.framework.theme.themes.light.background = lightTheme.background
|
|
107
|
+
state.vuetifyInstance.framework.theme.themes.light.appBar = lightTheme.appBar
|
|
105
108
|
|
|
106
109
|
state.vuetifyInstance.framework.theme.themes.dark.primary = darkTheme.primary
|
|
107
110
|
state.vuetifyInstance.framework.theme.themes.dark.onPrimary = darkTheme.onPrimary
|
|
108
111
|
state.vuetifyInstance.framework.theme.themes.dark.secondary = darkTheme.secondary
|
|
109
112
|
state.vuetifyInstance.framework.theme.themes.dark.onSecondary = darkTheme.onSecondary
|
|
110
113
|
state.vuetifyInstance.framework.theme.themes.dark.background = darkTheme.background
|
|
114
|
+
state.vuetifyInstance.framework.theme.themes.dark.appBar = darkTheme.appBar
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
},
|