Browse Source

Merge pull request #1504 from youichiro/show_example_list_for_all_user

Display dataset page for all user
pull/1510/head
Hiroki Nakayama 3 years ago
committed by GitHub
parent
commit
7f359d7393
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions
  1. 2
      frontend/components/layout/TheSideBar.vue
  2. 7
      frontend/middleware/check-admin.js
  3. 6
      frontend/pages/projects/_id/dataset/index.vue

2
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',

7
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)

6
frontend/pages/projects/_id/dataset/index.vue

@ -1,6 +1,6 @@
<template>
<v-card>
<v-card-title>
<v-card-title v-if="isProjectAdmin">
<action-menu
@upload="upload"
@download="dialogDownload=true"
@ -112,7 +112,8 @@ export default Vue.extend({
project: {} as ProjectDTO,
item: {} as ExampleListDTO,
selected: [] as ExampleDTO[],
isLoading: false
isLoading: false,
isProjectAdmin: false
}
},
@ -148,6 +149,7 @@ export default Vue.extend({
async created() {
this.project = await this.$services.project.findById(this.projectId)
this.isProjectAdmin = this.project.current_users_role.is_project_admin
},
methods: {

Loading…
Cancel
Save