@things-factory/worklist 10.1.256 → 10.1.257
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/dist-client/activity-state-counts.d.ts +3 -3
- package/dist-client/activity-state-counts.js +6 -5
- package/dist-client/activity-state-counts.js.map +1 -1
- package/dist-client/chip-counts.d.ts +1 -1
- package/dist-client/chip-counts.js +1 -1
- package/dist-client/chip-counts.js.map +1 -1
- package/dist-client/chip-filters.d.ts +3 -2
- package/dist-client/chip-filters.js +5 -3
- package/dist-client/chip-filters.js.map +1 -1
- package/dist-client/components/activity-/bowner-view.js +26 -40
- package/dist-client/components/activity-/bowner-view.js.map +1 -1
- package/dist-client/components/activity-instance-preview.js +37 -49
- package/dist-client/components/activity-instance-preview.js.map +1 -1
- package/dist-client/components/activity-intro-view.js +26 -40
- package/dist-client/components/activity-intro-view.js.map +1 -1
- package/dist-client/components/activity-reporter-view.js +26 -40
- package/dist-client/components/activity-reporter-view.js.map +1 -1
- package/dist-client/components/activity-starter-form.d.ts +2 -3
- package/dist-client/components/activity-starter-form.js +52 -64
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/components/mutation-outcome.d.ts +6 -0
- package/dist-client/components/mutation-outcome.js +9 -0
- package/dist-client/components/mutation-outcome.js.map +1 -1
- package/dist-client/components/say-outcome.d.ts +3 -0
- package/dist-client/components/say-outcome.js +3 -0
- package/dist-client/components/say-outcome.js.map +1 -1
- package/dist-client/entity360/person-open-work-section.d.ts +2 -3
- package/dist-client/entity360/person-open-work-section.js +17 -31
- package/dist-client/entity360/person-open-work-section.js.map +1 -1
- package/dist-client/pages/activity/activity-list-page.d.ts +4 -2
- package/dist-client/pages/activity/activity-list-page.js +6 -11
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-page.d.ts +13 -7
- package/dist-client/pages/activity/activity-page.js +111 -167
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +14 -8
- package/dist-client/pages/activity-approval/activity-approval-page.js +107 -123
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-catalog/activity-catalog-page.d.ts +10 -9
- package/dist-client/pages/activity-catalog/activity-catalog-page.js +38 -70
- package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -1
- package/dist-client/pages/activity-catalog/activity-detail-page.d.ts +6 -6
- package/dist-client/pages/activity-catalog/activity-detail-page.js +30 -57
- package/dist-client/pages/activity-catalog/activity-detail-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +2 -2
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +6 -3
- package/dist-client/pages/activity-instance/activity-instance-search-page.js +27 -29
- package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +15 -8
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +130 -239
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.d.ts +2 -2
- package/dist-client/pages/activity-instance/activity-instance-view.js +109 -118
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +15 -6
- package/dist-client/pages/activity-thread/activity-thread-page.js +128 -131
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +6 -6
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +28 -53
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.d.ts +3 -3
- package/dist-client/pages/todo/approval-done-list-page.js +5 -14
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.d.ts +19 -9
- package/dist-client/pages/todo/approval-pending-list-page.js +46 -59
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.d.ts +8 -2
- package/dist-client/pages/todo/draft-list-page.js +24 -23
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +3 -3
- package/dist-client/pages/todo/pickable-list-page.js +5 -14
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +11 -5
- package/dist-client/pages/todo/todo-list-page.js +33 -36
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* How many activities each state chip (작성 중 · 배포 · 폐기) would show, under the activity list's other conditions -
|
|
3
|
-
* counted by the server (`activityStateCounts`), the state conditions left out. Both activity lists ask it
|
|
4
|
-
* and the meta designer's.
|
|
3
|
+
* counted by the server (`activityStateCounts`), the state conditions left out. Both activity lists ask it from their
|
|
4
|
+
* grid's `countHandler`, under the read's `signal`: worklist's and the meta designer's.
|
|
5
5
|
*/
|
|
6
|
-
export declare function activityStateCounts(filters: any[]): Promise<
|
|
6
|
+
export declare function activityStateCounts(filters: any[], signal?: AbortSignal): Promise<Record<string, number>>;
|
|
@@ -2,10 +2,10 @@ import gql from 'graphql-tag';
|
|
|
2
2
|
import { client } from '@operato/graphql';
|
|
3
3
|
/**
|
|
4
4
|
* How many activities each state chip (작성 중 · 배포 · 폐기) would show, under the activity list's other conditions -
|
|
5
|
-
* counted by the server (`activityStateCounts`), the state conditions left out. Both activity lists ask it
|
|
6
|
-
* and the meta designer's.
|
|
5
|
+
* counted by the server (`activityStateCounts`), the state conditions left out. Both activity lists ask it from their
|
|
6
|
+
* grid's `countHandler`, under the read's `signal`: worklist's and the meta designer's.
|
|
7
7
|
*/
|
|
8
|
-
export async function activityStateCounts(filters) {
|
|
8
|
+
export async function activityStateCounts(filters, signal) {
|
|
9
9
|
const response = await client.query({
|
|
10
10
|
query: gql `
|
|
11
11
|
query ($filters: [Filter!]) {
|
|
@@ -16,8 +16,9 @@ export async function activityStateCounts(filters) {
|
|
|
16
16
|
}
|
|
17
17
|
`,
|
|
18
18
|
variables: { filters },
|
|
19
|
-
fetchPolicy: 'no-cache'
|
|
19
|
+
fetchPolicy: 'no-cache',
|
|
20
|
+
context: { fetchOptions: { signal }, queryDeduplication: false }
|
|
20
21
|
});
|
|
21
|
-
return
|
|
22
|
+
return Object.fromEntries((response.data?.activityStateCounts ?? []).map((row) => [row.value, row.count]));
|
|
22
23
|
}
|
|
23
24
|
//# sourceMappingURL=activity-state-counts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-state-counts.js","sourceRoot":"","sources":["../client/activity-state-counts.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAc;
|
|
1
|
+
{"version":3,"file":"activity-state-counts.js","sourceRoot":"","sources":["../client/activity-state-counts.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAc,EAAE,MAAoB;IAC5E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;KAOT;QACD,SAAS,EAAE,EAAE,OAAO,EAAE;QACtB,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE;KACjE,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAqC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC9I,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\n/**\n * How many activities each state chip (작성 중 · 배포 · 폐기) would show, under the activity list's other conditions -\n * counted by the server (`activityStateCounts`), the state conditions left out. Both activity lists ask it from their\n * grid's `countHandler`, under the read's `signal`: worklist's and the meta designer's.\n */\nexport async function activityStateCounts(filters: any[], signal?: AbortSignal): Promise<Record<string, number>> {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!]) {\n activityStateCounts(filters: $filters) {\n value\n count\n }\n }\n `,\n variables: { filters },\n fetchPolicy: 'no-cache',\n context: { fetchOptions: { signal }, queryDeduplication: false }\n })\n return Object.fromEntries((response.data?.activityStateCounts ?? []).map((row: { value: string; count: number }) => [row.value, row.count]))\n}\n"]}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* chip, so the number is counted by the server exactly as the list is. Pure: the caller gives the filters each chip
|
|
5
5
|
* makes and the door that totals the sets.
|
|
6
6
|
*/
|
|
7
|
-
export declare function chipCounts<F>(keys: readonly string[], filtersFor: (key: string) => F[], totals: (sets: F[][]) => Promise<number[]>): Promise<
|
|
7
|
+
export declare function chipCounts<F>(keys: readonly string[], filtersFor: (key: string) => F[], totals: (sets: F[][]) => Promise<number[]>): Promise<Record<string, number>>;
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export async function chipCounts(keys, filtersFor, totals) {
|
|
8
8
|
const counted = await totals(keys.map(key => filtersFor(key)));
|
|
9
|
-
return
|
|
9
|
+
return Object.fromEntries(keys.map((key, at) => [key, counted[at] ?? 0]));
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=chip-counts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip-counts.js","sourceRoot":"","sources":["../client/chip-counts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAI,IAAuB,EAAE,UAAgC,EAAE,MAA0C;IACvI,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"chip-counts.js","sourceRoot":"","sources":["../client/chip-counts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAI,IAAuB,EAAE,UAAgC,EAAE,MAA0C;IACvI,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9D,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC3E,CAAC","sourcesContent":["/**\n * The numbers beside a list's condition chips (「중요」, 「만기」 ...): each is how many the list would show with that\n * chip pressed under the list's other conditions - the list's own door asked for its total, one set of filters per\n * chip, so the number is counted by the server exactly as the list is. Pure: the caller gives the filters each chip\n * makes and the door that totals the sets.\n */\nexport async function chipCounts<F>(keys: readonly string[], filtersFor: (key: string) => F[], totals: (sets: F[][]) => Promise<number[]>): Promise<Record<string, number>> {\n const counted = await totals(keys.map(key => filtersFor(key)))\n return Object.fromEntries(keys.map((key, at) => [key, counted[at] ?? 0]))\n}\n"]}
|
|
@@ -55,6 +55,7 @@ export declare function dueSoonChip(): {
|
|
|
55
55
|
export declare function withChips(filters: any[], chosen?: string | string[] | null): any[];
|
|
56
56
|
/**
|
|
57
57
|
* How many each chip would show under the list's other conditions (`filters`, without the pressed chip) - the list
|
|
58
|
-
* door `query` asked for its total once per chip, in one request.
|
|
58
|
+
* door `query` asked for its total once per chip, in one request. A list's `countHandler` asks it under the grid
|
|
59
|
+
* read's `signal`.
|
|
59
60
|
*/
|
|
60
|
-
export declare function countChips(query: string, keys: string[], filters: any[]): Promise<
|
|
61
|
+
export declare function countChips(query: string, keys: string[], filters: any[], signal?: AbortSignal): Promise<Record<string, number>>;
|
|
@@ -83,9 +83,10 @@ export function withChips(filters, chosen) {
|
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* How many each chip would show under the list's other conditions (`filters`, without the pressed chip) - the list
|
|
86
|
-
* door `query` asked for its total once per chip, in one request.
|
|
86
|
+
* door `query` asked for its total once per chip, in one request. A list's `countHandler` asks it under the grid
|
|
87
|
+
* read's `signal`.
|
|
87
88
|
*/
|
|
88
|
-
export async function countChips(query, keys, filters) {
|
|
89
|
+
export async function countChips(query, keys, filters, signal) {
|
|
89
90
|
return chipCounts(keys, key => withChips(filters, key), async (sets) => {
|
|
90
91
|
const response = await client.query({
|
|
91
92
|
query: gql `
|
|
@@ -94,7 +95,8 @@ export async function countChips(query, keys, filters) {
|
|
|
94
95
|
}
|
|
95
96
|
`,
|
|
96
97
|
variables: Object.fromEntries(sets.map((set, at) => [`f${at}`, set])),
|
|
97
|
-
fetchPolicy: 'no-cache'
|
|
98
|
+
fetchPolicy: 'no-cache',
|
|
99
|
+
context: { fetchOptions: { signal }, queryDeduplication: false }
|
|
98
100
|
});
|
|
99
101
|
return sets.map((_, at) => response.data?.[`c${at}`]?.total ?? 0);
|
|
100
102
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip-filters.js","sourceRoot":"","sources":["../client/chip-filters.ts"],"names":[],"mappings":"AAAA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EAAE,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;cACzD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,eAAe,EAAE,gDAAgD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;SAEtH;YACD,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YACrE,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE;SACjE,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAA;IACnE,CAAC,CACF,CAAA;AACH,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { adjustFilters } from '@operato/utils'\n\nimport { chipCounts } from './chip-counts.js'\nimport { ActivityThreadStatus } from './types/activity-thread.js'\n\n/**\n * 목록 위의 칩이 무엇을 걸러 내는가 — **한 곳에서 정한다.**\n *\n * ── 왜 모았나 (2026-09-02) ─────────────────────────────────────────────────\n * 「중요」와 「만기」가 다섯 화면에 있는데, 그 뜻이 다섯 곳에 복사돼 있었다.\n *\n * priority gte 2 5곳\n * dueAt lte (지금 + 24 * 3600 * 1000) 4곳\n *\n * 한 화면에서 「중요」를 우선순위 3 이상으로 바꾸면 나머지 넷은 2로 남는다. 그러면 **같은 이름의 칩이\n * 화면마다 다른 것을 걸러 낸다.** 사용자는 그것을 알 방법이 없다.\n *\n * ── 칩은 컬럼 필터가 아니다 ────────────────────────────────────────────────\n * `ox-filters-form` 은 칸 하나와 연산자 하나를 그린다. 이 칩들은 **이름 붙인 조건 묶음**이다 —\n * 「중요」는 `priority = ?` 가 아니라 `priority >= 2` 이고, 「만기」는 지금 시각에서 계산한다.\n *\n * 그래서 사용자가 스스로 만들 수 없다. 「중요 = 우선순위 2 이상」은 제품이 아는 사실이다.\n *\n * ── 그러니 그 뜻을 화면이 말해야 한다 ──────────────────────────────────────\n * 이름만 보이면 눌러 보고 결과를 되짚어야 한다. 칩마다 `hint` 를 함께 낸다(마우스를 올리면 보인다).\n */\n\n/** 「중요」의 경계. 이 값 이상이 중요하다. */\nexport const IMPORTANT_FROM = 2\n\n/** 「만기」의 창. 이 시간 안에 만기가 오는 것. */\nexport const DUE_WITHIN_HOURS = 24\n\n/*\n * 연산자를 리터럴로 좁힌다(`as const`). `adjustFilters` 가 받는 타입은 연산자가 정해진 낱말 중\n * 하나인데, 그 타입이 내보내지지 않아 여기서 가져올 수 없다. `string` 으로 두면 넘길 때 거절된다.\n */\n\n/** 우선순위가 경계 이상인 것. */\nexport function importantFilters() {\n return [{ name: 'priority', operator: 'gte' as const, value: IMPORTANT_FROM }]\n}\n\n/**\n * 만기가 창 안에 드는 것.\n *\n * 부를 때마다 지금 시각으로 계산한다 — 화면을 열어 둔 채 시간이 지나면 「만기 임박」의 범위도 함께\n * 움직여야 한다.\n */\nexport function dueSoonFilters() {\n const until = new Date(Date.now() + DUE_WITHIN_HOURS * 3600 * 1000).toISOString().replace('T', ' ')\n\n return [{ name: 'dueAt', operator: 'lte' as const, value: until }]\n}\n\n/** 칩 하나 — 이름과 뜻. */\nexport function importantChip() {\n return {\n display: i18next.t('label.filter-important'),\n value: 'important',\n hint: i18next.t('text.filter-important-hint', { from: IMPORTANT_FROM })\n }\n}\n\nexport function dueSoonChip() {\n return {\n display: i18next.t('label.filter-due'),\n value: 'due',\n hint: i18next.t('text.filter-due-hint', { hours: DUE_WITHIN_HOURS })\n }\n}\n\n/*\n * 칩마다 거는 조건 — 화면마다 if 로 따로 적던 것을 여기 한 곳에 둔다. 같은 이름의 칩은 어느 화면에서나 같은 것을\n * 걸러 낸다(위 「왜 모았나」). 시각에서 계산하는 것은 부를 때마다 지금으로 계산한다.\n */\nconst CONDITIONS: Record<string, () => { name: string; operator: any; value: any }[]> = {\n important: importantFilters,\n due: dueSoonFilters,\n proceeding: () => [{ name: 'state', operator: 'eq', value: ActivityThreadStatus.Started }],\n /* 최근 24시간 이내에 끝낸 일 */\n recent: () => [{ name: 'terminatedAt', operator: 'gte', value: new Date(Date.now() - 24 * 3600 * 1000).toISOString().replace('T', ' ') }],\n aborted: () => [{ name: 'state', operator: 'eq', value: ActivityThreadStatus.Aborted }],\n resubmitted: () => [{ name: 'round', operator: 'gte', value: 2 }],\n rejected: () => [{ name: 'judgment', operator: 'eq', value: 'rejected' }]\n}\n\n/** The list's filters with the pressed chips' conditions added. */\nexport function withChips(filters: any[], chosen?: string | string[] | null): any[] {\n const keys = chosen instanceof Array ? chosen : chosen ? [chosen] : []\n return keys.reduce((narrowed, key) => (CONDITIONS[key] ? adjustFilters(narrowed, CONDITIONS[key]()) : narrowed), filters)\n}\n\n/**\n * How many each chip would show under the list's other conditions (`filters`, without the pressed chip) - the list\n * door `query` asked for its total once per chip, in one request. A list's `countHandler` asks it under the grid\n * read's `signal`.\n */\nexport async function countChips(query: string, keys: string[], filters: any[], signal?: AbortSignal): Promise<Record<string, number>> {\n return chipCounts(\n keys,\n key => withChips(filters, key),\n async sets => {\n const response = await client.query({\n query: gql`\n query (${sets.map((_, at) => `$f${at}: [Filter!]`).join(', ')}) {\n ${sets.map((_, at) => `c${at}: ${query}(filters: $f${at}, pagination: { page: 1, limit: 1 }) { total }`).join('\\n')}\n }\n `,\n variables: Object.fromEntries(sets.map((set, at) => [`f${at}`, set])),\n fetchPolicy: 'no-cache',\n context: { fetchOptions: { signal }, queryDeduplication: false }\n })\n return sets.map((_, at) => response.data?.[`c${at}`]?.total ?? 0)\n }\n )\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import '@material/web/button/elevated-button.js';
|
|
|
3
3
|
import gql from 'graphql-tag';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
-
import {
|
|
6
|
+
import { QueryController } from '@operato/graphql';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
9
9
|
let ActivityOwnerView = class ActivityOwnerView extends localize(i18next)(LitElement) {
|
|
@@ -33,10 +33,34 @@ let ActivityOwnerView = class ActivityOwnerView extends localize(i18next)(LitEle
|
|
|
33
33
|
]; }
|
|
34
34
|
constructor() {
|
|
35
35
|
super();
|
|
36
|
+
/* The activity the id names (ADR-0190). */
|
|
37
|
+
this.activity = new QueryController(this, gql `
|
|
38
|
+
query activity($id: String!) {
|
|
39
|
+
activity(id: $id) {
|
|
40
|
+
id
|
|
41
|
+
name
|
|
42
|
+
description
|
|
43
|
+
state
|
|
44
|
+
thumbnail
|
|
45
|
+
model {
|
|
46
|
+
name
|
|
47
|
+
description
|
|
48
|
+
active
|
|
49
|
+
tag
|
|
50
|
+
inout
|
|
51
|
+
type
|
|
52
|
+
unit
|
|
53
|
+
options
|
|
54
|
+
quantifier
|
|
55
|
+
spec
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`, { variables: () => (this.activityId ? { id: this.activityId } : undefined) });
|
|
36
60
|
this.activityInstance = {};
|
|
37
61
|
}
|
|
38
62
|
render() {
|
|
39
|
-
const { name, description, thumbnail } = this.activity || {};
|
|
63
|
+
const { name, description, thumbnail } = this.activity.data?.activity || {};
|
|
40
64
|
return html `
|
|
41
65
|
<content>
|
|
42
66
|
<section>
|
|
@@ -50,49 +74,11 @@ let ActivityOwnerView = class ActivityOwnerView extends localize(i18next)(LitEle
|
|
|
50
74
|
</content>
|
|
51
75
|
`;
|
|
52
76
|
}
|
|
53
|
-
firstUpdated() {
|
|
54
|
-
this.fetchActivity(this.activityId);
|
|
55
|
-
}
|
|
56
|
-
async fetchActivity(id) {
|
|
57
|
-
const response = await client.query({
|
|
58
|
-
query: gql `
|
|
59
|
-
query activity($id: String!) {
|
|
60
|
-
activity(id: $id) {
|
|
61
|
-
id
|
|
62
|
-
name
|
|
63
|
-
description
|
|
64
|
-
state
|
|
65
|
-
thumbnail
|
|
66
|
-
model {
|
|
67
|
-
name
|
|
68
|
-
description
|
|
69
|
-
active
|
|
70
|
-
tag
|
|
71
|
-
inout
|
|
72
|
-
type
|
|
73
|
-
unit
|
|
74
|
-
options
|
|
75
|
-
quantifier
|
|
76
|
-
spec
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
`,
|
|
81
|
-
variables: {
|
|
82
|
-
id
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
this.activity = response.data.activity;
|
|
86
|
-
}
|
|
87
77
|
};
|
|
88
78
|
__decorate([
|
|
89
79
|
property({ type: String }),
|
|
90
80
|
__metadata("design:type", String)
|
|
91
81
|
], ActivityOwnerView.prototype, "activityId", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
property({ type: Object }),
|
|
94
|
-
__metadata("design:type", Object)
|
|
95
|
-
], ActivityOwnerView.prototype, "activity", void 0);
|
|
96
82
|
__decorate([
|
|
97
83
|
property({ type: Object }),
|
|
98
84
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-\bowner-view.js","sourceRoot":"","sources":["../../client/components/activity-\bowner-view.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAEhD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM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,WAAW;;;;qBAIpB,SAAS;;;KAGzB,CAAA;IACH,CAAC;;AArD2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAAsB;AA1B7C,iBAAiB;IADtB,aAAa,CAAC,qBAAqB,CAAC;;GAC/B,iBAAiB,CA+EtB","sourcesContent":["import '@material/web/button/elevated-button.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-owner-view')\nclass ActivityOwnerView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n content {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: var(--spacing-medium);\n overflow: auto;\n }\n\n section {\n display: flex;\n flex-direction: column;\n }\n `\n ]\n @property({ type: String }) activityId?: string\n @property({ type: Object }) activityInstance: any\n\n constructor() {\n super()\n\n this.activityInstance = {}\n }\n\n /* The activity the id names (ADR-0190). */\n private activity = new QueryController(\n this,\n gql`\n query activity($id: String!) {\n activity(id: $id) {\n id\n name\n description\n state\n thumbnail\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n }\n `,\n { variables: () => (this.activityId ? { id: this.activityId } : undefined) }\n )\n\n render() {\n const { name, description, thumbnail } = this.activity.data?.activity || {}\n\n return html`\n <content>\n <section>\n <div>name: ${name}</div>\n <div>description: ${description}</div>\n </section>\n\n <section>\n <img src=${thumbnail} />\n </section>\n </content>\n `\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
|
4
4
|
import gql from 'graphql-tag';
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
|
-
import { client } from '@operato/graphql';
|
|
7
|
+
import { client, QueryController } from '@operato/graphql';
|
|
8
8
|
import { i18next, localize } from '@operato/i18n';
|
|
9
9
|
import { canPick } from './can-pick.js';
|
|
10
10
|
import { ranMutation } from './say-outcome.js';
|
|
@@ -13,7 +13,39 @@ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
|
13
13
|
let ActivityInstancePreview = class ActivityInstancePreview extends localize(i18next)(LitElement) {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
|
|
16
|
+
/* The instance the id names (ADR-0190). */
|
|
17
|
+
this.instance = new QueryController(this, gql `
|
|
18
|
+
query ($id: String!) {
|
|
19
|
+
activityInstance(id: $id) {
|
|
20
|
+
id
|
|
21
|
+
name
|
|
22
|
+
description
|
|
23
|
+
input
|
|
24
|
+
state
|
|
25
|
+
threadsMin
|
|
26
|
+
threadsMax
|
|
27
|
+
activity {
|
|
28
|
+
id
|
|
29
|
+
name
|
|
30
|
+
description
|
|
31
|
+
state
|
|
32
|
+
thumbnail
|
|
33
|
+
model {
|
|
34
|
+
name
|
|
35
|
+
description
|
|
36
|
+
active
|
|
37
|
+
tag
|
|
38
|
+
inout
|
|
39
|
+
type
|
|
40
|
+
unit
|
|
41
|
+
options
|
|
42
|
+
quantifier
|
|
43
|
+
spec
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`, { variables: () => (this.activityInstanceId ? { id: this.activityInstanceId } : undefined) });
|
|
17
49
|
this.picked = false;
|
|
18
50
|
}
|
|
19
51
|
static { this.styles = [
|
|
@@ -45,6 +77,9 @@ let ActivityInstancePreview = class ActivityInstancePreview extends localize(i18
|
|
|
45
77
|
}
|
|
46
78
|
`
|
|
47
79
|
]; }
|
|
80
|
+
get activityInstance() {
|
|
81
|
+
return this.instance.data?.activityInstance ?? {};
|
|
82
|
+
}
|
|
48
83
|
render() {
|
|
49
84
|
const { id, name, description, input, state, threadsMin = 0, threadsMax = 0, activity } = this.activityInstance || {};
|
|
50
85
|
const { model, thumbnail } = activity || {};
|
|
@@ -93,49 +128,6 @@ let ActivityInstancePreview = class ActivityInstancePreview extends localize(i18
|
|
|
93
128
|
</div>
|
|
94
129
|
`;
|
|
95
130
|
}
|
|
96
|
-
updated(changes) {
|
|
97
|
-
if (changes.has('activityInstanceId')) {
|
|
98
|
-
this.fetchAll(this.activityInstanceId);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
async fetchAll(id) {
|
|
102
|
-
const response = await client.query({
|
|
103
|
-
query: gql `
|
|
104
|
-
{
|
|
105
|
-
activityInstance(id: "${id}") {
|
|
106
|
-
id
|
|
107
|
-
name
|
|
108
|
-
description
|
|
109
|
-
input
|
|
110
|
-
state
|
|
111
|
-
threadsMin
|
|
112
|
-
threadsMax
|
|
113
|
-
activity {
|
|
114
|
-
id
|
|
115
|
-
name
|
|
116
|
-
description
|
|
117
|
-
state
|
|
118
|
-
thumbnail
|
|
119
|
-
model {
|
|
120
|
-
name
|
|
121
|
-
description
|
|
122
|
-
active
|
|
123
|
-
tag
|
|
124
|
-
inout
|
|
125
|
-
type
|
|
126
|
-
unit
|
|
127
|
-
options
|
|
128
|
-
quantifier
|
|
129
|
-
spec
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
`
|
|
136
|
-
});
|
|
137
|
-
this.activityInstance = response.data.activityInstance;
|
|
138
|
-
}
|
|
139
131
|
async pickActivityInstance() {
|
|
140
132
|
const outcome = await ranMutation(() => client.mutate({
|
|
141
133
|
mutation: gql `
|
|
@@ -163,10 +155,6 @@ __decorate([
|
|
|
163
155
|
property({ type: String }),
|
|
164
156
|
__metadata("design:type", String)
|
|
165
157
|
], ActivityInstancePreview.prototype, "activityInstanceId", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
property({ type: Object }),
|
|
168
|
-
__metadata("design:type", Object)
|
|
169
|
-
], ActivityInstancePreview.prototype, "activityInstance", void 0);
|
|
170
158
|
__decorate([
|
|
171
159
|
state(),
|
|
172
160
|
__metadata("design:type", Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-instance-preview.js","sourceRoot":"","sources":["../../client/components/activity-instance-preview.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,wDAAwD,CAAA;AAE/D,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,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,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"activity-instance-preview.js","sourceRoot":"","sources":["../../client/components/activity-instance-preview.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,wDAAwD,CAAA;AAE/D,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,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,MAAM,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE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O,EAAE,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE;oBAC7C,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE;iBACvE,CAAC;aACH,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;;AAjI2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mEAA4B;AA4C9C;IAAR,KAAK,EAAE;;uDAAwB;AA3E5B,uBAAuB;IAD5B,aAAa,CAAC,2BAA2B,CAAC;GACrC,uBAAuB,CAiK5B","sourcesContent":["import '@material/web/button/elevated-button.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { client, QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\n\nimport { canPick } from './can-pick.js'\nimport { ranMutation } from './say-outcome.js'\nimport { notify } from '@operato/layout'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-instance-preview')\nclass ActivityInstancePreview extends localize(i18next)(LitElement) {\n static styles = [\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n content {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: var(--spacing-medium);\n overflow: auto;\n }\n\n section {\n display: flex;\n flex-direction: column;\n }\n\n #description {\n height: 60px;\n }\n `\n ]\n\n @property({ type: String }) activityInstanceId?: string\n\n /* The instance the id names (ADR-0190). */\n private instance = new QueryController(\n this,\n gql`\n query ($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n input\n state\n threadsMin\n threadsMax\n activity {\n id\n name\n description\n state\n thumbnail\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n }\n }\n `,\n { variables: () => (this.activityInstanceId ? { id: this.activityInstanceId } : undefined) }\n )\n\n private get activityInstance(): any {\n return this.instance.data?.activityInstance ?? {}\n }\n\n @state() picked: boolean = false\n\n render() {\n const {\n id,\n name,\n description,\n input,\n state,\n threadsMin = 0,\n threadsMax = 0,\n activity\n } = this.activityInstance || {}\n const { model, thumbnail } = activity || {}\n\n const inputSpec = (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n label: item.name\n }\n })\n\n const pickable = canPick(this.activityInstance, this.picked)\n\n return html`\n <content>\n <section>\n <h2>mission statement</h2>\n <div>title: ${name}</div>\n <div>${description}</div>\n <div>min-max: ${threadsMin} - ${threadsMax}</div>\n <img src=${thumbnail} />\n </section>\n\n <label>Input</label>\n ${!model\n ? html``\n : html`\n <ox-properties-dynamic-view\n .props=${inputSpec}\n .value=${input}\n @property-change=${e => {\n this.activityInstance.input = e.currentTarget.value\n console.log('activity-instance', this.activityInstance.input)\n }}\n ></ox-properties-dynamic-view>\n `}\n </content>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${e => history.back()}><md-icon>close</md-icon>${i18next.t('button.close')}</button>\n ${pickable\n ? html`<button @click=${this.pickActivityInstance.bind(this)} done>\n <md-icon>done</md-icon>${i18next.t('button.pick')}\n </button>`\n : html``}\n </div>\n `\n }\n\n async pickActivityInstance() {\n const outcome = await ranMutation(() => client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n pickActivityInstance(id: $id) {\n id\n }\n }\n `,\n variables: {\n id: this.activityInstanceId\n }\n }))\n\n if (outcome.ok) {\n this.picked = true\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: `${i18next.t('label.activity-instance')} ${i18next.t('text.pick')}`\n })\n })\n }\n }\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import '@material/web/button/elevated-button.js';
|
|
|
3
3
|
import gql from 'graphql-tag';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
-
import {
|
|
6
|
+
import { QueryController } from '@operato/graphql';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
9
9
|
let ActivityIntroView = class ActivityIntroView extends localize(i18next)(LitElement) {
|
|
@@ -11,6 +11,30 @@ let ActivityIntroView = class ActivityIntroView extends localize(i18next)(LitEle
|
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.activityTemplateId = '';
|
|
13
13
|
this.activityInstance = {};
|
|
14
|
+
/* The template the id names (ADR-0190). */
|
|
15
|
+
this.template = new QueryController(this, gql `
|
|
16
|
+
query activityTemplate($id: String!) {
|
|
17
|
+
activityTemplate(id: $id) {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
description
|
|
21
|
+
state
|
|
22
|
+
thumbnail
|
|
23
|
+
model {
|
|
24
|
+
name
|
|
25
|
+
description
|
|
26
|
+
active
|
|
27
|
+
tag
|
|
28
|
+
inout
|
|
29
|
+
type
|
|
30
|
+
unit
|
|
31
|
+
options
|
|
32
|
+
quantifier
|
|
33
|
+
spec
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`, { variables: () => (this.activityTemplateId ? { id: this.activityTemplateId } : undefined) });
|
|
14
38
|
}
|
|
15
39
|
static { this.styles = [
|
|
16
40
|
ScrollbarStyles,
|
|
@@ -37,7 +61,7 @@ let ActivityIntroView = class ActivityIntroView extends localize(i18next)(LitEle
|
|
|
37
61
|
`
|
|
38
62
|
]; }
|
|
39
63
|
render() {
|
|
40
|
-
const { name, description, thumbnail } = this.activityTemplate || {};
|
|
64
|
+
const { name, description, thumbnail } = this.template.data?.activityTemplate || {};
|
|
41
65
|
return html `
|
|
42
66
|
<content>
|
|
43
67
|
<section>
|
|
@@ -51,49 +75,11 @@ let ActivityIntroView = class ActivityIntroView extends localize(i18next)(LitEle
|
|
|
51
75
|
</content>
|
|
52
76
|
`;
|
|
53
77
|
}
|
|
54
|
-
firstUpdated() {
|
|
55
|
-
this.fetchActivity(this.activityTemplateId);
|
|
56
|
-
}
|
|
57
|
-
async fetchActivity(id) {
|
|
58
|
-
const response = await client.query({
|
|
59
|
-
query: gql `
|
|
60
|
-
query activityTemplate($id: String!) {
|
|
61
|
-
activityTemplate(id: $id) {
|
|
62
|
-
id
|
|
63
|
-
name
|
|
64
|
-
description
|
|
65
|
-
state
|
|
66
|
-
thumbnail
|
|
67
|
-
model {
|
|
68
|
-
name
|
|
69
|
-
description
|
|
70
|
-
active
|
|
71
|
-
tag
|
|
72
|
-
inout
|
|
73
|
-
type
|
|
74
|
-
unit
|
|
75
|
-
options
|
|
76
|
-
quantifier
|
|
77
|
-
spec
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
`,
|
|
82
|
-
variables: {
|
|
83
|
-
id
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
this.activityTemplate = response.data.activityTemplate;
|
|
87
|
-
}
|
|
88
78
|
};
|
|
89
79
|
__decorate([
|
|
90
80
|
property({ type: String }),
|
|
91
81
|
__metadata("design:type", String)
|
|
92
82
|
], ActivityIntroView.prototype, "activityTemplateId", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
property({ type: Object }),
|
|
95
|
-
__metadata("design:type", Object)
|
|
96
|
-
], ActivityIntroView.prototype, "activityTemplate", void 0);
|
|
97
83
|
__decorate([
|
|
98
84
|
property({ type: Object }),
|
|
99
85
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-intro-view.js","sourceRoot":"","sources":["../../client/components/activity-intro-view.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAEhD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAA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;uBAGQ,IAAI;8BACG,WAAW;;;;qBAIpB,SAAS;;;KAGzB,CAAA;IACH,CAAC;;AAxE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAgC;AAC/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAA2B;AAFlD,iBAAiB;IADtB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,iBAAiB,CA0EtB","sourcesContent":["import '@material/web/button/elevated-button.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-intro-view')\nclass ActivityIntroView extends localize(i18next)(LitElement) {\n @property({ type: String }) activityTemplateId: string = ''\n @property({ type: Object }) activityInstance: any = {}\n\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n content {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: var(--spacing-medium);\n overflow: auto;\n }\n\n section {\n display: flex;\n flex-direction: column;\n }\n `\n ]\n\n /* The template the id names (ADR-0190). */\n private template = new QueryController(\n this,\n gql`\n query activityTemplate($id: String!) {\n activityTemplate(id: $id) {\n id\n name\n description\n state\n thumbnail\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n }\n `,\n { variables: () => (this.activityTemplateId ? { id: this.activityTemplateId } : undefined) }\n )\n\n render() {\n const { name, description, thumbnail } = this.template.data?.activityTemplate || {}\n\n return html`\n <content>\n <section>\n <div>name: ${name}</div>\n <div>description: ${description}</div>\n </section>\n\n <section>\n <img src=${thumbnail} />\n </section>\n </content>\n `\n }\n}\n"]}
|