Browse Source

fix: Removed Untitled from default name in View, table and base create

pull/6836/head
Muhammed Mustafa 1 year ago
parent
commit
5d6a7b2560
  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
packages/nc-gui/components/dlg/ViewCreate.vue

@ -110,11 +110,11 @@ watch(
) )
function init() { 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 const repeatCount = views.value.filter((v) => v.title.startsWith(form.title)).length
if (repeatCount) { if (repeatCount) {
form.title = `${form.title} ${repeatCount}` form.title = `${form.title}-${repeatCount}`
} }
if (selectedViewId.value) { if (selectedViewId.value) {

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

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

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

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

Loading…
Cancel
Save