@webiny/app-headless-cms-scheduler 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.eb196ccd2f
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/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js +3 -3
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js.map +1 -1
- package/Gateways/SchedulerGetGateway.d.ts +1 -3
- package/Gateways/SchedulerGetGateway.js.map +1 -1
- package/Presentation/SchedulerConfigs/SchedulerConfigs.js +6 -1
- package/Presentation/SchedulerConfigs/SchedulerConfigs.js.map +1 -1
- package/Presentation/abstractions/ISchedulerPresenter.d.ts +4 -3
- package/Presentation/abstractions/ISchedulerPresenter.js.map +1 -1
- package/Presentation/components/Cells/CellActions/CellActions.js +1 -1
- package/Presentation/components/Cells/CellActions/CellActions.js.map +1 -1
- package/Presentation/components/Cells/CellRevision/CellRevision.d.ts +2 -0
- package/Presentation/components/Cells/CellRevision/CellRevision.js +20 -0
- package/Presentation/components/Cells/CellRevision/CellRevision.js.map +1 -0
- package/Presentation/components/Cells/CellRevision/CellRevision.styled.d.ts +12 -0
- package/Presentation/components/Cells/CellRevision/CellRevision.styled.js +47 -0
- package/Presentation/components/Cells/CellRevision/CellRevision.styled.js.map +1 -0
- package/Presentation/components/Cells/CellRevision/index.d.ts +1 -0
- package/Presentation/components/Cells/CellRevision/index.js +3 -0
- package/Presentation/components/Cells/CellRevision/index.js.map +1 -0
- package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.js +1 -1
- package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -1
- package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js +1 -1
- package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -1
- package/Presentation/components/Cells/CellTitle/CellTitle.js +1 -1
- package/Presentation/components/Cells/CellTitle/CellTitle.js.map +1 -1
- package/Presentation/components/Cells/CellType/CellType.js +1 -1
- package/Presentation/components/Cells/CellType/CellType.js.map +1 -1
- package/Presentation/components/Cells/index.d.ts +1 -0
- package/Presentation/components/Cells/index.js +1 -0
- package/Presentation/components/Cells/index.js.map +1 -1
- package/Presentation/components/ScheduleDialog/ScheduleDialogAction.d.ts +15 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogAction.js +51 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogAction.js.map +1 -0
- package/Presentation/components/ScheduleDialog/index.d.ts +2 -0
- package/Presentation/components/ScheduleDialog/index.js +4 -0
- package/Presentation/components/ScheduleDialog/index.js.map +1 -0
- package/Presentation/components/ScheduleDialog/types.d.ts +15 -0
- package/Presentation/components/ScheduleDialog/types.js +3 -0
- package/Presentation/components/ScheduleDialog/types.js.map +1 -0
- package/Presentation/components/ScheduleDialog/useScheduleDialog.d.ts +19 -0
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js +174 -0
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +1 -0
- package/Presentation/components/Table/Table.js +11 -5
- package/Presentation/components/Table/Table.js.map +1 -1
- package/Presentation/configs/list/Browser/EntryAction.d.ts +2 -2
- package/Presentation/configs/list/Browser/EntryAction.js +1 -2
- package/Presentation/configs/list/Browser/EntryAction.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/Column.d.ts +10 -5
- package/Presentation/configs/list/Browser/Table/Column.js +1 -2
- package/Presentation/configs/list/Browser/Table/Column.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/Sorting.d.ts +2 -2
- package/Presentation/configs/list/Browser/Table/Sorting.js +1 -2
- package/Presentation/configs/list/Browser/Table/Sorting.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/index.d.ts +7 -2
- package/Presentation/configs/list/Browser/index.d.ts +7 -2
- package/Presentation/configs/list/SchedulerListConfig.d.ts +7 -2
- package/Presentation/index.d.ts +2 -1
- package/Presentation/index.js +2 -1
- package/Presentation/index.js.map +1 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +1 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +1 -1
- package/package.json +15 -12
- package/types.d.ts +2 -0
- package/types.js.map +1 -1
- package/Presentation/components/ScheduleDialog/ScheduleDialog.d.ts +0 -13
- package/Presentation/components/ScheduleDialog/ScheduleDialog.js +0 -15
- package/Presentation/components/ScheduleDialog/ScheduleDialog.js.map +0 -1
|
@@ -26,7 +26,7 @@ export class SchedulerItemsRepository {
|
|
|
26
26
|
return {};
|
|
27
27
|
}
|
|
28
28
|
async getItem(params) {
|
|
29
|
-
const
|
|
29
|
+
const item = await this.getGateway.execute({
|
|
30
30
|
...params,
|
|
31
31
|
modelId: this.model.modelId
|
|
32
32
|
});
|
|
@@ -36,11 +36,11 @@ export class SchedulerItemsRepository {
|
|
|
36
36
|
runInAction(() => {
|
|
37
37
|
this.items = [];
|
|
38
38
|
});
|
|
39
|
-
if (!
|
|
39
|
+
if (!item) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
runInAction(() => {
|
|
43
|
-
this.items = [
|
|
43
|
+
this.items = [item];
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
async listItems(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["makeAutoObservable","runInAction","uniqBy","Meta","SchedulerItemsRepository","items","constructor","params","metaRepository","listGateway","getGateway","cancelGateway","unpublishGateway","publishGateway","model","modelId","getItems","getMeta","get","getLoading","getItem","
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","runInAction","uniqBy","Meta","SchedulerItemsRepository","items","constructor","params","metaRepository","listGateway","getGateway","cancelGateway","unpublishGateway","publishGateway","model","modelId","getItems","getMeta","get","getLoading","getItem","item","execute","listItems","response","set","create","meta","listMoreItems","cursor","after","scheduleCancelItem","id","filter","decreaseTotalCount","schedulePublishItem","scheduleOn","increaseTotalCount","scheduleUnpublishItem"],"sources":["SchedulerItemsRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport uniqBy from \"lodash/uniqBy\";\nimport type { SchedulerItem } from \"~/Domain\";\nimport type {\n ISchedulerCancelGateway,\n ISchedulerListGateway,\n ISchedulerPublishGateway,\n ISchedulerUnpublishGateway\n} from \"~/Gateways\";\nimport {\n type ISchedulerGetExecuteParams,\n type ISchedulerGetGateway,\n type ISchedulerListExecuteParams\n} from \"~/Gateways\";\nimport type { IMetaRepository } from \"@webiny/app-utils\";\nimport { Meta } from \"@webiny/app-utils\";\nimport type { ISchedulerItemsRepository } from \"./ISchedulerItemsRepository\";\nimport type { CmsModel } from \"@webiny/app-headless-cms-common/types/index.js\";\n\nexport interface ISchedulerItemsRepositoryParams {\n metaRepository: IMetaRepository;\n getGateway: ISchedulerGetGateway;\n listGateway: ISchedulerListGateway;\n cancelGateway: ISchedulerCancelGateway;\n unpublishGateway: ISchedulerUnpublishGateway;\n publishGateway: ISchedulerPublishGateway;\n model: Pick<CmsModel, \"modelId\">;\n}\n\nexport class SchedulerItemsRepository implements ISchedulerItemsRepository {\n private readonly metaRepository: IMetaRepository;\n private readonly getGateway: ISchedulerGetGateway;\n private readonly listGateway: ISchedulerListGateway;\n private readonly cancelGateway: ISchedulerCancelGateway;\n private readonly unpublishGateway: ISchedulerUnpublishGateway;\n private readonly publishGateway: ISchedulerPublishGateway;\n private readonly model: Pick<CmsModel, \"modelId\">;\n private items: SchedulerItem[] = [];\n private params: ISchedulerListExecuteParams;\n\n public constructor(params: ISchedulerItemsRepositoryParams) {\n this.metaRepository = params.metaRepository;\n this.listGateway = params.listGateway;\n this.getGateway = params.getGateway;\n this.cancelGateway = params.cancelGateway;\n this.unpublishGateway = params.unpublishGateway;\n this.publishGateway = params.publishGateway;\n this.model = params.model;\n this.params = {\n modelId: this.model.modelId\n };\n makeAutoObservable(this);\n }\n\n public getItems() {\n return this.items;\n }\n\n public getMeta() {\n return this.metaRepository.get();\n }\n\n public getLoading() {\n return {};\n }\n\n public async getItem(params: Omit<ISchedulerGetExecuteParams, \"modelId\">) {\n const item = await this.getGateway.execute({\n ...params,\n modelId: this.model.modelId\n });\n /**\n * TODO Do we want to reset the items list?\n */\n runInAction(() => {\n this.items = [];\n });\n\n if (!item) {\n return;\n }\n\n runInAction(() => {\n this.items = [item];\n });\n }\n\n public async listItems(params: Omit<ISchedulerListExecuteParams, \"modelId\">) {\n this.params = {\n ...params,\n modelId: this.model.modelId\n };\n\n const response = await this.listGateway.execute({ ...this.params });\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.items = response.items;\n this.metaRepository.set(Meta.create(response.meta));\n });\n }\n\n public async listMoreItems() {\n const { cursor } = this.metaRepository.get();\n\n if (!cursor) {\n return;\n }\n\n const response = await this.listGateway.execute({ ...this.params, after: cursor });\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.items = uniqBy([...this.items, ...response.items], \"id\");\n this.metaRepository.set(Meta.create(response.meta));\n });\n }\n\n public async scheduleCancelItem(id: string) {\n await this.cancelGateway.execute({\n modelId: this.model.modelId,\n id\n });\n\n runInAction(() => {\n this.items = this.items.filter(item => item.id !== id);\n this.metaRepository.decreaseTotalCount(1);\n });\n }\n\n public async schedulePublishItem(id: string, scheduleOn: Date) {\n const { item } = await this.publishGateway.execute({\n modelId: this.model.modelId,\n id,\n scheduleOn\n });\n\n if (!item) {\n return;\n }\n\n runInAction(() => {\n this.items = [...this.items, item];\n this.metaRepository.increaseTotalCount(1);\n });\n }\n\n public async scheduleUnpublishItem(id: string, scheduleOn: Date) {\n const { item } = await this.unpublishGateway.execute({\n modelId: this.model.modelId,\n id,\n scheduleOn\n });\n\n if (!item) {\n return;\n }\n\n runInAction(() => {\n this.items = [...this.items, item];\n this.metaRepository.increaseTotalCount(1);\n });\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AACtD,OAAOC,MAAM,MAAM,eAAe;AAclC,SAASC,IAAI,QAAQ,mBAAmB;AAcxC,OAAO,MAAMC,wBAAwB,CAAsC;EAQ/D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5
|
}
|
|
6
|
-
export
|
|
7
|
-
item: SchedulerEntry;
|
|
8
|
-
}
|
|
6
|
+
export type ISchedulerGetGatewayResponse = SchedulerEntry | null;
|
|
9
7
|
export interface ISchedulerGetGateway {
|
|
10
8
|
execute(params: ISchedulerGetExecuteParams): Promise<ISchedulerGetGatewayResponse>;
|
|
11
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["SchedulerGetGateway.ts"],"sourcesContent":["import type { SchedulerEntry } from \"~/types.js\";\n\nexport interface ISchedulerGetExecuteParams {\n modelId: string;\n id: string;\n}\n\nexport
|
|
1
|
+
{"version":3,"names":[],"sources":["SchedulerGetGateway.ts"],"sourcesContent":["import type { SchedulerEntry } from \"~/types.js\";\n\nexport interface ISchedulerGetExecuteParams {\n modelId: string;\n id: string;\n}\n\nexport type ISchedulerGetGatewayResponse = SchedulerEntry | null;\n\nexport interface ISchedulerGetGateway {\n execute(params: ISchedulerGetExecuteParams): Promise<ISchedulerGetGatewayResponse>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SchedulerListConfig } from "../configs";
|
|
3
|
-
import { CellActions, CellScheduledBy, CellScheduledOn, CellTitle, CellType } from "../components/Cells";
|
|
3
|
+
import { CellActions, CellScheduledBy, CellScheduledOn, CellTitle, CellType, CellRevision } from "../components/Cells";
|
|
4
4
|
import { CancelItemAction } from "../components/Actions";
|
|
5
5
|
const {
|
|
6
6
|
Browser
|
|
@@ -13,6 +13,11 @@ export const SchedulerConfigs = () => {
|
|
|
13
13
|
sortable: true,
|
|
14
14
|
hideable: false,
|
|
15
15
|
size: 200
|
|
16
|
+
}), /*#__PURE__*/React.createElement(Browser.Table.Column, {
|
|
17
|
+
name: "revision",
|
|
18
|
+
header: "Revision",
|
|
19
|
+
cell: /*#__PURE__*/React.createElement(CellRevision, null),
|
|
20
|
+
hideable: false
|
|
16
21
|
}), /*#__PURE__*/React.createElement(Browser.Table.Column, {
|
|
17
22
|
name: "scheduledBy",
|
|
18
23
|
header: "Author",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","SchedulerListConfig","CellActions","CellScheduledBy","CellScheduledOn","CellTitle","CellType","CancelItemAction","Browser","SchedulerConfigs","createElement","Fragment","Table","Column","name","header","cell","sortable","hideable","size","className","resizable","Sorting","field","order","EntryAction","element"],"sources":["SchedulerConfigs.tsx"],"sourcesContent":["import React from \"react\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\nimport {\n CellActions,\n CellScheduledBy,\n CellScheduledOn,\n CellTitle,\n CellType\n} from \"~/Presentation/components/Cells\";\nimport { CancelItemAction } from \"~/Presentation/components/Actions\";\n\nconst { Browser } = SchedulerListConfig;\n\nexport const SchedulerConfigs = () => {\n return (\n <>\n <SchedulerListConfig>\n <Browser.Table.Column\n name={\"title\"}\n header={\"Title\"}\n cell={<CellTitle />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column\n name={\"scheduledBy\"}\n header={\"Author\"}\n cell={<CellScheduledBy />}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"type\"}\n header={\"Action Type\"}\n cell={<CellType />}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"scheduledOn\"}\n header={\"Action Date\"}\n cell={<CellScheduledOn />}\n sortable={true}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"actions\"}\n header={\" \"}\n cell={<CellActions />}\n size={80}\n className={\"rmwc-data-table__cell--align-end\"}\n hideable={false}\n resizable={false}\n />\n <Browser.Table.Sorting name={\"scheduledOn\"} field={\"scheduledOn\"} order={\"desc\"} />\n <Browser.EntryAction name={\"cancel\"} element={<CancelItemAction />} />\n </SchedulerListConfig>\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB;AAC5B,SACIC,WAAW,EACXC,eAAe,EACfC,eAAe,EACfC,SAAS,EACTC,QAAQ;
|
|
1
|
+
{"version":3,"names":["React","SchedulerListConfig","CellActions","CellScheduledBy","CellScheduledOn","CellTitle","CellType","CellRevision","CancelItemAction","Browser","SchedulerConfigs","createElement","Fragment","Table","Column","name","header","cell","sortable","hideable","size","className","resizable","Sorting","field","order","EntryAction","element"],"sources":["SchedulerConfigs.tsx"],"sourcesContent":["import React from \"react\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\nimport {\n CellActions,\n CellScheduledBy,\n CellScheduledOn,\n CellTitle,\n CellType,\n CellRevision\n} from \"~/Presentation/components/Cells\";\nimport { CancelItemAction } from \"~/Presentation/components/Actions\";\n\nconst { Browser } = SchedulerListConfig;\n\nexport const SchedulerConfigs = () => {\n return (\n <>\n <SchedulerListConfig>\n <Browser.Table.Column\n name={\"title\"}\n header={\"Title\"}\n cell={<CellTitle />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column\n name={\"revision\"}\n header={\"Revision\"}\n cell={<CellRevision />}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"scheduledBy\"}\n header={\"Author\"}\n cell={<CellScheduledBy />}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"type\"}\n header={\"Action Type\"}\n cell={<CellType />}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"scheduledOn\"}\n header={\"Action Date\"}\n cell={<CellScheduledOn />}\n sortable={true}\n hideable={false}\n />\n <Browser.Table.Column\n name={\"actions\"}\n header={\" \"}\n cell={<CellActions />}\n size={80}\n className={\"rmwc-data-table__cell--align-end\"}\n hideable={false}\n resizable={false}\n />\n <Browser.Table.Sorting name={\"scheduledOn\"} field={\"scheduledOn\"} order={\"desc\"} />\n <Browser.EntryAction name={\"cancel\"} element={<CancelItemAction />} />\n </SchedulerListConfig>\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB;AAC5B,SACIC,WAAW,EACXC,eAAe,EACfC,eAAe,EACfC,SAAS,EACTC,QAA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,EAAE,aAAc;IACpBC,MAAM,EAAE,aAAc;IACtBC,IAAI,eAAEjB,KAAA,CAAAW,aAAA,CAACP,eAAe,MAAE,CAAE;IAC1Bc,QAAQ,EAAE,IAAK;IACfC,QAAQ,EAAE;EAAM,CACnB,CAAC,eACFnB,KAAA,CAAAW,aAAA,CAACF,OAAO,CAACI,KAAK,CAACC,MAAM;IACjBC,IAAI,EAAE,SAAU;IAChBC,MAAM,EAAE,GAAI;IACZC,IAAI,eAAEjB,KAAA,CAAAW,aAAA,CAACT,WAAW,MAAE,CAAE;IACtBkB,IAAI,EAAE,EAAG;IACTC,SAAS,EAAE,kCAAmC;IAC9CF,QAAQ,EAAE,KAAM;IAChBG,SAAS,EAAE;EAAM,CACpB,CAAC,eACFtB,KAAA,CAAAW,aAAA,CAACF,OAAO,CAACI,KAAK,CAACU,OAAO;IAACR,IAAI,EAAE,aAAc;IAACS,KAAK,EAAE,aAAc;IAACC,KAAK,EAAE;EAAO,CAAE,CAAC,eACnFzB,KAAA,CAAAW,aAAA,CAACF,OAAO,CAACiB,WAAW;IAACX,IAAI,EAAE,QAAS;IAACY,OAAO,eAAE3B,KAAA,CAAAW,aAAA,CAACH,gBAAgB,MAAE;EAAE,CAAE,CACpD,CACvB,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ColumnSorting } from "@webiny/app-utils";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SchedulerMetaResponse } from "../../types.js";
|
|
3
|
+
import type { SchedulerItem } from "../../Domain";
|
|
3
4
|
export interface SchedulerPresenterViewModel {
|
|
4
|
-
items:
|
|
5
|
-
selectedItems:
|
|
5
|
+
items: SchedulerItem[];
|
|
6
|
+
selectedItems: SchedulerItem[];
|
|
6
7
|
allowSelectAll: boolean;
|
|
7
8
|
isSelectedAll: boolean;
|
|
8
9
|
sorting: ColumnSorting[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ISchedulerPresenter.ts"],"sourcesContent":["import type { ColumnSorting } from \"@webiny/app-utils\";\nimport type {
|
|
1
|
+
{"version":3,"names":[],"sources":["ISchedulerPresenter.ts"],"sourcesContent":["import type { ColumnSorting } from \"@webiny/app-utils\";\nimport type { SchedulerMetaResponse } from \"~/types.js\";\nimport type { SchedulerItem } from \"~/Domain\";\n\nexport interface SchedulerPresenterViewModel {\n items: SchedulerItem[];\n selectedItems: SchedulerItem[];\n allowSelectAll: boolean;\n isSelectedAll: boolean;\n sorting: ColumnSorting[];\n loading: Record<string, boolean>;\n isEmptyView: boolean;\n isSearchView: boolean;\n meta: SchedulerMetaResponse;\n searchQuery: string | undefined;\n searchLabel: string;\n nameColumnId: string;\n}\n\nexport interface ISchedulerPresenter {\n get vm(): SchedulerPresenterViewModel;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@ export const CellActions = () => {
|
|
|
14
14
|
record: recordConfig
|
|
15
15
|
} = useAcoConfig();
|
|
16
16
|
return /*#__PURE__*/React.createElement(SchedulerItemProvider, {
|
|
17
|
-
item: row
|
|
17
|
+
item: row.data
|
|
18
18
|
}, /*#__PURE__*/React.createElement(OptionsMenu, {
|
|
19
19
|
actions: recordConfig.actions,
|
|
20
20
|
"data-testid": "table.row.scheduler.entry.menu-action"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useAcoConfig","OptionsMenu","SchedulerListConfig","SchedulerItemProvider","CellActions","useTableRow","Browser","Table","Column","row","record","recordConfig","createElement","item","actions"],"sources":["CellActions.tsx"],"sourcesContent":["import React from \"react\";\nimport { useAcoConfig } from \"@webiny/app-aco\";\nimport { OptionsMenu } from \"@webiny/app-admin\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\nimport { SchedulerItemProvider } from \"~/Presentation/hooks\";\n\nexport const CellActions = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n const { record: recordConfig } = useAcoConfig();\n\n return (\n <SchedulerItemProvider item={row}>\n <OptionsMenu\n actions={recordConfig.actions}\n data-testid={\"table.row.scheduler.entry.menu-action\"}\n />\n </SchedulerItemProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC7B,MAAM;IAAEC;EAAY,CAAC,GAAGH,mBAAmB,CAACI,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAC7B,MAAM;IAAEK,MAAM,EAAEC;EAAa,CAAC,GAAGX,YAAY,CAAC,CAAC;EAE/C,oBACID,KAAA,CAAAa,aAAA,CAACT,qBAAqB;IAACU,IAAI,EAAEJ;
|
|
1
|
+
{"version":3,"names":["React","useAcoConfig","OptionsMenu","SchedulerListConfig","SchedulerItemProvider","CellActions","useTableRow","Browser","Table","Column","row","record","recordConfig","createElement","item","data","actions"],"sources":["CellActions.tsx"],"sourcesContent":["import React from \"react\";\nimport { useAcoConfig } from \"@webiny/app-aco\";\nimport { OptionsMenu } from \"@webiny/app-admin\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\nimport { SchedulerItemProvider } from \"~/Presentation/hooks\";\n\nexport const CellActions = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n const { record: recordConfig } = useAcoConfig();\n\n return (\n <SchedulerItemProvider item={row.data}>\n <OptionsMenu\n actions={recordConfig.actions}\n data-testid={\"table.row.scheduler.entry.menu-action\"}\n />\n </SchedulerItemProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC7B,MAAM;IAAEC;EAAY,CAAC,GAAGH,mBAAmB,CAACI,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAC7B,MAAM;IAAEK,MAAM,EAAEC;EAAa,CAAC,GAAGX,YAAY,CAAC,CAAC;EAE/C,oBACID,KAAA,CAAAa,aAAA,CAACT,qBAAqB;IAACU,IAAI,EAAEJ,GAAG,CAACK;EAAK,gBAClCf,KAAA,CAAAa,aAAA,CAACX,WAAW;IACRc,OAAO,EAAEJ,YAAY,CAACI,OAAQ;IAC9B,eAAa;EAAwC,CACxD,CACkB,CAAC;AAEhC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RowText, RowTitle } from "./CellRevision.styled";
|
|
3
|
+
import { SchedulerListConfig } from "../../../configs";
|
|
4
|
+
import { parseIdentifier } from "@webiny/utils/parseIdentifier.js";
|
|
5
|
+
export const CellRevision = () => {
|
|
6
|
+
const {
|
|
7
|
+
useTableRow
|
|
8
|
+
} = SchedulerListConfig.Browser.Table.Column;
|
|
9
|
+
const {
|
|
10
|
+
row
|
|
11
|
+
} = useTableRow();
|
|
12
|
+
const {
|
|
13
|
+
version
|
|
14
|
+
} = parseIdentifier(row.id);
|
|
15
|
+
return /*#__PURE__*/React.createElement(RowTitle, null, /*#__PURE__*/React.createElement(RowText, {
|
|
16
|
+
use: "subtitle2"
|
|
17
|
+
}, version));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=CellRevision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","RowText","RowTitle","SchedulerListConfig","parseIdentifier","CellRevision","useTableRow","Browser","Table","Column","row","version","id","createElement","use"],"sources":["CellRevision.tsx"],"sourcesContent":["import React from \"react\";\nimport { RowText, RowTitle } from \"./CellRevision.styled\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\nimport { parseIdentifier } from \"@webiny/utils/parseIdentifier.js\";\n\nexport const CellRevision = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n const { version } = parseIdentifier(row.id);\n return (\n <RowTitle>\n <RowText use={\"subtitle2\"}>{version}</RowText>\n </RowTitle>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,EAAEC,QAAQ;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,eAAe,QAAQ,kCAAkC;AAElE,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM;IAAEC;EAAY,CAAC,GAAGH,mBAAmB,CAACI,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,MAAM;IAAEK;EAAQ,CAAC,GAAGP,eAAe,CAACM,GAAG,CAACE,EAAE,CAAC;EAC3C,oBACIZ,KAAA,CAAAa,aAAA,CAACX,QAAQ,qBACLF,KAAA,CAAAa,aAAA,CAACZ,OAAO;IAACa,GAAG,EAAE;EAAY,GAAEH,OAAiB,CACvC,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const RowTitle: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const RowIcon: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/ui/Typography/Typography").TypographyProps & {
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
4
|
+
export const RowTitle = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
5
|
+
target: "e17kl7w02"
|
|
6
|
+
} : {
|
|
7
|
+
target: "e17kl7w02",
|
|
8
|
+
label: "RowTitle"
|
|
9
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
10
|
+
name: "s5xdrg",
|
|
11
|
+
styles: "display:flex;align-items:center"
|
|
12
|
+
} : {
|
|
13
|
+
name: "s5xdrg",
|
|
14
|
+
styles: "display:flex;align-items:center",
|
|
15
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxSZXZpc2lvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdxQyIsImZpbGUiOiJDZWxsUmV2aXNpb24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVHlwb2dyYXBoeSB9IGZyb20gXCJAd2ViaW55L3VpL1R5cG9ncmFwaHlcIjtcblxuZXhwb3J0IGNvbnN0IFJvd1RpdGxlID0gc3R5bGVkKFwiZGl2XCIpYFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBSb3dJY29uID0gc3R5bGVkKFwiZGl2XCIpYFxuICAgIG1hcmdpbi1yaWdodDogOHB4O1xuICAgIGhlaWdodDogMjRweDtcbmA7XG5cbmV4cG9ydCBjb25zdCBSb3dUZXh0ID0gc3R5bGVkKFR5cG9ncmFwaHkpYFxuICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbmA7XG4iXX0= */",
|
|
16
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
17
|
+
});
|
|
18
|
+
export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
19
|
+
target: "e17kl7w01"
|
|
20
|
+
} : {
|
|
21
|
+
target: "e17kl7w01",
|
|
22
|
+
label: "RowIcon"
|
|
23
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
24
|
+
name: "1hpq26k",
|
|
25
|
+
styles: "margin-right:8px;height:24px"
|
|
26
|
+
} : {
|
|
27
|
+
name: "1hpq26k",
|
|
28
|
+
styles: "margin-right:8px;height:24px",
|
|
29
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxSZXZpc2lvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFvQyIsImZpbGUiOiJDZWxsUmV2aXNpb24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVHlwb2dyYXBoeSB9IGZyb20gXCJAd2ViaW55L3VpL1R5cG9ncmFwaHlcIjtcblxuZXhwb3J0IGNvbnN0IFJvd1RpdGxlID0gc3R5bGVkKFwiZGl2XCIpYFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBSb3dJY29uID0gc3R5bGVkKFwiZGl2XCIpYFxuICAgIG1hcmdpbi1yaWdodDogOHB4O1xuICAgIGhlaWdodDogMjRweDtcbmA7XG5cbmV4cG9ydCBjb25zdCBSb3dUZXh0ID0gc3R5bGVkKFR5cG9ncmFwaHkpYFxuICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbmA7XG4iXX0= */",
|
|
30
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
31
|
+
});
|
|
32
|
+
export const RowText = /*#__PURE__*/_styled(Typography, process.env.NODE_ENV === "production" ? {
|
|
33
|
+
target: "e17kl7w00"
|
|
34
|
+
} : {
|
|
35
|
+
target: "e17kl7w00",
|
|
36
|
+
label: "RowText"
|
|
37
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
38
|
+
name: "l8l8b8",
|
|
39
|
+
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
40
|
+
} : {
|
|
41
|
+
name: "l8l8b8",
|
|
42
|
+
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis",
|
|
43
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxSZXZpc2lvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWF5QyIsImZpbGUiOiJDZWxsUmV2aXNpb24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVHlwb2dyYXBoeSB9IGZyb20gXCJAd2ViaW55L3VpL1R5cG9ncmFwaHlcIjtcblxuZXhwb3J0IGNvbnN0IFJvd1RpdGxlID0gc3R5bGVkKFwiZGl2XCIpYFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBSb3dJY29uID0gc3R5bGVkKFwiZGl2XCIpYFxuICAgIG1hcmdpbi1yaWdodDogOHB4O1xuICAgIGhlaWdodDogMjRweDtcbmA7XG5cbmV4cG9ydCBjb25zdCBSb3dUZXh0ID0gc3R5bGVkKFR5cG9ncmFwaHkpYFxuICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbmA7XG4iXX0= */",
|
|
44
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=CellRevision.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Typography","RowTitle","_styled","process","env","NODE_ENV","target","label","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","RowIcon","RowText"],"sources":["CellRevision.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nexport const RowTitle = styled(\"div\")`\n display: flex;\n align-items: center;\n`;\n\nexport const RowIcon = styled(\"div\")`\n margin-right: 8px;\n height: 24px;\n`;\n\nexport const RowText = styled(Typography)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;AACA,SAASA,UAAU,QAAQ,uBAAuB;AAElD,OAAO,MAAMC,QAAQ,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAGpC;AAED,OAAO,MAAMC,OAAO,gBAAGX,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAGnC;AAED,OAAO,MAAME,OAAO,gBAAGZ,OAAA,CAAOF,UAAU,EAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAIxC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CellRevision.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CellRevision.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ export const CellScheduledBy = () => {
|
|
|
7
7
|
const {
|
|
8
8
|
row
|
|
9
9
|
} = useTableRow();
|
|
10
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, row.scheduledBy?.displayName || "unknown");
|
|
10
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, row.data.scheduledBy?.displayName || "unknown");
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=CellScheduledBy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","SchedulerListConfig","CellScheduledBy","useTableRow","Browser","Table","Column","row","createElement","Fragment","scheduledBy","displayName"],"sources":["CellScheduledBy.tsx"],"sourcesContent":["import React from \"react\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellScheduledBy = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return <>{row.scheduledBy?.displayName || \"unknown\"}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBAAOH,KAAA,CAAAQ,aAAA,CAAAR,KAAA,CAAAS,QAAA,QAAGF,GAAG,CAACG,WAAW,EAAEC,WAAW,IAAI,SAAY,CAAC;
|
|
1
|
+
{"version":3,"names":["React","SchedulerListConfig","CellScheduledBy","useTableRow","Browser","Table","Column","row","createElement","Fragment","data","scheduledBy","displayName"],"sources":["CellScheduledBy.tsx"],"sourcesContent":["import React from \"react\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellScheduledBy = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return <>{row.data.scheduledBy?.displayName || \"unknown\"}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBAAOH,KAAA,CAAAQ,aAAA,CAAAR,KAAA,CAAAS,QAAA,QAAGF,GAAG,CAACG,IAAI,CAACC,WAAW,EAAEC,WAAW,IAAI,SAAY,CAAC;AAChE,CAAC","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ export const CellScheduledOn = () => {
|
|
|
8
8
|
const {
|
|
9
9
|
row
|
|
10
10
|
} = useTableRow();
|
|
11
|
-
const dateTime = row.publishOn || row.unpublishOn;
|
|
11
|
+
const dateTime = row.data.publishOn || row.data.unpublishOn;
|
|
12
12
|
if (!dateTime) {
|
|
13
13
|
return /*#__PURE__*/React.createElement(React.Fragment, null, "Missing publish or unpublish date.");
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","TimeAgo","SchedulerListConfig","CellScheduledOn","useTableRow","Browser","Table","Column","row","dateTime","publishOn","unpublishOn","createElement","Fragment","datetime"],"sources":["CellScheduledOn.tsx"],"sourcesContent":["import React from \"react\";\nimport { TimeAgo } from \"@webiny/ui/TimeAgo\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellScheduledOn = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n const dateTime = row.publishOn || row.unpublishOn;\n if (!dateTime) {\n return <>Missing publish or unpublish date.</>;\n }\n\n return <TimeAgo datetime={dateTime} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,MAAMK,QAAQ,GAAGD,GAAG,CAACE,SAAS,
|
|
1
|
+
{"version":3,"names":["React","TimeAgo","SchedulerListConfig","CellScheduledOn","useTableRow","Browser","Table","Column","row","dateTime","data","publishOn","unpublishOn","createElement","Fragment","datetime"],"sources":["CellScheduledOn.tsx"],"sourcesContent":["import React from \"react\";\nimport { TimeAgo } from \"@webiny/ui/TimeAgo\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellScheduledOn = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n const dateTime = row.data.publishOn || row.data.unpublishOn;\n if (!dateTime) {\n return <>Missing publish or unpublish date.</>;\n }\n\n return <TimeAgo datetime={dateTime} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,MAAMK,QAAQ,GAAGD,GAAG,CAACE,IAAI,CAACC,SAAS,IAAIH,GAAG,CAACE,IAAI,CAACE,WAAW;EAC3D,IAAI,CAACH,QAAQ,EAAE;IACX,oBAAOT,KAAA,CAAAa,aAAA,CAAAb,KAAA,CAAAc,QAAA,QAAE,oCAAoC,CAAC;EAClD;EAEA,oBAAOd,KAAA,CAAAa,aAAA,CAACZ,OAAO;IAACc,QAAQ,EAAEN;EAAS,CAAE,CAAC;AAC1C,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ export const CellTitle = () => {
|
|
|
11
11
|
} = useTableRow();
|
|
12
12
|
return /*#__PURE__*/React.createElement(RowTitle, null, /*#__PURE__*/React.createElement(RowIcon, null, /*#__PURE__*/React.createElement(File, null)), /*#__PURE__*/React.createElement(RowText, {
|
|
13
13
|
use: "subtitle2"
|
|
14
|
-
}, row.title));
|
|
14
|
+
}, row.data.title));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=CellTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","File","RowIcon","RowText","RowTitle","SchedulerListConfig","CellTitle","useTableRow","Browser","Table","Column","row","createElement","use","title"],"sources":["CellTitle.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as File } from \"@material-design-icons/svg/outlined/description.svg\";\nimport { RowIcon, RowText, RowTitle } from \"./CellTitle.styled\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellTitle = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return (\n <RowTitle>\n <RowIcon>\n <File />\n </RowIcon>\n <RowText use={\"subtitle2\"}>{row.title}</RowText>\n </RowTitle>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,IAAIC,IAAI,QAAQ,qDAAqD;AAC5F,SAASC,OAAO,EAAEC,OAAO,EAAEC,QAAQ;AACnC,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC3B,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBACIR,KAAA,CAAAa,aAAA,CAACR,QAAQ,qBACLL,KAAA,CAAAa,aAAA,CAACV,OAAO,qBACJH,KAAA,CAAAa,aAAA,CAACX,IAAI,MAAE,CACF,CAAC,eACVF,KAAA,CAAAa,aAAA,CAACT,OAAO;IAACU,GAAG,EAAE;EAAY,GAAEF,GAAG,CAACG,KAAe,
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","File","RowIcon","RowText","RowTitle","SchedulerListConfig","CellTitle","useTableRow","Browser","Table","Column","row","createElement","use","data","title"],"sources":["CellTitle.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as File } from \"@material-design-icons/svg/outlined/description.svg\";\nimport { RowIcon, RowText, RowTitle } from \"./CellTitle.styled\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellTitle = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return (\n <RowTitle>\n <RowIcon>\n <File />\n </RowIcon>\n <RowText use={\"subtitle2\"}>{row.data.title}</RowText>\n </RowTitle>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,IAAIC,IAAI,QAAQ,qDAAqD;AAC5F,SAASC,OAAO,EAAEC,OAAO,EAAEC,QAAQ;AACnC,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC3B,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBACIR,KAAA,CAAAa,aAAA,CAACR,QAAQ,qBACLL,KAAA,CAAAa,aAAA,CAACV,OAAO,qBACJH,KAAA,CAAAa,aAAA,CAACX,IAAI,MAAE,CACF,CAAC,eACVF,KAAA,CAAAa,aAAA,CAACT,OAAO;IAACU,GAAG,EAAE;EAAY,GAAEF,GAAG,CAACG,IAAI,CAACC,KAAe,CAC9C,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ export const CellType = () => {
|
|
|
11
11
|
} = useTableRow();
|
|
12
12
|
return /*#__PURE__*/React.createElement(RowType, null, /*#__PURE__*/React.createElement(RowIcon, null, /*#__PURE__*/React.createElement(File, null)), /*#__PURE__*/React.createElement(RowText, {
|
|
13
13
|
use: "subtitle2"
|
|
14
|
-
}, row.type));
|
|
14
|
+
}, row.data.type));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=CellType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","File","RowIcon","RowText","RowType","SchedulerListConfig","CellType","useTableRow","Browser","Table","Column","row","createElement","use","type"],"sources":["CellType.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as File } from \"@material-design-icons/svg/outlined/description.svg\";\nimport { RowIcon, RowText, RowType } from \"./CellType.styled\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellType = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return (\n <RowType>\n <RowIcon>\n <File />\n </RowIcon>\n <RowText use={\"subtitle2\"}>{row.type}</RowText>\n </RowType>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,IAAIC,IAAI,QAAQ,qDAAqD;AAC5F,SAASC,OAAO,EAAEC,OAAO,EAAEC,OAAO;AAClC,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBACIR,KAAA,CAAAa,aAAA,CAACR,OAAO,qBACJL,KAAA,CAAAa,aAAA,CAACV,OAAO,qBACJH,KAAA,CAAAa,aAAA,CAACX,IAAI,MAAE,CACF,CAAC,eACVF,KAAA,CAAAa,aAAA,CAACT,OAAO;IAACU,GAAG,EAAE;EAAY,GAAEF,GAAG,CAACG,IAAc,
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","File","RowIcon","RowText","RowType","SchedulerListConfig","CellType","useTableRow","Browser","Table","Column","row","createElement","use","data","type"],"sources":["CellType.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as File } from \"@material-design-icons/svg/outlined/description.svg\";\nimport { RowIcon, RowText, RowType } from \"./CellType.styled\";\nimport { SchedulerListConfig } from \"~/Presentation/configs\";\n\nexport const CellType = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return (\n <RowType>\n <RowIcon>\n <File />\n </RowIcon>\n <RowText use={\"subtitle2\"}>{row.data.type}</RowText>\n </RowType>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,IAAIC,IAAI,QAAQ,qDAAqD;AAC5F,SAASC,OAAO,EAAEC,OAAO,EAAEC,OAAO;AAClC,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBACIR,KAAA,CAAAa,aAAA,CAACR,OAAO,qBACJL,KAAA,CAAAa,aAAA,CAACV,OAAO,qBACJH,KAAA,CAAAa,aAAA,CAACX,IAAI,MAAE,CACF,CAAC,eACVF,KAAA,CAAAa,aAAA,CAACT,OAAO;IAACU,GAAG,EAAE;EAAY,GAAEF,GAAG,CAACG,IAAI,CAACC,IAAc,CAC9C,CAAC;AAElB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CellActions\";\nexport * from \"./CellScheduledBy\";\nexport * from \"./CellScheduledOn\";\nexport * from \"./CellType\";\nexport * from \"./CellTitle\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CellActions\";\nexport * from \"./CellScheduledBy\";\nexport * from \"./CellScheduledOn\";\nexport * from \"./CellType\";\nexport * from \"./CellTitle\";\nexport * from \"./CellRevision\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ISchedulerCancelGateway, ISchedulerPublishGateway, ISchedulerUnpublishGateway } from "../../../Gateways/index.js";
|
|
2
|
+
import type { IScheduleDialogAction, IScheduleDialogCancelActionExecuteParams, IScheduleDialogScheduleActionExecuteParams } from "./types.js";
|
|
3
|
+
export interface IScheduleDialogActionParams {
|
|
4
|
+
cancelGateway: ISchedulerCancelGateway;
|
|
5
|
+
publishGateway: ISchedulerPublishGateway;
|
|
6
|
+
unpublishGateway: ISchedulerUnpublishGateway;
|
|
7
|
+
}
|
|
8
|
+
export declare class ScheduleDialogAction implements IScheduleDialogAction {
|
|
9
|
+
readonly cancelGateway: ISchedulerCancelGateway;
|
|
10
|
+
readonly publishGateway: ISchedulerPublishGateway;
|
|
11
|
+
readonly unpublishGateway: ISchedulerUnpublishGateway;
|
|
12
|
+
constructor(params: IScheduleDialogActionParams);
|
|
13
|
+
schedule(params: IScheduleDialogScheduleActionExecuteParams): Promise<void>;
|
|
14
|
+
cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ScheduleType } from "../../../types.js";
|
|
2
|
+
export class ScheduleDialogAction {
|
|
3
|
+
constructor(params) {
|
|
4
|
+
const {
|
|
5
|
+
publishGateway,
|
|
6
|
+
unpublishGateway,
|
|
7
|
+
cancelGateway
|
|
8
|
+
} = params;
|
|
9
|
+
this.cancelGateway = cancelGateway;
|
|
10
|
+
this.publishGateway = publishGateway;
|
|
11
|
+
this.unpublishGateway = unpublishGateway;
|
|
12
|
+
}
|
|
13
|
+
async schedule(params) {
|
|
14
|
+
const {
|
|
15
|
+
id,
|
|
16
|
+
modelId,
|
|
17
|
+
type,
|
|
18
|
+
scheduleOn
|
|
19
|
+
} = params;
|
|
20
|
+
switch (type) {
|
|
21
|
+
case ScheduleType.publish:
|
|
22
|
+
await this.publishGateway.execute({
|
|
23
|
+
modelId,
|
|
24
|
+
id,
|
|
25
|
+
scheduleOn
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
case ScheduleType.unpublish:
|
|
29
|
+
await this.unpublishGateway.execute({
|
|
30
|
+
modelId,
|
|
31
|
+
id,
|
|
32
|
+
scheduleOn
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
default:
|
|
36
|
+
throw new Error(`Unsupported schedule type "${type}" for entry "${id}" and model "${modelId}".`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async cancel(params) {
|
|
40
|
+
const {
|
|
41
|
+
id,
|
|
42
|
+
modelId
|
|
43
|
+
} = params;
|
|
44
|
+
await this.cancelGateway.execute({
|
|
45
|
+
modelId,
|
|
46
|
+
id
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=ScheduleDialogAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScheduleType","ScheduleDialogAction","constructor","params","publishGateway","unpublishGateway","cancelGateway","schedule","id","modelId","type","scheduleOn","publish","execute","unpublish","Error","cancel"],"sources":["ScheduleDialogAction.ts"],"sourcesContent":["import { ScheduleType } from \"~/types.js\";\nimport type {\n ISchedulerCancelGateway,\n ISchedulerPublishGateway,\n ISchedulerUnpublishGateway\n} from \"~/Gateways/index.js\";\nimport type {\n IScheduleDialogAction,\n IScheduleDialogCancelActionExecuteParams,\n IScheduleDialogScheduleActionExecuteParams\n} from \"./types.js\";\n\nexport interface IScheduleDialogActionParams {\n cancelGateway: ISchedulerCancelGateway;\n publishGateway: ISchedulerPublishGateway;\n unpublishGateway: ISchedulerUnpublishGateway;\n}\n\nexport class ScheduleDialogAction implements IScheduleDialogAction {\n public readonly cancelGateway: ISchedulerCancelGateway;\n public readonly publishGateway: ISchedulerPublishGateway;\n public readonly unpublishGateway: ISchedulerUnpublishGateway;\n\n public constructor(params: IScheduleDialogActionParams) {\n const { publishGateway, unpublishGateway, cancelGateway } = params;\n\n this.cancelGateway = cancelGateway;\n this.publishGateway = publishGateway;\n this.unpublishGateway = unpublishGateway;\n }\n\n public async schedule(params: IScheduleDialogScheduleActionExecuteParams): Promise<void> {\n const { id, modelId, type, scheduleOn } = params;\n\n switch (type) {\n case ScheduleType.publish:\n await this.publishGateway.execute({\n modelId,\n id,\n scheduleOn\n });\n return;\n case ScheduleType.unpublish:\n await this.unpublishGateway.execute({\n modelId,\n id,\n scheduleOn\n });\n return;\n default:\n throw new Error(\n `Unsupported schedule type \"${type}\" for entry \"${id}\" and model \"${modelId}\".`\n );\n }\n }\n\n public async cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void> {\n const { id, modelId } = params;\n await this.cancelGateway.execute({\n modelId,\n id\n });\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY;AAkBrB,OAAO,MAAMC,oBAAoB,CAAkC;EAKxDC,WAAWA,CAACC,MAAmC,EAAE;IACpD,MAAM;MAAEC,cAAc;MAAEC,gBAAgB;MAAEC;IAAc,CAAC,GAAGH,MAAM;IAElE,IAAI,CAACG,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACF,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB;EAC5C;EAEA,MAAaE,QAAQA,CAACJ,MAAkD,EAAiB;IACrF,MAAM;MAAEK,EAAE;MAAEC,OAAO;MAAEC,IAAI;MAAEC;IAAW,CAAC,GAAGR,MAAM;IAEhD,QAAQO,IAAI;MACR,KAAKV,YAAY,CAACY,OAAO;QACrB,MAAM,IAAI,CAACR,cAAc,CAACS,OAAO,CAAC;UAC9BJ,OAAO;UACPD,EAAE;UACFG;QACJ,CAAC,CAAC;QACF;MACJ,KAAKX,YAAY,CAACc,SAAS;QACvB,MAAM,IAAI,CAACT,gBAAgB,CAACQ,OAAO,CAAC;UAChCJ,OAAO;UACPD,EAAE;UACFG;QACJ,CAAC,CAAC;QACF;MACJ;QACI,MAAM,IAAII,KAAK,CACX,8BAA8BL,IAAI,gBAAgBF,EAAE,gBAAgBC,OAAO,IAC/E,CAAC;IACT;EACJ;EAEA,MAAaO,MAAMA,CAACb,MAAgD,EAAiB;IACjF,MAAM;MAAEK,EAAE;MAAEC;IAAQ,CAAC,GAAGN,MAAM;IAC9B,MAAM,IAAI,CAACG,aAAa,CAACO,OAAO,CAAC;MAC7BJ,OAAO;MACPD;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ScheduleDialogAction.js\";\nexport * from \"./useScheduleDialog.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ScheduleType } from "../../../types";
|
|
2
|
+
export interface IScheduleDialogScheduleActionExecuteParams {
|
|
3
|
+
id: string;
|
|
4
|
+
modelId: string;
|
|
5
|
+
scheduleOn: Date;
|
|
6
|
+
type: ScheduleType;
|
|
7
|
+
}
|
|
8
|
+
export interface IScheduleDialogCancelActionExecuteParams {
|
|
9
|
+
id: string;
|
|
10
|
+
modelId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IScheduleDialogAction {
|
|
13
|
+
schedule(params: IScheduleDialogScheduleActionExecuteParams): Promise<void>;
|
|
14
|
+
cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ScheduleType } from \"~/types\";\n\nexport interface IScheduleDialogScheduleActionExecuteParams {\n id: string;\n modelId: string;\n scheduleOn: Date;\n type: ScheduleType;\n}\n\nexport interface IScheduleDialogCancelActionExecuteParams {\n id: string;\n modelId: string;\n}\n\nexport interface IScheduleDialogAction {\n schedule(params: IScheduleDialogScheduleActionExecuteParams): Promise<void>;\n cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SchedulerEntry } from "../../../types";
|
|
2
|
+
import type { CmsContentEntry } from "@webiny/app-headless-cms-common/types";
|
|
3
|
+
import type { IScheduleDialogAction } from "./types";
|
|
4
|
+
export interface ShowDialogParamsEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
status: CmsContentEntry["meta"]["status"];
|
|
7
|
+
title: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ShowDialogParams {
|
|
11
|
+
entry: ShowDialogParamsEntry;
|
|
12
|
+
schedulerEntry: SchedulerEntry | null;
|
|
13
|
+
action: IScheduleDialogAction;
|
|
14
|
+
}
|
|
15
|
+
interface UseShowScheduleDialogResponse {
|
|
16
|
+
showDialog: (params: ShowDialogParams) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const useScheduleDialog: () => UseShowScheduleDialogResponse;
|
|
19
|
+
export {};
|