Browse Source

feat: updated some dialogs

pull/5627/head
DarkPhoenix2704 1 year ago
parent
commit
623d1a5d74
  1. 13
      packages/nc-gui/components/dlg/TableCreate.vue
  2. 19
      packages/nc-gui/components/dlg/TableDuplicate.vue
  3. 38
      packages/nc-gui/components/dlg/TableRename.vue
  4. 10
      packages/nc-gui/components/dlg/ViewCreate.vue
  5. 6
      packages/nc-gui/components/dlg/ViewDelete.vue
  6. 6
      packages/nc-gui/lang/en.json

13
packages/nc-gui/components/dlg/TableCreate.vue

@ -118,24 +118,21 @@ onMounted(() => {
<a-modal <a-modal
v-model:visible="dialogShow" v-model:visible="dialogShow"
:class="{ active: dialogShow }" :class="{ active: dialogShow }"
width="max(30vw, 600px)" :title="$t('activity.createTable')"
centered centered
wrap-class-name="nc-modal-table-create" wrap-class-name="nc-modal-table-create"
@keydown.esc="dialogShow = false" @keydown.esc="dialogShow = false"
> >
<template #footer> <template #footer>
<a-button key="back" size="large" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button> <a-button key="back" size="middle" class="!rounded-md" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button>
<a-button key="submit" size="large" type="primary" :loading="creating" @click="_createTable" <a-button key="submit" size="middle" class="!rounded-md" type="primary" :loading="creating" @click="_createTable"
>{{ $t('general.submit') }} >{{ $t('general.submit') }}
</a-button> </a-button>
</template> </template>
<div class="pl-10 pr-10 pt-5"> <div>
<a-form :model="table" name="create-new-table-form" @keydown.enter="_createTable"> <a-form :model="table" name="create-new-table-form" @keydown.enter="_createTable">
<!-- Create A New Table -->
<div class="prose-xl font-bold self-center my-4">{{ $t('activity.createTable') }}</div>
<!-- hint="Enter table name" --> <!-- hint="Enter table name" -->
<!-- Table name --> <!-- Table name -->
<div class="mb-2">{{ $t('labels.tableName') }}</div> <div class="mb-2">{{ $t('labels.tableName') }}</div>
@ -206,7 +203,7 @@ onMounted(() => {
overflow: hidden; overflow: hidden;
&.active { &.active {
max-height: 200px; max-height: 100px;
} }
} }
</style> </style>

19
packages/nc-gui/components/dlg/TableDuplicate.vue

@ -50,29 +50,24 @@ const isEaster = ref(false)
<a-modal <a-modal
v-model:visible="dialogShow" v-model:visible="dialogShow"
:class="{ active: dialogShow }" :class="{ active: dialogShow }"
width="max(30vw, 600px)"
centered centered
wrap-class-name="nc-modal-table-duplicate" wrap-class-name="nc-modal-table-duplicate"
@keydown.esc="dialogShow = false" @keydown.esc="dialogShow = false"
> >
<template #footer> <template #footer>
<a-button key="back" size="large" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button> <a-button key="back" size="middle" class="!rounded-md" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button>
<a-button key="submit" size="large" type="primary" :loading="isLoading" @click="_duplicate" <a-button key="submit" size="middle" type="primary" class="!rounded-md" :loading="isLoading" @click="_duplicate"
>{{ $t('general.confirm') }} >{{ $t('general.confirm') }}
</a-button> </a-button>
</template> </template>
<div class="pl-10 pr-10 pt-5"> <div>
<div class="prose-xl font-bold self-center my-4" @dblclick="isEaster = !isEaster">{{ $t('general.duplicate') }}</div> <div class="prose-xl font-bold self-center my-4" @dblclick="isEaster = !isEaster">
{{ $t('general.duplicate') }} {{ table.title }}
<div class="mb-2">Are you sure you want to duplicate the `{{ table.title }}` table?</div> </div>
<div class="prose-md self-center text-gray-500 mt-4">{{ $t('title.advancedSettings') }}</div>
<a-divider class="!m-0 !p-0 !my-2" />
<div class="text-xs p-2"> <div class="text-xs">
<a-checkbox v-model:checked="options.includeData">Include data</a-checkbox> <a-checkbox v-model:checked="options.includeData">Include data</a-checkbox>
<a-checkbox v-model:checked="options.includeViews">Include views</a-checkbox> <a-checkbox v-model:checked="options.includeViews">Include views</a-checkbox>
<a-checkbox v-show="isEaster" v-model:checked="options.includeHooks">Include hooks</a-checkbox> <a-checkbox v-show="isEaster" v-model:checked="options.includeHooks">Include hooks</a-checkbox>

38
packages/nc-gui/components/dlg/TableRename.vue

@ -177,31 +177,33 @@ const renameTable = async (undo = false) => {
:class="{ active: dialogShow }" :class="{ active: dialogShow }"
:title="$t('activity.renameTable')" :title="$t('activity.renameTable')"
:mask-closable="false" :mask-closable="false"
centered
wrap-class-name="nc-modal-table-rename" wrap-class-name="nc-modal-table-rename"
@keydown.esc="dialogShow = false" @keydown.esc="dialogShow = false"
@finish="renameTable" @finish="renameTable"
> >
<template #footer> <template #footer>
<a-button key="back" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button> <a-button key="back" class="!rounded-md" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="renameTable()">{{ $t('general.submit') }}</a-button> <a-button key="submit" class="!rounded-md" type="primary" :loading="loading" @click="renameTable()">{{
$t('general.submit')
}}</a-button>
</template> </template>
<div class="pl-10 pr-10 pt-5"> <a-form :model="formState" name="create-new-table-form">
<a-form :model="formState" name="create-new-table-form"> <!-- hint="Enter table name" -->
<!-- hint="Enter table name" --> <div class="mb-2">{{ $t('msg.info.enterTableName') }}</div>
<div class="mb-2">{{ $t('msg.info.enterTableName') }}</div>
<a-form-item v-bind="validateInfos.title">
<a-form-item v-bind="validateInfos.title"> <a-input
<a-input ref="inputEl"
ref="inputEl" v-model:value="formState.title"
v-model:value="formState.title" hide-details
hide-details size="large"
:placeholder="$t('msg.info.enterTableName')" :placeholder="$t('msg.info.enterTableName')"
@keydown.enter="renameTable()" @keydown.enter="renameTable()"
/> />
</a-form-item> </a-form-item>
</a-form> </a-form>
</div>
</a-modal> </a-modal>
</template> </template>

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

@ -207,7 +207,7 @@ async function onSubmit() {
<template> <template>
<a-modal <a-modal
v-model:visible="vModel" v-model:visible="vModel"
class="!top-[35%]" centered
:class="{ active: vModel }" :class="{ active: vModel }"
:confirm-loading="loading" :confirm-loading="loading"
wrap-class-name="nc-modal-view-create" wrap-class-name="nc-modal-view-create"
@ -219,7 +219,7 @@ async function onSubmit() {
<a-form ref="formValidator" layout="vertical" :model="form"> <a-form ref="formValidator" layout="vertical" :model="form">
<a-form-item :label="$t('labels.viewName')" name="title" :rules="viewNameRules"> <a-form-item :label="$t('labels.viewName')" name="title" :rules="viewNameRules">
<a-input ref="inputEl" v-model:value="form.title" autofocus @keydown.enter="onSubmit" /> <a-input ref="inputEl" size="large" v-model:value="form.title" autofocus @keydown.enter="onSubmit" />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-if="form.type === ViewTypes.KANBAN" v-if="form.type === ViewTypes.KANBAN"
@ -254,8 +254,10 @@ async function onSubmit() {
</a-form> </a-form>
<template #footer> <template #footer>
<a-button key="back" @click="vModel = false">{{ $t('general.cancel') }}</a-button> <a-button key="back" class="!rounded-md" @click="vModel = false">{{ $t('general.cancel') }}</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="onSubmit">{{ $t('general.submit') }}</a-button> <a-button key="submit" class="!rounded-md" type="primary" :loading="loading" @click="onSubmit">{{
$t('general.submit')
}}</a-button>
</template> </template>
</a-modal> </a-modal>
</template> </template>

6
packages/nc-gui/components/dlg/ViewDelete.vue

@ -50,7 +50,7 @@ async function onDelete() {
<template> <template>
<a-modal <a-modal
v-model:visible="vModel" v-model:visible="vModel"
class="!top-[35%]" centered
:class="{ active: vModel }" :class="{ active: vModel }"
:confirm-loading="isLoading" :confirm-loading="isLoading"
wrap-class-name="nc-modal-view-delete" wrap-class-name="nc-modal-view-delete"
@ -60,9 +60,9 @@ async function onDelete() {
{{ $t('msg.info.deleteViewConfirmation') }} {{ $t('msg.info.deleteViewConfirmation') }}
<template #footer> <template #footer>
<a-button key="back" @click="vModel = false">{{ $t('general.cancel') }}</a-button> <a-button key="back" class="!rounded-md" @click="vModel = false">{{ $t('general.cancel') }}</a-button>
<a-button key="submit" danger html-type="submit" :loading="isLoading" @click="onDelete"> <a-button key="submit" class="!rounded-md" danger html-type="submit" :loading="isLoading" @click="onDelete">
{{ $t('general.submit') }} {{ $t('general.submit') }}
</a-button> </a-button>
</template> </template>

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

@ -385,10 +385,10 @@
"nextRecord": "Next record", "nextRecord": "Next record",
"previousRecord": "Previous record", "previousRecord": "Previous record",
"copyApiURL": "Copy API URL", "copyApiURL": "Copy API URL",
"createTable": "Table Create", "createTable": "Create New Table",
"refreshTable": "Tables Refresh", "refreshTable": "Tables Refresh",
"renameTable": "Table Rename", "renameTable": "Rename Table",
"deleteTable": "Table Delete", "deleteTable": "Delete Table",
"addField": "Add new field to this table", "addField": "Add new field to this table",
"setDisplay": "Set as Display value", "setDisplay": "Set as Display value",
"addRow": "Add new row", "addRow": "Add new row",

Loading…
Cancel
Save