From 3dd7169b8b7619e3add66d37db1866cd1fc3f7db Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Fri, 13 Mar 2020 23:09:01 -0500 Subject: [PATCH] WIP Adding support for Text entry measurements (renamed from List). --- .../measure-config/MeasureConfigForm.vue | 4 +- .../measure-config/TextMeasureConfigForm.vue | 10 +++++ .../measure-config/measure-config-form.ts | 7 +++- .../text-measure-config-form.ts | 17 ++++++++ .../measure-summaries/ListSummary.vue | 6 --- .../measure-summaries/MeasureSummary.vue | 2 +- .../measure-summaries/TextSummary.vue | 13 +++++++ .../measure-summaries/list-summary.ts | 16 -------- .../measure-summaries/measure-summary.ts | 4 +- .../measure-summaries/text-summary.scss | 39 +++++++++++++++++++ .../measure-summaries/text-summary.ts | 33 ++++++++++++++++ .../measurement-entry/MeasurementEntry.vue | 2 + .../measurement-entry/SimpleEntry.vue | 4 +- .../measurement-entry/TextEntry.vue | 26 +++++++++++++ .../measurement-entry/measurement-entry.ts | 6 ++- .../measurement-entry/simple-entry.ts | 2 - .../measurement-entry/text-entry.ts | 13 +++++++ web/src/models.d.ts | 7 ++-- web/src/store-modules/measure.ts | 3 +- web/src/views/Measures.vue | 5 +-- web/src/views/new-measurement.ts | 4 +- 21 files changed, 179 insertions(+), 44 deletions(-) create mode 100644 web/src/components/measure-config/TextMeasureConfigForm.vue create mode 100644 web/src/components/measure-config/text-measure-config-form.ts delete mode 100644 web/src/components/measure-summaries/ListSummary.vue create mode 100644 web/src/components/measure-summaries/TextSummary.vue delete mode 100644 web/src/components/measure-summaries/list-summary.ts create mode 100644 web/src/components/measure-summaries/text-summary.scss create mode 100644 web/src/components/measure-summaries/text-summary.ts create mode 100644 web/src/components/measurement-entry/TextEntry.vue create mode 100644 web/src/components/measurement-entry/text-entry.ts diff --git a/web/src/components/measure-config/MeasureConfigForm.vue b/web/src/components/measure-config/MeasureConfigForm.vue index 8bb5e24..b127e1e 100644 --- a/web/src/components/measure-config/MeasureConfigForm.vue +++ b/web/src/components/measure-config/MeasureConfigForm.vue @@ -7,14 +7,14 @@ name=measureType v-model=value.type> - +
- + diff --git a/web/src/components/measure-config/TextMeasureConfigForm.vue b/web/src/components/measure-config/TextMeasureConfigForm.vue new file mode 100644 index 0000000..76a0587 --- /dev/null +++ b/web/src/components/measure-config/TextMeasureConfigForm.vue @@ -0,0 +1,10 @@ + + diff --git a/web/src/components/measure-config/measure-config-form.ts b/web/src/components/measure-config/measure-config-form.ts index 951ffd4..e8518dd 100644 --- a/web/src/components/measure-config/measure-config-form.ts +++ b/web/src/components/measure-config/measure-config-form.ts @@ -1,8 +1,13 @@ import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator'; import { logService } from '@/services/logging'; import { Measure, MeasureConfig } from '@/models'; +import TextMeasureConfigForm from './TextMeasureConfigForm.vue'; -@Component({}) +@Component({ + components: { + TextMeasureConfigForm + } +}) export class MeasureConfigForm extends Vue { @Prop({}) public value!: MeasureConfig; @Prop({}) public disabled: boolean = false; diff --git a/web/src/components/measure-config/text-measure-config-form.ts b/web/src/components/measure-config/text-measure-config-form.ts new file mode 100644 index 0000000..22eef21 --- /dev/null +++ b/web/src/components/measure-config/text-measure-config-form.ts @@ -0,0 +1,17 @@ +import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator'; +import { logService } from '@/services/logging'; +import { Measure, MeasureConfig, TextMeasureConfig } from '@/models'; + +@Component({}) +export class TextMeasureConfigForm extends Vue { + @Prop({}) public value!: MeasureConfig; + @Prop({}) public disabled: boolean = false; + + @Watch('value', { immediate: true, deep: true }) + @Emit('input') + private onConfigChanged(newVal: TextMeasureConfig, oldVal: TextMeasureConfig) { + return newVal; + } +} + +export default TextMeasureConfigForm; diff --git a/web/src/components/measure-summaries/ListSummary.vue b/web/src/components/measure-summaries/ListSummary.vue deleted file mode 100644 index 525c279..0000000 --- a/web/src/components/measure-summaries/ListSummary.vue +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/web/src/components/measure-summaries/MeasureSummary.vue b/web/src/components/measure-summaries/MeasureSummary.vue index f03faaa..74b7876 100644 --- a/web/src/components/measure-summaries/MeasureSummary.vue +++ b/web/src/components/measure-summaries/MeasureSummary.vue @@ -5,7 +5,7 @@ {{measure.name}} - diff --git a/web/src/components/measure-summaries/TextSummary.vue b/web/src/components/measure-summaries/TextSummary.vue new file mode 100644 index 0000000..e1784e2 --- /dev/null +++ b/web/src/components/measure-summaries/TextSummary.vue @@ -0,0 +1,13 @@ + + +