From deacdb74f004271d1497d4adc646c0c9d156fb9b Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Tue, 12 Dec 2023 16:52:26 +0100 Subject: [PATCH 01/10] Added: first prototype of bredcrumbs based on router --- web-app/packages/app/src/router.ts | 11 +++- web-app/packages/lib/components.d.ts | 1 + .../layout/components/AppBreadcrumbs.vue | 62 +++++++++++++++++++ .../layout/components/AppHeaderTemplate.vue | 37 ++++++----- .../src/modules/layout/components/index.ts | 1 + .../packages/lib/src/modules/project/types.ts | 1 + .../project/views/ProjectViewTemplate.vue | 9 ++- .../packages/lib/src/shims-vue-router.d.ts | 9 +++ 8 files changed, 114 insertions(+), 17 deletions(-) create mode 100644 web-app/packages/lib/src/modules/layout/components/AppBreadcrumbs.vue create mode 100644 web-app/packages/lib/src/shims-vue-router.d.ts diff --git a/web-app/packages/app/src/router.ts b/web-app/packages/app/src/router.ts index 9d5917d6..06e41914 100644 --- a/web-app/packages/app/src/router.ts +++ b/web-app/packages/app/src/router.ts @@ -141,6 +141,9 @@ export const createRouter = (pinia: Pinia) => { props: { default: true }, + meta: { + title: 'Projects' + }, redirect: { name: 'project-tree' }, children: [ { @@ -182,7 +185,13 @@ export const createRouter = (pinia: Pinia) => { props: true, meta: { public: true } } - ] + ].map((child) => ({ + ...child, + beforeEnter: (to, from, next) => { + to.meta.title = to.params.projectName as string + next() + } + })) }, { path: '/:pathMatch(.*)*', diff --git a/web-app/packages/lib/components.d.ts b/web-app/packages/lib/components.d.ts index e70c1e8b..5ae03a03 100644 --- a/web-app/packages/lib/components.d.ts +++ b/web-app/packages/lib/components.d.ts @@ -8,6 +8,7 @@ export {} declare module 'vue' { export interface GlobalComponents { PAvatar: typeof import('primevue/avatar')['default'] + PBreadcrumb: typeof import('primevue/breadcrumb')['default'] PButton: typeof import('primevue/button')['default'] PColumn: typeof import('primevue/column')['default'] PDataTable: typeof import('primevue/datatable')['default'] diff --git a/web-app/packages/lib/src/modules/layout/components/AppBreadcrumbs.vue b/web-app/packages/lib/src/modules/layout/components/AppBreadcrumbs.vue new file mode 100644 index 00000000..5952793a --- /dev/null +++ b/web-app/packages/lib/src/modules/layout/components/AppBreadcrumbs.vue @@ -0,0 +1,62 @@ + + + + + + + diff --git a/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue b/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue index 30a7b99b..4a06909b 100644 --- a/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue +++ b/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue @@ -5,10 +5,22 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial --> diff --git a/web-app/packages/lib/src/modules/project/components/AccountAutocomplete.vue b/web-app/packages/lib/src/modules/project/components/AccountAutocomplete.vue index 8df05921..330a3409 100644 --- a/web-app/packages/lib/src/modules/project/components/AccountAutocomplete.vue +++ b/web-app/packages/lib/src/modules/project/components/AccountAutocomplete.vue @@ -94,11 +94,11 @@ import { defineComponent } from 'vue' import { SendIcon, UserIcon } from 'vue-tabler-icons' import { isValidEmail } from '@/common/text_utils' +import { useUserStore } from '@/main' import { useProjectStore } from '@/modules/project/store' import UserSearchChip from '@/modules/user/components/UserSearchChip.vue' import { EMPTY_INVITE_ITEM } from '@/modules/user/constants' import { UserSearchParams } from '@/modules/user/types' -import { useUserStore } from '@/main' export default defineComponent({ name: 'AccountAutocomplete', diff --git a/web-app/packages/lib/src/modules/project/components/ProjectsTableDataLoader.vue b/web-app/packages/lib/src/modules/project/components/ProjectsTableDataLoader.vue index 4dde8bec..5381a7a4 100644 --- a/web-app/packages/lib/src/modules/project/components/ProjectsTableDataLoader.vue +++ b/web-app/packages/lib/src/modules/project/components/ProjectsTableDataLoader.vue @@ -157,7 +157,7 @@ export default defineComponent({ dialog, listeners: { error: (err, data) => this.$emit('new-project-error', err, data) - }, + } } }) } diff --git a/web-app/packages/lib/src/modules/project/components/UploadPanel.vue b/web-app/packages/lib/src/modules/project/components/UploadPanel.vue index 62ea4244..84de2e70 100644 --- a/web-app/packages/lib/src/modules/project/components/UploadPanel.vue +++ b/web-app/packages/lib/src/modules/project/components/UploadPanel.vue @@ -69,9 +69,7 @@ import axios from 'axios' import pick from 'lodash/pick' import { mapActions, mapState } from 'pinia' import { defineComponent } from 'vue' -import { CloudUploadIcon } from 'vue-tabler-icons' -import ActionButton from '@/common/components/ActionButton.vue' import { CHUNK_SIZE, isVersionedFile } from '@/common/mergin_utils' import { ConfirmDialog, useDialogStore, useNotificationStore } from '@/modules' import { useProjectStore } from '@/modules/project/store' diff --git a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue index 0dc8f133..5c473119 100644 --- a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue +++ b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue @@ -200,7 +200,6 @@ export default defineComponent({ + diff --git a/web-app/packages/lib/src/modules/project/views/FileVersionDetailView.vue b/web-app/packages/lib/src/modules/project/views/FileVersionDetailView.vue index 2a43c9af..d374e8fb 100644 --- a/web-app/packages/lib/src/modules/project/views/FileVersionDetailView.vue +++ b/web-app/packages/lib/src/modules/project/views/FileVersionDetailView.vue @@ -132,7 +132,7 @@ export default defineComponent({ typeof row.old === 'undefined' ? 'N/A' : row.old } else { data.values[columnIdentifier] = - (typeof row.old === 'undefined' ? 'N/A' : row.old) + + (typeof row.old === 'undefinedchangesets/' ? 'N/A' : row.old) + ' ' + String.fromCharCode(parseInt('2794', 16)) + ' ' + diff --git a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue index 6c2c8341..0ca84721 100644 --- a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue +++ b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue @@ -5,172 +5,204 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial --> + + + + + From f590f54a7a8f4b44995d9fc2156b0dc24cfad01e Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Mon, 18 Dec 2023 16:48:13 +0100 Subject: [PATCH 10/10] Added: - primary button wth border 2px - Upload panel on top for mobiles - sidebar margin padding --- web-app/packages/app/src/App.vue | 4 ++-- .../themes/mm-theme-light/variables/_button.scss | 2 +- .../packages/lib/src/common/components/AppMenu.vue | 2 +- .../lib/src/common/components/AppSidebarRight.vue | 2 +- web-app/packages/lib/src/modules/index.ts | 2 +- web-app/packages/lib/src/modules/layout/store.ts | 6 +++--- .../modules/project/components/FileDetailSidebar.vue | 2 +- .../src/modules/project/components/UploadPanel.vue | 12 +++++++++--- 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/web-app/packages/app/src/App.vue b/web-app/packages/app/src/App.vue index 9ece0f1e..7db90208 100644 --- a/web-app/packages/app/src/App.vue +++ b/web-app/packages/app/src/App.vue @@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial 'col-12', 'min-h-full', 'overflow-auto', - drawer && !isOverlay && 'xl:col-offset-2 xl:col-10' + drawer && !isUnderOverlayBreakpoint && 'xl:col-offset-2 xl:col-10' ]" > @@ -94,7 +94,7 @@ export default defineComponent({ ...mapState(useInstanceStore, ['pingData']), ...mapState(useAppStore, ['serverError']), ...mapState(useUserStore, ['loggedUser']), - ...mapState(useLayoutStore, ['drawer', 'isOverlay']), + ...mapState(useLayoutStore, ['drawer', 'isUnderOverlayBreakpoint']), error() { return this.serverError diff --git a/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_button.scss b/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_button.scss index 827de497..5e652f39 100644 --- a/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_button.scss +++ b/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_button.scss @@ -20,7 +20,7 @@ $buttonTextColor: $primaryDarkColor; /// Border of a button /// @group button -$buttonBorder: 1px solid $primaryColor; +$buttonBorder: 2px solid $primaryColor; /// Background of a button in hover state /// @group button diff --git a/web-app/packages/lib/src/common/components/AppMenu.vue b/web-app/packages/lib/src/common/components/AppMenu.vue index 96901eba..e2126875 100644 --- a/web-app/packages/lib/src/common/components/AppMenu.vue +++ b/web-app/packages/lib/src/common/components/AppMenu.vue @@ -28,7 +28,7 @@ withDefaults( items: MenuItem[] icon: string }>(), - { icon: 'ti ti-settings' } + { icon: 'ti ti-sort-descending' } ) const menu = ref<{ toggle: (event: Event) => void }>() diff --git a/web-app/packages/lib/src/common/components/AppSidebarRight.vue b/web-app/packages/lib/src/common/components/AppSidebarRight.vue index 8711863a..4436ee22 100644 --- a/web-app/packages/lib/src/common/components/AppSidebarRight.vue +++ b/web-app/packages/lib/src/common/components/AppSidebarRight.vue @@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial -
+
diff --git a/web-app/packages/lib/src/modules/index.ts b/web-app/packages/lib/src/modules/index.ts index 67c0624e..d375466e 100644 --- a/web-app/packages/lib/src/modules/index.ts +++ b/web-app/packages/lib/src/modules/index.ts @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial +export * from './layout' export * from './app' export * from './form' export * from './project' @@ -9,6 +10,5 @@ export * from './user' export * from './notification' export * from './dialog' export * from './dashboard' -export * from './layout' export * from './instance' export * from './types' diff --git a/web-app/packages/lib/src/modules/layout/store.ts b/web-app/packages/lib/src/modules/layout/store.ts index ba9d3b25..07938e45 100644 --- a/web-app/packages/lib/src/modules/layout/store.ts +++ b/web-app/packages/lib/src/modules/layout/store.ts @@ -8,7 +8,7 @@ export interface LayoutState { overlayBreakpoint: number drawer: boolean /** If sidebar is in overlay mode (on mobile is flying over content) */ - isOverlay: boolean + isUnderOverlayBreakpoint: boolean /** Parsed closed elements from local storage and pushed back to local storage */ closedElements: string[] } @@ -19,7 +19,7 @@ export const useLayoutStore = defineStore('layoutModule', { state: (): LayoutState => ({ overlayBreakpoint: 992, drawer: false, - isOverlay: false, + isUnderOverlayBreakpoint: false, closedElements: [] }), getters: { @@ -51,7 +51,7 @@ export const useLayoutStore = defineStore('layoutModule', { ).matches : width < this.overlayBreakpoint this.drawer = !isSmall - this.isOverlay = isSmall + this.isUnderOverlayBreakpoint = isSmall }, setDrawer(payload) { this.drawer = payload.drawer diff --git a/web-app/packages/lib/src/modules/project/components/FileDetailSidebar.vue b/web-app/packages/lib/src/modules/project/components/FileDetailSidebar.vue index 162be658..65e3214d 100644 --- a/web-app/packages/lib/src/modules/project/components/FileDetailSidebar.vue +++ b/web-app/packages/lib/src/modules/project/components/FileDetailSidebar.vue @@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-
Name
+
File

{{ fileName }} diff --git a/web-app/packages/lib/src/modules/project/components/UploadPanel.vue b/web-app/packages/lib/src/modules/project/components/UploadPanel.vue index 84de2e70..8af58b2a 100644 --- a/web-app/packages/lib/src/modules/project/components/UploadPanel.vue +++ b/web-app/packages/lib/src/modules/project/components/UploadPanel.vue @@ -7,11 +7,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial