diff --git a/web-app/packages/app/src/router.ts b/web-app/packages/app/src/router.ts index 0adb4523..fb4670ce 100644 --- a/web-app/packages/app/src/router.ts +++ b/web-app/packages/app/src/router.ts @@ -7,7 +7,6 @@ import { FileBrowserView, FileVersionDetailView, ProjectVersionsView, - VersionDetailView, NotFoundView, VerifyEmailView, routeUtils, @@ -146,6 +145,23 @@ export const createRouter = (pinia: Pinia) => { return } }, + /** Redirect of unused /history/:version_id path to /history?version_id */ + { + path: '/projects/:namespace/:projectName/history/:version_id', + name: 'project-versions-detail', + component: NotFoundView, + props: true, + meta: { public: true }, + beforeEnter: (to, from, next) => { + next({ + path: `/projects/${to.params.namespace}/${ + to.params.projectName + }/history`, + query: { version_id: to.params.version_id } + }) + return + } + }, { path: '/projects/:namespace/:projectName', name: 'project', @@ -182,12 +198,6 @@ export const createRouter = (pinia: Pinia) => { component: ProjectVersionsView, props: true }, - { - path: 'history/:version_id', - name: 'project-versions-detail', - component: VersionDetailView, - props: true - }, { path: 'history/:version_id/:path', name: 'file-version-detail', diff --git a/web-app/packages/lib/components.d.ts b/web-app/packages/lib/components.d.ts index 277dad86..45dad27f 100644 --- a/web-app/packages/lib/components.d.ts +++ b/web-app/packages/lib/components.d.ts @@ -7,6 +7,8 @@ export {} declare module 'vue' { export interface GlobalComponents { + PAccordion: typeof import('primevue/accordion')['default'] + PAccordionTab: typeof import('primevue/accordiontab')['default'] PAvatar: typeof import('primevue/avatar')['default'] PBreadcrumb: typeof import('primevue/breadcrumb')['default'] PButton: typeof import('primevue/button')['default'] @@ -14,6 +16,7 @@ declare module 'vue' { PDataTable: typeof import('primevue/datatable')['default'] PDataView: typeof import('primevue/dataview')['default'] PDialog: typeof import('primevue/dialog')['default'] + PDivider: typeof import('primevue/divider')['default'] PDropdown: typeof import('primevue/dropdown')['default'] PImage: typeof import('primevue/image')['default'] PInlineMessage: typeof import('primevue/inlinemessage')['default'] @@ -48,7 +51,6 @@ declare module 'vue' { VImg: typeof import('vuetify/components')['VImg'] VLayout: typeof import('vuetify/components')['VLayout'] VList: typeof import('vuetify/components')['VList'] - VListGroup: typeof import('vuetify/components')['VListGroup'] VListItem: typeof import('vuetify/components')['VListItem'] VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle'] VListItemTitle: typeof import('vuetify/components')['VListItemTitle'] diff --git a/web-app/packages/lib/src/common/components/AppSidebarRight.vue b/web-app/packages/lib/src/common/components/AppSidebarRight.vue index 4436ee22..9443da1d 100644 --- a/web-app/packages/lib/src/common/components/AppSidebarRight.vue +++ b/web-app/packages/lib/src/common/components/AppSidebarRight.vue @@ -59,7 +59,7 @@ const model = computed({ get() { return props.modelValue }, - set(value) { + set() { return emitModelValue('update:modelValue') } }) diff --git a/web-app/packages/lib/src/modules/project/components/DropArea.vue b/web-app/packages/lib/src/modules/project/components/DropArea.vue index dd899ea7..33a56c73 100644 --- a/web-app/packages/lib/src/modules/project/components/DropArea.vue +++ b/web-app/packages/lib/src/modules/project/components/DropArea.vue @@ -63,6 +63,8 @@ import { useInstanceStore } from '@/modules/instance/store' import { useNotificationStore } from '@/modules/notification/store' import { useProjectStore } from '@/modules/project/store' +type ExtendedFile = File & { isFile: boolean } + export default defineComponent({ props: ['location'], data() { @@ -114,9 +116,9 @@ export default defineComponent({ }) } // prepare all entries because they will be not accessible after this callback ends (after 'await') - const entries = Array.from(evt.dataTransfer.items).map( - (i: DataTransferItem) => i.webkitGetAsEntry() - ) + const entries = Array.from( + evt.dataTransfer.items as DataTransferItem[] + ).map((i) => i.webkitGetAsEntry()) if (entries.some((e) => e === null)) { return this.error({ text: 'Drop only files or folders' @@ -129,9 +131,11 @@ export default defineComponent({ this.$refs.selectFilesInput.click() } }, - onFileSelected(evt) { + onFileSelected(evt: Event) { // prepare all entries because they will be not accessible after this callback ends (after 'await') - const entries = Array.from(evt.target.files).map((i: any) => { + const entries = Array.from( + (evt.target as HTMLInputElement).files as unknown as ExtendedFile[] + ).map((i) => { i.isFile = true return i }) diff --git a/web-app/packages/lib/src/modules/project/components/FileChangesetSummaryTable.vue b/web-app/packages/lib/src/modules/project/components/FileChangesetSummaryTable.vue index 34aad7e6..27744186 100644 --- a/web-app/packages/lib/src/modules/project/components/FileChangesetSummaryTable.vue +++ b/web-app/packages/lib/src/modules/project/components/FileChangesetSummaryTable.vue @@ -5,69 +5,76 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial --> - - + - - - - - {{ header.icon }} - - - Added - - - - - - {{ header.icon }} - - - Deleted - + + + + + {{ col.text }} + + - - - - {{ header.icon }} - - - Modified - + + + + {{ item[col.value] }} + + - + + + diff --git a/web-app/packages/lib/src/modules/project/components/index.ts b/web-app/packages/lib/src/modules/project/components/index.ts index cd2d3a5a..2fc104a5 100644 --- a/web-app/packages/lib/src/modules/project/components/index.ts +++ b/web-app/packages/lib/src/modules/project/components/index.ts @@ -22,3 +22,4 @@ export { default as ProjectsTableDataLoader } from './ProjectsTableDataLoader.vu export { default as UploadPanel } from './UploadPanel.vue' export { default as ProjectAccessRequestTableTemplate } from './ProjectAccessRequestTableTemplate.vue' export { default as FileDetailSidebar } from './FileDetailSidebar.vue' +export { default as VersionDetailSidebar } from './VersionDetailSidebar.vue' diff --git a/web-app/packages/lib/src/modules/project/projectApi.ts b/web-app/packages/lib/src/modules/project/projectApi.ts index 6fe2a359..fa7d867c 100644 --- a/web-app/packages/lib/src/modules/project/projectApi.ts +++ b/web-app/packages/lib/src/modules/project/projectApi.ts @@ -21,7 +21,8 @@ import { PushProjectChangesParams, PushProjectChangesResponse, SaveProjectSettings, - UpdateProjectAccessParams + UpdateProjectAccessParams, + ProjectVersion } from '@/modules/project/types' export const ProjectApi = { @@ -253,7 +254,7 @@ export const ProjectApi = { async getProjectVersion( projectId: string, versionName: string - ): Promise> { + ): Promise> { return ProjectModule.httpService.get( `/v1/project/version/${projectId}/${versionName}` ) diff --git a/web-app/packages/lib/src/modules/project/types.ts b/web-app/packages/lib/src/modules/project/types.ts index 4c3c05eb..ec661eed 100644 --- a/web-app/packages/lib/src/modules/project/types.ts +++ b/web-app/packages/lib/src/modules/project/types.ts @@ -244,7 +244,8 @@ export interface ProjectVersion { project_name: string namespace: string user_agent: string - changesets: ChangesetSuccess | ChangesetError + changesets: ChangesetSuccess & ChangesetError + project_size: number } export interface PaginatedProjectVersionsResponse @@ -321,3 +322,13 @@ export interface ProjectsSortingParams { sortBy: string sortDesc: boolean } + +export interface ProjectVersionFileChange { + changes: { + columns: number + name: string + new: string + }[] + table: string + type: 'insert' | 'update' | 'delete' +} 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 d374e8fb..cf1af293 100644 --- a/web-app/packages/lib/src/modules/project/views/FileVersionDetailView.vue +++ b/web-app/packages/lib/src/modules/project/views/FileVersionDetailView.vue @@ -6,90 +6,153 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial - - - - - {{ name }} - - - - - {{ - actions[value].icon - }} - - + + + {{ path }} + + + {{ name }} + + + + + + + + + + + + + {{ + slotProps.data[col.value] + }} + + + + + No changeset for current layer + + + + + + + + + Changes cannot be calculated + + For details please check the + documentation. + - - - - Changes cannot be calculated - For details please check the - documentation. - + + 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 0ca84721..b20fe9a3 100644 --- a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue +++ b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue @@ -48,11 +48,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial :key="item.id" class="flex align-items-center hover:bg-gray-200 cursor-pointer border-bottom-1 border-gray-200 text-sm px-3 py-2 mt-0" :style="[rowStyle(item)]" + @click.prevent="!item.disabled && rowClick(item.name)" > - + + @@ -202,6 +201,8 @@ import { mapActions, mapState } from 'pinia' import { DataViewPageEvent } from 'primevue/dataview' import { defineComponent, PropType } from 'vue' +import VersionDetailSidebar from '../components/VersionDetailSidebar.vue' + import { AppSection, AppContainer } from '@/common/components' import { FetchProjectVersionsParams, @@ -222,7 +223,8 @@ export default defineComponent({ name: 'ProjectVersionsViewTemplate', components: { AppSection, - AppContainer + AppContainer, + VersionDetailSidebar }, props: { projectName: String, diff --git a/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue index 0585743d..7d92a1c5 100644 --- a/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue +++ b/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue @@ -68,23 +68,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial } }" > - - - + - - - - + + + @@ -219,7 +208,9 @@ export default defineComponent({ }, activeTabIndex(): number { - return this.tabs.findIndex((item) => item.route === this.$route.name) + return this.tabs.findIndex((item) => + this.$route.matched.some((m) => m.name === item.route) + ) }, /** Rewrite of styles for TabPanels */ diff --git a/web-app/packages/lib/src/modules/project/views/VersionDetailView.vue b/web-app/packages/lib/src/modules/project/views/VersionDetailView.vue deleted file mode 100644 index 0daf9ca9..00000000 --- a/web-app/packages/lib/src/modules/project/views/VersionDetailView.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - archive - - - Download Project Version {{ version.name }} (ZIP) - - - - - - Version - {{ version.name }} - - - - - Author - {{ version.author }} - - - - - Project Size - {{ $filters.filesize(version.project_size) }} - - - - - - Created - {{ $filters.datetime(version.created) }} - - - - - - User Agent - {{ version.user_agent }} - - - - - - - Files changes: - - - - - - - - - {{ text }} ({{ changes[key].length }}) - - - - - - - {{ item.path - }}{{ - $filters.filesize( - version.changesets[item.path] - ? version.changesets[item.path]['size'] - : item.size - ) - }} - - - - - Show advanced - - - - - - Details not available: {{ version.changesets[item.path].error }} - - - - - - - - - - - - diff --git a/web-app/packages/lib/src/modules/project/views/index.ts b/web-app/packages/lib/src/modules/project/views/index.ts index 456d8243..cc59c8ed 100644 --- a/web-app/packages/lib/src/modules/project/views/index.ts +++ b/web-app/packages/lib/src/modules/project/views/index.ts @@ -8,5 +8,4 @@ export { default as ProjectsListViewTemplate } from './ProjectsListViewTemplate. export { default as ProjectSettingsViewTemplate } from './ProjectSettingsViewTemplate.vue' export { default as ProjectVersionsView } from './ProjectVersionsView.vue' export { default as ProjectViewTemplate } from './ProjectViewTemplate.vue' -export { default as VersionDetailView } from './VersionDetailView.vue' export { default as ProjectVersionsViewTemplate } from './ProjectVersionsViewTemplate.vue'
No changeset for current layer
+ For details please check the + documentation. +