@things-factory/dataset 9.1.18 → 10.0.0-beta.1
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.
- package/EXPLORATION_INDEX.md +252 -0
- package/FRONTEND_ARCHITECTURE.md +732 -0
- package/QUICK_REFERENCE.md +365 -0
- package/dist-client/pages/data-archive/data-archive-list-page.d.ts +1 -7
- package/dist-client/pages/data-archive/data-archive-list-page.js +42 -77
- package/dist-client/pages/data-archive/data-archive-list-page.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.d.ts +1 -7
- package/dist-client/pages/data-entry/data-entry-list-page.js +77 -143
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-key-set/data-key-set-list-page.d.ts +1 -7
- package/dist-client/pages/data-key-set/data-key-set-list-page.js +69 -131
- package/dist-client/pages/data-key-set/data-key-set-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +0 -6
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +87 -166
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-report/data-report-list-page.d.ts +1 -7
- package/dist-client/pages/data-report/data-report-list-page.js +71 -132
- package/dist-client/pages/data-report/data-report-list-page.js.map +1 -1
- package/dist-client/pages/data-report/data-report-samples-page.d.ts +1 -7
- package/dist-client/pages/data-report/data-report-samples-page.js +17 -30
- package/dist-client/pages/data-report/data-report-samples-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-list-page.d.ts +0 -6
- package/dist-client/pages/data-sample/data-sample-list-page.js +68 -130
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-search-page.d.ts +1 -7
- package/dist-client/pages/data-sample/data-sample-search-page.js +63 -116
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
- package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +0 -6
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +89 -167
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
- package/dist-client/pages/data-set/data-item-list.js +15 -1
- package/dist-client/pages/data-set/data-item-list.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.d.ts +0 -6
- package/dist-client/pages/data-set/data-set-list-page.js +2 -4
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-list-page.d.ts +1 -7
- package/dist-client/pages/data-summary/data-summary-list-page.js +56 -105
- package/dist-client/pages/data-summary/data-summary-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-period-page.d.ts +1 -7
- package/dist-client/pages/data-summary/data-summary-period-page.js +50 -90
- package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-search-page.d.ts +1 -7
- package/dist-client/pages/data-summary/data-summary-search-page.js +61 -111
- package/dist-client/pages/data-summary/data-summary-search-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-review.js +5 -2
- package/dist-server/activities/activity-data-review.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +4 -1
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-ooc.js +2 -1
- package/dist-server/controllers/create-data-ooc.js.map +1 -1
- package/dist-server/controllers/create-data-sample.js +59 -7
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/issue-data-collection-task.js +9 -5
- package/dist-server/controllers/issue-data-collection-task.js.map +1 -1
- package/dist-server/controllers/issue-ooc-resolve.js +11 -6
- package/dist-server/controllers/issue-ooc-resolve.js.map +1 -1
- package/dist-server/controllers/issue-ooc-review.js +9 -6
- package/dist-server/controllers/issue-ooc-review.js.map +1 -1
- package/dist-server/service/data-set/data-item-type.d.ts +259 -0
- package/dist-server/service/data-set/data-item-type.js +259 -0
- package/dist-server/service/data-set/data-item-type.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/index.d.ts +1 -0
- package/dist-server/utils/index.js +1 -0
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/media-validation.d.ts +51 -0
- package/dist-server/utils/media-validation.js +148 -0
- package/dist-server/utils/media-validation.js.map +1 -0
- package/package.json +26 -26
- package/spec/integration/debug.spec.ts +42 -0
- package/spec/integration/ooc-lifecycle.spec.ts +484 -0
- package/spec/integration/ooc-workflow.spec.ts +276 -0
- package/spec/integration/simple.spec.ts +62 -0
- package/spec/unit/controllers/activity-callbacks.spec.ts +609 -0
- package/spec/unit/controllers/create-data-ooc.spec.ts +310 -0
- package/spec/unit/controllers/issue-ooc-resolve.spec.ts +431 -0
- package/spec/unit/controllers/issue-ooc-review.spec.ts +288 -0
- package/spec/unit/data-use-case.spec.ts +150 -0
- package/spec/unit/ooc-state-transition.spec.ts +233 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-archive-list-page.js","sourceRoot":"","sources":["../../../client/pages/data-archive/data-archive-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,6CAA6C,CAAA;AAEpD,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;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,SAAS,EAA4B,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAe,SAAS,EAAE,MAAM,iBAAiB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CAAC,EAAE,EAAE,CAAC;aACT,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAC9C,CAAC;;AAxOQ;IAAR,KAAK,EAAE;;wDAAiB;AAChB;IAAR,KAAK,EAAE;;iDAAoE;AAEjD;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;kDAAA;AA1BjC,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAgQ/B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\nimport '@operato/context/ox-context-page-toolbar.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PopupHandle, openPopup } from '@operato/layout'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\n\nimport './data-archive-request-popup.js'\n\n@customElement('data-archive-list-page')\nexport class DataArchiveListPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n .header {\n grid-template-areas: 'filters actions';\n }\n `\n ]\n\n @state() gristConfig: any\n @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n private popup?: PopupHandle\n\n get context() {\n return {\n title: i18next.t('title.data-archive 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-archive',\n actions: [\n {\n title: i18next.t('button.request-archive'),\n action: this.openArchivePopup.bind(this),\n icon: 'archive'\n }\n ],\n exportable: {\n name: i18next.t('title.data-archive list'),\n data: this._exportableData.bind(this)\n },\n toolbar: false\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')\n\n return html`\n <ox-grist\n .mode=${mode}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ?url-params-sensitive=${false /* this.active */}\n >\n <div slot=\"headroom\" class=\"header\">\n <!-- <div class=\"filters\">\n <ox-filters-form class=\"filter\" autofocus without-search></ox-filters-form>\n </div> -->\n\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: { fields: ['updater', 'updatedAt'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n // { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'resource-object',\n name: 'creator',\n header: i18next.t('field.creator'),\n sortable: true,\n width: 120,\n imex: true\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: i18next.t('field.created_at'),\n sortable: true,\n width: 180,\n imex: true\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n sortable: true,\n width: 180,\n imex: true\n },\n {\n type: 'json5',\n name: 'requestParams',\n header: i18next.t('field.request-params'),\n record: {\n editable: false\n },\n width: 200,\n imex: true\n },\n {\n type: 'string',\n name: 'downloadUrl',\n label: true,\n header: i18next.t('field.download-url'),\n record: {\n editable: false\n },\n width: 240,\n imex: true\n },\n {\n type: 'string',\n name: 'status',\n label: true,\n header: i18next.t('field.status'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120,\n imex: true\n }\n ],\n rows: {\n appendable: false,\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'createdAt',\n desc: true\n }\n ]\n }\n }\n\n closePopupAndRefesh() {\n this.popup?.close()\n this.grist.fetch()\n }\n\n async openArchivePopup() {\n this.popup = openPopup(\n html` <data-archive-request-popup\n @requested=${this.closePopupAndRefesh.bind(this)}\n @created=${this.closePopupAndRefesh.bind(this)}\n ></data-archive-request-popup>`,\n {\n backdrop: true,\n size: 'small',\n title: i18next.t('title.data-archive request popup')\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: dataArchives(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n type\n requestParams\n downloadUrl\n status\n creator {\n id\n name\n }\n updater {\n id\n name\n }\n updatedAt\n createdAt\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 _exportableData() {\n let records = [] as GristRecord[]\n if (this.grist.selected && this.grist.selected.length > 0) {\n records = this.grist.selected\n } else {\n records = this.grist.data.records\n }\n\n var headerSetting = this.grist.compiledConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .map(column => {\n return column.imex === true\n ? {\n header: column.header.renderer(column),\n key: column.name,\n width: column.width,\n type: column.type\n }\n : column.imex\n })\n\n var data = records.map(item => {\n return {\n id: item.id,\n ...this.gristConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .reduce((record, column) => {\n const key = column.imex === true ? column.name : column.imex.key\n record[key] = key\n .split('.')\n .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)\n return record\n }, {})\n }\n })\n\n return { header: headerSetting, data: data }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"data-archive-list-page.js","sourceRoot":"","sources":["../../../client/pages/data-archive/data-archive-list-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AE,MAAM,EAAE,EAAE;oBAAe,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAA;oBACxG,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG;yBACd,KAAK,CAAC,GAAG,CAAC;yBACV,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;oBACvF,OAAO,MAAM,CAAA;gBACxB,CAAC,EAAE,EAAE,CAAC;aACL,CAAA;QACD,CAAC,CAAC,CAAA;QAEC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAC/C,CAAC;;AA7LS;IAAR,KAAK,EAAE;;wDAAiB;AAChB;IAAR,KAAK,EAAE;;iDAAoE;AAEjD;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;kDAAA;AAtBjC,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAiN/B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\nimport '@operato/context/ox-context-page-toolbar.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PopupHandle, openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\n\nimport './data-archive-request-popup.js'\n\n@customElement('data-archive-list-page')\nexport class DataArchiveListPage extends localize(i18next)(PageView) { static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n\n .header { grid-template-areas: 'filters actions';\n }\n `\n ]\n\n @state() gristConfig: any\n @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n private popup?: PopupHandle\n\n get context() { return { title: i18next.t('title.data-archive list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'dataset/data-archive',\n actions: [\n { title: i18next.t('button.request-archive'),\n action: this.openArchivePopup.bind(this),\n icon: 'archive'\n }\n ],\n exportable: { name: i18next.t('title.data-archive list'),\n data: this._exportableData.bind(this)\n },\n toolbar: false\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')\n\n return html`\n <ox-grist\n .mode=${mode}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ?url-params-sensitive=${false /* this.active */}\n >\n <div slot=\"headroom\" class=\"header\">\n <!-- <div class=\"filters\">\n <ox-filters-form class=\"filter\" autofocus without-search></ox-filters-form>\n </div> -->\n\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) { this.gristConfig = { list: { fields: ['updater', 'updatedAt'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n // { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'resource-object',\n name: 'creator',\n header: i18next.t('field.creator'),\n sortable: true,\n width: 120,\n imex: true\n },\n { type: 'datetime',\n name: 'createdAt',\n header: i18next.t('field.created_at'),\n sortable: true,\n width: 180,\n imex: true\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n sortable: true,\n width: 180,\n imex: true\n },\n { type: 'json5',\n name: 'requestParams',\n header: i18next.t('field.request-params'),\n record: { editable: false\n },\n width: 200,\n imex: true\n },\n { type: 'string',\n name: 'downloadUrl',\n label: true,\n header: i18next.t('field.download-url'),\n record: { editable: false\n },\n width: 240,\n imex: true\n },\n { type: 'string',\n name: 'status',\n label: true,\n header: i18next.t('field.status'),\n record: { editable: false\n },\n sortable: true,\n width: 120,\n imex: true\n }\n ],\n rows: { appendable: false,\n selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'createdAt',\n desc: true\n }\n ]\n }\n }\n\n closePopupAndRefesh() { this.popup?.close()\n this.grist.fetch()\n }\n\n async openArchivePopup() { this.popup = openPopup(\n html` <data-archive-request-popup\n @requested=${this.closePopupAndRefesh.bind(this)}\n @created=${this.closePopupAndRefesh.bind(this)}\n ></data-archive-request-popup>`,\n { backdrop: true,\n size: 'small',\n title: i18next.t('title.data-archive request popup')\n }\n )\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: dataArchives(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n type\n requestParams\n downloadUrl\n status\n creator { id\n name\n }\n updater { id\n name\n }\n updatedAt\n createdAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n _exportableData() { let records = [] as GristRecord[]\n if (this.grist.selected && this.grist.selected.length > 0) { records = this.grist.selected\n } else { records = this.grist.data.records\n }\n\n var headerSetting = this.grist.compiledConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .map(column => { return column.imex === true\n ? { header: column.header.renderer(column),\n key: column.name,\n width: column.width,\n type: column.type\n }\n : column.imex\n })\n\n var data = records.map(item => { return { id: item.id,\n ...this.gristConfig.columns\n .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)\n .reduce((record, column) => { const key = column.imex === true ? column.name : column.imex.key\n record[key] = key\n .split('.')\n .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)\n return record\n }, {})\n }\n })\n\n return { header: headerSetting, data: data }\n }\n}\n"]}
|
|
@@ -6,13 +6,7 @@ import '../../components/data-entry-form.js';
|
|
|
6
6
|
import '../../components/checklist-entry-form.js';
|
|
7
7
|
import { FetchOption } from '@operato/data-grist';
|
|
8
8
|
import { PageView } from '@operato/shell';
|
|
9
|
-
declare const DataEntryListPage_base: (new (...args: any[]) =>
|
|
10
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
11
|
-
connectedCallback(): void;
|
|
12
|
-
disconnectedCallback(): void;
|
|
13
|
-
stateChanged(_state: unknown): void;
|
|
14
|
-
readonly isConnected: boolean;
|
|
15
|
-
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
9
|
+
declare const DataEntryListPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
16
10
|
export declare class DataEntryListPage extends DataEntryListPage_base {
|
|
17
11
|
static styles: import("lit").CSSResult[];
|
|
18
12
|
private gristConfig;
|
|
@@ -8,27 +8,24 @@ import '../../components/checklist-entry-form.js';
|
|
|
8
8
|
import gql from 'graphql-tag';
|
|
9
9
|
import { css, html } from 'lit';
|
|
10
10
|
import { customElement, query, state } from 'lit/decorators.js';
|
|
11
|
-
import { connect } from 'pwa-helpers/connect-mixin';
|
|
12
11
|
import { DataGrist, getRenderer } from '@operato/data-grist';
|
|
13
12
|
import { OxDataUseCase } from '@operato/dataset';
|
|
14
13
|
import { client } from '@operato/graphql';
|
|
15
14
|
import { i18next, localize } from '@operato/i18n';
|
|
16
15
|
import { openPopup, notify } from '@operato/layout';
|
|
17
|
-
import { InheritedValueType, navigate, PageView
|
|
16
|
+
import { InheritedValueType, navigate, PageView } from '@operato/shell';
|
|
18
17
|
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
19
18
|
import { provider } from '@things-factory/board-ui/dist-client/board-provider.js';
|
|
20
19
|
const USECASE_OPTIONS = () => {
|
|
21
20
|
return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
|
|
22
|
-
return {
|
|
23
|
-
display: name,
|
|
21
|
+
return { display: name,
|
|
24
22
|
value: name
|
|
25
23
|
};
|
|
26
24
|
});
|
|
27
25
|
};
|
|
28
26
|
const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
29
27
|
if (!record.isEntryAllowed) {
|
|
30
|
-
notify({
|
|
31
|
-
message: 'You are not allowed to enter data for this dataset',
|
|
28
|
+
notify({ message: 'You are not allowed to enter data for this dataset',
|
|
32
29
|
level: 'error'
|
|
33
30
|
});
|
|
34
31
|
return;
|
|
@@ -37,24 +34,21 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
|
37
34
|
const title = `${name} - ${i18next.t('title.data-entry-form')}`;
|
|
38
35
|
switch (entryType) {
|
|
39
36
|
case 'generated':
|
|
40
|
-
openPopup(html ` <data-entry-form .dataSet=${record} style="background-color: white;"></data-entry-form> `, {
|
|
41
|
-
closable: true,
|
|
37
|
+
openPopup(html ` <data-entry-form .dataSet=${record} style="background-color: white;"></data-entry-form> `, { closable: true,
|
|
42
38
|
backdrop: true,
|
|
43
39
|
size: 'large',
|
|
44
40
|
title
|
|
45
41
|
});
|
|
46
42
|
break;
|
|
47
43
|
case 'checklist':
|
|
48
|
-
openPopup(html ` <checklist-entry-form .dataSet=${record} style="background-color: white;"></checklist-entry-form> `, {
|
|
49
|
-
closable: true,
|
|
44
|
+
openPopup(html ` <checklist-entry-form .dataSet=${record} style="background-color: white;"></checklist-entry-form> `, { closable: true,
|
|
50
45
|
backdrop: true,
|
|
51
46
|
size: 'large',
|
|
52
47
|
title
|
|
53
48
|
});
|
|
54
49
|
break;
|
|
55
50
|
case 'board':
|
|
56
|
-
const board = {
|
|
57
|
-
id: entryView
|
|
51
|
+
const board = { id: entryView
|
|
58
52
|
};
|
|
59
53
|
openPopup(html `
|
|
60
54
|
<ox-board-viewer
|
|
@@ -64,8 +58,7 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
|
64
58
|
hide-fullscreen
|
|
65
59
|
hide-navigation
|
|
66
60
|
></ox-board-viewer>
|
|
67
|
-
`, {
|
|
68
|
-
closable: true,
|
|
61
|
+
`, { closable: true,
|
|
69
62
|
backdrop: true,
|
|
70
63
|
size: 'large',
|
|
71
64
|
title
|
|
@@ -84,73 +77,60 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
|
84
77
|
};
|
|
85
78
|
const issueDataEntry = async (columns, data, column, record, rowIndex) => {
|
|
86
79
|
if (!record.isSupervisor) {
|
|
87
|
-
notify({
|
|
88
|
-
message: 'You are not allowed to issue data collection for this dataset',
|
|
80
|
+
notify({ message: 'You are not allowed to issue data collection for this dataset',
|
|
89
81
|
level: 'error'
|
|
90
82
|
});
|
|
91
83
|
return;
|
|
92
84
|
}
|
|
93
|
-
const response = await client.mutate({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
issueDataCollection(dataSetId: $dataSetId)
|
|
97
|
-
}
|
|
85
|
+
const response = await client.mutate({ mutation: gql `
|
|
86
|
+
mutation ($dataSetId: String!) { issueDataCollection(dataSetId: $dataSetId)
|
|
87
|
+
}
|
|
98
88
|
`,
|
|
99
89
|
variables: { dataSetId: record.id }
|
|
100
90
|
});
|
|
101
91
|
if (response.errors) {
|
|
102
|
-
notify({
|
|
103
|
-
message: response.errors[0].message,
|
|
92
|
+
notify({ message: response.errors[0].message,
|
|
104
93
|
level: 'error'
|
|
105
94
|
});
|
|
106
95
|
}
|
|
107
96
|
else {
|
|
108
|
-
notify({
|
|
109
|
-
message: 'Data entry task issued successfully'
|
|
97
|
+
notify({ message: 'Data entry task issued successfully'
|
|
110
98
|
});
|
|
111
99
|
}
|
|
112
100
|
};
|
|
113
|
-
let DataEntryListPage = class DataEntryListPage extends
|
|
101
|
+
let DataEntryListPage = class DataEntryListPage extends localize(i18next)(PageView) {
|
|
114
102
|
static { this.styles = [
|
|
115
103
|
ScrollbarStyles,
|
|
116
104
|
CommonHeaderStyles,
|
|
117
105
|
css `
|
|
118
|
-
:host {
|
|
119
|
-
display: flex;
|
|
106
|
+
:host { display: flex;
|
|
120
107
|
|
|
121
108
|
width: 100%;
|
|
122
109
|
|
|
123
110
|
--grid-record-emphasized-background-color: #8b0000;
|
|
124
111
|
--grid-record-emphasized-color: #ff6b6b;
|
|
125
|
-
|
|
112
|
+
}
|
|
126
113
|
|
|
127
|
-
ox-grist {
|
|
128
|
-
overflow-y: auto;
|
|
114
|
+
ox-grist { overflow-y: auto;
|
|
129
115
|
flex: 1;
|
|
130
|
-
|
|
116
|
+
}
|
|
131
117
|
|
|
132
|
-
.header {
|
|
133
|
-
|
|
134
|
-
}
|
|
118
|
+
.header { grid-template-areas: 'filters actions';
|
|
119
|
+
}
|
|
135
120
|
`
|
|
136
121
|
]; }
|
|
137
122
|
get context() {
|
|
138
|
-
return {
|
|
139
|
-
|
|
140
|
-
search: {
|
|
141
|
-
handler: (search) => {
|
|
123
|
+
return { title: i18next.t('title.data-entry list'),
|
|
124
|
+
search: { handler: (search) => {
|
|
142
125
|
this.grist.searchText = search;
|
|
143
126
|
},
|
|
144
|
-
value: this.grist?.searchText || ''
|
|
145
|
-
|
|
146
|
-
filter: {
|
|
147
|
-
handler: () => {
|
|
127
|
+
value: this.grist?.searchText || '' },
|
|
128
|
+
filter: { handler: () => {
|
|
148
129
|
this.grist.toggleHeadroom();
|
|
149
130
|
}
|
|
150
131
|
},
|
|
151
132
|
help: 'dataset/data-entry-list',
|
|
152
|
-
toolbar: false
|
|
153
|
-
};
|
|
133
|
+
toolbar: false };
|
|
154
134
|
}
|
|
155
135
|
render() {
|
|
156
136
|
return html `
|
|
@@ -169,73 +149,59 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
|
|
|
169
149
|
`;
|
|
170
150
|
}
|
|
171
151
|
async pageInitialized(lifecycle) {
|
|
172
|
-
this.gristConfig = {
|
|
173
|
-
list: {
|
|
174
|
-
thumbnail: 'entryView',
|
|
152
|
+
this.gristConfig = { list: { thumbnail: 'entryView',
|
|
175
153
|
fields: ['name', 'description'],
|
|
176
154
|
details: ['schedule', 'type', 'useCase', 'latestCollectedAt', 'prevSchedule', 'nextSchedule']
|
|
177
155
|
},
|
|
178
156
|
columns: [
|
|
179
|
-
{
|
|
180
|
-
type: 'gutter',
|
|
157
|
+
{ type: 'gutter',
|
|
181
158
|
gutterName: 'button',
|
|
182
159
|
icon: record => (record?.isSupervisor || record?.isEntryAllowed ? 'assignment_add' : ''),
|
|
183
160
|
iconOnly: false,
|
|
184
161
|
width: 96,
|
|
185
162
|
fixed: true,
|
|
186
163
|
title: record => record?.isSupervisor || record?.isEntryAllowed ? i18next.t('button.assign-data-collection') : '',
|
|
187
|
-
handlers: {
|
|
188
|
-
click: issueDataEntry
|
|
164
|
+
handlers: { click: issueDataEntry
|
|
189
165
|
}
|
|
190
166
|
},
|
|
191
|
-
{
|
|
192
|
-
type: 'gutter',
|
|
167
|
+
{ type: 'gutter',
|
|
193
168
|
gutterName: 'button',
|
|
194
169
|
icon: record => (record?.isEntryAllowed ? 'note_alt' : ''),
|
|
195
170
|
iconOnly: false,
|
|
196
171
|
width: 96,
|
|
197
172
|
fixed: true,
|
|
198
173
|
title: record => (record?.isEntryAllowed ? i18next.t('button.enter-data') : ''),
|
|
199
|
-
handlers: {
|
|
200
|
-
click: showEntryView
|
|
174
|
+
handlers: { click: showEntryView
|
|
201
175
|
}
|
|
202
176
|
},
|
|
203
|
-
{
|
|
204
|
-
type: 'string',
|
|
177
|
+
{ type: 'string',
|
|
205
178
|
name: 'name',
|
|
206
179
|
header: i18next.t('field.name'),
|
|
207
|
-
record: {
|
|
208
|
-
editable: false
|
|
180
|
+
record: { editable: false
|
|
209
181
|
},
|
|
210
182
|
filter: 'search',
|
|
211
183
|
sortable: true,
|
|
212
184
|
width: 150
|
|
213
185
|
},
|
|
214
|
-
{
|
|
215
|
-
type: 'string',
|
|
186
|
+
{ type: 'string',
|
|
216
187
|
name: 'description',
|
|
217
188
|
header: i18next.t('field.description'),
|
|
218
|
-
record: {
|
|
219
|
-
editable: false
|
|
189
|
+
record: { editable: false
|
|
220
190
|
},
|
|
221
191
|
filter: 'search',
|
|
222
192
|
width: 200
|
|
223
193
|
},
|
|
224
|
-
{
|
|
225
|
-
type: 'select',
|
|
194
|
+
{ type: 'select',
|
|
226
195
|
name: 'type',
|
|
227
196
|
label: true,
|
|
228
197
|
header: i18next.t('field.type'),
|
|
229
|
-
record: {
|
|
230
|
-
editable: false,
|
|
198
|
+
record: { editable: false,
|
|
231
199
|
options: [
|
|
232
200
|
{},
|
|
233
|
-
{
|
|
234
|
-
display: i18next.t('text.manually collected'),
|
|
201
|
+
{ display: i18next.t('text.manually collected'),
|
|
235
202
|
value: 'manual'
|
|
236
203
|
},
|
|
237
|
-
{
|
|
238
|
-
display: i18next.t('text.automatically collected'),
|
|
204
|
+
{ display: i18next.t('text.automatically collected'),
|
|
239
205
|
value: 'automatic'
|
|
240
206
|
}
|
|
241
207
|
]
|
|
@@ -244,86 +210,69 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
|
|
|
244
210
|
filter: true,
|
|
245
211
|
width: 60
|
|
246
212
|
},
|
|
247
|
-
{
|
|
248
|
-
type: 'select',
|
|
213
|
+
{ type: 'select',
|
|
249
214
|
name: 'useCase',
|
|
250
215
|
label: true,
|
|
251
216
|
header: i18next.t('field.use-case'),
|
|
252
|
-
record: {
|
|
253
|
-
editable: false,
|
|
217
|
+
record: { editable: false,
|
|
254
218
|
options: USECASE_OPTIONS
|
|
255
219
|
},
|
|
256
220
|
sortable: true,
|
|
257
|
-
filter: {
|
|
258
|
-
operator: 'eq',
|
|
221
|
+
filter: { operator: 'eq',
|
|
259
222
|
options: USECASE_OPTIONS /* in case select options type is a function, filter should have its own options */
|
|
260
223
|
},
|
|
261
224
|
width: 80
|
|
262
225
|
},
|
|
263
|
-
{
|
|
264
|
-
type: 'crontab',
|
|
226
|
+
{ type: 'crontab',
|
|
265
227
|
name: 'schedule',
|
|
266
228
|
label: true,
|
|
267
229
|
header: i18next.t('field.schedule'),
|
|
268
|
-
record: {
|
|
269
|
-
editable: false
|
|
230
|
+
record: { editable: false
|
|
270
231
|
},
|
|
271
232
|
width: 80
|
|
272
233
|
},
|
|
273
|
-
{
|
|
274
|
-
type: 'resource-object',
|
|
234
|
+
{ type: 'resource-object',
|
|
275
235
|
name: 'entryRole',
|
|
276
236
|
header: i18next.t('field.entry-role'),
|
|
277
|
-
record: {
|
|
278
|
-
editable: false
|
|
237
|
+
record: { editable: false
|
|
279
238
|
},
|
|
280
239
|
width: 120
|
|
281
240
|
},
|
|
282
|
-
{
|
|
283
|
-
type: 'resource-object',
|
|
241
|
+
{ type: 'resource-object',
|
|
284
242
|
name: 'supervisoryRole',
|
|
285
243
|
header: i18next.t('field.supervisory-role'),
|
|
286
|
-
record: {
|
|
287
|
-
editable: false
|
|
244
|
+
record: { editable: false
|
|
288
245
|
},
|
|
289
246
|
width: 120
|
|
290
247
|
},
|
|
291
|
-
{
|
|
292
|
-
type: 'datetime',
|
|
248
|
+
{ type: 'datetime',
|
|
293
249
|
name: 'latestCollectedAt',
|
|
294
250
|
label: true,
|
|
295
251
|
header: i18next.t('field.latest-collected-at'),
|
|
296
|
-
record: {
|
|
297
|
-
editable: false
|
|
252
|
+
record: { editable: false
|
|
298
253
|
},
|
|
299
254
|
width: 180
|
|
300
255
|
},
|
|
301
|
-
{
|
|
302
|
-
type: 'datetime',
|
|
256
|
+
{ type: 'datetime',
|
|
303
257
|
name: 'prevSchedule',
|
|
304
258
|
label: true,
|
|
305
259
|
header: i18next.t('field.prev-schedule'),
|
|
306
|
-
record: {
|
|
307
|
-
editable: false
|
|
260
|
+
record: { editable: false
|
|
308
261
|
},
|
|
309
262
|
width: 180
|
|
310
263
|
},
|
|
311
|
-
{
|
|
312
|
-
type: 'datetime',
|
|
264
|
+
{ type: 'datetime',
|
|
313
265
|
name: 'nextSchedule',
|
|
314
266
|
label: true,
|
|
315
267
|
header: i18next.t('field.next-schedule'),
|
|
316
|
-
record: {
|
|
317
|
-
editable: false
|
|
268
|
+
record: { editable: false
|
|
318
269
|
},
|
|
319
270
|
width: 180
|
|
320
271
|
},
|
|
321
|
-
{
|
|
322
|
-
type: 'string',
|
|
272
|
+
{ type: 'string',
|
|
323
273
|
name: 'entryView',
|
|
324
274
|
hidden: true,
|
|
325
|
-
record: {
|
|
326
|
-
editable: false,
|
|
275
|
+
record: { editable: false,
|
|
327
276
|
renderer: function (value, column, record, rowIndex, field) {
|
|
328
277
|
const type = record.entryType !== 'board' ? 'string' : 'image';
|
|
329
278
|
let renderedValue;
|
|
@@ -336,8 +285,7 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
|
|
|
336
285
|
return getRenderer(type)(renderedValue, column, record, rowIndex, field);
|
|
337
286
|
}
|
|
338
287
|
},
|
|
339
|
-
handlers: {
|
|
340
|
-
click: (columns, data, column, record, rowIndex) => {
|
|
288
|
+
handlers: { click: (columns, data, column, record, rowIndex) => {
|
|
341
289
|
if (record?.isEntryAllowed) {
|
|
342
290
|
showEntryView(columns, data, column, record, rowIndex);
|
|
343
291
|
}
|
|
@@ -345,33 +293,26 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
|
|
|
345
293
|
}
|
|
346
294
|
}
|
|
347
295
|
],
|
|
348
|
-
rows: {
|
|
349
|
-
appendable: false,
|
|
296
|
+
rows: { appendable: false,
|
|
350
297
|
editable: false,
|
|
351
|
-
selectable: {
|
|
352
|
-
multiple: false
|
|
298
|
+
selectable: { multiple: false
|
|
353
299
|
},
|
|
354
300
|
classifier: function (record, rowIndex) { }
|
|
355
301
|
},
|
|
356
302
|
sorters: [
|
|
357
|
-
{
|
|
358
|
-
name: 'name'
|
|
303
|
+
{ name: 'name'
|
|
359
304
|
}
|
|
360
305
|
]
|
|
361
306
|
};
|
|
362
307
|
}
|
|
363
308
|
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
364
|
-
const response = await client.query({
|
|
365
|
-
|
|
366
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $inherited: InheritedValueType) {
|
|
367
|
-
responses: dataSetsForEntry(
|
|
309
|
+
const response = await client.query({ query: gql `
|
|
310
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $inherited: InheritedValueType) { responses: dataSetsForEntry(
|
|
368
311
|
filters: $filters
|
|
369
312
|
pagination: $pagination
|
|
370
313
|
sortings: $sortings
|
|
371
314
|
inherited: $inherited
|
|
372
|
-
) {
|
|
373
|
-
items {
|
|
374
|
-
id
|
|
315
|
+
) { items { id
|
|
375
316
|
name
|
|
376
317
|
description
|
|
377
318
|
partitionKeys
|
|
@@ -382,30 +323,25 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
|
|
|
382
323
|
timezone
|
|
383
324
|
isSupervisor
|
|
384
325
|
isEntryAllowed
|
|
385
|
-
entryRole {
|
|
386
|
-
id
|
|
326
|
+
entryRole { id
|
|
387
327
|
name
|
|
388
|
-
|
|
389
|
-
supervisoryRole {
|
|
390
|
-
id
|
|
328
|
+
}
|
|
329
|
+
supervisoryRole { id
|
|
391
330
|
name
|
|
392
|
-
|
|
331
|
+
}
|
|
393
332
|
entryType
|
|
394
333
|
entryView
|
|
395
|
-
entryBoard {
|
|
396
|
-
|
|
397
|
-
}
|
|
334
|
+
entryBoard { thumbnail
|
|
335
|
+
}
|
|
398
336
|
monitorType
|
|
399
337
|
monitorView
|
|
400
|
-
updater {
|
|
401
|
-
id
|
|
338
|
+
updater { id
|
|
402
339
|
name
|
|
403
|
-
|
|
340
|
+
}
|
|
404
341
|
reportType
|
|
405
342
|
reportView
|
|
406
343
|
updatedAt
|
|
407
|
-
dataItems {
|
|
408
|
-
name
|
|
344
|
+
dataItems { name
|
|
409
345
|
description
|
|
410
346
|
active
|
|
411
347
|
hidden
|
|
@@ -418,25 +354,23 @@ let DataEntryListPage = class DataEntryListPage extends connect(store)(localize(
|
|
|
418
354
|
quota
|
|
419
355
|
spec
|
|
420
356
|
stat
|
|
421
|
-
|
|
357
|
+
}
|
|
422
358
|
latestCollectedAt
|
|
423
359
|
nextSchedule
|
|
424
360
|
prevSchedule
|
|
425
361
|
nextSummarySchedule
|
|
426
|
-
|
|
362
|
+
}
|
|
427
363
|
total
|
|
428
|
-
|
|
429
|
-
|
|
364
|
+
}
|
|
365
|
+
}
|
|
430
366
|
`,
|
|
431
|
-
variables: {
|
|
432
|
-
filters,
|
|
367
|
+
variables: { filters,
|
|
433
368
|
pagination: { page, limit },
|
|
434
369
|
sortings,
|
|
435
370
|
inherited: InheritedValueType.Include
|
|
436
371
|
}
|
|
437
372
|
});
|
|
438
|
-
return {
|
|
439
|
-
total: response.data.responses.total || 0,
|
|
373
|
+
return { total: response.data.responses.total || 0,
|
|
440
374
|
records: response.data.responses.items || []
|
|
441
375
|
};
|
|
442
376
|
}
|