Browse Source

fix: while cloning base show only workspaces with required roles

pull/9348/head
Pranav C 3 months ago
parent
commit
bb3d2dc8f6
  1. 15
      packages/nc-gui/components/dlg/SharedBaseDuplicate.vue
  2. 4
      packages/nc-gui/lang/en.json

15
packages/nc-gui/components/dlg/SharedBaseDuplicate.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ProjectTypes } from 'nocodb-sdk'
import { ProjectTypes, WorkspaceUserRoles } from 'nocodb-sdk'
const props = defineProps<{
modelValue: boolean
@ -96,6 +96,12 @@ const _duplicate = async () => {
dialogShow.value = false
}
}
const filteredWorkspaces = computed(() => {
return workspacesList.value
?.filter((ws) => ws.roles === WorkspaceUserRoles.OWNER || ws.roles === WorkspaceUserRoles.CREATOR)
.map((w) => ({ label: `${w.title[0].toUpperCase()}${w.title.slice(1)}`, value: w.id }))
})
</script>
<template>
@ -105,12 +111,7 @@ const _duplicate = async () => {
<template v-if="isEeUI">
<div class="my-4">Select workspace to duplicate shared base to:</div>
<NcSelect
v-model:value="selectedWorkspace"
class="w-full"
:options="workspacesList.map((w) => ({ label: `${w.title[0].toUpperCase()}${w.title.slice(1)}`, value: w.id }))"
placeholder="Select Workspace"
/>
<NcSelect v-model:value="selectedWorkspace" class="w-full" :options="filteredWorkspaces" placeholder="Select Workspace" />
</template>
<div class="prose-md self-center text-gray-500 mt-4">{{ $t('title.advancedSettings') }}</div>

4
packages/nc-gui/lang/en.json

@ -623,6 +623,7 @@
"setup": "Setup",
"configLabel": "Configure {label}",
"switchToProd": "Switch to a production-ready app database",
"sharedBase": "Shared Base",
"fieldID": "Field ID",
"addDescription": "Add description",
"editDescription": "Edit description",
@ -996,7 +997,6 @@
"redirectToUrl": "Redirect to URL"
},
"activity": {
"pending": "Pending",
"webhookDetails": "Webhook Details",
"hideWeekends": "Hide weekends",
"renameBase": "Rename Base",
@ -1799,7 +1799,7 @@
"columnDuplicated": "Field duplicated successfully",
"rowDuplicatedWithoutSavedYet": "Record duplicated (not saved)",
"updatedUIACL": "Updated UI ACL for tables successfully",
"pluginUninstalled": "Configuration reset successfully",
"pluginUninstalled": "Plugin uninstalled successfully",
"pluginSettingsSaved": "Plugin settings saved successfully",
"pluginTested": "Successfully tested plugin settings",
"tableRenamed": "Table renamed successfully",

Loading…
Cancel
Save