Browse Source

Nc chore/menu titles (#8961)

* fix: menu items

* test: fix menu item name change

* fix: menu items in expand record, kanban & mfe
pull/8967/head
Raju Udava 5 months ago committed by GitHub
parent
commit
dce7bf8502
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue
  2. 6
      packages/nc-gui/components/smartsheet/Kanban.vue
  3. 4
      packages/nc-gui/components/smartsheet/details/Fields.vue
  4. 8
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  5. 10
      packages/nc-gui/components/smartsheet/grid/Table.vue
  6. 8
      packages/nc-gui/components/smartsheet/header/Menu.vue
  7. 22
      packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
  8. 32
      packages/nc-gui/lang/en.json
  9. 4
      tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  10. 6
      tests/playwright/pages/Dashboard/Grid/Column/index.ts

6
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -348,7 +348,7 @@ const source = computed(() => {
>
<div v-e="['c:table:rename']" class="flex gap-2 items-center">
<GeneralIcon icon="rename" class="text-gray-700" />
{{ $t('general.rename') }} {{ $t('objects.table') }}
{{ $t('general.rename') }} {{ $t('objects.table').toLowerCase() }}
</div>
</NcMenuItem>
@ -365,7 +365,7 @@ const source = computed(() => {
>
<div v-e="['c:table:duplicate']" class="flex gap-2 items-center">
<GeneralIcon icon="duplicate" class="text-gray-700" />
{{ $t('general.duplicate') }} {{ $t('objects.table') }}
{{ $t('general.duplicate') }} {{ $t('objects.table').toLowerCase() }}
</div>
</NcMenuItem>
@ -378,7 +378,7 @@ const source = computed(() => {
>
<div v-e="['c:table:delete']" class="flex gap-2 items-center">
<GeneralIcon icon="delete" />
{{ $t('general.delete') }} {{ $t('objects.table') }}
{{ $t('general.delete') }} {{ $t('objects.table').toLowerCase() }}
</div>
</NcMenuItem>
</template>

6
packages/nc-gui/components/smartsheet/Kanban.vue

@ -1112,7 +1112,11 @@ const handleSubmitRenameOrNewStack = async (loadMeta: boolean, stack?: any, stac
<div v-e="['a:kanban:delete-record']" class="flex items-center gap-2 nc-kanban-context-menu-item">
<component :is="iconMap.delete" class="flex" />
<!-- Delete Record -->
{{ $t('activity.deleteRecord') }}
{{
$t('general.deleteEntity', {
entity: $t('objects.record').toLowerCase(),
})
}}
</div>
</NcMenuItem>
</NcMenu>

4
packages/nc-gui/components/smartsheet/details/Fields.vue

@ -1208,7 +1208,7 @@ watch(
@click="duplicateField(field)"
>
<GeneralIcon icon="duplicate" class="text-gray-800" />
<span>{{ $t('general.duplicate') }}</span>
<span>{{ $t('general.duplicate') }} {{ $t('objects.field').toLowerCase() }}</span>
</NcMenuItem>
<NcMenuItem
v-if="!field.pv"
@ -1238,7 +1238,7 @@ watch(
>
<div class="text-red-500">
<GeneralIcon icon="delete" class="group-hover:text-accent -ml-0.25 -mt-0.75 mr-0.5" />
{{ $t('general.delete') }}
{{ $t('general.delete') }} {{ $t('objects.field').toLowerCase() }}
</div>
</NcMenuItem>
</template>

8
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -687,7 +687,7 @@ export default {
<NcMenuItem class="text-gray-700" @click="_loadRow()">
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload">
<component :is="iconMap.reload" class="cursor-pointer" />
{{ $t('general.reload') }}
{{ $t('general.reload') }} {{ $t('objects.record') }}
</div>
</NcMenuItem>
<NcMenuItem
@ -719,7 +719,11 @@ export default {
<div v-e="['c:row-expand:delete']" class="flex gap-2 items-center" data-testid="nc-expanded-form-delete">
<component :is="iconMap.delete" class="cursor-pointer nc-delete-row" />
<span class="-ml-0.25">
{{ $t('activity.deleteRecord') }}
{{
$t('general.deleteEntity', {
entity: $t('objects.record').toLowerCase(),
})
}}
</span>
</div>
</NcMenuItem>

10
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -2268,7 +2268,7 @@ onKeyStroke('ArrowDown', onDown)
<div v-e="['a:row:copy']" class="flex gap-2 items-center">
<GeneralIcon icon="copy" />
<!-- Copy -->
{{ $t('general.copy') }}
{{ $t('general.copy') }} {{ $t('objects.cell').toLowerCase() }}
</div>
</NcMenuItem>
@ -2282,7 +2282,7 @@ onKeyStroke('ArrowDown', onDown)
<div v-e="['a:row:paste']" class="flex gap-2 items-center">
<GeneralIcon icon="paste" />
<!-- Paste -->
{{ $t('general.paste') }}
{{ $t('general.paste') }} {{ $t('objects.cell').toLowerCase() }}
</div>
</NcMenuItem>
@ -2302,7 +2302,7 @@ onKeyStroke('ArrowDown', onDown)
>
<div v-e="['a:row:clear']" class="flex gap-2 items-center">
<GeneralIcon icon="close" />
{{ $t('general.clear') }}
{{ $t('general.clear') }} {{ $t('objects.cell').toLowerCase() }}
</div>
</NcMenuItem>
@ -2316,7 +2316,7 @@ onKeyStroke('ArrowDown', onDown)
>
<div v-e="['a:row:clear-range']" class="flex gap-2 items-center">
<GeneralIcon icon="closeBox" class="text-gray-500" />
{{ $t('general.clear') }}
{{ $t('general.clear') }} {{ $t('objects.cell').toLowerCase() }}
</div>
</NcMenuItem>
@ -2325,7 +2325,7 @@ onKeyStroke('ArrowDown', onDown)
<NcMenuItem class="nc-base-menu-item" @click="commentRow(contextMenuTarget.row)">
<div v-e="['a:row:comment']" class="flex gap-2 items-center">
<MdiMessageOutline class="h-4 w-4" />
{{ $t('general.comment') }}
{{ $t('general.add') }} {{ $t('general.comment').toLowerCase() }}
</div>
</NcMenuItem>
</template>

8
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -404,7 +404,7 @@ const isColumnEditAllowed = computed(() => {
<div class="nc-column-edit nc-header-menu-item">
<component :is="iconMap.ncEdit" class="text-gray-700" />
<!-- Edit -->
{{ $t('general.edit') }}
{{ $t('general.edit') }} {{ $t('objects.field').toLowerCase() }}
</div>
</NcMenuItem>
</GeneralSourceRestrictionTooltip>
@ -418,7 +418,7 @@ const isColumnEditAllowed = computed(() => {
<div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item">
<component :is="iconMap.duplicate" class="text-gray-700" />
<!-- Duplicate -->
{{ t('general.duplicate') }}
{{ t('general.duplicate') }} {{ $t('objects.field').toLowerCase() }}
</div>
</NcMenuItem>
</GeneralSourceRestrictionTooltip>
@ -530,7 +530,7 @@ const isColumnEditAllowed = computed(() => {
<div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item">
<component :is="iconMap.duplicate" class="text-gray-700" />
<!-- Duplicate -->
{{ t('general.duplicate') }}
{{ t('general.duplicate') }} {{ $t('objects.field').toLowerCase() }}
</div>
</NcMenuItem>
</GeneralSourceRestrictionTooltip>
@ -563,7 +563,7 @@ const isColumnEditAllowed = computed(() => {
>
<component :is="iconMap.delete" />
<!-- Delete -->
{{ $t('general.delete') }}
{{ $t('general.delete') }} {{ $t('objects.field').toLowerCase() }}
</div>
</NcMenuItem>
</GeneralSourceRestrictionTooltip>

22
packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue

@ -176,18 +176,30 @@ const onDelete = async () => {
<NcDivider />
<NcMenuItem v-if="lockType !== LockType.Locked" @click="onRenameMenuClick">
<GeneralIcon icon="rename" />
{{ $t('activity.renameView') }}
{{
$t('general.renameEntity', {
entity: view.type !== ViewTypes.FORM ? $t('objects.view').toLowerCase() : $t('objects.viewType.form').toLowerCase(),
})
}}
</NcMenuItem>
<NcTooltip v-else>
<template #title> {{ $t('msg.info.disabledAsViewLocked') }} </template>
<NcMenuItem class="!cursor-not-allowed !text-gray-400">
<GeneralIcon icon="rename" />
{{ $t('activity.renameView') }}
{{
$t('general.renameEntity', {
entity: view.type !== ViewTypes.FORM ? $t('objects.view').toLowerCase() : $t('objects.viewType.form').toLowerCase(),
})
}}
</NcMenuItem>
</NcTooltip>
<NcMenuItem @click="onDuplicate">
<GeneralIcon class="nc-view-copy-icon" icon="duplicate" />
{{ $t('labels.duplicateView') }}
{{
$t('general.duplicateEntity', {
entity: view.type !== ViewTypes.FORM ? $t('objects.view').toLowerCase() : $t('objects.viewType.form').toLowerCase(),
})
}}
</NcMenuItem>
</template>
@ -302,7 +314,7 @@ const onDelete = async () => {
<GeneralIcon class="nc-view-delete-icon" icon="delete" />
{{
$t('general.deleteEntity', {
entity: $t('objects.view'),
entity: view.type !== ViewTypes.FORM ? $t('objects.view').toLowerCase() : $t('objects.viewType.form').toLowerCase(),
})
}}
</NcMenuItem>
@ -311,7 +323,7 @@ const onDelete = async () => {
<GeneralIcon class="nc-view-delete-icon" icon="delete" />
{{
$t('general.deleteEntity', {
entity: $t('objects.view'),
entity: view.type !== ViewTypes.FORM ? $t('objects.view').toLowerCase() : $t('objects.viewType.form').toLowerCase(),
})
}}
</NcMenuItem>

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

@ -142,6 +142,7 @@
"code": "Code",
"duplicate": "Duplicate",
"duplicating": "Duplicating",
"duplicateEntity": "Duplicate {entity}",
"activate": "Activate",
"action": "Action",
"insert": "Insert",
@ -154,6 +155,7 @@
"update": "Update",
"updating": "Updating",
"rename": "Rename",
"renameEntity": "Rename {entity}",
"reload": "Reload",
"refresh": "Refresh",
"reset": "Reset",
@ -213,14 +215,14 @@
"moreInfo": "More information can be found here",
"logs": "Logs",
"groupingField": "Stack by field",
"insertAfter": "Insert After",
"insertBefore": "Insert Before",
"insertAfter": "Insert right",
"insertBefore": "Insert left",
"insertAbove": "Insert above",
"insertBelow": "Insert below",
"hideField": "Hide Field",
"showField": "Show Field",
"sortAsc": "Sort Ascending",
"sortDesc": "Sort Descending",
"hideField": "Hide field",
"showField": "Show field",
"sortAsc": "Sort ascending",
"sortDesc": "Sort descending",
"move": "Move",
"geoDataField": "GeoData Field",
"type": "Type",
@ -288,6 +290,8 @@
"fields": "Fields",
"column": "Field",
"columns": "Fields",
"cell": "Cell",
"cells": "Cells",
"page": "Page",
"pages": "Pages",
"record": "record",
@ -653,7 +657,7 @@
"forRole": "for role",
"clickToCopyTableID": "Click to copy Table ID",
"clickToCopyViewID": "Click to copy View ID",
"viewMode": "View Mode",
"viewMode": "View mode",
"searchUsers": "Search Users",
"superAdmin": "Super Admin",
"allTables": "All Tables",
@ -677,7 +681,7 @@
"dashboardName": "Dashboard name",
"createView": "Create view",
"creatingView": "Creating View",
"duplicateView": "Duplicate View",
"duplicateView": "Duplicate view",
"duplicateGridView": "Duplicate Grid View",
"createGridView": "Create Grid View",
"duplicateGalleryView": "Duplicate Gallery View",
@ -785,7 +789,7 @@
"apiKey": "API Key",
"personalAccessToken": "Personal Access Token",
"sharedBaseUrl": "Shared Base URL",
"importData": "Import Data",
"importData": "Import data",
"importSecondaryViews": "Import Secondary Views",
"importRollupColumns": "Import Rollup Fields",
"importLookupColumns": "Import Lookup Fields",
@ -991,7 +995,7 @@
"renameLayout": "Layout Rename",
"deleteTable": "Delete Table",
"addField": "Add new field to this table",
"setDisplay": "Set as Display value",
"setDisplay": "Set as display value",
"addRow": "Add new record",
"saveRow": "Save record",
"saveAndExit": "Save & Exit",
@ -1021,9 +1025,9 @@
"listSharedView": "Shared View List",
"ListView": "Views List",
"copyView": "Copy View",
"renameView": "Rename View",
"renameView": "Rename view",
"uploadData": "Upload Data",
"deleteView": "Delete View",
"deleteView": "Delete view",
"createGrid": "Create Grid View",
"createGallery": "Create Gallery View",
"createCalendar": "Create Calendar View",
@ -1062,8 +1066,8 @@
"recordCreatedLinked": "Record Created & Linked",
"useConnectionUrl": "Use Connection URL",
"toggleCommentsDraw": "Toggle comments draw",
"expandRecord": "Expand Record",
"deleteRecord": "Delete Record",
"expandRecord": "Expand record",
"deleteRecord": "Delete record",
"fullWidth": "Full width",
"exitFullWidth": "Exit full width",
"markAllAsRead": "Mark all as read",

4
tests/playwright/pages/Dashboard/ExpandedForm/index.ts

@ -46,8 +46,8 @@ export class ExpandedFormPage extends BasePage {
}
async clickDeleteRow() {
await this.click3DotsMenu('Delete Record');
await this.rootPage.locator('.ant-btn-danger:has-text("Delete Record")').click();
await this.click3DotsMenu('Delete record');
await this.rootPage.locator('.ant-btn-danger:has-text("Delete record")').click();
}
async isDisabledDuplicateRow() {

6
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -97,14 +97,14 @@ export class ColumnPageObject extends BasePage {
await this.grid.get().locator(`th[data-title="${insertBeforeColumnTitle}"]`).scrollIntoViewIfNeeded();
await this.grid.get().locator(`th[data-title="${insertBeforeColumnTitle}"] .nc-ui-dt-dropdown`).click();
if (isDisplayValue) {
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before")')).toHaveCount(0);
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Insert left")')).toHaveCount(0);
return;
}
await this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before"):visible').click();
await this.rootPage.locator('li[role="menuitem"]:has-text("Insert left"):visible').click();
} else if (insertAfterColumnTitle) {
await this.grid.get().locator(`th[data-title="${insertAfterColumnTitle}"]`).scrollIntoViewIfNeeded();
await this.grid.get().locator(`th[data-title="${insertAfterColumnTitle}"] .nc-ui-dt-dropdown`).click();
await this.rootPage.locator('li[role="menuitem"]:has-text("Insert After"):visible').click();
await this.rootPage.locator('li[role="menuitem"]:has-text("Insert right"):visible').click();
} else {
await this.grid.get().locator('.nc-column-add').click();
}

Loading…
Cancel
Save