@things-factory/dataset 6.2.29 → 6.2.30

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 (64) hide show
  1. package/client/activities/activity-data-collect-assign-edit.ts +99 -0
  2. package/client/activities/activity-data-collect-assign-view.ts +99 -0
  3. package/client/bootstrap.ts +2 -1
  4. package/client/pages/data-entry/data-entry-list-page.ts +17 -23
  5. package/client/pages/data-ooc/data-ooc-list-page.ts +16 -31
  6. package/client/pages/data-sensor/data-sensor-list-page.ts +40 -32
  7. package/client/pages/data-set/data-set-list-page.ts +23 -12
  8. package/client/pages/data-summary/data-summary-list-page.ts +15 -30
  9. package/client/pages/data-summary/data-summary-period-page.ts +0 -11
  10. package/client/pages/data-summary/data-summary-search-page.ts +12 -27
  11. package/dist-client/activities/activity-data-collect-assign-edit.d.ts +14 -0
  12. package/dist-client/activities/activity-data-collect-assign-edit.js +102 -0
  13. package/dist-client/activities/activity-data-collect-assign-edit.js.map +1 -0
  14. package/dist-client/activities/activity-data-collect-assign-view.d.ts +14 -0
  15. package/dist-client/activities/activity-data-collect-assign-view.js +102 -0
  16. package/dist-client/activities/activity-data-collect-assign-view.js.map +1 -0
  17. package/dist-client/bootstrap.d.ts +2 -0
  18. package/dist-client/bootstrap.js +2 -0
  19. package/dist-client/bootstrap.js.map +1 -1
  20. package/dist-client/pages/data-entry/data-entry-list-page.d.ts +3 -2
  21. package/dist-client/pages/data-entry/data-entry-list-page.js +16 -26
  22. package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
  23. package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +5 -4
  24. package/dist-client/pages/data-ooc/data-ooc-list-page.js +13 -32
  25. package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
  26. package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +12 -5
  27. package/dist-client/pages/data-sensor/data-sensor-list-page.js +41 -35
  28. package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
  29. package/dist-client/pages/data-set/data-set-list-page.js +22 -3
  30. package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
  31. package/dist-client/pages/data-summary/data-summary-list-page.d.ts +4 -3
  32. package/dist-client/pages/data-summary/data-summary-list-page.js +18 -37
  33. package/dist-client/pages/data-summary/data-summary-list-page.js.map +1 -1
  34. package/dist-client/pages/data-summary/data-summary-period-page.js +0 -11
  35. package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
  36. package/dist-client/pages/data-summary/data-summary-search-page.d.ts +2 -1
  37. package/dist-client/pages/data-summary/data-summary-search-page.js +12 -31
  38. package/dist-client/pages/data-summary/data-summary-search-page.js.map +1 -1
  39. package/dist-client/tsconfig.tsbuildinfo +1 -1
  40. package/dist-server/activities/activity-data-collect-assign.js +85 -0
  41. package/dist-server/activities/activity-data-collect-assign.js.map +1 -0
  42. package/dist-server/activities/activity-ooc-review.js +3 -2
  43. package/dist-server/activities/activity-ooc-review.js.map +1 -1
  44. package/dist-server/controllers/create-data-sample.js +59 -5
  45. package/dist-server/controllers/create-data-sample.js.map +1 -1
  46. package/dist-server/service/data-set/data-set-mutation.js +36 -6
  47. package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
  48. package/dist-server/service/data-set/data-set-type.js +8 -0
  49. package/dist-server/service/data-set/data-set-type.js.map +1 -1
  50. package/dist-server/service/data-set/data-set.js +10 -2
  51. package/dist-server/service/data-set/data-set.js.map +1 -1
  52. package/dist-server/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +9 -9
  54. package/server/activities/activity-data-collect-assign.ts +98 -0
  55. package/server/activities/activity-ooc-review.ts +4 -3
  56. package/server/controllers/create-data-sample.ts +64 -6
  57. package/server/service/data-set/data-set-mutation.ts +41 -3
  58. package/server/service/data-set/data-set-type.ts +7 -1
  59. package/server/service/data-set/data-set.ts +9 -2
  60. package/translations/en.json +1 -0
  61. package/translations/ja.json +1 -0
  62. package/translations/ko.json +1 -0
  63. package/translations/ms.json +1 -0
  64. package/translations/zh.json +1 -0
@@ -41,17 +41,6 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
41
41
  overflow-y: auto;
42
42
  flex: 1;
43
43
  }
44
-
45
- .header {
46
- grid-template-areas:
47
- 'titler actions'
48
- 'filters filters';
49
- }
50
-
51
- .header .actions {
52
- display: flex;
53
- flex-direction: row-reverse;
54
- }
55
44
  `
56
45
  ]
57
46
 
@@ -1,4 +1,5 @@
1
1
  import '@operato/data-grist'
2
+ import '@operato/context/ox-context-page-toolbar.js'
2
3
  import './data-summary-view.js'
3
4
  import moment from 'moment-timezone'
4
5
 
@@ -20,7 +21,7 @@ import { client } from '@operato/graphql'
20
21
  import { i18next, localize } from '@operato/i18n'
21
22
  import { openPopup } from '@operato/layout'
22
23
  import { PageView, store } from '@operato/shell'
23
- import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
24
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
24
25
  import { isMobileDevice } from '@operato/utils'
25
26
  import { OxPopup } from '@operato/popup'
26
27
  import { DataItem } from '@operato/dataset'
@@ -36,7 +37,7 @@ enum DataSetSummaryPeriodType {
36
37
  export class DataSummarySearchPage extends connect(store)(localize(i18next)(PageView)) {
37
38
  static styles = [
38
39
  ScrollbarStyles,
39
- CommonGristStyles,
40
+ CommonHeaderStyles,
40
41
  css`
