[feat] save display name mode
This commit is contained in:
parent
93669d66dc
commit
d34898e1e9
|
@ -22,6 +22,7 @@ export const useUserStore = defineStore({
|
|||
state: () => ({
|
||||
roles: [] as FG.Role[],
|
||||
permissions: [] as FG.Permission[],
|
||||
userSettings: {} as FG.UserSettings,
|
||||
// list of all users, include deleted ones, use `users` getter for list of active ones
|
||||
_users: [] as FG.User[],
|
||||
// Internal flags for deciding if lists need to force-loaded
|
||||
|
@ -218,5 +219,35 @@ export const useUserStore = defineStore({
|
|||
await api.delete(`/roles/${role}`);
|
||||
this.roles = this.roles.filter((r) => r.id !== role);
|
||||
},
|
||||
|
||||
/** Get Settings for display name mode
|
||||
* @param force If set to true a fresh list is loaded from backend even when a local copy is available
|
||||
* @throws Probably an AxiosError if request failed
|
||||
* @returns Settings for display name mode
|
||||
*/
|
||||
async getDisplayNameModeSetting(force = false): Promise<string> {
|
||||
const mainStore = useMainStore();
|
||||
if (force) {
|
||||
const { data } = await api.get<{ data: string }>(
|
||||
`users/${mainStore.currentUser.userid}/setting/display_name_mode`
|
||||
);
|
||||
this.userSettings['display_name'] = data.data;
|
||||
}
|
||||
return this.userSettings['display_name'];
|
||||
},
|
||||
|
||||
/** Set Settings for display name mode
|
||||
* @param mode New display name mode
|
||||
* @throws Probably an AxiosError if request failed
|
||||
* @returns Settings for display name mode
|
||||
*/
|
||||
async setDisplayNameModeSetting(mode: string): Promise<string> {
|
||||
const mainStore = useMainStore();
|
||||
await api.put(`users/${mainStore.currentUser.userid}/setting/display_name_mode`, {
|
||||
data: mode,
|
||||
});
|
||||
this.userSettings['display_name'] = mode;
|
||||
return mode;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -3,4 +3,4 @@ module.exports = [
|
|||
// '@flaschengeist/balance',
|
||||
// '@flaschengeist/schedule',
|
||||
// '@flaschengeist/pricelist',
|
||||
]
|
||||
'@flaschengeist/schedule',
|
||||
|
|
|
@ -15,12 +15,18 @@ const { configure } = require('quasar/wrappers');
|
|||
const operation = () => {
|
||||
const custom_plgns = require('./plugin.config.js');
|
||||
const required_plgns = require('./src/vendor-plugin.config.js');
|
||||
const plugins = [...custom_plgns, ...required_plgns].map((v) => `import("${v}").catch(() => "${v}")`);
|
||||
const replace = new ReplaceOperation('all', `\\/\\* *INSERT_PLUGIN_LIST *\\*\\/`, `${plugins.join(', ')}`);
|
||||
const plugins = [...custom_plgns, ...required_plgns].map(
|
||||
(v) => `import("${v}").catch(() => "${v}")`
|
||||
);
|
||||
const replace = new ReplaceOperation(
|
||||
'all',
|
||||
`\\/\\* *INSERT_PLUGIN_LIST *\\*\\/`,
|
||||
`${plugins.join(', ')}`
|
||||
);
|
||||
return replace;
|
||||
};
|
||||
|
||||
module.exports = configure(function(/* ctx */) {
|
||||
module.exports = configure(function (/* ctx */) {
|
||||
return {
|
||||
// https://quasar.dev/quasar-cli/supporting-ts
|
||||
supportTS: {
|
||||
|
@ -60,7 +66,7 @@ module.exports = configure(function(/* ctx */) {
|
|||
// Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
|
||||
build: {
|
||||
vueRouterMode: 'history', // available values: 'hash', 'history'
|
||||
|
||||
//publicPath: 'flaschengeist2',
|
||||
// transpile: false,
|
||||
|
||||
// Add dependencies for transpiling with Babel (Array of string/regex)
|
||||
|
@ -214,5 +220,8 @@ module.exports = configure(function(/* ctx */) {
|
|||
// chainWebpack also available besides this extendWebpack
|
||||
},
|
||||
},
|
||||
bin: {
|
||||
linuxAndroidStudio: '/home/crimsen/.local/share/JetBrains/Toolbox/scripts/studio',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue