diff --git a/client/web/compose/src/components/Admin/Module/FieldRowEdit.vue b/client/web/compose/src/components/Admin/Module/FieldRowEdit.vue
index d9d2bd4ee..49a9abb05 100644
--- a/client/web/compose/src/components/Admin/Module/FieldRowEdit.vue
+++ b/client/web/compose/src/components/Admin/Module/FieldRowEdit.vue
@@ -16,7 +16,7 @@
@@ -49,19 +49,16 @@
a.label.localeCompare(b.label))
},
- exists () {
- return this.module.ID !== NoID && this.value.fieldID !== NoID
- },
-
isEditDisabled () {
return !this.value.cap.configurable || this.nameState !== null
},
diff --git a/client/web/compose/src/components/ModuleFields/Configurator/DateTime.vue b/client/web/compose/src/components/ModuleFields/Configurator/DateTime.vue
index 7e24aa452..a4c660f81 100644
--- a/client/web/compose/src/components/ModuleFields/Configurator/DateTime.vue
+++ b/client/web/compose/src/components/ModuleFields/Configurator/DateTime.vue
@@ -1,58 +1,72 @@
-
- {{ $t('kind.dateTime.dateOnly') }}
-
-
- {{ $t('kind.dateTime.timeOnly') }}
-
-
-
- {{ $t('kind.dateTime.pastValuesOnly') }}
-
-
- {{ $t('kind.dateTime.futureValuesOnly') }}
-
-
-
- {{ $t('kind.dateTime.relativeOutput') }}
-
+
+
+
+
+
+
-
+
+ {{ $t('kind.dateTime.relativeOutput') }}
+
-
-
- Moment.js
-
+
+
+
+
@@ -67,5 +81,33 @@ export default {
},
extends: base,
+
+ computed: {
+ inputType () {
+ if (this.f.options.onlyDate) return 'date'
+ if (this.f.options.onlyTime) return 'time'
+
+ return 'dateTime'
+ },
+
+ constraintType () {
+ if (this.f.options.onlyPastValues) return 'pastValuesOnly'
+ if (this.f.options.onlyFutureValues) return 'futureValuesOnly'
+
+ return 'all'
+ },
+ },
+
+ methods: {
+ onTypeChange (v) {
+ this.f.options.onlyDate = v === 'date'
+ this.f.options.onlyTime = v === 'time'
+ },
+
+ onConstraintChange (v) {
+ this.f.options.onlyPastValues = v === 'pastValuesOnly'
+ this.f.options.onlyFutureValues = v === 'futureValuesOnly'
+ },
+ },
}
diff --git a/client/web/compose/src/components/ModuleFields/Configurator/Number.vue b/client/web/compose/src/components/ModuleFields/Configurator/Number.vue
index 2b6666081..0037e00db 100644
--- a/client/web/compose/src/components/ModuleFields/Configurator/Number.vue
+++ b/client/web/compose/src/components/ModuleFields/Configurator/Number.vue
@@ -23,13 +23,13 @@
lg="6"
>
-
- {{ `${$t('kind.number.precisionLabel')} ${(f.options.precision)}` }}
-
-import { compose } from '@cortezaproject/corteza-js'
+import { compose, NoID } from '@cortezaproject/corteza-js'
export default {
props: {
@@ -17,6 +17,11 @@ export default {
type: compose.ModuleField,
required: true,
},
+
+ hasRecords: {
+ type: Boolean,
+ default: false,
+ },
},
computed: {
@@ -29,6 +34,14 @@ export default {
this.$emit('update:field', f)
},
},
+
+ isNew () {
+ return this.module.moduleID === NoID || this.field.fieldID === NoID
+ },
+
+ hasData () {
+ return !this.isNew && this.hasRecords
+ },
},
}
diff --git a/client/web/compose/src/components/ModuleFields/Configurator/index.vue b/client/web/compose/src/components/ModuleFields/Configurator/index.vue
index f12f390c8..b6d03fe25 100644
--- a/client/web/compose/src/components/ModuleFields/Configurator/index.vue
+++ b/client/web/compose/src/components/ModuleFields/Configurator/index.vue
@@ -24,6 +24,7 @@
:namespace="namespace"
:module="module"
:field.sync="f"
+ :has-records="hasRecords"
/>
diff --git a/client/web/compose/src/views/Admin/Modules/Edit.vue b/client/web/compose/src/views/Admin/Modules/Edit.vue
index 76d23cbd6..5e0a3fb8c 100644
--- a/client/web/compose/src/views/Admin/Modules/Edit.vue
+++ b/client/web/compose/src/views/Admin/Modules/Edit.vue
@@ -403,6 +403,7 @@
:module="module"
:connection="connection"
:sensitivity-levels="sensitivityLevels"
+ :has-records="hasRecords"
/>
diff --git a/lib/vue/src/components/input/CInputDateTime/index.vue b/lib/vue/src/components/input/CInputDateTime/index.vue
index dfbc5acaf..700ddce47 100644
--- a/lib/vue/src/components/input/CInputDateTime/index.vue
+++ b/lib/vue/src/components/input/CInputDateTime/index.vue
@@ -1,5 +1,5 @@
-