41
42
  :host {
42
43
  display: flex;
@@ -62,7 +63,6 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
62
63
  @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
63
64
 
64
65
  @query('ox-grist') private grist!: DataGrist
65
- @query('#sorter-control') private sortersControl!: OxPopup
66
66
 
67
67
  get context() {
68
68
  return {
@@ -83,7 +83,8 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
83
83
  exportable: {
84
84
  name: i18next.t('title.data-summary search'),
85
85
  data: this._exportableData.bind(this)
86
- }
86
+ },
87
+ toolbar: false
87
88
  }
88
89
  }
89
90
 
@@ -92,33 +93,17 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
92
93
 
93
94
  return html`
94
95
  <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
95
- <div slot="headroom">
96
- <div id="filters">
97
- <ox-filters-form autofocus without-search></ox-filters-form>
96
+ <div slot="headroom" class="header">
97
+ <div class="title">
98
+ <mwc-icon>summarize</mwc-icon>
99
+ ${i18next.t('title.data-summary search')}
98
100
  </div>
99
101
 
100
- <div id="sorters">
101
- Sort
102
- <mwc-icon
103
- @click=${e => {
104
- const target = e.currentTarget
105
- this.sortersControl.open({
106
- right: 0,
107
- top: target.offsetTop + target.offsetHeight
108
- })
109
- }}
110
- >expand_more</mwc-icon
111
- >
112
- <ox-popup id="sorter-control">
113
- <ox-sorters-control> </ox-sorters-control>
114
- </ox-popup>
102
+ <div class="filters">
103
+ <ox-filters-form autofocus without-search></ox-filters-form>
115
104
  </div>
116
105
 
117
- <div id="modes">
118
- <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
119
- <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
120
- <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
121
- </div>
106
+ <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
122
107
  </div>
123
108
  </ox-grist>
124
109
  `
@@ -0,0 +1,14 @@
1
+ import '@operato/dataset/ox-data-entry-form.js';
2
+ import { LitElement } from 'lit';
3
+ declare const DataCollectAssignActivityEdit_base: (new (...args: any[]) => LitElement) & typeof LitElement;
4
+ export declare class DataCollectAssignActivityEdit extends DataCollectAssignActivityEdit_base {
5
+ static styles: import("lit").CSSResult[];
6
+ input?: any;
7
+ output?: any;
8
+ dataReview?: any;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ onChangeInstruction(e: Event): void;
11
+ updated(changes: any): void;
12
+ fetchDataAssign(): Promise<void>;
13
+ }
14
+ export {};
@@ -0,0 +1,102 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/dataset/ox-data-entry-form.js';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property, state } from 'lit/decorators.js';
5
+ import { i18next, localize } from '@operato/i18n';
6
+ import { ScrollbarStyles } from '@operato/styles';
7
+ let DataCollectAssignActivityEdit = class DataCollectAssignActivityEdit extends localize(i18next)(LitElement) {
8
+ render() {
9
+ return html `
10
+ <div content>
11
+ <ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>
12
+ </div>
13
+ `;
14
+ }
15
+ onChangeInstruction(e) {
16
+ this.output || (this.output = {});
17
+ this.output.instruction = e.target.value;
18
+ this.dispatchEvent(new CustomEvent('change', {
19
+ detail: this.output
20
+ }));
21
+ }
22
+ updated(changes) {
23
+ if (changes.has('input')) {
24
+ this.fetchDataAssign();
25
+ }
26
+ }
27
+ async fetchDataAssign() {
28
+ var _a;
29
+ const dataSample = (_a = this.input) === null || _a === void 0 ? void 0 : _a.dataSample;
30
+ this.dataReview = dataSample;
31
+ }
32
+ };
33
+ DataCollectAssignActivityEdit.styles = [
34
+ ScrollbarStyles,
35
+ css `
36
+ :host {
37
+ display: flex;
38
+ flex-direction: column;
39
+
40
+ background-color: #fff;
41
+ }
42
+
43
+ div[content] {
44
+ flex: 1;
45
+ flex-direction: column;
46
+
47
+ display: flex;
48
+ overflow: auto;
49
+ }
50
+
51
+ ox-data-sample-view {
52
+ flex: 1;
53
+ padding: var(--padding-wide);
54
+ overflow: auto;
55
+ }
56
+
57
+ label[instruction] {
58
+ display: flex;
59
+ flex-direction: column;
60
+
61
+ padding: var(--padding-wide);
62
+ }
63
+
64
+ label[instruction] div {
65
+ display: flex;
66
+ }
67
+
68
+ mwc-icon {
69
+ color: var(--status-danger-color);
70
+ }
71
+
72
+ textarea {
73
+ border: var(--input-field-border);
74
+ border-radius: var(--input-border-radius);
75
+ padding: var(--input-field-padding);
76
+ font: var(--input-field-font);
77
+ }
78
+
79
+ .button-container {
80
+ display: flex;
81
+ margin-left: auto;
82
+ padding: var(--padding-default);
83
+ }
84
+ `
85
+ ];
86
+ __decorate([
87
+ property({ type: Object }),
88
+ __metadata("design:type", Object)
89
+ ], DataCollectAssignActivityEdit.prototype, "input", void 0);
90
+ __decorate([
91
+ property({ type: Object }),
92
+ __metadata("design:type", Object)
93
+ ], DataCollectAssignActivityEdit.prototype, "output", void 0);
94
+ __decorate([
95
+ state(),
96
+ __metadata("design:type", Object)
97
+ ], DataCollectAssignActivityEdit.prototype, "dataReview", void 0);
98
+ DataCollectAssignActivityEdit = __decorate([
99
+ customElement('activity-data-collect-assign-edit')
100
+ ], DataCollectAssignActivityEdit);
101
+ export { DataCollectAssignActivityEdit };
102
+ //# sourceMappingURL=activity-data-collect-assign-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-data-collect-assign-edit.js","sourceRoot":"","sources":["../../client/activities/activity-data-collect-assign-edit.ts"],"names":[],"mappings":";AAAA,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG1C,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IA4D9E,MAAM;QACJ,OAAO,IAAI,CAAA;;2CAE4B,IAAI,CAAC,UAAU;;KAErD,CAAA;IACH,CAAC;IAED,mBAAmB,CAAC,CAAQ;QAC1B,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,EAAE,EAAA;QAClB,IAAI,CAAC,MAAM,CAAC,WAAW,GAAI,CAAC,CAAC,MAA8B,CAAC,KAAK,CAAA;QAEjE,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,eAAe,EAAE,CAAA;SACvB;IACH,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU,CAAA;QACzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;;AAvFM,oCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAa;AAExC;IAAC,KAAK,EAAE;;iEAAiB;AA1Dd,6BAA6B;IADzC,aAAa,CAAC,mCAAmC,CAAC;GACtC,6BAA6B,CAyFzC;SAzFY,6BAA6B","sourcesContent":["import '@operato/dataset/ox-data-entry-form.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-data-collect-assign-edit')\nexport class DataCollectAssignActivityEdit extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n div[content] {\n flex: 1;\n flex-direction: column;\n\n display: flex;\n overflow: auto;\n }\n\n ox-data-sample-view {\n flex: 1;\n padding: var(--padding-wide);\n overflow: auto;\n }\n\n label[instruction] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n label[instruction] div {\n display: flex;\n }\n\n mwc-icon {\n color: var(--status-danger-color);\n }\n\n textarea {\n border: var(--input-field-border);\n border-radius: var(--input-border-radius);\n padding: var(--input-field-padding);\n font: var(--input-field-font);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n\n @state() dataReview?: any\n\n render() {\n return html`\n <div content>\n <ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>\n </div>\n `\n }\n\n onChangeInstruction(e: Event) {\n this.output ||= {}\n this.output.instruction = (e.target as HTMLTextAreaElement).value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchDataAssign()\n }\n }\n\n async fetchDataAssign() {\n const dataSample = this.input?.dataSample\n this.dataReview = dataSample\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import '@operato/dataset/ox-data-entry-form.js';
2
+ import { LitElement } from 'lit';
3
+ declare const DataCollectAssignActivityView_base: (new (...args: any[]) => LitElement) & typeof LitElement;
4
+ export declare class DataCollectAssignActivityView extends DataCollectAssignActivityView_base {
5
+ static styles: import("lit").CSSResult[];
6
+ input?: any;
7
+ output?: any;
8
+ dataReview?: any;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ onChangeInstruction(e: Event): void;
11
+ updated(changes: any): void;
12
+ fetchDataAssign(): Promise<void>;
13
+ }
14
+ export {};
@@ -0,0 +1,102 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/dataset/ox-data-entry-form.js';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property, state } from 'lit/decorators.js';
5
+ import { i18next, localize } from '@operato/i18n';
6
+ import { ScrollbarStyles } from '@operato/styles';
7
+ let DataCollectAssignActivityView = class DataCollectAssignActivityView extends localize(i18next)(LitElement) {
8
+ render() {
9
+ return html `
10
+ <div content>
11
+ <ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>
12
+ </div>
13
+ `;
14
+ }
15
+ onChangeInstruction(e) {
16
+ this.output || (this.output = {});
17
+ this.output.instruction = e.target.value;
18
+ this.dispatchEvent(new CustomEvent('change', {
19
+ detail: this.output
20
+ }));
21
+ }
22
+ updated(changes) {
23
+ if (changes.has('input')) {
24
+ this.fetchDataAssign();
25
+ }
26
+ }
27
+ async fetchDataAssign() {
28
+ var _a;
29
+ const dataSample = (_a = this.input) === null || _a === void 0 ? void 0 : _a.dataSample;
30
+ this.dataReview = dataSample;
31
+ }
32
+ };
33
+ DataCollectAssignActivityView.styles = [
34
+ ScrollbarStyles,
35
+ css `
36
+ :host {
37
+ display: flex;
38
+ flex-direction: column;
39
+
40
+ background-color: #fff;
41
+ }
42
+
43
+ div[content] {
44
+ flex: 1;
45
+ flex-direction: column;
46
+
47
+ display: flex;
48
+ overflow: auto;
49
+ }
50
+
51
+ ox-data-sample-view {
52
+ flex: 1;
53
+ padding: var(--padding-wide);
54
+ overflow: auto;
55
+ }
56
+
57
+ label[instruction] {
58
+ display: flex;
59
+ flex-direction: column;
60
+
61
+ padding: var(--padding-wide);
62
+ }
63
+
64
+ label[instruction] div {
65
+ display: flex;
66
+ }
67
+
68
+ mwc-icon {
69
+ color: var(--status-danger-color);
70
+ }
71
+
72
+ textarea {
73
+ border: var(--input-field-border);
74
+ border-radius: var(--input-border-radius);
75
+ padding: var(--input-field-padding);
76
+ font: var(--input-field-font);
77
+ }
78
+
79
+ .button-container {
80
+ display: flex;
81
+ margin-left: auto;
82
+ padding: var(--padding-default);
83
+ }
84
+ `
85
+ ];
86
+ __decorate([
87
+ property({ type: Object }),
88
+ __metadata("design:type", Object)
89
+ ], DataCollectAssignActivityView.prototype, "input", void 0);
90
+ __decorate([
91
+ property({ type: Object }),
92
+ __metadata("design:type", Object)
93
+ ], DataCollectAssignActivityView.prototype, "output", void 0);
94
+ __decorate([
95
+ state(),
96
+ __metadata("design:type", Object)
97
+ ], DataCollectAssignActivityView.prototype, "dataReview", void 0);
98
+ DataCollectAssignActivityView = __decorate([
99
+ customElement('activity-data-collect-assign-view')
100
+ ], DataCollectAssignActivityView);
101
+ export { DataCollectAssignActivityView };
102
+ //# sourceMappingURL=activity-data-collect-assign-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-data-collect-assign-view.js","sourceRoot":"","sources":["../../client/activities/activity-data-collect-assign-view.ts"],"names":[],"mappings":";AAAA,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG1C,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IA4D9E,MAAM;QACJ,OAAO,IAAI,CAAA;;2CAE4B,IAAI,CAAC,UAAU;;KAErD,CAAA;IACH,CAAC;IAED,mBAAmB,CAAC,CAAQ;QAC1B,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,EAAE,EAAA;QAClB,IAAI,CAAC,MAAM,CAAC,WAAW,GAAI,CAAC,CAAC,MAA8B,CAAC,KAAK,CAAA;QAEjE,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,eAAe,EAAE,CAAA;SACvB;IACH,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU,CAAA;QACzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;;AAvFM,oCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAa;AAExC;IAAC,KAAK,EAAE;;iEAAiB;AA1Dd,6BAA6B;IADzC,aAAa,CAAC,mCAAmC,CAAC;GACtC,6BAA6B,CAyFzC;SAzFY,6BAA6B","sourcesContent":["import '@operato/dataset/ox-data-entry-form.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-data-collect-assign-view')\nexport class DataCollectAssignActivityView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n div[content] {\n flex: 1;\n flex-direction: column;\n\n display: flex;\n overflow: auto;\n }\n\n ox-data-sample-view {\n flex: 1;\n padding: var(--padding-wide);\n overflow: auto;\n }\n\n label[instruction] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n label[instruction] div {\n display: flex;\n }\n\n mwc-icon {\n color: var(--status-danger-color);\n }\n\n textarea {\n border: var(--input-field-border);\n border-radius: var(--input-border-radius);\n padding: var(--input-field-padding);\n font: var(--input-field-font);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n\n @state() dataReview?: any\n\n render() {\n return html`\n <div content>\n <ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>\n </div>\n `\n }\n\n onChangeInstruction(e: Event) {\n this.output ||= {}\n this.output.instruction = (e.target as HTMLTextAreaElement).value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchDataAssign()\n }\n }\n\n async fetchDataAssign() {\n const dataSample = this.input?.dataSample\n this.dataReview = dataSample\n }\n}\n"]}
@@ -4,5 +4,7 @@ import './activities/activity-ooc-resolve-edit';
4
4
  import './activities/activity-data-collect-view';
