diff --git a/next-ui/src/components.d.ts b/next-ui/src/components.d.ts index 15639833e..d35f6cdc8 100644 --- a/next-ui/src/components.d.ts +++ b/next-ui/src/components.d.ts @@ -61,6 +61,7 @@ declare module 'vue' { LibraryFormStepOptions: typeof import('./components/library/form/StepOptions.vue')['default'] LibraryFormStepScanner: typeof import('./components/library/form/StepScanner.vue')['default'] LibraryMenuLibraries: typeof import('./components/library/MenuLibraries.vue')['default'] + LibraryMenuLibrary: typeof import('./components/library/MenuLibrary.vue')['default'] LocaleSelector: typeof import('./components/LocaleSelector.vue')['default'] MenuLibraries: typeof import('./components/menu/MenuLibraries.vue')['default'] PageHashKnownTable: typeof import('./components/pageHash/KnownTable.vue')['default'] diff --git a/next-ui/src/components/layout/app/drawer/menu/Libraries.vue b/next-ui/src/components/layout/app/drawer/menu/Libraries.vue index 6ebe1a20b..195bbb786 100644 --- a/next-ui/src/components/layout/app/drawer/menu/Libraries.vue +++ b/next-ui/src/components/layout/app/drawer/menu/Libraries.vue @@ -24,7 +24,7 @@ @click="createLibrary" /> - + @@ -47,6 +47,7 @@ @@ -86,6 +91,7 @@ @@ -145,39 +155,38 @@ function createLibrary() { props: { createMode: true }, } dialogConfirmEdit.value.record = getLibraryDefaults() - dialogConfirmEdit.value.callback = handleDialogConfirmation -} + dialogConfirmEdit.value.callback = ( + hideDialog: () => void, + setLoading: (isLoading: boolean) => void, + ) => { + setLoading(true) -function handleDialogConfirmation( - hideDialog: () => void, - setLoading: (isLoading: boolean) => void, -) { - setLoading(true) + const newLib = dialogConfirmEdit.value.record as components['schemas']['LibraryCreationDto'] - const newLib = dialogConfirmEdit.value.record as components['schemas']['LibraryCreationDto'] - - mutateCreateLibrary(newLib) - .then(() => { - hideDialog() - messagesStore.messages.push({ - text: intl.formatMessage( - { - description: 'Snackbar notification shown upon successful library creation', - defaultMessage: 'Library created: {library}', - id: '+8++PW', - }, - { - library: newLib.name, - }, - ), + mutateCreateLibrary(newLib) + .then(() => { + hideDialog() + messagesStore.messages.push({ + text: intl.formatMessage( + { + description: 'Snackbar notification shown upon successful library creation', + defaultMessage: 'Library created: {library}', + id: '+8++PW', + }, + { + library: newLib.name, + }, + ), + }) }) - }) - .catch((error) => { - messagesStore.messages.push({ - text: - (error?.cause as ErrorCause)?.message || intl.formatMessage(commonMessages.networkError), + .catch((error) => { + messagesStore.messages.push({ + text: + (error?.cause as ErrorCause)?.message || + intl.formatMessage(commonMessages.networkError), + }) + setLoading(false) }) - setLoading(false) - }) + } } diff --git a/next-ui/src/components/library/MenuLibraries.vue b/next-ui/src/components/library/MenuLibraries.vue index a1123c8e9..69b35433e 100644 --- a/next-ui/src/components/library/MenuLibraries.vue +++ b/next-ui/src/components/library/MenuLibraries.vue @@ -1,5 +1,8 @@ + + + + + +