Browse Source

fix(nc-gui): add col title to changedColumns if they are preset only for kanban

pull/3563/head
Wing-Kam Wong 2 years ago
parent
commit
fe22ed15aa
  1. 13
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  2. 5
      packages/nc-gui/pages/signup/[[token]].vue

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

@ -5,6 +5,7 @@ import type { Ref } from 'vue'
import { import {
FieldsInj, FieldsInj,
IsFormInj, IsFormInj,
IsKanbanInj,
MetaInj, MetaInj,
ReloadRowDataHookInj, ReloadRowDataHookInj,
computedInject, computedInject,
@ -50,18 +51,20 @@ const fields = computedInject(FieldsInj, (_fields) => {
return _fields?.value ?? [] return _fields?.value ?? []
}) })
const isKanban = inject(IsKanbanInj, ref(false))
provide(MetaInj, meta) provide(MetaInj, meta)
const { commentsDrawer, changedColumns, state: rowState, isNew, loadRow } = useProvideExpandedFormStore(meta, row) const { commentsDrawer, changedColumns, state: rowState, isNew, loadRow } = useProvideExpandedFormStore(meta, row)
if (props.loadRow) { if (props.loadRow) {
await loadRow() loadRow()
} }
if (props.rowId) { if (props.rowId) {
try { try {
await loadRow(props.rowId) loadRow(props.rowId)
} catch (e) { } catch (e: any) {
if (e.response?.status === 404) { if (e.response?.status === 404) {
// todo: i18n // todo: i18n
message.error('Record not found') message.error('Record not found')
@ -108,12 +111,14 @@ reloadHook.on(() => {
provide(ReloadRowDataHookInj, reloadHook) provide(ReloadRowDataHookInj, reloadHook)
// adding column titles to changedColumns if they are preset (e.g. kanban) if (isKanban.value) {
// adding column titles to changedColumns if they are preset
for (const [k, v] of Object.entries(row.value.row)) { for (const [k, v] of Object.entries(row.value.row)) {
if (v) { if (v) {
changedColumns.value.add(k) changedColumns.value.add(k)
} }
} }
}
</script> </script>
<script lang="ts"> <script lang="ts">

5
packages/nc-gui/pages/signup/[[token]].vue

@ -85,7 +85,10 @@ function resetError() {
<div <div
class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)" class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)"
> >
<LazyGeneralNocoIcon class="color-transition hover:(ring ring-accent) hover:(ring ring-accent ring-opacity-100)" :animate="isLoading" /> <LazyGeneralNocoIcon
class="color-transition hover:(ring ring-accent) hover:(ring ring-accent ring-opacity-100)"
:animate="isLoading"
/>
<h1 class="prose-2xl font-bold self-center my-4"> <h1 class="prose-2xl font-bold self-center my-4">
{{ $t('general.signUp') }} {{ $t('general.signUp') }}

Loading…
Cancel
Save