@things-factory/calendar 10.1.278 → 10.1.279
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/package.json +21 -5
- package/CHANGELOG.md +0 -8
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/calendar/calendar-days-off-page.js.map +0 -1
- package/dist-client/pages/calendar/calendar-list-page.js.map +0 -1
- package/dist-client/pages/calendar/calendar-page.js.map +0 -1
- package/dist-client/pages/event/event-list-page.js.map +0 -1
- package/dist-client/pages/sure-to-delete.js.map +0 -1
- package/dist-client/route.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-server/controllers/index.js.map +0 -1
- package/dist-server/index.js.map +0 -1
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/role-tasks.js.map +0 -1
- package/dist-server/routes.js.map +0 -1
- package/dist-server/service/attendee/attendee-query.js.map +0 -1
- package/dist-server/service/attendee/attendee-service.js.map +0 -1
- package/dist-server/service/attendee/attendee-type.js.map +0 -1
- package/dist-server/service/attendee/attendee.js.map +0 -1
- package/dist-server/service/attendee/index.js.map +0 -1
- package/dist-server/service/calendar/calendar-mutation.js.map +0 -1
- package/dist-server/service/calendar/calendar-query.js.map +0 -1
- package/dist-server/service/calendar/calendar-service.js.map +0 -1
- package/dist-server/service/calendar/calendar-type.js.map +0 -1
- package/dist-server/service/calendar/calendar.js.map +0 -1
- package/dist-server/service/calendar/index.js.map +0 -1
- package/dist-server/service/calendar/working-days-resolver.js.map +0 -1
- package/dist-server/service/calendar/working-days.js.map +0 -1
- package/dist-server/service/event/event-import.js.map +0 -1
- package/dist-server/service/event/event-mutation.js.map +0 -1
- package/dist-server/service/event/event-query.js.map +0 -1
- package/dist-server/service/event/event-rules.js.map +0 -1
- package/dist-server/service/event/event-service.js.map +0 -1
- package/dist-server/service/event/event-type.js.map +0 -1
- package/dist-server/service/event/event.js.map +0 -1
- package/dist-server/service/event/index.js.map +0 -1
- package/dist-server/service/event-series/event-series-mutation.js.map +0 -1
- package/dist-server/service/event-series/event-series-query.js.map +0 -1
- package/dist-server/service/event-series/event-series-service.js.map +0 -1
- package/dist-server/service/event-series/event-series-type.js.map +0 -1
- package/dist-server/service/event-series/event-series.js.map +0 -1
- package/dist-server/service/event-series/index.js.map +0 -1
- package/dist-server/service/event-series/recurrence.js.map +0 -1
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
- package/dist-server/work-doors.js.map +0 -1
- package/tests/open-doors.test.ts +0 -40
package/package.json
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/calendar",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.279",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"assets",
|
|
8
|
+
"dist-client",
|
|
9
|
+
"dist-server",
|
|
10
|
+
"helps",
|
|
11
|
+
"things-factory.config.js",
|
|
12
|
+
"translations",
|
|
13
|
+
"!**/*.map",
|
|
14
|
+
"!**/*.test.*",
|
|
15
|
+
"!**/*.spec.*",
|
|
16
|
+
"!**/test/**",
|
|
17
|
+
"!**/tests/**",
|
|
18
|
+
"!**/__tests__/**",
|
|
19
|
+
"!**/*.tsbuildinfo",
|
|
20
|
+
"!**/.DS_Store"
|
|
21
|
+
],
|
|
6
22
|
"things-factory": true,
|
|
7
23
|
"license": "MIT",
|
|
8
24
|
"author": "heartyoh <heartyoh@hatiolab.com>",
|
|
@@ -34,10 +50,10 @@
|
|
|
34
50
|
"@operato/graphql": "^10.29.69",
|
|
35
51
|
"@operato/popup": "^10.0.0",
|
|
36
52
|
"@operato/shell": "^10.29.69",
|
|
37
|
-
"@things-factory/ai-assistant": "^10.1.
|
|
38
|
-
"@things-factory/auth-base": "^10.1.
|
|
39
|
-
"@things-factory/shell": "^10.1.
|
|
53
|
+
"@things-factory/ai-assistant": "^10.1.279",
|
|
54
|
+
"@things-factory/auth-base": "^10.1.279",
|
|
55
|
+
"@things-factory/shell": "^10.1.279",
|
|
40
56
|
"cron-parser": "^4.3.0"
|
|
41
57
|
},
|
|
42
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "666c08055c408b408fde961ad10da080941b147c"
|
|
43
59
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
|
-
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
<!-- ## [Unreleased] -->
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,KAAI,CAAC","sourcesContent":["export default function bootstrap() {}\n"]}
|
package/dist-client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-days-off-page.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-days-off-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE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,MAAM,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IAC9I,CAAC;IAEO,KAAK,CAAC,MAAM;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACzE,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,YAAY,EAAE,CAAC;YAAE,OAAM;QAClD,IAAI,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IACnK,CAAC;;AAzH2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDAAiB;AAE3B;IAAhB,KAAK,EAAE;;uDAAwB;AAmBL;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;kDAAA;AAxBjC,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA6H/B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist'\nimport { client, QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\n\nimport gql from 'graphql-tag'\n\nimport { sureToDelete } from '../sure-to-delete'\n\n/** The longest day off one row holds - the server's DAYS_OFF_MAX_SPAN, said next to the field. */\nconst DAYS_OFF_MAX_SPAN = 31\n\n/**\n * A days-off calendar's days (ADR-0179): the company's days off written as rows from one day to another - 창립기념일,\n * 하계 휴무. Each counts at once: leave skips it, the calendars paint it. Opened from the calendar's row; the public\n * holiday calendar is the import's and is read on the event list instead.\n */\n@customElement('calendar-days-off-page')\nexport class CalendarDaysOffPage extends localize(i18next)(PageView) {\n static styles = [WorkSurfacePageStyles, ScrollbarStyles, CommonGristStyles]\n\n @property({ type: Object }) gristConfig: any\n\n @state() private calendarId = ''\n\n /* The name of the calendar the address names, for the title (ADR-0190). */\n private calendar = new QueryController(\n this,\n gql`\n query ($id: String!) {\n calendar(id: $id) {\n name\n }\n }\n `,\n { variables: () => (this.calendarId ? { id: this.calendarId } : undefined) }\n )\n\n private get calendarName(): string {\n return this.calendar.data?.calendar?.name ?? ''\n }\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: this.calendarName ? `${i18next.t('title.calendar-days-off')} · ${this.calendarName}` : i18next.t('title.calendar-days-off'),\n help: 'calendar/calendar',\n /* The days of a calendar - the menu marks the calendars. */\n menu: 'calendar-list',\n actions: [\n { title: i18next.t('button.save'), action: this.save.bind(this), ...CommonButtonStyles.save },\n { title: i18next.t('button.delete'), action: this.delete.bind(this), ...CommonButtonStyles.delete }\n ]\n }\n }\n\n render() {\n return html`<ox-grist class=\"page-fill\" mode=\"GRID\" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>`\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string', name: 'name', header: i18next.t('field.name'), record: { editable: true, mandatory: true }, width: 200 },\n { type: 'date', name: 'from', header: i18next.t('field.days-off-from'), record: { editable: true, mandatory: true }, width: 130 },\n {\n type: 'date',\n name: 'to',\n header: i18next.t('field.days-off-to'),\n record: { editable: true, hint: i18next.t('text.days-off-to-hint', { max: DAYS_OFF_MAX_SPAN }) },\n width: 130\n }\n ],\n rows: { selectable: { multiple: true } },\n pagination: { infinite: true }\n }\n this.open(lifecycle?.params?.calendar || '')\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (!this.active || !changes.params) return\n const calendarId = lifecycle?.params?.calendar || ''\n if (calendarId !== this.calendarId) this.open(calendarId)\n }\n\n private open(calendarId: string) {\n this.calendarId = calendarId\n this.grist?.fetch()\n }\n\n async fetchHandler() {\n if (!this.calendarId) return { total: 0, records: [] }\n const response = await client.query({\n query: gql`\n query ($calendarId: String!) {\n calendarDaysOff(calendarId: $calendarId) {\n id\n name\n from\n to\n }\n }\n `,\n variables: { calendarId: this.calendarId },\n fetchPolicy: 'no-cache'\n })\n const records = response.data?.calendarDaysOff ?? []\n return { total: records.length, records }\n }\n\n private async write(patches: any[]) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($calendarId: String!, $patches: [DayOffSpanPatch!]!) {\n updateCalendarDaysOff(calendarId: $calendarId, patches: $patches)\n }\n `,\n variables: { calendarId: this.calendarId, patches }\n })\n if (!response.errors) {\n this.grist.fetch()\n return true\n }\n return false\n }\n\n private async save() {\n const patches = (this.grist.dirtyRecords || []).map((row: any) => {\n const patch: any = { cuFlag: row.__dirty__, ...(row.id ? { id: row.id } : {}) }\n for (const key in row.__dirtyfields__) patch[key] = row.__dirtyfields__[key].after || undefined\n return patch\n })\n if (patches.length && (await this.write(patches))) notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.save') }) })\n }\n\n private async delete() {\n const ids = this.grist.selected.map((row: any) => row.id).filter(Boolean)\n if (!ids.length || !(await sureToDelete())) return\n if (await this.write(ids.map((id: string) => ({ id, cuFlag: '-' })))) notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') }) })\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-list-page.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,mDAAmD,CAAA;AAE1D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACnI,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAgB,SAAS,EAA+B,MAAM,qBAAqB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IAA1D;;QAkBuB,SAAI,GAA6B,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;IA4OjG,CAAC;aA9P4E,WAAM,GAAG;QAClF,qEAAqE;QACrE,qBAAqB;QACrB,eAAe;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/ai-assistant/dist-client/index.js'\n\nimport { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { navigate, PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { sureToDelete } from '../sure-to-delete'\n\n@customElement('calendar-list-page')\nexport class CalendarListPage extends localize(i18next)(PageView) { static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-filters-form { flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.calendar list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || '',\n autofocus: true\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'calendar/calendar',\n actions: [\n /* The only way to start a calendar - there is no empty row under the records. */\n { id: 'add-row', title: i18next.t('button.add-row'), icon: 'add', action: () => this.grist.addNewRecord() },\n { id: 'save', title: i18next.t('button.save'), action: this._updateCalendar.bind(this), ...CommonButtonStyles.save }\n ],\n exportable: { name: i18next.t('title.calendar list'),\n data: this.exportHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n /*\n * Deleting the picked calendars is on the selection bar over the list (FOOTER-BUTTON-REVIEW F06). The query - filters,\n * sort, search, page - lives in the address (G09); the grid/list/card mode is how it is drawn, kept by the page.\n */\n return html`\n <ox-assistant-selection-bar\n .gridOf=${() => this.grist}\n name=${i18next.t('title.calendar list')}\n .assistant=${false}\n .actions=${[{ id: 'delete', title: i18next.t('button.delete'), icon: 'delete_outline', emphasis: { danger: true }, action: () => this._deleteCalendar() }]}\n ></ox-assistant-selection-bar>\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form without-search autofocus></ox-filters-form>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n /* A row's state (new, changed); a new row's mark removes it until it is saved (data-grist 행 제거). */\n { type: 'gutter', gutterName: 'dirty' },\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n /*\n * A calendar's days are its events - opened from its row, so which days a calendar holds is one click away. A\n * days-off calendar's days are written there as days off; the others are read on the event list.\n */\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'event_note',\n title: i18next.t('button.calendar-events'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) navigate(record.kind === 'DAYS_OFF' ? `calendar-days-off?calendar=${record.id}` : `event-list?calendar=${record.id}`)\n }\n }\n },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'select',\n name: 'kind',\n header: i18next.t('field.calendar-kind'),\n record: { editable: true,\n hint: i18next.t('text.calendar-kind-hint'),\n options: ['GENERAL', 'DAYS_OFF', 'PUBLIC_HOLIDAYS'].map(value => ({ display: i18next.t(`text.calendar-kind-${value.toLowerCase().replace(/_/g, '-')}`), value }))\n },\n filter: true,\n sortable: true,\n width: 110\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n /* No empty row under the records: 「행 추가」 starts one, and a paste past the last row adds rows. */\n rows: { appendable: false,\n pasteAppendable: true,\n selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: calendars(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n kind\n active\n updater { id\n name\n }\n updatedAt\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 async _deleteCalendar() {\n const ids = this.grist.selected.map(record => record.id).filter(Boolean)\n if (!ids.length) {\n notify({ level: 'info', message: i18next.t('text.select-rows-to-delete') })\n return\n }\n if (await sureToDelete()) {\n if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteCalendars(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateCalendar() { let patches = this.grist.dirtyRecords\n if (!patches?.length) {\n notify({ level: 'info', message: i18next.t('text.nothing-to-save') })\n return\n }\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({ mutation: gql`\n mutation ($patches: [CalendarPatch!]!) { updateMultipleCalendar(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n }\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'kind', 'active'])\n\n return exportTargets.map(calendar => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = calendar[field]\n }\n\n return tempObj\n })\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-page.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-page.ts"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAA;AAE7C,OAAO,EAAkB,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG1C,IAAM,YAAY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AAC,eAAe,CAAC;8BAAa,WAAW;+CAAA;AAnBpC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA8GxB","sourcesContent":["import '@operato/event-view/ox-event-view.js'\n\nimport { PropertyValues, html, css } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { PageView } from '@operato/shell'\nimport { BizEvent, CALENDAR, EventProvider } from '@operato/event-view/types.js'\nimport { OxEventView } from '@operato/event-view'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('calendar-page')\nexport class CalendarPage extends PageView {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n }\n\n ox-event-view {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: String }) itemId?: string\n @property({ type: Object }) params: any\n\n @query('ox-event-view') eventView!: OxEventView\n\n render() {\n return html` <ox-event-view mode=\"monthly\" .eventProvider=${this}></ox-event-view> `\n }\n\n updated(changes: PropertyValues<this>) {\n /*\n * If this page properties are changed, this callback will be invoked.\n * This callback will be called back only when this page is activated.\n */\n if (changes.has('itemId') || changes.has('params')) {\n /* do something */\n }\n }\n\n fetchEventsForCalendar(calendar: CALENDAR): Map<Date, BizEvent[]> {\n const eventMap = new Map<Date, BizEvent[]>()\n\n calendar.forEach(({ date }) => {\n eventMap.set(date, [])\n })\n\n return eventMap\n }\n\n\n /*\n * page lifecycle\n *\n * - pageInitialized(lifecycle)\n * - pageUpdated(changes, lifecycle, changedBefore)\n * - pageDisposed(lifecycle)\n *\n * lifecycle value has\n * - active : this page is activated\n * - page : first path of href\n * - resourceId : second path of href\n * - params : search params object of href\n * - initialized : initialized state of this page\n *\n * you can update lifecycle values, or add custom values\n * by calling this.pageUpdate({ ...values }, force)\n * If lifecycle values changed by this.pageUpdate(...),\n * this.pageUpdated(...) will be called back right after.\n * If you want to invoke this.pageUpdated(...) callback,\n * set force argument to true.\n *\n * you can re-initialize this page\n * by calling this.pageReset().\n * this.pageInitialized(...) followed by this.pageDisposed(...) will be invoked\n * by calling this.pageReset().\n *\n * you can invoke this.pageDisposed()\n * by calling this.pageDispose()\n */\n\n pageInitialized(lifecycle: any) {\n /*\n * This page is initialized.\n * It's right time to configure of this page.\n *\n * - called before when this page activated first\n * - called when i18next resource is updated (loaded, changed, ..)\n * - called right after this.pageReset()\n */\n }\n\n pageUpdated(changes: any, lifecycle: any, before: any) {\n if (this.active) {\n /*\n * this page is activated\n */\n this.itemId = lifecycle.resourceId\n this.params = lifecycle.params\n } else {\n /* this page is deactivated */\n }\n }\n\n pageDisposed(lifecycle: any) {\n /*\n * This page is disposed.\n * It's right time to release system resources.\n *\n * - called just before (re)pageInitialized\n * - called right after when i18next resource updated (loaded, changed, ..)\n * - called right after this.pageReset()\n * - called right after this.pageDispose()\n */\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-list-page.js","sourceRoot":"","sources":["../../../client/pages/event/event-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B;;;GAGG;AAEI,IAAM,aAAa,GAAnB,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\n\nimport { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\n/**\n * The events of the domain, one-off and occurrences of series alike. Read only: an event's time and status change by\n * postponing, cancelling or holding it, and an application (Office's meeting sessions) does that in its own screens.\n */\n@customElement('event-list-page')\nexport class EventListPage extends localize(i18next)(PageView) {\n static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n ox-filters-form {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n /* The calendar whose events are shown, when opened from a calendar's row (`event-list?calendar=<id>`). */\n @state() private calendarId = ''\n @state() private calendars: { id: string; name: string }[] = []\n\n get context() {\n const calendar = this.calendars.find(one => one.id === this.calendarId)\n return {\n title: calendar ? `${i18next.t('title.event list')} · ${calendar.name}` : i18next.t('title.event list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || '',\n autofocus: true\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'calendar/event',\n /* Opened from a calendar's row, the menu marks the calendars - the page is that calendar's detail. */\n ...(calendar ? { menu: 'calendar-list' } : {})\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form without-search autofocus></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n const response = await client.query({\n query: gql`\n query {\n calendars(sortings: [{ name: \"name\" }]) {\n items {\n id\n name\n }\n }\n }\n `\n })\n this.calendars = response.data?.calendars?.items || []\n this.calendarId = lifecycle?.params?.calendar || ''\n this.updateContext()\n\n this.gristConfig = {\n list: {\n fields: ['name', 'startAt'],\n details: ['status', 'location']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'string', name: 'name', header: i18next.t('field.name'), filter: 'search', sortable: true, width: 200 },\n /* Which calendar an event is of - a holiday counts as a day off only on a calendar of days off or public holidays. */\n {\n type: 'select',\n name: 'calendarId',\n header: i18next.t('field.calendar'),\n record: { options: [{ display: '', value: '' }, ...this.calendars.map(one => ({ display: one.name, value: one.id }))] },\n filter: true,\n width: 140\n },\n { type: 'datetime', name: 'startAt', header: i18next.t('field.start_at'), sortable: true, width: 180 },\n { type: 'datetime', name: 'endAt', header: i18next.t('field.end_at'), sortable: true, width: 180 },\n {\n type: 'select',\n name: 'status',\n header: i18next.t('field.status'),\n record: {\n options: ['', 'SCHEDULED', 'POSTPONED', 'CANCELLED', 'HELD'].map(value => ({\n display: value ? i18next.t(`label.event-status.${value}`) : '',\n value\n }))\n },\n filter: true,\n sortable: true,\n width: 100\n },\n { type: 'string', name: 'location', header: i18next.t('field.location'), filter: 'search', width: 160 },\n { type: 'resource-object', name: 'series', header: i18next.t('field.event-series'), width: 160 },\n { type: 'resource-object', name: 'organizer', header: i18next.t('field.organizer'), width: 120 },\n /* Whose calendar a brought-in event was found in - empty for one made here. */\n {\n type: 'string',\n name: 'sourceMailboxes',\n header: i18next.t('field.event-source-mailboxes'),\n record: { editable: false, renderer: (value: string[] | null) => (value ?? []).join(', ') },\n width: 220\n }\n ],\n rows: {\n selectable: false\n },\n sorters: [{ name: 'startAt' }]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (!this.active || !changes.params) return\n const calendarId = lifecycle?.params?.calendar || ''\n if (calendarId === this.calendarId) return\n this.calendarId = calendarId\n this.updateContext()\n this.grist?.fetch()\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n /* The calendar the page was opened for, unless the filter form names one. */\n if (this.calendarId && !filters.some(one => one.name === 'calendarId')) {\n filters = [...filters, { name: 'calendarId', operator: 'eq', value: this.calendarId }]\n }\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: events(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n startAt\n endAt\n status\n location\n calendarId\n series {\n id\n name\n }\n organizer {\n id\n name\n }\n sourceMailboxes\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sure-to-delete.js","sourceRoot":"","sources":["../../client/pages/sure-to-delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,2HAA2H;AAC3H,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAC/B,QAAQ,CAAC,IAAI,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;IACrC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;IAClE,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE;IACpD,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;CACnD,CAAC,CAAA","sourcesContent":["import { i18next } from '@operato/i18n'\nimport { OxPrompt } from '@operato/popup'\n\n/* The framework's confirmation - a browser's own confirm() can be suppressed, and then nothing is deleted with no word. */\nexport const sureToDelete = () =>\n OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n"]}
|
package/dist-client/route.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU;YACb,MAAM,CAAC,gCAAgC,CAAC,CAAA;YACxC,OAAO,IAAI,CAAA;QAEb,KAAK,eAAe;YAClB,MAAM,CAAC,qCAAqC,CAAC,CAAA;YAC7C,OAAO,IAAI,CAAA;QAEb,KAAK,mBAAmB;YACtB,MAAM,CAAC,yCAAyC,CAAC,CAAA;YACjD,OAAO,IAAI,CAAA;QAEb,KAAK,YAAY;YACf,MAAM,CAAC,+BAA+B,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case 'calendar':\n import('./pages/calendar/calendar-page')\n return page\n\n case 'calendar-list':\n import('./pages/calendar/calendar-list-page')\n return page\n\n case 'calendar-days-off':\n import('./pages/calendar/calendar-days-off-page')\n return page\n\n case 'event-list':\n import('./pages/event/event-list-page')\n return page\n }\n}\n"]}
|