From 6eecfa4b88f3478c0a33c3ac34db112f809df170 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Sun, 9 Jan 2022 19:28:02 +0100 Subject: [PATCH] Show changed files of pipeline in UI (#650) --- web/src/components/tabs/Tab.vue | 2 +- web/src/router.ts | 5 +++ .../views/repo/build/BuildChangedFiles.vue | 38 +++++++++++++++++++ web/src/views/repo/build/BuildWrapper.vue | 9 +++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 web/src/views/repo/build/BuildChangedFiles.vue diff --git a/web/src/components/tabs/Tab.vue b/web/src/components/tabs/Tab.vue index 28a2a4aa5..6c4f7905b 100644 --- a/web/src/components/tabs/Tab.vue +++ b/web/src/components/tabs/Tab.vue @@ -37,7 +37,7 @@ export default defineComponent({ onMounted(() => { tab.value = { - id: props.title.toLocaleLowerCase() || tabs.value.length.toString(), + id: props.id || props.title.toLocaleLowerCase().replace(' ', '-') || tabs.value.length.toString(), title: props.title, }; tabs.value.push(tab.value); diff --git a/web/src/router.ts b/web/src/router.ts index cf866b64c..381555599 100644 --- a/web/src/router.ts +++ b/web/src/router.ts @@ -58,6 +58,11 @@ const routes: RouteRecordRaw[] = [ component: (): Component => import('~/views/repo/build/Build.vue'), props: true, }, + { + path: 'changed-files', + name: 'repo-build-changed-files', + component: (): Component => import('~/views/repo/build/BuildChangedFiles.vue'), + }, { path: 'config', name: 'repo-build-config', diff --git a/web/src/views/repo/build/BuildChangedFiles.vue b/web/src/views/repo/build/BuildChangedFiles.vue new file mode 100644 index 000000000..99cd89e4b --- /dev/null +++ b/web/src/views/repo/build/BuildChangedFiles.vue @@ -0,0 +1,38 @@ + + + diff --git a/web/src/views/repo/build/BuildWrapper.vue b/web/src/views/repo/build/BuildWrapper.vue index 4e808997e..dae71944f 100644 --- a/web/src/views/repo/build/BuildWrapper.vue +++ b/web/src/views/repo/build/BuildWrapper.vue @@ -32,6 +32,7 @@ +
@@ -193,6 +194,10 @@ export default defineComponent({ const activeTab = computed({ get() { + if (route.name === 'repo-build-changed-files') { + return 'changed-files'; + } + if (route.name === 'repo-build-config') { return 'config'; } @@ -204,6 +209,10 @@ export default defineComponent({ router.replace({ name: 'repo-build' }); } + if (tab === 'changed-files') { + router.replace({ name: 'repo-build-changed-files' }); + } + if (tab === 'config') { router.replace({ name: 'repo-build-config' }); }