@things-factory/dataset 8.0.26 → 8.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/client/activities/activity-data-collect-edit.ts +18 -32
  2. package/client/activities/activity-data-review-edit.ts +7 -11
  3. package/client/activities/activity-data-review-view.ts +5 -7
  4. package/client/activities/activity-ooc-review-edit.ts +7 -14
  5. package/client/components/checklist-entry-form.ts +109 -0
  6. package/client/components/data-entry-form.ts +2 -49
  7. package/client/pages/data-entry/data-entry-list-page.ts +14 -2
  8. package/client/pages/data-ooc/data-ooc-list-page.ts +2 -2
  9. package/client/pages/data-sample/data-sample-view.ts +6 -9
  10. package/client/pages/data-set/data-set-list-page.ts +19 -3
  11. package/client/route.ts +0 -4
  12. package/dist-client/activities/activity-data-collect-edit.d.ts +1 -1
  13. package/dist-client/activities/activity-data-collect-edit.js +18 -34
  14. package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
  15. package/dist-client/activities/activity-data-review-edit.d.ts +1 -1
  16. package/dist-client/activities/activity-data-review-edit.js +7 -12
  17. package/dist-client/activities/activity-data-review-edit.js.map +1 -1
  18. package/dist-client/activities/activity-data-review-view.js +5 -8
  19. package/dist-client/activities/activity-data-review-view.js.map +1 -1
  20. package/dist-client/activities/activity-ooc-review-edit.js +7 -15
  21. package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
  22. package/dist-client/components/checklist-entry-form.d.ts +21 -0
  23. package/dist-client/components/checklist-entry-form.js +108 -0
  24. package/dist-client/components/checklist-entry-form.js.map +1 -0
  25. package/dist-client/components/data-entry-form.d.ts +0 -6
  26. package/dist-client/components/data-entry-form.js +1 -51
  27. package/dist-client/components/data-entry-form.js.map +1 -1
  28. package/dist-client/pages/data-entry/data-entry-list-page.d.ts +1 -0
  29. package/dist-client/pages/data-entry/data-entry-list-page.js +10 -1
  30. package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
  31. package/dist-client/pages/data-ooc/data-ooc-list-page.js +2 -2
  32. package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
  33. package/dist-client/pages/data-sample/data-sample-view.d.ts +1 -1
  34. package/dist-client/pages/data-sample/data-sample-view.js +6 -10
  35. package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
  36. package/dist-client/pages/data-set/data-set-list-page.d.ts +1 -0
  37. package/dist-client/pages/data-set/data-set-list-page.js +15 -2
  38. package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
  39. package/dist-client/route.js +0 -3
  40. package/dist-client/route.js.map +1 -1
  41. package/dist-client/tsconfig.tsbuildinfo +1 -1
  42. package/dist-server/service/data-ooc/index.d.ts +1 -1
  43. package/dist-server/service/data-set/data-set-mutation.js +2 -2
  44. package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
  45. package/dist-server/service/data-set/data-set.d.ts +1 -0
  46. package/dist-server/service/data-set/data-set.js +5 -0
  47. package/dist-server/service/data-set/data-set.js.map +1 -1
  48. package/dist-server/service/data-set/index.d.ts +1 -1
  49. package/dist-server/service/index.d.ts +2 -2
  50. package/dist-server/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +2 -2
  52. package/server/service/data-set/data-set-mutation.ts +2 -2
  53. package/server/service/data-set/data-set.ts +5 -0
  54. package/client/pages/data-entry/checklist-entry-page.ts +0 -211
@@ -25,7 +25,8 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
25
25
  background-color: var(--md-sys-color-surface);
26
26
  }
27
27
 
28
- ox-data-entry-form {
28
+ ox-data-entry-form,
29
+ ox-checklist-entry-form {
29
30
  flex: 1;
30
31
  padding: 10px;
31
32
  overflow: auto;
@@ -47,12 +48,9 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
47
48
 
48
49
  switch (entryType) {
49
50
  case 'generated':
50
- if (!entryView || entryView === 'Default') {
51
- return this.dataEntryForm
52
- } else if (entryView === 'Checklist') {
53
- return this.checklistEntryForm
54
- }
55
- break
51
+ return this.dataEntryForm
52
+ case 'checklist':
53
+ return this.checklistEntryForm
56
54
  case 'board':
57
55
  break
58
56
  case 'page':
@@ -64,38 +62,26 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
64
62
  }
65
63
 
66
64
  render() {
67
- return html`
68
- <div class="container">
69
- <!-- <ox-data-entry-form
70
- .dataSet=${this.dataSet}
71
- .value=${this.output}
72
- @change=${this._updateDataItems}
73
- ></ox-data-entry-form> -->
74
- ${this.showEntryView()}
75
- </div>
76
- `
65
+ return html` <div class="container">${this.renderEntryForm()}</div> `
77
66
  }
78
67
 
79
- private showEntryView() {
68
+ private renderEntryForm() {
80
69
  const entryType = this.dataSet?.entryType
81
70
  const entryView = this.dataSet?.entryView
82
71
 
83
72
  switch (entryType) {
84
73
  case 'generated':
85
- if (!entryView || entryView === 'Default') {
86
- return html`<ox-data-entry-form
87
- .dataSet=${this.dataSet}
88
- .value=${this.output}
89
- @change=${this._updateDataItems}
90
- ></ox-data-entry-form>`
91
- } else if (entryView === 'Checklist') {
92
- return html`<ox-checklist-entry-form
93
- .dataSet=${this.dataSet}
94
- .value=${this.output}
95
- @change=${this._updateDataItems}
96
- ></ox-checklist-entry-form>`
97
- }
98
- break
74
+ return html`<ox-data-entry-form
75
+ .dataSet=${this.dataSet}
76
+ .value=${this.output}
77
+ @change=${this._updateDataItems}
78
+ ></ox-data-entry-form>`
79
+ case 'checklist':
80
+ return html`<ox-checklist-entry-form
81
+ .dataSet=${this.dataSet}
82
+ .value=${this.output}
83
+ @change=${this._updateDataItems}
84
+ ></ox-checklist-entry-form>`
99
85
  case 'board':
100
86
  break
101
87
  case 'page':
@@ -31,7 +31,8 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
31
31
  overflow: auto;
32
32
  }
33
33
 
34
- ox-data-sample-view {
34
+ ox-data-sample-view,
35
+ ox-checklist-sample-view {
35
36
  flex: 1;
36
37
  padding: var(--spacing-large);
37
38
  overflow: auto;
@@ -114,7 +115,7 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
114
115
  const editable = state == 'unassigned' || state == 'assigned' || state == 'started' || state == 'submitted'
115
116
 
116
117
  return html`
117
- <div content>${this.showDataSampleView()}</div>
118
+ <div content>${this.renderDataSample()}</div>
118
119
 
119
120
  <form @change=${this.onChangeInstruction}>
120
121
  ${editable
@@ -187,26 +188,21 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
187
188
  `
188
189
  }
189
190
 
190
- private showDataSampleView() {
191
+ private renderDataSample() {
191
192
  const dataSet = this.dataSample?.dataSet
192
193
  const monitorType = dataSet?.monitorType
193
- const monitorView = dataSet?.monitorView
194
194
 
195
195
  switch (monitorType) {
196
196
  case 'generated':
197
- if (!monitorView || monitorView === 'Default') {
198
- return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
199
- } else if (monitorView === 'Checklist') {
200
- return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
201
- }
202
- break
197
+ return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
198
+ case 'checklist':
199
+ return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
203
200
  case 'board':
204
201
  break
205
202
  case 'page':
206
203
  break
207
204
  default:
208
205
  return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
209
- break
210
206
  }
211
207
  }
212
208
 
@@ -29,7 +29,8 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
29
29
  overflow: auto;
30
30
  }
31
31
 
32
- ox-data-sample-view {
32
+ ox-data-sample-view,
33
+ ox-checklist-sample-view {
33
34
  flex: 1;
34
35
  padding: var(--spacing-large);
35
36
  overflow: auto;
@@ -233,12 +234,9 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
233
234
 
234
235
  switch (monitorType) {
235
236
  case 'generated':
236
- if (!monitorView || monitorView === 'Default') {
237
- return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
238
- } else if (monitorView === 'Checklist') {
239
- return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
240
- }
241
- break
237
+ return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
238
+ case 'checklist':
239
+ return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
242
240
  case 'board':
243
241
  break
244
242
  case 'page':
@@ -29,7 +29,8 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
29
29
  overflow: auto;
30
30
  }
31
31
 
32
- ox-data-sample-view {
32
+ ox-data-sample-view,
33
+ ox-checklist-sample-view {
33
34
  flex: 1;
34
35
  padding: var(--spacing-large);
35
36
  overflow: auto;
@@ -88,10 +89,7 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
88
89
  const editable = state == 'unassigned' || state == 'assigned' || state == 'started' || state == 'submitted'
89
90
 
90
91
  return html`
91
- <div content>
92
- ${this.showDataSampleView()}
93
- <!-- <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view> -->
94
- </div>
92
+ <div content>${this.renderDataSample()}</div>
95
93
 
96
94
  <label instruction>
97
95
  <h2><md-icon>build_circle</md-icon>&nbsp;<span>${i18next.t('label.corrective instruction')}</span></h2>
@@ -179,26 +177,21 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
179
177
  }
180
178
  }
181
179
 
182
- private showDataSampleView() {
180
+ private renderDataSample() {
183
181
  const dataSet = this.dataOoc?.dataSet
184
182
  const monitorType = dataSet?.monitorType
185
- const monitorView = dataSet?.monitorView
186
183
 
187
184
  switch (monitorType) {
188
185
  case 'generated':
189
- if (!monitorView || monitorView === 'Default') {
190
- return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
191
- } else if (monitorView === 'Checklist') {
192
- return html`<ox-checklist-sample-view .dataSample=${this.dataOoc}></ox-checklist-sample-view>`
193
- }
194
- break
186
+ return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
187
+ case 'checklist':
188
+ return html`<ox-checklist-sample-view .dataSample=${this.dataOoc}></ox-checklist-sample-view>`
195
189
  case 'board':
196
190
  break
197
191
  case 'page':
198
192
  break
199
193
  default:
200
194
  return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
201
- break
202
195
  }
203
196
  }
204
197
  }
@@ -0,0 +1,109 @@
1
+ import '@material/web/icon/icon.js'
2
+ import '@operato/dataset/ox-checklist-entry-form.js'
3
+
4
+ import gql from 'graphql-tag'
5
+ import { css, html, LitElement } from 'lit'
6
+ import { customElement, property, query, state } from 'lit/decorators.js'
7
+
8
+ import { client } from '@operato/graphql'
9
+ import { i18next, localize } from '@operato/i18n'
10
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
11
+ import { DataSet } from '@operato/dataset'
12
+ import { OxChecklistEntryForm } from '@operato/dataset/ox-checklist-entry-form.js'
13
+
14
+ @customElement('checklist-entry-form')
15
+ export class ChecklistEntryForm extends localize(i18next)(LitElement) {
16
+ static styles = [
17
+ CommonHeaderStyles,
18
+ ScrollbarStyles,
19
+ css`
20
+ :host {
21
+ display: flex;
22
+ flex-direction: column;
23
+
24
+ background-color: var(--md-sys-color-surface);
25
+ }
26
+
27
+ ox-checklist-entry-form {
28
+ flex: 1;
29
+ padding: 10px;
30
+ overflow: auto;
31
+ }
32
+
33
+ .footer span {
34
+ font-size: 0.8em;
35
+ color: var(--md-sys-color-on-surface);
36
+ line-height: 1.5;
37
+ padding: 10px;
38
+ }
39
+ `
40
+ ]
41
+
42
+ @property({ type: Object }) dataSet?: DataSet & { id: string; entryType?: string }
43
+
44
+ @state() dataSample?: { id: string; collectedAt: Date }
45
+
46
+ @query('ox-checklist-entry-form') entryForm?: OxChecklistEntryForm
47
+
48
+ render() {
49
+ return html`
50
+ <ox-checklist-entry-form .dataSet=${this.dataSet}></ox-checklist-entry-form>
51
+
52
+ <div class="footer">
53
+ <div filler></div>
54
+ ${!this.dataSample
55
+ ? html`
56
+ <button @click=${this.updateDataItems.bind(this)} done>
57
+ <md-icon>save</md-icon>${i18next.t('button.save')}
58
+ </button>
59
+ `
60
+ : html` <span>${i18next.t('field.collected-at')}: ${this.dataSample.collectedAt.toLocaleString()}</span> `}
61
+ </div>
62
+ `
63
+ }
64
+
65
+ private async updateDataItems() {
66
+ //@ts-ignore TODO replace with following line and confirm
67
+ const data = this.entryForm.buildValue()
68
+
69
+ const dataSample = {
70
+ dataSet: {
71
+ id: this.dataSet?.id
72
+ },
73
+ data
74
+ } as any
75
+
76
+ if (this.dataSample?.collectedAt) {
77
+ dataSample.collectedAt = this.dataSample.collectedAt
78
+ }
79
+
80
+ const response = await client.mutate({
81
+ mutation: gql`
82
+ mutation ($dataSample: NewDataSample!) {
83
+ createDataSample(dataSample: $dataSample) {
84
+ id
85
+ collectedAt
86
+ }
87
+ }
88
+ `,
89
+ variables: {
90
+ dataSample
91
+ },
92
+ context: {
93
+ hasUpload: true
94
+ }
95
+ })
96
+
97
+ if (!response.errors) {
98
+ const { id, collectedAt } = response.data.createDataSample
99
+ this.dataSample = {
100
+ id,
101
+ collectedAt: new Date(collectedAt)
102
+ }
103
+
104
+ document.dispatchEvent(
105
+ new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } })
106
+ )
107
+ }
108
+ }
109
+ }
@@ -1,6 +1,5 @@
1
1
  import '@material/web/icon/icon.js'
2
2
  import '@operato/dataset/ox-data-entry-form.js'
3
- import '@operato/dataset/ox-checklist-entry-form.js'
4
3
 
5
4
  import gql from 'graphql-tag'
6
5
  import { css, html, LitElement } from 'lit'
@@ -11,7 +10,6 @@ import { i18next, localize } from '@operato/i18n'
11
10
  import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
12
11
  import { DataSet } from '@operato/dataset'
13
12
  import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
14
- import { OxChecklistEntryForm } from '@operato/dataset/ox-checklist-entry-form.js'
15
13
 
16
14
  @customElement('data-entry-form')
17
15
  export class DataEntryForm extends localize(i18next)(LitElement) {
@@ -41,38 +39,15 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
41
39
  `
42
40
  ]
43
41
 
44
- @property({ type: Object }) dataSet?: DataSet & { id: string; entryType?: string; entryView?: string }
42
+ @property({ type: Object }) dataSet?: DataSet & { id: string; entryType?: string }
45
43
 
46
44
  @state() dataSample?: { id: string; collectedAt: Date }
47
45
 
48
46
  @query('ox-data-entry-form') dataEntryForm?: OxDataEntryForm
49
- @query('ox-checklist-entry-form') checklistEntryForm?: OxChecklistEntryForm
50
-
51
- get entryForm() {
52
- const entryType = this.dataSet?.entryType
53
- const entryView = this.dataSet?.entryView
54
-
55
- switch (entryType) {
56
- case 'generated':
57
- if (!entryView || entryView === 'Default') {
58
- return this.dataEntryForm
59
- } else if (entryView === 'Checklist') {
60
- return this.checklistEntryForm
61
- }
62
- break
63
- case 'board':
64
- break
65
- case 'page':
66
- break
67
- default:
68
- return this.dataEntryForm
69
- break
70
- }
71
- }
72
47
 
73
48
  render() {
74
49
  return html`
75
- ${this.showEntryView()}
50
+ <ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>
76
51
 
77
52
  <div class="footer">
78
53
  <div filler></div>
@@ -87,28 +62,6 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
87
62
  `
88
63
  }
89
64
 
90
- private showEntryView() {
91
- const entryType = this.dataSet?.entryType
92
- const entryView = this.dataSet?.entryView
93
-
94
- switch (entryType) {
95
- case 'generated':
96
- if (!entryView || entryView === 'Default') {
97
- return html`<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>`
98
- } else if (entryView === 'Checklist') {
99
- return html`<ox-checklist-entry-form .dataSet=${this.dataSet}></ox-checklist-entry-form>`
100
- }
101
- break
102
- case 'board':
103
- break
104
- case 'page':
105
- break
106
- default:
107
- return html`<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>`
108
- break
109
- }
110
- }
111
-
112
65
  private async updateDataItems() {
113
66
  //@ts-ignore TODO replace with following line and confirm
114
67
  const data = this.entryForm.buildValue()
@@ -3,6 +3,7 @@ import '@operato/data-grist'
3
3
  import '@operato/context/ox-context-page-toolbar.js'
4
4
  import '@operato/board/ox-board-viewer.js'
5
5
  import '../../components/data-entry-form.js'
6
+ import '../../components/checklist-entry-form.js'
6
7
 
7
8
  import gql from 'graphql-tag'
8
9
  import { css, html } from 'lit'
@@ -17,8 +18,7 @@ import { i18next, localize } from '@operato/i18n'
17
18
  import { openPopup, notify } from '@operato/layout'
18
19
  import { InheritedValueType, navigate, PageView, store } from '@operato/shell'
19
20
  import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
20
- import { provider } from '@things-factory/board-ui/dist-client'
21
- import { OxPopup } from '@operato/popup'
21
+ import { provider } from '@things-factory/board-ui/dist-client/board-provider.js'
22
22
 
23
23
  const USECASE_OPTIONS = () => {
24
24
  return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
@@ -51,6 +51,18 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
51
51
  })
52
52
  break
53
53
 
54
+ case 'checklist':
55
+ openPopup(
56
+ html` <checklist-entry-form .dataSet=${record} style="background-color: white;"></checklist-entry-form> `,
57
+ {
58
+ closable: true,
59
+ backdrop: true,
60
+ size: 'large',
61
+ title
62
+ }
63
+ )
64
+ break
65
+
54
66
  case 'board':
55
67
  const board = {
56
68
  id: entryView
@@ -213,7 +213,7 @@ export class DataOocListPage extends connect(store)(p13n(localize(i18next)(PageV
213
213
  imex: true
214
214
  },
215
215
  {
216
- type: 'textarea',
216
+ type: 'string',
217
217
  name: 'correctiveInstruction',
218
218
  label: true,
219
219
  header: i18next.t('field.corrective-instruction'),
@@ -225,7 +225,7 @@ export class DataOocListPage extends connect(store)(p13n(localize(i18next)(PageV
225
225
  imex: true
226
226
  },
227
227
  {
228
- type: 'textarea',
228
+ type: 'string',
229
229
  name: 'correctiveAction',
230
230
  label: true,
231
231
  header: i18next.t('field.corrective-action'),
@@ -28,6 +28,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
28
28
  }
29
29
 
30
30
  ox-data-sample-view,
31
+ ox-checklist-sample-view,
31
32
  ox-data-ooc-brief-view {
32
33
  padding: var(--spacing-large);
33
34
  }
@@ -78,7 +79,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
78
79
 
79
80
  return html`
80
81
  ${!dataSample?.dataOoc
81
- ? html`${this.showDataSampleView()}`
82
+ ? html`${this.renderDataSample()}`
82
83
  : html` <ox-data-ooc-brief-view .dataOoc=${dataSample!.dataOoc}></ox-data-ooc-brief-view>`}
83
84
  ${reviewActivityThread
84
85
  ? html`
@@ -119,19 +120,15 @@ export class DataSampleView extends localize(i18next)(LitElement) {
119
120
  }
120
121
  }
121
122
 
122
- private showDataSampleView() {
123
+ private renderDataSample() {
123
124
  const dataSet = this.dataSample?.dataSet
124
125
  const monitorType = dataSet?.monitorType
125
- const monitorView = dataSet?.monitorView
126
126
 
127
127
  switch (monitorType) {
128
128
  case 'generated':
129
- if (!monitorView || monitorView === 'Default') {
130
- return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
131
- } else if (monitorView === 'Checklist') {
132
- return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
133
- }
134
- break
129
+ return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
130
+ case 'checklist':
131
+ return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
135
132
  case 'board':
136
133
  break
137
134
  case 'page':
@@ -4,6 +4,7 @@ import '@operato/context/ox-context-page-toolbar.js'
4
4
  import './data-item-list.js'
5
5
  import './data-set-importer.js'
6
6
  import '../../components/data-entry-form.js'
7
+ import '../../components/checklist-entry-form.js'
7
8
 
8
9
  import gql from 'graphql-tag'
9
10
  import { css, html } from 'lit'
@@ -19,7 +20,7 @@ import { i18next, localize } from '@operato/i18n'
19
20
  import { notify, openPopup } from '@operato/layout'
20
21
  import { PageView, store, navigate } from '@operato/shell'
21
22
  import { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
22
- import { isMobileDevice, sleep } from '@operato/utils'
23
+ import { isMobileDevice, sleep, adjustFilters } from '@operato/utils'
23
24
 
24
25
  import { p13n } from '@operato/p13n'
25
26
  import { provider } from '@things-factory/board-ui/dist-client'
@@ -47,6 +48,7 @@ const TIMEZONE_OPTIONS = ['', DEFAULT_TZ, ...moment.tz.names().filter(tz => tz !
47
48
  const ENTRY_TYPES = [
48
49
  { display: '', value: '' },
49
50
  { display: 'Generated', value: 'generated' },
51
+ { display: 'Checklist', value: 'checklist' },
50
52
  { display: 'Board', value: 'board' },
51
53
  { display: 'CustomElement', value: 'custom-element' },
52
54
  { display: 'Page', value: 'page' },
@@ -56,6 +58,7 @@ const ENTRY_TYPES = [
56
58
  const MONITOR_TYPES = [
57
59
  { display: '', value: '' },
58
60
  { display: 'Generated', value: 'generated' },
61
+ { display: 'Checklist', value: 'checklist' },
59
62
  { display: 'Board', value: 'board' },
60
63
  { display: 'CustomElement', value: 'custom-element' },
61
64
  { display: 'Page', value: 'page' },
@@ -103,6 +106,17 @@ export const showEntryView = async (columns, data, column, record, rowIndex) =>
103
106
  title
104
107
  })
105
108
  break
109
+ case 'checklist':
110
+ openPopup(
111
+ html` <checklist-entry-form .dataSet=${record} style="background-color: white;"></checklist-entry-form> `,
112
+ {
113
+ closable: true,
114
+ backdrop: true,
115
+ size: 'large',
116
+ title
117
+ }
118
+ )
119
+ break
106
120
 
107
121
  case 'board':
108
122
  const board = {
@@ -228,7 +242,6 @@ export class DataSetListPage extends connect(store)(p13n(localize(i18next)(PageV
228
242
  .config=${this.gristConfig}
229
243
  .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}
230
244
  .fetchHandler=${this.fetchHandler.bind(this)}
231
- ?url-params-sensitive=${this.active}
232
245
  >
233
246
  <div slot="headroom" class="header">
234
247
  <div class="filters">
@@ -365,7 +378,10 @@ export class DataSetListPage extends connect(store)(p13n(localize(i18next)(PageV
365
378
  record: {
366
379
  editable: true
367
380
  },
368
- filter: true,
381
+ filter: {
382
+ type: 'boolean',
383
+ value: true
384
+ },
369
385
  sortable: true,
370
386
  width: 60,
371
387
  imex: {
package/client/route.ts CHANGED
@@ -56,10 +56,6 @@ export default function route(page) {
56
56
  import('./pages/data-entry/data-entry-list-page.js')
57
57
  return page
58
58
 
59
- case 'checklist-entry-page':
60
- import('./pages/data-entry/checklist-entry-page')
61
- return page
62
-
63
59
  case 'data-report-list':
64
60
  import('./pages/data-report/data-report-list-page.js')
65
61
  return page
@@ -18,7 +18,7 @@ export declare class DataCollectActivityEdit extends DataCollectActivityEdit_bas
18
18
  checklistEntryForm?: OxChecklistEntryForm;
19
19
  get entryForm(): OxDataEntryForm | OxChecklistEntryForm | undefined;
20
20
  render(): import("lit-html").TemplateResult<1>;
21
- private showEntryView;
21
+ private renderEntryForm;
22
22
  _updateDataItems(e: CustomEvent): Promise<void>;
23
23
  updated(changes: any): void;
24
24
  fetchDataSet(): Promise<void>;
@@ -16,13 +16,9 @@ let DataCollectActivityEdit = class DataCollectActivityEdit extends localize(i18
16
16
  const entryView = (_b = this.dataSet) === null || _b === void 0 ? void 0 : _b.entryView;
17
17
  switch (entryType) {
18
18
  case 'generated':
19
- if (!entryView || entryView === 'Default') {
20
- return this.dataEntryForm;
21
- }
22
- else if (entryView === 'Checklist') {
23
- return this.checklistEntryForm;
24
- }
25
- break;
19
+ return this.dataEntryForm;
20
+ case 'checklist':
21
+ return this.checklistEntryForm;
26
22
  case 'board':
27
23
  break;
28
24
  case 'page':
@@ -33,38 +29,25 @@ let DataCollectActivityEdit = class DataCollectActivityEdit extends localize(i18
33
29
  }
34
30
  }
35
31
  render() {
36
- return html `
37
- <div class="container">
38
- <!-- <ox-data-entry-form
39
- .dataSet=${this.dataSet}
40
- .value=${this.output}
41
- @change=${this._updateDataItems}
42
- ></ox-data-entry-form> -->
43
- ${this.showEntryView()}
44
- </div>
45
- `;
32
+ return html ` <div class="container">${this.renderEntryForm()}</div> `;
46
33
  }
47
- showEntryView() {
34
+ renderEntryForm() {
48
35
  var _a, _b;
49
36
  const entryType = (_a = this.dataSet) === null || _a === void 0 ? void 0 : _a.entryType;
50
37
  const entryView = (_b = this.dataSet) === null || _b === void 0 ? void 0 : _b.entryView;
51
38
  switch (entryType) {
52
39
  case 'generated':
53
- if (!entryView || entryView === 'Default') {
54
- return html `<ox-data-entry-form
55
- .dataSet=${this.dataSet}
56
- .value=${this.output}
57
- @change=${this._updateDataItems}
58
- ></ox-data-entry-form>`;
59
- }
60
- else if (entryView === 'Checklist') {
61
- return html `<ox-checklist-entry-form
62
- .dataSet=${this.dataSet}
63
- .value=${this.output}
64
- @change=${this._updateDataItems}
65
- ></ox-checklist-entry-form>`;
66
- }
67
- break;
40
+ return html `<ox-data-entry-form
41
+ .dataSet=${this.dataSet}
42
+ .value=${this.output}
43
+ @change=${this._updateDataItems}
44
+ ></ox-data-entry-form>`;
45
+ case 'checklist':
46
+ return html `<ox-checklist-entry-form
47
+ .dataSet=${this.dataSet}
48
+ .value=${this.output}
49
+ @change=${this._updateDataItems}
50
+ ></ox-checklist-entry-form>`;
68
51
  case 'board':
69
52
  break;
70
53
  case 'page':
@@ -140,7 +123,8 @@ DataCollectActivityEdit.styles = [
140
123
  background-color: var(--md-sys-color-surface);
141
124
  }
142
125
 
143
- ox-data-entry-form {
126
+ ox-data-entry-form,
127
+ ox-checklist-entry-form {
144
128
  flex: 1;
145
129
  padding: 10px;
146
130
  overflow: auto;