Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): update copy from view modal design

Ramesh Mane9c6045bf6d1b
diff --git a/packages/nc-gui/components/nc/List/ViewSelector.vue b/packages/nc-gui/components/nc/List/ViewSelector.vue
index 6bde8facb7..61cea94932 100644
--- a/packages/nc-gui/components/nc/List/ViewSelector.vue
+++ b/packages/nc-gui/components/nc/List/ViewSelector.vue
@@ -151,7 +151,7 @@ defineExpose({
<NcListDropdown v-model:is-open="isOpenViewSelectDropdown" :disabled="disabled" :has-error="!!selectedView?.ncItemDisabled">
<div class="flex-1 flex items-center gap-2 min-w-0">
<div v-if="selectedView" class="min-w-5 flex items-center justify-center">
- <NcIconView :view="selectedView" class="text-gray-500" />
+ <NcIconView :view="selectedView" class="text-nc-content-gray-muted" />
</div>
<NcTooltip hide-on-click class="flex-1 truncate" show-on-truncate-only>
<span
@@ -188,7 +188,7 @@ defineExpose({
>
<template #listItemExtraLeft="{ option }">
<div class="min-w-5 flex items-center justify-center">
- <NcIconView :view="option" class="text-gray-500" />
+ <NcIconView :view="option" class="text-nc-content-gray-muted" />
</div>
</template>
</NcList>
diff --git a/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
index e9eddfeb2f..9c544969db 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
@@ -29,7 +29,11 @@ const view = computed(() => props.view)
const table = computed(() => props.table)
-const { navigateToView, duplicateView, updateView, isUserViewOwner, onOpenCopyViewConfigFromAnotherViewModal } = useViewsStore()
+const viewsStore = useViewsStore()
+
+const { navigateToView, duplicateView, updateView, isUserViewOwner, onOpenCopyViewConfigFromAnotherViewModal } = viewsStore
+
+const { isCopyViewConfigFromAnotherViewFeatureEnabled } = storeToRefs(viewsStore)
const { base } = storeToRefs(useBase())
@@ -281,9 +285,12 @@ defineOptions({
}}
</NcMenuItem>
</template>
- <NcDivider v-if="isEeUI && isUIAllowed('viewCreateOrEdit') && view?.is_default" />
+
+ <NcDivider
+ v-if="isEeUI && isUIAllowed('viewCreateOrEdit') && view?.is_default && isCopyViewConfigFromAnotherViewFeatureEnabled"
+ />
<SmartsheetToolbarNotAllowedTooltip
- v-if="isEeUI && isUIAllowed('viewCreateOrEdit')"
+ v-if="isEeUI && isUIAllowed('viewCreateOrEdit') && isCopyViewConfigFromAnotherViewFeatureEnabled"
:enabled="(isPersonalView && !isViewOwner) || lockType === LockType.Locked"
:message="
isPersonalView && !isViewOwner
diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json
index 27d51fe985..977c0c9186 100644
--- a/packages/nc-gui/lang/en.json
+++ b/packages/nc-gui/lang/en.json
@@ -292,6 +292,7 @@
"showMenu": "Show menu",
"hideMenu": "Hide menu",
"addAll": "Add all",
+ "selectAll": "Select all",
"removeAll": "Remove all",
"signUp": "SIGN UP",
"signIn": "SIGN IN",
@@ -659,7 +660,11 @@
"group": "Group",
"sort": "Sort",
"rowColoring": "Row coloring",
- "copyAnotherViewConfig": "Copy another view configuration"
+ "copyAnotherViewConfig": "Copy another view configuration",
+ "selectConfigurationToCopy": "Select configuration(s) to copy",
+ "selectViewToCopyFrom": "Select view to copy from",
+ "copyConfigurationFromAnotherView": "Copy configuration from another view",
+ "notSupportedByViewType": "Not supported by {view} view type"
}
},
"datatype": {
@@ -1510,7 +1515,8 @@
"emptyScript": "Empty Script",
"enterFullscreen": "Enter fullscreen",
"exitFullscreen": "Exit fullscreen",
- "selectRole": "Select Role"
+ "selectRole": "Select Role",
+ "copyConfiguration": "Copy configuration"
},
"activity": {
"clickToResolve": "Click to resolve",
diff --git a/packages/nc-gui/store/views.ts b/packages/nc-gui/store/views.ts
index d8956a542c..6b318affa3 100644
--- a/packages/nc-gui/store/views.ts
+++ b/packages/nc-gui/store/views.ts
@@ -57,6 +57,8 @@ export const useViewsStore = defineStore('viewsStore', () => {
const { activeTable } = storeToRefs(tablesStore)
+ const { isFeatureEnabled } = useBetaFeatureToggle()
+
const route = router.currentRoute
const allRecentViews = ref<RecentView[]>([])
@@ -162,6 +164,10 @@ export const useViewsStore = defineStore('viewsStore', () => {
const isActiveViewLocked = computed(() => activeView.value?.lock_type === 'locked')
const isLockedView = computed(() => activeView.value?.lock_type === 'locked')
+ const isCopyViewConfigFromAnotherViewFeatureEnabled = computed(() =>
+ isFeatureEnabled(FEATURE_FLAG.COPY_VIEW_CONFIG_FROM_ANOTHER_VIEW),
+ )
+
const refreshViewTabTitle = createEventHook<void>()
const loadViews = async ({
@@ -957,6 +963,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
lastOpenedViewId,
activeViewRowColorInfo,
sharedView,
+ isCopyViewConfigFromAnotherViewFeatureEnabled,
// Methods
createView,
diff --git a/packages/nc-gui/utils/iconUtils.ts b/packages/nc-gui/utils/iconUtils.ts
index 191871bd49..0612f9d5ec 100644
--- a/packages/nc-gui/utils/iconUtils.ts
+++ b/packages/nc-gui/utils/iconUtils.ts
@@ -43,6 +43,7 @@ import PhExcelThin from '~icons/ph/microsoft-excel-logo-light'
import VscodeIconsExcelColored from '~icons/vscode-icons/file-type-excel'
import PhCsvThin from '~icons/ph/file-csv'
import PhSplitVerticalThin from '~icons/material-symbols/height-rounded'
+import PhSplitHorizontalThin from '~icons/material-symbols/arrow-range-rounded'
import LogosDiscordIcon from '~icons/logos/discord-icon'
import LogosRedditIcon from '~icons/logos/reddit-icon'
import RiTwitterXFill from '~icons/ri/twitter-x-line'
@@ -1180,6 +1181,7 @@ export const iconMap = {
'view': h('span', { class: 'material-symbols' }, 'visibility'),
// rowHeight: h('span', { class: 'material-symbols' }, 'height'),
'rowHeight': h(PhSplitVerticalThin, { style: { fontSize: '14px' } }),
+ 'columnWidth': h(PhSplitHorizontalThin, { style: { fontSize: '14px' } }),
'closeCircle': h('span', { class: 'material-symbols' }, 'cancel'),
'closeBox': h('span', { class: 'material-symbols' }, 'close'),
'close': MSCloseRounded,
diff --git a/packages/nocodb-sdk/src/lib/viewUtils.ts b/packages/nocodb-sdk/src/lib/viewUtils.ts
index f906a2d20d..290bb73765 100644
--- a/packages/nocodb-sdk/src/lib/viewUtils.ts
+++ b/packages/nocodb-sdk/src/lib/viewUtils.ts
@@ -83,7 +83,7 @@ export const copyViewConfigOptionMap: Record<
value: ViewSettingOverrideOptions.COLUMN_WIDTH,
i18nLabel: `objects.copyViewConfig.${ViewSettingOverrideOptions.COLUMN_WIDTH}`,
supportedViewTypes: [ViewTypes.GRID],
- icon: 'rowHeight',
+ icon: 'columnWidth',
},
[ViewSettingOverrideOptions.ROW_HEIGHT]: {
order: 4,