Skip to content

Commit

Permalink
Added:
Browse files Browse the repository at this point in the history
- prop for showing projects access requests table (default: false)
- show access requests is based on global admin
  • Loading branch information
MarcelGeo committed Dec 18, 2023
1 parent 55f833e commit 77d13fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
:projectName="projectName"
:asAdmin="asAdmin"
:show-settings="true"
:show-access-requests="true"
>
<!-- TODO: V3_UPGRADE [MERGIN-EXT] - change settingsAccess to settings.access -->
<template #permissions="{ settings, keyProp, saveProject }">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
:projectName="projectName"
:asAdmin="asAdmin"
:show-settings="projectStore.isProjectOwner"
:show-access-requests="userStore.isGlobalWorkspaceAdmin"
>
<!-- TODO: V3_UPGRADE [MERGIN-EXT] - change settingsAccess to settings.access -->
<template #permissions="{ settings, keyProp, saveProject }">
Expand All @@ -26,7 +27,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
import {
ProjectSettingsViewTemplate,
ProjectPermissionsTemplate,
useProjectStore
useProjectStore,
useUserStore
} from '@mergin/lib'
import { defineComponent } from 'vue'

Expand All @@ -46,9 +48,11 @@ export default defineComponent({
},
setup(_props) {
const projectStore = useProjectStore()
const userStore = useUserStore()

return {
projectStore
projectStore,
userStore
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
:key-prop="key"
:save-project="saveProject"
></slot>
<project-access-requests />
<project-access-requests v-if="showAccessRequests" />
<v-layout class="public-private-zone">
<v-container>
<v-row>
Expand Down Expand Up @@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
<script lang="ts">
import debounce from 'lodash/debounce'
import { mapActions, mapState } from 'pinia'
import { defineComponent } from 'vue'
import { PropType, defineComponent } from 'vue'

import { getErrorMessage } from '@/common/error_utils'
import ConfirmDialog from '@/modules/dialog/components/ConfirmDialog.vue'
Expand All @@ -87,7 +87,11 @@ export default defineComponent({
type: Boolean,
default: false
},
showSettings: Boolean
showSettings: Boolean,
showAccessRequests: {
type: Boolean as PropType<boolean>,
default: false
}
},
data() {
return {
Expand Down

0 comments on commit 77d13fe

Please sign in to comment.