From af97b40820c77dfe6cf3caad6d05c0121878a234 Mon Sep 17 00:00:00 2001 From: youichiro Date: Mon, 27 Sep 2021 09:43:08 +0900 Subject: [PATCH 1/3] Show a dataset link in the sidebar for all user --- frontend/components/layout/TheSideBar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/layout/TheSideBar.vue b/frontend/components/layout/TheSideBar.vue index f7996ccf..37e4d504 100644 --- a/frontend/components/layout/TheSideBar.vue +++ b/frontend/components/layout/TheSideBar.vue @@ -73,7 +73,7 @@ export default { icon: 'mdi-database', text: this.$t('dataset.dataset'), link: 'dataset', - isVisible: this.role.is_project_admin + isVisible: true }, { icon: 'label', From 84bea12ba5691b070c7fd9e72999bc00475f20a4 Mon Sep 17 00:00:00 2001 From: youichiro Date: Mon, 27 Sep 2021 09:45:16 +0900 Subject: [PATCH 2/3] Don't redirect to the project page if the transition is to the dataset page. --- frontend/middleware/check-admin.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/middleware/check-admin.js b/frontend/middleware/check-admin.js index 92cd6f7d..66f7e642 100644 --- a/frontend/middleware/check-admin.js +++ b/frontend/middleware/check-admin.js @@ -9,7 +9,10 @@ export default _.debounce(async function({ app, store, route, redirect }) { const role = store.getters['projects/getCurrentUserRole'] const projectRoot = app.localePath('/projects/' + route.params.id) const path = route.fullPath.replace(/\/$/g, '') - if (!role.is_project_admin && path !== projectRoot) { - return redirect(projectRoot) + + if (role.is_project_admin || path === projectRoot || path.startsWith(projectRoot + '/dataset')) { + return } + + return redirect(projectRoot) }, 1000) From be4bc047834a2fb12c1c8cac3d1c28a41c85e5e6 Mon Sep 17 00:00:00 2001 From: youichiro Date: Mon, 27 Sep 2021 09:47:38 +0900 Subject: [PATCH 3/3] Show buttons for uploading, downloading, and deleting datasets for admin only. --- frontend/pages/projects/_id/dataset/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/pages/projects/_id/dataset/index.vue b/frontend/pages/projects/_id/dataset/index.vue index 9a1a7972..c8888359 100644 --- a/frontend/pages/projects/_id/dataset/index.vue +++ b/frontend/pages/projects/_id/dataset/index.vue @@ -1,6 +1,6 @@