@operato/process 1.4.53 → 1.4.55

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/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [1.4.55](https://github.com/heartyoh/ioperato/compare/v1.4.54...v1.4.55) (2023-09-08)
7
+
8
+ **Note:** Version bump only for package @operato/process
9
+
10
+
11
+
12
+
13
+
14
+ ### [1.4.54](https://github.com/heartyoh/ioperato/compare/v1.4.53...v1.4.54) (2023-09-07)
15
+
16
+
17
+ ### :bug: Bug Fix
18
+
19
+ * 보드모델 생성시 기본 속성 변경 ([2182f99](https://github.com/heartyoh/ioperato/commit/2182f999b0a0f658f4f97ac8dc82da579d45f48c))
20
+
21
+
22
+
6
23
  ### [1.4.53](https://github.com/heartyoh/ioperato/compare/v1.4.52...v1.4.53) (2023-09-07)
7
24
 
8
25
  **Note:** Version bump only for package @operato/process
@@ -265,8 +265,9 @@ let ProcessSelector = class ProcessSelector extends InfiniteScrollable(localize(
265
265
  }
266
266
  async createProcess(name, description, groupId) {
267
267
  var model = JSON.stringify({
268
- width: 800,
269
- height: 600
268
+ width: 1200,
269
+ height: 800,
270
+ fillStyle: 'white'
270
271
  });
271
272
  const response = await client.mutate({
272
273
  mutation: CREATE_PROCESS_GQL,
@@ -1 +1 @@
1
- {"version":3,"file":"ox-process-selector.js","sourceRoot":"","sources":["../../../src/selector/ox-process-selector.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM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;IACjD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAAY,EAAE,WAAmB,EAAE,OAAe;QACpE,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;YACzB,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ,CAAC,CAAA;QAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,IAAI;oBACJ,WAAW;oBACX,OAAO;oBACP,KAAK;iBACN;aACF;YACD,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF,CAAA;AArL4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAiE;AAChE;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAsB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AACb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AAxF/B,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CAyQ3B","sourcesContent":["import './ox-process-creation-card'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { buildArgs, client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport InfiniteScrollable from '@operato/utils/mixins/infinite-scrollable.js'\n\nconst FETCH_PROCESS_LIST_GQL = (listParam: any) => {\n return gql`\n {\n processes(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n }\n total\n }\n }\n`\n}\n\nconst FETCH_PROCESS_GROUP_LIST_GQL = gql`\n {\n processGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n`\n\nconst CREATE_PROCESS_GQL = gql`\n mutation CreateProcess($process: NewProcess!) {\n createProcess(process: $process) {\n id\n name\n description\n model\n createdAt\n updatedAt\n }\n }\n`\n\n@customElement('ox-process-selector')\nexport class ProcessSelector extends InfiniteScrollable(localize(i18next)(LitElement)) {\n static get styles() {\n return [\n ScrollbarStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: auto auto 1fr;\n overflow: hidden;\n background-color: var(--popup-content-background-color);\n }\n\n #main {\n overflow: auto;\n padding: var(--popup-content-padding);\n display: grid;\n grid-template-columns: var(--card-list-template);\n grid-auto-rows: var(--card-list-rows-height);\n grid-gap: 20px;\n }\n\n .card {\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n border-radius: var(--card-list-border-radius);\n background-color: var(--card-list-background-color);\n }\n\n .card[selected] {\n border: red solid;\n }\n\n .card.create {\n overflow: visible;\n }\n\n .card:hover {\n cursor: pointer;\n }\n\n .card > .name {\n background-color: var(--board-renderer-name-background-color);\n opacity: 0.8;\n margin-top: -35px;\n width: 100%;\n color: #fff;\n font-weight: bolder;\n font-size: 13px;\n text-indent: 7px;\n }\n\n .card > .description {\n background-color: rgba(0, 0, 0, 0.7);\n width: 100%;\n min-height: 15px;\n font-size: 0.6rem;\n color: #fff;\n text-indent: 7px;\n }\n .card img {\n max-height: 100%;\n min-height: 100%;\n }\n\n #filter {\n padding: var(--popup-content-padding);\n background-color: #fff;\n box-shadow: var(--box-shadow);\n }\n\n #filter * {\n font-size: 15px;\n }\n\n select {\n text-transform: capitalize;\n float: right;\n }\n `\n ]\n }\n\n @property({ type: Array }) groups: { id: string; name: string; description: string }[] = []\n @property({ type: Array }) processes: any[] = []\n @property({ type: String }) group?: string\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: String }) value?: string\n\n private _page: number = 1\n private _total: number = 0\n\n constructor() {\n super()\n\n this._infiniteScrollOptions.limit = 20\n }\n\n render() {\n return html`\n <div id=\"filter\">\n <select\n @change=${(e: Event) => {\n this.group = (e.currentTarget as any)?.value\n this.requestUpdate()\n }}\n >\n <option value=\"\">${i18next.t('label.all')}</option>\n ${this.groups.map(group => html` <option value=${group.id}>${group.description}</option> `)}\n </select>\n </div>\n\n <div\n id=\"main\"\n @scroll=${(e: Event) => {\n this.onScroll(e)\n }}\n >\n ${this.creatable\n ? html`\n <ox-process-creation-card\n class=\"card create\"\n .groups=${this.groups}\n .defaultGroup=${this.group}\n @create-process=${(e: CustomEvent) => this.onCreateProcess(e)}\n ></ox-process-creation-card>\n `\n : html``}\n ${this.processes.map(\n process => html`\n <div\n class=\"card\"\n @click=${(e: Event) => this.onClickSelect(process)}\n ?selected=${this.value === process.id}\n >\n <img src=${process.thumbnail} />\n <div class=\"name\">${process.name}</div>\n <div class=\"description\">${process.description}</div>\n </div>\n `\n )}\n </div>\n `\n }\n\n get scrollTargetEl(): HTMLElement | null {\n return this.renderRoot.querySelector('#main') as HTMLElement\n }\n\n async scrollAction() {\n return this.appendProcesses()\n }\n\n firstUpdated() {\n this.refreshGroups()\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('group')) {\n this.refreshProcesses()\n }\n }\n\n onClickSelect(process: any) {\n this.dispatchEvent(\n new CustomEvent('process-selected', {\n composed: true,\n bubbles: true,\n detail: {\n process\n }\n })\n )\n }\n\n async onCreateProcess(e: CustomEvent) {\n var { name, description, groupId } = e.detail\n\n await this.createProcess(name, description, groupId)\n this.refreshProcesses()\n }\n\n async refreshGroups() {\n var groupListResponse = await client.query({\n query: FETCH_PROCESS_GROUP_LIST_GQL,\n context: gqlContext()\n })\n\n if (!groupListResponse || !groupListResponse.data) return\n\n var groups = groupListResponse.data.processGroups.items\n this.groups = [...groups]\n\n this.group = groups.filter((group: { id: string }) => group.id == this.group).length > 0 ? this.group : ''\n }\n\n async refreshProcesses() {\n var processes = await this.getProcesses()\n this.processes = [...processes]\n\n var creationCard = this.renderRoot.querySelector('ox-process-creation-card')\n if (creationCard) {\n ;(creationCard as any).reset()\n }\n }\n\n async appendProcesses() {\n var processes = await this.getProcesses({ page: this._page + 1 })\n this.processes = [...this.processes, ...processes]\n }\n\n async getProcesses({ page = 1, limit = this._infiniteScrollOptions.limit } = {}) {\n var filters = []\n var sortings = [] as any[]\n var pagination = {\n limit,\n page\n }\n\n if (this.group)\n filters.push({\n name: 'groupId',\n operator: 'eq',\n value: this.group\n })\n\n var params = {\n filters,\n sortings,\n pagination\n }\n var processListResponse = await client.query({\n query: FETCH_PROCESS_LIST_GQL(params),\n context: gqlContext()\n })\n\n if (!processListResponse || !processListResponse.data) return []\n this._total = processListResponse.data.processes.total\n this._page = page\n\n return processListResponse.data.processes.items\n }\n\n async createProcess(name: string, description: string, groupId: string) {\n var model = JSON.stringify({\n width: 800,\n height: 600\n })\n\n const response = await client.mutate({\n mutation: CREATE_PROCESS_GQL,\n variables: {\n process: {\n name,\n description,\n groupId,\n model\n }\n },\n context: gqlContext()\n })\n\n return response.data\n }\n}\n"]}
1
+ {"version":3,"file":"ox-process-selector.js","sourceRoot":"","sources":["../../../src/selector/ox-process-selector.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,kBAAkB,MAAM,8CAA8C,CAAA;AAE7E,MAAM,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AA;QAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,IAAI;oBACJ,WAAW;oBACX,OAAO;oBACP,KAAK;iBACN;aACF;YACD,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF,CAAA;AAtL4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAiE;AAChE;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAsB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AACb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AAxF/B,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CA0Q3B","sourcesContent":["import './ox-process-creation-card'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { buildArgs, client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport InfiniteScrollable from '@operato/utils/mixins/infinite-scrollable.js'\n\nconst FETCH_PROCESS_LIST_GQL = (listParam: any) => {\n return gql`\n {\n processes(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n }\n total\n }\n }\n`\n}\n\nconst FETCH_PROCESS_GROUP_LIST_GQL = gql`\n {\n processGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n`\n\nconst CREATE_PROCESS_GQL = gql`\n mutation CreateProcess($process: NewProcess!) {\n createProcess(process: $process) {\n id\n name\n description\n model\n createdAt\n updatedAt\n }\n }\n`\n\n@customElement('ox-process-selector')\nexport class ProcessSelector extends InfiniteScrollable(localize(i18next)(LitElement)) {\n static get styles() {\n return [\n ScrollbarStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: auto auto 1fr;\n overflow: hidden;\n background-color: var(--popup-content-background-color);\n }\n\n #main {\n overflow: auto;\n padding: var(--popup-content-padding);\n display: grid;\n grid-template-columns: var(--card-list-template);\n grid-auto-rows: var(--card-list-rows-height);\n grid-gap: 20px;\n }\n\n .card {\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n border-radius: var(--card-list-border-radius);\n background-color: var(--card-list-background-color);\n }\n\n .card[selected] {\n border: red solid;\n }\n\n .card.create {\n overflow: visible;\n }\n\n .card:hover {\n cursor: pointer;\n }\n\n .card > .name {\n background-color: var(--board-renderer-name-background-color);\n opacity: 0.8;\n margin-top: -35px;\n width: 100%;\n color: #fff;\n font-weight: bolder;\n font-size: 13px;\n text-indent: 7px;\n }\n\n .card > .description {\n background-color: rgba(0, 0, 0, 0.7);\n width: 100%;\n min-height: 15px;\n font-size: 0.6rem;\n color: #fff;\n text-indent: 7px;\n }\n .card img {\n max-height: 100%;\n min-height: 100%;\n }\n\n #filter {\n padding: var(--popup-content-padding);\n background-color: #fff;\n box-shadow: var(--box-shadow);\n }\n\n #filter * {\n font-size: 15px;\n }\n\n select {\n text-transform: capitalize;\n float: right;\n }\n `\n ]\n }\n\n @property({ type: Array }) groups: { id: string; name: string; description: string }[] = []\n @property({ type: Array }) processes: any[] = []\n @property({ type: String }) group?: string\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: String }) value?: string\n\n private _page: number = 1\n private _total: number = 0\n\n constructor() {\n super()\n\n this._infiniteScrollOptions.limit = 20\n }\n\n render() {\n return html`\n <div id=\"filter\">\n <select\n @change=${(e: Event) => {\n this.group = (e.currentTarget as any)?.value\n this.requestUpdate()\n }}\n >\n <option value=\"\">${i18next.t('label.all')}</option>\n ${this.groups.map(group => html` <option value=${group.id}>${group.description}</option> `)}\n </select>\n </div>\n\n <div\n id=\"main\"\n @scroll=${(e: Event) => {\n this.onScroll(e)\n }}\n >\n ${this.creatable\n ? html`\n <ox-process-creation-card\n class=\"card create\"\n .groups=${this.groups}\n .defaultGroup=${this.group}\n @create-process=${(e: CustomEvent) => this.onCreateProcess(e)}\n ></ox-process-creation-card>\n `\n : html``}\n ${this.processes.map(\n process => html`\n <div\n class=\"card\"\n @click=${(e: Event) => this.onClickSelect(process)}\n ?selected=${this.value === process.id}\n >\n <img src=${process.thumbnail} />\n <div class=\"name\">${process.name}</div>\n <div class=\"description\">${process.description}</div>\n </div>\n `\n )}\n </div>\n `\n }\n\n get scrollTargetEl(): HTMLElement | null {\n return this.renderRoot.querySelector('#main') as HTMLElement\n }\n\n async scrollAction() {\n return this.appendProcesses()\n }\n\n firstUpdated() {\n this.refreshGroups()\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('group')) {\n this.refreshProcesses()\n }\n }\n\n onClickSelect(process: any) {\n this.dispatchEvent(\n new CustomEvent('process-selected', {\n composed: true,\n bubbles: true,\n detail: {\n process\n }\n })\n )\n }\n\n async onCreateProcess(e: CustomEvent) {\n var { name, description, groupId } = e.detail\n\n await this.createProcess(name, description, groupId)\n this.refreshProcesses()\n }\n\n async refreshGroups() {\n var groupListResponse = await client.query({\n query: FETCH_PROCESS_GROUP_LIST_GQL,\n context: gqlContext()\n })\n\n if (!groupListResponse || !groupListResponse.data) return\n\n var groups = groupListResponse.data.processGroups.items\n this.groups = [...groups]\n\n this.group = groups.filter((group: { id: string }) => group.id == this.group).length > 0 ? this.group : ''\n }\n\n async refreshProcesses() {\n var processes = await this.getProcesses()\n this.processes = [...processes]\n\n var creationCard = this.renderRoot.querySelector('ox-process-creation-card')\n if (creationCard) {\n ;(creationCard as any).reset()\n }\n }\n\n async appendProcesses() {\n var processes = await this.getProcesses({ page: this._page + 1 })\n this.processes = [...this.processes, ...processes]\n }\n\n async getProcesses({ page = 1, limit = this._infiniteScrollOptions.limit } = {}) {\n var filters = []\n var sortings = [] as any[]\n var pagination = {\n limit,\n page\n }\n\n if (this.group)\n filters.push({\n name: 'groupId',\n operator: 'eq',\n value: this.group\n })\n\n var params = {\n filters,\n sortings,\n pagination\n }\n var processListResponse = await client.query({\n query: FETCH_PROCESS_LIST_GQL(params),\n context: gqlContext()\n })\n\n if (!processListResponse || !processListResponse.data) return []\n this._total = processListResponse.data.processes.total\n this._page = page\n\n return processListResponse.data.processes.items\n }\n\n async createProcess(name: string, description: string, groupId: string) {\n var model = JSON.stringify({\n width: 1200,\n height: 800,\n fillStyle: 'white'\n })\n\n const response = await client.mutate({\n mutation: CREATE_PROCESS_GQL,\n variables: {\n process: {\n name,\n description,\n groupId,\n model\n }\n },\n context: gqlContext()\n })\n\n return response.data\n }\n}\n"]}