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"> <script setup lang="ts">
import { ProjectTypes } from 'nocodb-sdk' import { ProjectTypes, WorkspaceUserRoles } from 'nocodb-sdk'
const props = defineProps<{ const props = defineProps<{
modelValue: boolean modelValue: boolean
@ -96,6 +96,12 @@ const _duplicate = async () => {
dialogShow.value = false 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> </script>
<template> <template>
@ -105,12 +111,7 @@ const _duplicate = async () => {
<template v-if="isEeUI"> <template v-if="isEeUI">
<div class="my-4">Select workspace to duplicate shared base to:</div> <div class="my-4">Select workspace to duplicate shared base to:</div>
<NcSelect <NcSelect v-model:value="selectedWorkspace" class="w-full" :options="filteredWorkspaces" placeholder="Select Workspace" />
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"
/>
</template> </template>
<div class="prose-md self-center text-gray-500 mt-4">{{ $t('title.advancedSettings') }}</div> <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", "setup": "Setup",
"configLabel": "Configure {label}", "configLabel": "Configure {label}",
"switchToProd": "Switch to a production-ready app database", "switchToProd": "Switch to a production-ready app database",
"sharedBase": "Shared Base",
"fieldID": "Field ID", "fieldID": "Field ID",
"addDescription": "Add description", "addDescription": "Add description",
"editDescription": "Edit description", "editDescription": "Edit description",
@ -996,7 +997,6 @@
"redirectToUrl": "Redirect to URL" "redirectToUrl": "Redirect to URL"
}, },
"activity": { "activity": {
"pending": "Pending",
"webhookDetails": "Webhook Details", "webhookDetails": "Webhook Details",
"hideWeekends": "Hide weekends", "hideWeekends": "Hide weekends",
"renameBase": "Rename Base", "renameBase": "Rename Base",
@ -1799,7 +1799,7 @@
"columnDuplicated": "Field duplicated successfully", "columnDuplicated": "Field duplicated successfully",
"rowDuplicatedWithoutSavedYet": "Record duplicated (not saved)", "rowDuplicatedWithoutSavedYet": "Record duplicated (not saved)",
"updatedUIACL": "Updated UI ACL for tables successfully", "updatedUIACL": "Updated UI ACL for tables successfully",
"pluginUninstalled": "Configuration reset successfully", "pluginUninstalled": "Plugin uninstalled successfully",
"pluginSettingsSaved": "Plugin settings saved successfully", "pluginSettingsSaved": "Plugin settings saved successfully",
"pluginTested": "Successfully tested plugin settings", "pluginTested": "Successfully tested plugin settings",
"tableRenamed": "Table renamed successfully", "tableRenamed": "Table renamed successfully",

Loading…
Cancel
Save