[feat] save display name mode
This commit is contained in:
		
							parent
							
								
									93669d66dc
								
							
						
					
					
						commit
						d34898e1e9
					
				| 
						 | 
					@ -22,6 +22,7 @@ export const useUserStore = defineStore({
 | 
				
			||||||
  state: () => ({
 | 
					  state: () => ({
 | 
				
			||||||
    roles: [] as FG.Role[],
 | 
					    roles: [] as FG.Role[],
 | 
				
			||||||
    permissions: [] as FG.Permission[],
 | 
					    permissions: [] as FG.Permission[],
 | 
				
			||||||
 | 
					    userSettings: {} as FG.UserSettings,
 | 
				
			||||||
    // list of all users, include deleted ones, use `users` getter for list of active ones
 | 
					    // list of all users, include deleted ones, use `users` getter for list of active ones
 | 
				
			||||||
    _users: [] as FG.User[],
 | 
					    _users: [] as FG.User[],
 | 
				
			||||||
    // Internal flags for deciding if lists need to force-loaded
 | 
					    // Internal flags for deciding if lists need to force-loaded
 | 
				
			||||||
| 
						 | 
					@ -218,5 +219,35 @@ export const useUserStore = defineStore({
 | 
				
			||||||
      await api.delete(`/roles/${role}`);
 | 
					      await api.delete(`/roles/${role}`);
 | 
				
			||||||
      this.roles = this.roles.filter((r) => r.id !== 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/balance',
 | 
				
			||||||
//  '@flaschengeist/schedule',
 | 
					//  '@flaschengeist/schedule',
 | 
				
			||||||
//  '@flaschengeist/pricelist',
 | 
					//  '@flaschengeist/pricelist',
 | 
				
			||||||
]
 | 
					  '@flaschengeist/schedule',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,8 +15,14 @@ const { configure } = require('quasar/wrappers');
 | 
				
			||||||
const operation = () => {
 | 
					const operation = () => {
 | 
				
			||||||
  const custom_plgns = require('./plugin.config.js');
 | 
					  const custom_plgns = require('./plugin.config.js');
 | 
				
			||||||
  const required_plgns = require('./src/vendor-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 plugins = [...custom_plgns, ...required_plgns].map(
 | 
				
			||||||
  const replace = new ReplaceOperation('all', `\\/\\* *INSERT_PLUGIN_LIST *\\*\\/`, `${plugins.join(', ')}`);
 | 
					    (v) => `import("${v}").catch(() => "${v}")`
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					  const replace = new ReplaceOperation(
 | 
				
			||||||
 | 
					    'all',
 | 
				
			||||||
 | 
					    `\\/\\* *INSERT_PLUGIN_LIST *\\*\\/`,
 | 
				
			||||||
 | 
					    `${plugins.join(', ')}`
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
  return replace;
 | 
					  return replace;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -60,7 +66,7 @@ module.exports = configure(function(/* ctx */) {
 | 
				
			||||||
    // Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
 | 
					    // Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
 | 
				
			||||||
    build: {
 | 
					    build: {
 | 
				
			||||||
      vueRouterMode: 'history', // available values: 'hash', 'history'
 | 
					      vueRouterMode: 'history', // available values: 'hash', 'history'
 | 
				
			||||||
 | 
					      //publicPath: 'flaschengeist2',
 | 
				
			||||||
      // transpile: false,
 | 
					      // transpile: false,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Add dependencies for transpiling with Babel (Array of string/regex)
 | 
					      // 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
 | 
					        // chainWebpack also available besides this extendWebpack
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    bin: {
 | 
				
			||||||
 | 
					      linuxAndroidStudio: '/home/crimsen/.local/share/JetBrains/Toolbox/scripts/studio',
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue