@things-factory/calendar 10.1.303 → 10.1.304

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.
@@ -1,4 +1,5 @@
1
1
  import '@operato/data-grist';
2
+ import '@things-factory/ai-assistant/dist-client/index.js';
2
3
  import { PageView } from '@operato/shell';
3
4
  declare const CalendarDaysOffPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
4
5
  /**
@@ -1,5 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@operato/data-grist';
3
+ import '@things-factory/ai-assistant/dist-client/index.js';
3
4
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
4
5
  import { PageView } from '@operato/shell';
5
6
  import { html } from 'lit';
@@ -41,13 +42,21 @@ let CalendarDaysOffPage = class CalendarDaysOffPage extends localize(i18next)(Pa
41
42
  /* The days of a calendar - the menu marks the calendars. */
42
43
  menu: 'calendar-list',
43
44
  actions: [
44
- { title: i18next.t('button.save'), action: this.save.bind(this), ...CommonButtonStyles.save },
45
- { title: i18next.t('button.delete'), action: this.delete.bind(this), ...CommonButtonStyles.delete }
45
+ { title: i18next.t('button.save'), action: this.save.bind(this), ...CommonButtonStyles.save }
46
46
  ]
47
47
  };
48
48
  }
49
49
  render() {
50
- return html `<ox-grist class="page-fill" mode="GRID" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>`;
50
+ /* Deleting the picked days is on the selection bar over the column heads, shown while rows are picked (ADR-0225). */
51
+ return html `<ox-grist class="page-fill" mode="GRID" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
52
+ <ox-assistant-selection-bar
53
+ slot="selection"
54
+ .gridOf=${() => this.grist}
55
+ name=${i18next.t('title.calendar-days-off')}
56
+ .assistant=${false}
57
+ .actions=${[{ id: 'delete', title: i18next.t('button.delete'), icon: 'delete_outline', emphasis: { danger: true }, action: () => this.delete() }]}
58
+ ></ox-assistant-selection-bar>
59
+ </ox-grist>`;
51
60
  }
52
61
  async pageInitialized(lifecycle) {
53
62
  this.gristConfig = {
@@ -127,7 +136,11 @@ let CalendarDaysOffPage = class CalendarDaysOffPage extends localize(i18next)(Pa
127
136
  }
128
137
  async delete() {
129
138
  const ids = this.grist.selected.map((row) => row.id).filter(Boolean);
130
- if (!ids.length || !(await sureToDelete()))
139
+ if (!ids.length) {
140
+ notify({ level: 'info', message: i18next.t('text.select-rows-to-delete') });
141
+ return;
142
+ }
143
+ if (!(await sureToDelete()))
131
144
  return;
132
145
  if (await this.write(ids.map((id) => ({ id, cuFlag: '-' }))))
133
146
  notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') }) });
@@ -57,17 +57,18 @@ let CalendarListPage = class CalendarListPage extends localize(i18next)(PageView
57
57
  render() {
58
58
  const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
59
59
  /*
60
- * Deleting the picked calendars is on the selection bar over the list (FOOTER-BUTTON-REVIEW F06). The query - filters,
60
+ * Deleting the picked calendars is on the selection bar in the grid (ADR-0225) (FOOTER-BUTTON-REVIEW F06). The query - filters,
61
61
  * sort, search, page - lives in the address (G09); the grid/list/card mode is how it is drawn, kept by the page.
62
62
  */
63
63
  return html `
64
- <ox-assistant-selection-bar
65
- .gridOf=${() => this.grist}
66
- name=${i18next.t('title.calendar list')}
67
- .assistant=${false}
68
- .actions=${[{ id: 'delete', title: i18next.t('button.delete'), icon: 'delete_outline', emphasis: { danger: true }, action: () => this._deleteCalendar() }]}
69
- ></ox-assistant-selection-bar>
70
64
  <ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
65
+ <ox-assistant-selection-bar
66
+ slot="selection"
67
+ .gridOf=${() => this.grist}
68
+ name=${i18next.t('title.calendar list')}
69
+ .assistant=${false}
70
+ .actions=${[{ id: 'delete', title: i18next.t('button.delete'), icon: 'delete_outline', emphasis: { danger: true }, action: () => this._deleteCalendar() }]}
71
+ ></ox-assistant-selection-bar>
71
72
  <div slot="headroom" class="header">
72
73
  <div class="filters">
73
74
  <ox-filters-form without-search autofocus></ox-filters-form>
@@ -263,8 +264,9 @@ let CalendarListPage = class CalendarListPage extends localize(i18next)(PageView
263
264
  }
264
265
  }
265
266
  }
267
+ /* The list's own export is the rows it shows; the picked rows go out by the selection bar's 「선택 내보내기」 (ADR-0225). */
266
268
  async exportHandler() {
267
- const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
269
+ const exportTargets = this.grist.dirtyData.records;
268
270
  const targetFieldSet = new Set(['id', 'name', 'description', 'kind', 'active']);
269
271
  return exportTargets.map(calendar => {
270
272
  let tempObj = {};
@@ -92,12 +92,6 @@ let EventListPage = class EventListPage extends localize(i18next)(PageView) {
92
92
  const calendar = this.calendars.find(one => one.id === this.calendarId);
93
93
  const excludes = calendar?.importExcludes ?? [];
94
94
  return html `
95
- <ox-assistant-selection-bar
96
- .gridOf=${() => this.grist}
97
- name=${i18next.t('title.event list')}
98
- .assistant=${false}
99
- .actions=${[{ id: 'exclude-from-import', title: i18next.t('button.exclude-from-import'), icon: 'event_busy', action: () => this._excludeFromImport() }]}
100
- ></ox-assistant-selection-bar>
101
95
  ${excludes.length
102
96
  ? html `<div class="excludes">
103
97
  <span>${i18next.t('field.import-excludes')}</span>
@@ -107,6 +101,13 @@ let EventListPage = class EventListPage extends localize(i18next)(PageView) {
107
101
  </div>`
108
102
  : ''}
109
103
  <ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
104
+ <ox-assistant-selection-bar
105
+ slot="selection"
106
+ .gridOf=${() => this.grist}
107
+ name=${i18next.t('title.event list')}
108
+ .assistant=${false}
109
+ .actions=${[{ id: 'exclude-from-import', title: i18next.t('button.exclude-from-import'), icon: 'event_busy', action: () => this._excludeFromImport() }]}
110
+ ></ox-assistant-selection-bar>
110
111
  <div slot="headroom" class="header">
111
112
  <div class="filters">
112
113
  <ox-filters-form without-search autofocus></ox-filters-form>
@@ -12,7 +12,7 @@ let AttendeeQuery = class AttendeeQuery {
12
12
  return attendee.userId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: attendee.userId }) : null;
13
13
  }
14
14
  domain(attendee) {
15
- return (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: attendee.domainId });
15
+ return attendee.domainId ? (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: attendee.domainId }) : null;
16
16
  }
17
17
  updater(attendee) {
18
18
  return attendee.updaterId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: attendee.updaterId }) : null;
@@ -22,7 +22,7 @@ let CalendarQuery = class CalendarQuery {
22
22
  return { items, total };
23
23
  }
24
24
  domain(calendar) {
25
- return (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: calendar.domainId });
25
+ return calendar.domainId ? (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: calendar.domainId }) : null;
26
26
  }
27
27
  updater(calendar) {
28
28
  return calendar.updaterId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: calendar.updaterId }) : null;
@@ -54,7 +54,7 @@ let EventQuery = class EventQuery {
54
54
  return event.organizerId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: event.organizerId }) : null;
55
55
  }
56
56
  domain(event) {
57
- return (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: event.domainId });
57
+ return event.domainId ? (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: event.domainId }) : null;
58
58
  }
59
59
  updater(event) {
60
60
  return event.updaterId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: event.updaterId }) : null;
@@ -33,7 +33,7 @@ let EventSeriesQuery = class EventSeriesQuery {
33
33
  return series.organizerId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: series.organizerId }) : null;
34
34
  }
35
35
  domain(series) {
36
- return (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: series.domainId });
36
+ return series.domainId ? (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: series.domainId }) : null;
37
37
  }
38
38
  updater(series) {
39
39
  return series.updaterId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: series.updaterId }) : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/calendar",
3
- "version": "10.1.303",
3
+ "version": "10.1.304",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "files": [
@@ -50,11 +50,11 @@
50
50
  "@operato/graphql": "^10.29.69",
51
51
  "@operato/popup": "^10.0.0",
52
52
  "@operato/shell": "^10.29.69",
53
- "@things-factory/ai-assistant": "^10.1.303",
54
- "@things-factory/auth-base": "^10.1.303",
55
- "@things-factory/notification": "^10.1.303",
56
- "@things-factory/shell": "^10.1.303",
53
+ "@things-factory/ai-assistant": "^10.1.304",
54
+ "@things-factory/auth-base": "^10.1.304",
55
+ "@things-factory/notification": "^10.1.304",
56
+ "@things-factory/shell": "^10.1.304",
57
57
  "cron-parser": "^4.3.0"
58
58
  },
59
- "gitHead": "2d5888ebfc0a004b000a4aa3dfb8ff9561e75ff9"
59
+ "gitHead": "76ce38519069ba90190d69d2a9d6c130bc981cf0"
60
60
  }