* add menu item * implement versions modal * fix up modal * clean up badges * implement key features * fix up spacing * add error message * add notification icon * fix notification * fix bug when no updates * address lint issues * address multi line nodes * add closing animation * keep drawer open * address design feedback * address badge styling * use grid for icons * update cli to return version information * set env variables * add scss color variables * address comments * fix lint issue * handle edge cases * update scss variables, spacing * update spacing * build * override top value for theme * bolden version * update config * check endpoint exists * handle long names * set dates * set title * fix bug * update warning * remove unused component * refactor components * add fragments * inherit styles * fix icon size * fix lint issues * add cli dep * address comments * handle network error * address empty case * Revert "address comments" 480f969e07c3282c50bc326babbc5812baac5dae * remove dependency * build * update variable names * update variable names * refactor verion card * split out variables * clean up impl * clean up scss * move from nodeview * refactor out gift notification icon * fix lint issues * clean up variables * update scss variables * update info url * Add instanceId to frontendSettings * Use createHash from crypto module * Add instanceId to store & send it as http header * Fix lintings * Fix interfaces & apply review changes * Apply review changes * add console message * update text info * update endpoint * clean up interface * address comments * cleanup todo * Update packages/cli/config/index.ts Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> * update console message * ⚡ Display node-name on hover * ⚡ Formatting fix Co-authored-by: MedAliMarz <servfrdali@yahoo.fr> Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
73 lines
2.1 KiB
TypeScript
73 lines
2.1 KiB
TypeScript
import { DUPLICATE_MODAL_KEY, TAGS_MANAGER_MODAL_KEY, VERSIONS_MODAL_KEY, WORKLOW_OPEN_MODAL_KEY } from '@/constants';
|
|
import Vue from 'vue';
|
|
import { ActionContext, Module } from 'vuex';
|
|
import {
|
|
IRootState,
|
|
IUiState,
|
|
} from '../Interface';
|
|
|
|
const module: Module<IUiState, IRootState> = {
|
|
namespaced: true,
|
|
state: {
|
|
modals: {
|
|
[DUPLICATE_MODAL_KEY]: {
|
|
open: false,
|
|
},
|
|
[TAGS_MANAGER_MODAL_KEY]: {
|
|
open: false,
|
|
},
|
|
[WORKLOW_OPEN_MODAL_KEY]: {
|
|
open: false,
|
|
},
|
|
[VERSIONS_MODAL_KEY]: {
|
|
open: false,
|
|
},
|
|
},
|
|
modalStack: [],
|
|
sidebarMenuCollapsed: true,
|
|
isPageLoading: true,
|
|
},
|
|
getters: {
|
|
isVersionsOpen: (state: IUiState) => {
|
|
return state.modals[VERSIONS_MODAL_KEY].open;
|
|
},
|
|
isModalOpen: (state: IUiState) => {
|
|
return (name: string) => state.modals[name].open;
|
|
},
|
|
isModalActive: (state: IUiState) => {
|
|
return (name: string) => state.modalStack.length > 0 && name === state.modalStack[0];
|
|
},
|
|
sidebarMenuCollapsed: (state: IUiState): boolean => state.sidebarMenuCollapsed,
|
|
},
|
|
mutations: {
|
|
openModal: (state: IUiState, name: string) => {
|
|
Vue.set(state.modals[name], 'open', true);
|
|
state.modalStack = [name].concat(state.modalStack);
|
|
},
|
|
closeTopModal: (state: IUiState) => {
|
|
const name = state.modalStack[0];
|
|
Vue.set(state.modals[name], 'open', false);
|
|
|
|
state.modalStack = state.modalStack.slice(1);
|
|
},
|
|
toggleSidebarMenuCollapse: (state: IUiState) => {
|
|
state.sidebarMenuCollapsed = !state.sidebarMenuCollapsed;
|
|
},
|
|
},
|
|
actions: {
|
|
openTagsManagerModal: async (context: ActionContext<IUiState, IRootState>) => {
|
|
context.commit('openModal', TAGS_MANAGER_MODAL_KEY);
|
|
},
|
|
openWorklfowOpenModal: async (context: ActionContext<IUiState, IRootState>) => {
|
|
context.commit('openModal', WORKLOW_OPEN_MODAL_KEY);
|
|
},
|
|
openDuplicateModal: async (context: ActionContext<IUiState, IRootState>) => {
|
|
context.commit('openModal', DUPLICATE_MODAL_KEY);
|
|
},
|
|
openUpdatesPanel: async (context: ActionContext<IUiState, IRootState>) => {
|
|
context.commit('openModal', VERSIONS_MODAL_KEY);
|
|
},
|
|
},
|
|
};
|
|
|
|
export default module; |