Browse Source

feat: integrate after form submit options in shared form view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/642/head
Pranav C 3 years ago
parent
commit
69cc533c8e
  1. 1
      packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
  2. 29
      packages/nc-gui/components/project/spreadsheet/public/xcForm.vue
  3. 1
      packages/nc-gui/pages/nc/form/_id.vue
  4. 1
      packages/nc-gui/pages/nc/view/_id.vue

1
packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

@ -746,6 +746,7 @@ export default {
}, },
async genShareLink() { async genShareLink() {
this.showShareModel = true this.showShareModel = true
debugger
const sharedViewUrl = await this.$store.dispatch('sqlMgr/ActSqlOp', [ const sharedViewUrl = await this.$store.dispatch('sqlMgr/ActSqlOp', [
{ dbAlias: this.nodes.dbAlias }, { dbAlias: this.nodes.dbAlias },
'createSharedViewLink', 'createSharedViewLink',

29
packages/nc-gui/components/project/spreadsheet/public/xcForm.vue

@ -89,7 +89,7 @@
:is-form="true" :is-form="true"
:value="localParams.fields[col.alias].label || col._cn" :value="localParams.fields[col.alias].label || col._cn"
:column="col" :column="col"
:sql-ui="sqlUi" :sql-ui="sqlUiLoc"
:required="isRequired(col, localState, localParams.fields[col.alias].required)" :required="isRequired(col, localState, localParams.fields[col.alias].required)"
/> />
@ -107,7 +107,7 @@
:meta="meta" :meta="meta"
:api="api" :api="api"
:active="true" :active="true"
:sql-ui="sqlUi" :sql-ui="sqlUiLoc"
:is-new="true" :is-new="true"
is-form is-form
is-public is-public
@ -163,7 +163,7 @@
:column="col" :column="col"
class="xc-input body-2" class="xc-input body-2"
:meta="meta" :meta="meta"
:sql-ui="sqlUi" :sql-ui="sqlUiLoc"
is-form is-form
:hint="localParams.fields[col.alias].description" :hint="localParams.fields[col.alias].description"
@focus="active = col._cn" @focus="active = col._cn"
@ -215,6 +215,7 @@ export default {
active: null, active: null,
loading: false, loading: false,
submitting: false, submitting: false,
submitted: false,
client: null, client: null,
meta: null, meta: null,
columns: [], columns: [],
@ -223,16 +224,30 @@ export default {
localState: {}, localState: {},
dbAlias: '', dbAlias: '',
virtual: {}, virtual: {},
metas: {} metas: {},
secondsRemain: null
} }
}, },
computed: { computed: {
sqlUi() { sqlUiLoc() {
// todo: replace with correct client // todo: replace with correct client
return this.client && SqlUI.create({ client: this.client }) return this.client && SqlUI.create({ client: this.client })
} }
}, },
watch: {
submitted(val) {
if (val && this.localParams.submit.showBlankForm) {
this.secondsRemain = 5
const intvl = setInterval(() => {
if (--this.secondsRemain < 0) {
this.submitted = false
clearInterval(intvl)
}
}, 1000)
}
}
},
async mounted() { async mounted() {
await this.loadMetaData() await this.loadMetaData()
}, },
@ -291,9 +306,9 @@ export default {
} }
}) })
} }
debugger
// this.modelName = model_name // this.modelName = model_name
this.columns = columns.filter(c => fields.includes(c.alias)) this.columns = columns.filter(c => fields.includes(c.alias)).sort((a, b) => fields.indexOf(a.alias) - fields.indexOf(b.alias))
this.localParams = (this.query_params.extraViewParams && this.query_params.extraViewParams.formParams) || {} this.localParams = (this.query_params.extraViewParams && this.query_params.extraViewParams.formParams) || {}
} catch (e) { } catch (e) {

1
packages/nc-gui/pages/nc/form/_id.vue

@ -6,7 +6,6 @@
import XcForm from '../../../components/project/spreadsheet/public/xcForm' import XcForm from '../../../components/project/spreadsheet/public/xcForm'
export default { export default {
name: 'View',
components: { XcForm }, components: { XcForm },
layout: 'public', layout: 'public',
data: () => ({ data: () => ({

1
packages/nc-gui/pages/nc/view/_id.vue

@ -6,7 +6,6 @@
import XcTable from '../../../components/project/spreadsheet/public/xcTable' import XcTable from '../../../components/project/spreadsheet/public/xcTable'
export default { export default {
name: 'View',
components: { XcTable }, components: { XcTable },
layout: 'public', layout: 'public',
data: () => ({ data: () => ({

Loading…
Cancel
Save