Browse Source

Merge pull request #6836 from nocodb/nc-fix/remove-untitled-default-name

Nc fix/remove untitled default name
pull/6271/merge
Raju Udava 1 year ago committed by GitHub
parent
commit
8f1b604c7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/nc-gui/components/dlg/ViewCreate.vue
  2. 2
      packages/nc-gui/components/workspace/CreateProjectDlg.vue
  3. 2
      packages/nc-gui/composables/useTableNew.ts
  4. 6
      tests/playwright/tests/db/views/viewKanban.spec.ts

4
packages/nc-gui/components/dlg/ViewCreate.vue

@ -110,11 +110,11 @@ watch(
)
function init() {
form.title = `Untitled ${capitalize(typeAlias.value)}`
form.title = `${capitalize(typeAlias.value)}`
const repeatCount = views.value.filter((v) => v.title.startsWith(form.title)).length
if (repeatCount) {
form.title = `${form.title} ${repeatCount}`
form.title = `${form.title}-${repeatCount}`
}
if (selectedViewId.value) {

2
packages/nc-gui/components/workspace/CreateProjectDlg.vue

@ -72,7 +72,7 @@ watch(dialogShow, async (n, o) => {
form.value?.resetFields()
formState.value = {
title: 'Untitled Base',
title: 'Base',
}
await nextTick()

2
packages/nc-gui/composables/useTableNew.ts

@ -148,7 +148,7 @@ export function useTableNew(param: { onTableCreate?: (tableMeta: TableType) => v
)
const generateUniqueTitle = () => {
table.title = generateTitle('Untitled Table', tables.value, 'title')
table.title = generateTitle('Table', tables.value, 'title')
}
const deleteTable = (table: TableType) => {

6
tests/playwright/tests/db/views/viewKanban.spec.ts

@ -228,7 +228,7 @@ test.describe('View', () => {
await dashboard.viewSidebar.copyView({ title: 'Film Kanban' });
await dashboard.viewSidebar.verifyView({
title: 'Untitled Kanban',
title: 'Kanban',
index: 1,
});
const kanban = dashboard.kanban;
@ -254,12 +254,12 @@ test.describe('View', () => {
});
await dashboard.viewSidebar.changeViewIcon({
title: 'Untitled Kanban',
title: 'Kanban',
icon: 'american-football',
iconDisplay: '🏈',
});
await dashboard.viewSidebar.deleteView({ title: 'Untitled Kanban' });
await dashboard.viewSidebar.deleteView({ title: 'Kanban' });
///////////////////////////////////////////////
await dashboard.viewSidebar.openView({ title: 'Film Kanban' });

Loading…
Cancel
Save