5
5
  import './activities/activity-ooc-review-view';
6
6
  import './activities/activity-ooc-resolve-view';
7
+ import './activities/activity-data-collect-assign-edit';
8
+ import './activities/activity-data-collect-assign-view';
7
9
  import '@operato/app/filter-renderer.js';
8
10
  export default function bootstrap(): void;
@@ -4,6 +4,8 @@ import './activities/activity-ooc-resolve-edit'; /* refered by the activity temp
4
4
  import './activities/activity-data-collect-view'; /* refered by the activity template (activity-data-collect) on server */
5
5
  import './activities/activity-ooc-review-view'; /* refered by the activity template (activity-ooc-review) on server */
6
6
  import './activities/activity-ooc-resolve-view'; /* refered by the activity template (activity-ooc-resolve) on server */
7
+ import './activities/activity-data-collect-assign-edit';
8
+ import './activities/activity-data-collect-assign-view';
7
9
  import '@operato/app/filter-renderer.js'; /* register resource-object filter renderer */
8
10
  import { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js';
9
11
  import { OxGristRendererJson5, registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist';
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAA,CAAC,wEAAwE;AACzH,OAAO,uCAAuC,CAAA,CAAC,sEAAsE;AACrH,OAAO,wCAAwC,CAAA,CAAC,uEAAuE;AACvH,OAAO,yCAAyC,CAAA,CAAC,wEAAwE;AACzH,OAAO,uCAAuC,CAAA,CAAC,sEAAsE;AACrH,OAAO,wCAAwC,CAAA,CAAC,uEAAuE;AAEvH,OAAO,iCAAiC,CAAA,CAAC,8CAA8C;AAEvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAA;AACrF,OAAO,EACL,oBAAoB,EACpB,cAAc,IAAI,mBAAmB,EACrC,gBAAgB,IAAI,qBAAqB,EAC1C,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AACpG,OAAO,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAA;AAExG,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,mBAAmB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;IAChE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;IAE7D,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAA;IAEhD,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,CAAA;IACjE,qBAAqB,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import './activities/activity-data-collect-edit' /* refered by the activity template (activity-data-collect) on server */\nimport './activities/activity-ooc-review-edit' /* refered by the activity template (activity-ooc-review) on server */\nimport './activities/activity-ooc-resolve-edit' /* refered by the activity template (activity-ooc-resolve) on server */\nimport './activities/activity-data-collect-view' /* refered by the activity template (activity-data-collect) on server */\nimport './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */\nimport './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */\n\nimport '@operato/app/filter-renderer.js' /* register resource-object filter renderer */\n\nimport { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'\nimport {\n OxGristRendererJson5,\n registerEditor as registerGristEditor,\n registerRenderer as registerGristRenderer\n} from '@operato/data-grist'\nimport { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'\nimport { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'\nimport { OxGristRendererPartitionKeys } from '@operato/grist-editor/ox-grist-renderer-partition-keys.js'\n\nexport default function bootstrap() {\n registerGristEditor('data-item-spec', OxGristEditorDataItemSpec)\n registerGristRenderer('data-item-spec', OxGristRendererJson5)\n\n registerGristEditor('script', OxGristEditorCode)\n\n registerGristEditor('partition-keys', OxGristEditorPartitionKeys)\n registerGristRenderer('partition-keys', OxGristRendererPartitionKeys)\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAA,CAAC,wEAAwE;AACzH,OAAO,uCAAuC,CAAA,CAAC,sEAAsE;AACrH,OAAO,wCAAwC,CAAA,CAAC,uEAAuE;AACvH,OAAO,yCAAyC,CAAA,CAAC,wEAAwE;AACzH,OAAO,uCAAuC,CAAA,CAAC,sEAAsE;AACrH,OAAO,wCAAwC,CAAA,CAAC,uEAAuE;AACvH,OAAO,gDAAgD,CAAA;AACvD,OAAO,gDAAgD,CAAA;AACvD,OAAO,iCAAiC,CAAA,CAAC,8CAA8C;AAEvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAA;AACrF,OAAO,EACL,oBAAoB,EACpB,cAAc,IAAI,mBAAmB,EACrC,gBAAgB,IAAI,qBAAqB,EAC1C,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AACpG,OAAO,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAA;AAExG,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,mBAAmB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;IAChE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;IAE7D,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAA;IAEhD,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,CAAA;IACjE,qBAAqB,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import './activities/activity-data-collect-edit' /* refered by the activity template (activity-data-collect) on server */\nimport './activities/activity-ooc-review-edit' /* refered by the activity template (activity-ooc-review) on server */\nimport './activities/activity-ooc-resolve-edit' /* refered by the activity template (activity-ooc-resolve) on server */\nimport './activities/activity-data-collect-view' /* refered by the activity template (activity-data-collect) on server */\nimport './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */\nimport './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */\nimport './activities/activity-data-collect-assign-edit'\nimport './activities/activity-data-collect-assign-view'\nimport '@operato/app/filter-renderer.js' /* register resource-object filter renderer */\n\nimport { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'\nimport {\n OxGristRendererJson5,\n registerEditor as registerGristEditor,\n registerRenderer as registerGristRenderer\n} from '@operato/data-grist'\nimport { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'\nimport { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'\nimport { OxGristRendererPartitionKeys } from '@operato/grist-editor/ox-grist-renderer-partition-keys.js'\n\nexport default function bootstrap() {\n registerGristEditor('data-item-spec', OxGristEditorDataItemSpec)\n registerGristRenderer('data-item-spec', OxGristRendererJson5)\n\n registerGristEditor('script', OxGristEditorCode)\n\n registerGristEditor('partition-keys', OxGristEditorPartitionKeys)\n registerGristRenderer('partition-keys', OxGristRendererPartitionKeys)\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import '@operato/data-grist';
2
+ import '@operato/context/ox-context-page-toolbar.js';
2
3
  import '@operato/board/ox-board-viewer.js';
3
4
  import '../../components/data-entry-form.js';
4
5
  import { FetchOption } from '@operato/data-grist';
@@ -12,9 +13,8 @@ declare const DataEntryListPage_base: (new (...args: any[]) => {
12
13
  }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
13
14
  export declare class DataEntryListPage extends DataEntryListPage_base {
14
15
  static styles: import("lit").CSSResult[];
15
- gristConfig: any;
16
+ private gristConfig;
16
17
  private grist;
17
- private sortersControl;
18
18
  get context(): {
19
19
  title: string;
20
20
  search: {
@@ -25,6 +25,7 @@ export declare class DataEntryListPage extends DataEntryListPage_base {
25
25
  handler: () => void;
26
26
  };
27
27
  help: string;
28
+ toolbar: boolean;
28
29
  };
29
30
  render(): import("lit-html").TemplateResult<1>;
30
31
  pageInitialized(lifecycle: any): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@operato/data-grist';
3
+ import '@operato/context/ox-context-page-toolbar.js';
3
4
  import '@operato/board/ox-board-viewer.js';
4
5
  import '../../components/data-entry-form.js';
5
6
  import gql from 'graphql-tag';
@@ -12,9 +13,8 @@ import { client } from '@operato/graphql';
12
13
  import { i18next, localize } from '@operato/i18n';
13
14
  import { openPopup } from '@operato/layout';
14
15
  import { navigate, PageView, store } from '@operato/shell';
15
- import { CommonGristStyles, ScrollbarStyles } from '@operato/styles';
16
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
16
17
  import { provider } from '@things-factory/board-ui';
17
- import { OxPopup } from '@operato/popup';
18
18
  const USECASE_OPTIONS = () => {
19
19
  return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
20
20
  return {
@@ -81,7 +81,8 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
81
81
  this.grist.toggleHeadroom();
82
82
  }
83
83
  },
84
- help: 'dataset/data-entry-list'
84
+ help: 'dataset/data-entry-list',
85
+ toolbar: false
85
86
  };
86
87
  }
87
88
  render() {
@@ -93,26 +94,14 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
93
94
  .fetchHandler=${this.fetchHandler.bind(this)}
94
95
  ?url-params-sensitive=${this.active}
95
96
  >
96
- <div slot="headroom">
97
- <div id="filters">
98
- <ox-filters-form autofocus without-search></ox-filters-form>
97
+ <div slot="headroom" class="header">
98
+ <div class="title">
99
+ <mwc-icon>summarize</mwc-icon>
100
+ ${i18next.t('title.data-entry list')}
99
101
  </div>
100
102
 
101
- <div id="sorters">
102
- Sort
103
- <mwc-icon
104
- @click=${e => {
105
- const target = e.currentTarget;
106
- this.sortersControl.open({
107
- right: 0,
108
- top: target.offsetTop + target.offsetHeight
109
- });
110
- }}
111
- >expand_more</mwc-icon
112
- >
113
- <ox-popup id="sorter-control">
114
- <ox-sorters-control> </ox-sorters-control>
115
- </ox-popup>
103
+ <div class="filters">
104
+ <ox-filters-form autofocus without-search></ox-filters-form>
116
105
  </div>
117
106
  </div>
118
107
  </ox-grist>
@@ -354,7 +343,7 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
354
343
  };
355
344
  DataEntryListPage.styles = [
356
345
  ScrollbarStyles,
357
- CommonGristStyles,
346
+ CommonHeaderStyles,
358
347
  css `
359
348
  :host {
360
349
  display: flex;
@@ -364,6 +353,11 @@ DataEntryListPage.styles = [
364
353
  --grid-record-emphasized-background-color: red;
365
354
  --grid-record-emphasized-color: yellow;
366
355
  }
356
+
357
+ ox-grist {
358
+ overflow-y: auto;
359
+ flex: 1;
360
+ }
367
361
  `
368
362
  ];
369
363
  __decorate([
@@ -374,10 +368,6 @@ __decorate([
374
368
  query('ox-grist'),
375
369
  __metadata("design:type", DataGrist)
376
370
  ], DataEntryListPage.prototype, "grist", void 0);
377
- __decorate([
378
- query('#sorter-control'),
379
- __metadata("design:type", OxPopup)
380
- ], DataEntryListPage.prototype, "sortersControl", void 0);
381
371
  DataEntryListPage = __decorate([
382
372
  customElement('data-entry-list-page')
383
373
  ], DataEntryListPage);
@@ -1 +1 @@
1
- {"version":3,"file":"data-entry-list-page.js","sourceRoot":"","sources":["../../../client/pages/data-entry/data-entry-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,mCAAmC,CAAA;AAC1C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAgB,SAAS,EAA+B,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACvG,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,OAAO,CAAC,EAAE,EAAE,GAAG,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACzD,OAAO;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AK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsDT;YACD,SAAS,EAAE;gBACT,OAAO;gBACP,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;gBAC3B,QAAQ;aACT;SACF,CAAC,CAAA;QAEF,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;YACzC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;SAC7C,CAAA;IACH,CAAC;;AApTM,wBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;sDAAiB;AAEzB;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;gDAAA;AAC5C;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAA0B,OAAO;yDAAA;AAnB/C,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAsT7B;SAtTY,iBAAiB","sourcesContent":["import '@operato/data-grist'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/data-entry-form.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl, getRenderer } from '@operato/data-grist'\nimport { OxDataUseCase } from '@operato/dataset'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\nimport { OxPopup } from '@operato/popup'\n\nconst USECASE_OPTIONS = () => {\n return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {\n return {\n display: name,\n value: name\n }\n })\n}\n\nconst showEntryView = async (columns, data, column, record, rowIndex) => {\n const { name, entryType, entryView } = record\n const title = `${name} - ${i18next.t('title.data-entry-form')}`\n\n switch (entryType) {\n case 'generated':\n openPopup(html` <data-entry-form .dataSet=${record} style=\"background-color: white;\"></data-entry-form> `, {\n closable: true,\n backdrop: true,\n size: 'large',\n title\n })\n break\n\n case 'board':\n const board = {\n id: entryView\n }\n openPopup(\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${board}\n .provider=${provider}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `,\n {\n closable: true,\n backdrop: true,\n size: 'large',\n title\n }\n )\n\n // navigate(`board-viewer/${entryView}?interactive=true&title=${title}`)\n break\n\n case 'custom-element':\n break\n\n case 'page':\n navigate(entryView)\n break\n\n case 'external':\n window.open(entryView, '_blank')\n break\n }\n}\n\n@customElement('data-entry-list-page')\nexport class DataEntryListPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n @state() gristConfig: any\n\n @query('ox-grist') private grist!: DataGrist\n @query('#sorter-control') private sortersControl!: OxPopup\n\n get context() {\n return {\n title: i18next.t('title.data-entry list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'dataset/data-entry-list'\n }\n }\n\n render() {\n const mode = 'CARD'\n\n return html`\n <ox-grist\n .mode=${mode}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ?url-params-sensitive=${this.active}\n >\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n\n <div id=\"sorters\">\n Sort\n <mwc-icon\n @click=${e => {\n const target = e.currentTarget\n this.sortersControl.open({\n right: 0,\n top: target.offsetTop + target.offsetHeight\n })\n }}\n >expand_more</mwc-icon\n >\n <ox-popup id=\"sorter-control\">\n <ox-sorters-control> </ox-sorters-control>\n </ox-popup>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n thumbnail: 'entryView',\n fields: ['name', 'description'],\n details: ['schedule', 'type', 'useCase', 'latestCollectedAt', 'prevSchedule', 'nextSchedule']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'fact_check',\n handlers: {\n click: showEntryView\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: false\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'select',\n name: 'type',\n label: true,\n header: i18next.t('field.type'),\n record: {\n editable: false,\n options: [\n {},\n {\n display: i18next.t('text.manually collected'),\n value: 'manual'\n },\n {\n display: i18next.t('text.automatically collected'),\n value: 'automatic'\n }\n ]\n },\n sortable: true,\n filter: true,\n width: 60\n },\n {\n type: 'select',\n name: 'useCase',\n label: true,\n header: i18next.t('field.use-case'),\n record: {\n editable: false,\n options: USECASE_OPTIONS\n },\n sortable: true,\n filter: {\n operator: 'eq',\n options: USECASE_OPTIONS /* in case select options type is a function, filter should have its own options */\n },\n width: 80\n },\n {\n type: 'crontab',\n name: 'schedule',\n label: true,\n header: i18next.t('field.schedule'),\n record: {\n editable: false\n },\n width: 80\n },\n {\n type: 'resource-object',\n name: 'entryRole',\n header: i18next.t('field.entry-role'),\n record: {\n editable: false\n },\n width: 120\n },\n {\n type: 'resource-object',\n name: 'supervisoryRole',\n header: i18next.t('field.supervisory-role'),\n record: {\n editable: false\n },\n width: 120\n },\n {\n type: 'datetime',\n name: 'latestCollectedAt',\n label: true,\n header: i18next.t('field.latest-collected-at'),\n record: {\n editable: false\n },\n width: 180\n },\n {\n type: 'datetime',\n name: 'prevSchedule',\n label: true,\n header: i18next.t('field.prev-schedule'),\n record: {\n editable: false\n },\n width: 180\n },\n {\n type: 'datetime',\n name: 'nextSchedule',\n label: true,\n header: i18next.t('field.next-schedule'),\n record: {\n editable: false\n },\n width: 180\n },\n {\n type: 'string',\n name: 'entryView',\n hidden: true,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n const type = record.entryType !== 'board' ? 'string' : 'image'\n value = record.entryType !== 'board' ? value : record.entryBoard?.thumbnail\n\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n }\n }\n ],\n rows: {\n selectable: {\n multiple: false\n },\n handlers: {\n click: showEntryView\n },\n classifier: function (record, rowIndex) {}\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: dataSetsForEntry(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n partitionKeys\n active\n type\n useCase\n schedule\n timezone\n entryRole {\n id\n name\n }\n supervisoryRole {\n id\n name\n }\n entryType\n entryView\n entryBoard {\n thumbnail\n }\n monitorType\n monitorView\n updater {\n id\n name\n }\n reportType\n reportView\n updatedAt\n dataItems {\n name\n description\n active\n tag\n type\n unit\n options\n quota\n spec\n }\n latestCollectedAt\n nextSchedule\n prevSchedule\n nextSummarySchedule\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n}\n"]}
1
+ {"version":3,"file":"data-entry-list-page.js","sourceRoot":"","sources":["../../../client/pages/data-entry/data-entry-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO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;;;;;;;;;KAcF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;sDAAyB;AAEjC;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;gDAAA;AAvBjC,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CA+S7B;SA/SY,iBAAiB","sourcesContent":["import '@operato/data-grist'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/data-entry-form.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl, getRenderer } from '@operato/data-grist'\nimport { OxDataUseCase } from '@operato/dataset'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\nimport { OxPopup } from '@operato/popup'\n\nconst USECASE_OPTIONS = () => {\n return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {\n return {\n display: name,\n value: name\n }\n })\n}\n\nconst showEntryView = async (columns, data, column, record, rowIndex) => {\n const { name, entryType, entryView } = record\n const title = `${name} - ${i18next.t('title.data-entry-form')}`\n\n switch (entryType) {\n case 'generated':\n openPopup(html` <data-entry-form .dataSet=${record} style=\"background-color: white;\"></data-entry-form> `, {\n closable: true,\n backdrop: true,\n size: 'large',\n title\n })\n break\n\n case 'board':\n const board = {\n id: entryView\n }\n openPopup(\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${board}\n .provider=${provider}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `,\n {\n closable: true,\n backdrop: true,\n size: 'large',\n title\n }\n )\n\n // navigate(`board-viewer/${entryView}?interactive=true&title=${title}`)\n break\n\n case 'custom-element':\n break\n\n case 'page':\n navigate(entryView)\n break\n\n case 'external':\n window.open(entryView, '_blank')\n break\n }\n}\n\n@customElement('data-entry-list-page')\nexport class DataEntryListPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @state() private gristConfig: any\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.data-entry list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'dataset/data-entry-list',\n toolbar: false\n }\n }\n\n render() {\n const mode = 'CARD'\n\n return html`\n <ox-grist\n .mode=${mode}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ?url-params-sensitive=${this.active}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"title\">\n <mwc-icon>summarize</mwc-icon>\n ${i18next.t('title.data-entry list')}\n </div>\n\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n thumbnail: 'entryView',\n fields: ['name', 'description'],\n details: ['schedule', 'type', 'useCase', 'latestCollectedAt', 'prevSchedule', 'nextSchedule']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'fact_check',\n handlers: {\n click: showEntryView\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: false\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'select',\n name: 'type',\n label: true,\n header: i18next.t('field.type'),\n record: {\n editable: false,\n options: [\n {},\n {\n display: i18next.t('text.manually collected'),\n value: 'manual'\n },\n {\n display: i18next.t('text.automatically collected'),\n value: 'automatic'\n }\n ]\n },\n sortable: true,\n filter: true,\n width: 60\n },\n {\n type: 'select',\n name: 'useCase',\n label: true,\n header: i18next.t('field.use-case'),\n record: {\n editable: false,\n options: USECASE_OPTIONS\n },\n sortable: true,\n filter: {\n operator: 'eq',\n options: USECASE_OPTIONS /* in case select options type is a function, filter should have its own options */\n },\n width: 80\n },\n {\n type: 'crontab',\n name: 'schedule',\n label: true,\n header: i18next.t('field.schedule'),\n record: {\n editable: false\n },\n width: 80\n },\n {\n type: 'resource-object',\n name: 'entryRole',\n header: i18next.t('field.entry-role'),\n record: {\n editable: false\n },\n width: 120\n },\n {\n type: 'resource-object',\n name: 'supervisoryRole',\n header: i18next.t('field.supervisory-role'),\n record: {\n editable: false\n },\n width: 120\n },\n {\n type: 'datetime',\n name: 'latestCollectedAt',\n label: true,\n header: i18next.t('field.latest-collected-at'),\n record: {\n editable: false\n },\n width: 180\n },\n {\n type: 'datetime',\n name: 'prevSchedule',\n label: true,\n header: i18next.t('field.prev-schedule'),\n record: {\n editable: false\n },\n width: 180\n },\n {\n type: 'datetime',\n name: 'nextSchedule',\n label: true,\n header: i18next.t('field.next-schedule'),\n record: {\n editable: false\n },\n width: 180\n },\n {\n type: 'string',\n name: 'entryView',\n hidden: true,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n const type = record.entryType !== 'board' ? 'string' : 'image'\n value = record.entryType !== 'board' ? value : record.entryBoard?.thumbnail\n\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n }\n }\n ],\n rows: {\n selectable: {\n multiple: false\n },\n handlers: {\n click: showEntryView\n },\n classifier: function (record, rowIndex) {}\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: dataSetsForEntry(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n partitionKeys\n active\n type\n useCase\n schedule\n timezone\n entryRole {\n id\n name\n }\n supervisoryRole {\n id\n name\n }\n entryType\n entryView\n entryBoard {\n thumbnail\n }\n monitorType\n monitorView\n updater {\n id\n name\n }\n reportType\n reportView\n updatedAt\n dataItems {\n name\n description\n active\n tag\n type\n unit\n options\n quota\n spec\n }\n latestCollectedAt\n nextSchedule\n prevSchedule\n nextSummarySchedule\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import '@operato/data-grist';
2
+ import '@operato/context/ox-context-page-toolbar.js';
2
3
  import '@operato/input/ox-input-select-buttons.js';
3
4
  import './data-ooc-view.js';
4
5
  import { FetchOption } from '@operato/data-grist';
@@ -12,11 +13,10 @@ declare const DataOocListPage_base: (new (...args: any[]) => {
12
13
  }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
13
14
  export declare class DataOocListPage extends DataOocListPage_base {
14
15
  static styles: import("lit").CSSResult[];
15
- gristConfig: any;
16
- mode: 'CARD' | 'GRID' | 'LIST';
17
- state?: string[];
16
+ private gristConfig;
17
+ private mode;
18
+ private state?;
18
19
  private grist;
19
- private sortersControl;
20
20
  get context(): {
21
21
  title: string;
22
22
  search: {
@@ -39,6 +39,7 @@ export declare class DataOocListPage extends DataOocListPage_base {
39
39
  data: any;
40
40
  };
41
41
  };
42
+ toolbar: boolean;
42
43
  };
43
44
  render(): import("lit-html").TemplateResult<1>;
44
45
  pageInitialized(lifecycle: any): Promise<void>;