@webiny/app-scheduler 0.0.0-unstable.c27f4d8a31 → 0.0.0-unstable.e6f0dc8ca7
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/Presentation/Scheduler/controllers/SortItems/ISortItemsController.d.ts +2 -2
- package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js.map +1 -1
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.d.ts +2 -2
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js.map +1 -1
- package/Presentation/components/BottomInfoBar/ListStatus.js +3 -4
- package/Presentation/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/Presentation/components/Cells/CellRevision/CellRevision.js +1 -1
- package/Presentation/components/Cells/CellRevision/CellRevision.js.map +1 -1
- package/Presentation/components/Cells/CellRevision/CellRevision.styled.d.ts +1 -1
- package/Presentation/components/Cells/CellRevision/CellRevision.styled.js +5 -5
- package/Presentation/components/Cells/CellRevision/CellRevision.styled.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/CellTitle/CellTitle.styled.d.ts +1 -1
- package/Presentation/components/Cells/CellTitle/CellTitle.styled.js +5 -5
- package/Presentation/components/Cells/CellTitle/CellTitle.styled.js.map +1 -1
- package/Presentation/components/Cells/CellType/CellActionType.js +1 -1
- package/Presentation/components/Cells/CellType/CellActionType.js.map +1 -1
- package/Presentation/components/Cells/CellType/CellActionType.styled.d.ts +1 -1
- package/Presentation/components/Cells/CellType/CellActionType.styled.js +5 -5
- package/Presentation/components/Cells/CellType/CellActionType.styled.js.map +1 -1
- package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.d.ts +26 -0
- package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js +3 -0
- package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js.map +1 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.d.ts +22 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js +90 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js.map +1 -0
- package/Presentation/components/ScheduleDialog/index.d.ts +0 -1
- package/Presentation/components/ScheduleDialog/index.js +0 -1
- package/Presentation/components/ScheduleDialog/index.js.map +1 -1
- package/Presentation/components/ScheduleDialog/useScheduleDialog.d.ts +2 -3
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js +48 -35
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +1 -1
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js +1 -1
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js.map +1 -1
- package/Presentation/components/Title/Title.js +4 -6
- package/Presentation/components/Title/Title.js.map +1 -1
- package/Presentation/components/Title/Title.styled.d.ts +1 -2
- package/Presentation/components/Title/Title.styled.js +3 -3
- package/Presentation/components/Title/Title.styled.js.map +1 -1
- package/Presentation/hooks/useCancelSchedulerItem.js +1 -1
- package/Presentation/hooks/useCancelSchedulerItem.js.map +1 -1
- package/package.json +23 -22
- package/Presentation/components/ScheduleDialog/ScheduleDialogAction.d.ts +0 -15
- package/Presentation/components/ScheduleDialog/ScheduleDialogAction.js +0 -51
- package/Presentation/components/ScheduleDialog/ScheduleDialogAction.js.map +0 -1
- package/Presentation/components/ScheduleDialog/useGetScheduledAction.d.ts +0 -7
- package/Presentation/components/ScheduleDialog/useGetScheduledAction.js +0 -31
- package/Presentation/components/ScheduleDialog/useGetScheduledAction.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ISortItemsController.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["ISortItemsController.ts"],"sourcesContent":["import type { OnDataTableSortingChange } from \"@webiny/admin-ui\";\n\nexport interface ISortItemsController {\n execute: OnDataTableSortingChange;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OnDataTableSortingChange } from "@webiny/admin-ui";
|
|
2
2
|
import type { IListItemsUseCase, ISortItemsUseCase } from "../../../../UseCases/index.js";
|
|
3
3
|
import type { ISortItemsController } from "./ISortItemsController.js";
|
|
4
4
|
export declare class SortItemsController implements ISortItemsController {
|
|
5
5
|
private readonly listItemsUseCaseFactory;
|
|
6
6
|
private readonly sortItemsUseCaseFactory;
|
|
7
7
|
constructor(listItemsUseCaseFactory: () => IListItemsUseCase, sortItemsUseCaseFactory: () => ISortItemsUseCase);
|
|
8
|
-
execute:
|
|
8
|
+
execute: OnDataTableSortingChange;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SortingMapper","SortItemsController","constructor","listItemsUseCaseFactory","sortItemsUseCaseFactory","execute","updaterOrValue","newSorts","sortItemsUseCase","listItemsUseCase","map","sort","fromColumnToDTO"],"sources":["SortItemsController.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":["SortingMapper","SortItemsController","constructor","listItemsUseCaseFactory","sortItemsUseCaseFactory","execute","updaterOrValue","newSorts","sortItemsUseCase","listItemsUseCase","map","sort","fromColumnToDTO"],"sources":["SortItemsController.ts"],"sourcesContent":["import type { OnDataTableSortingChange } from \"@webiny/admin-ui\";\nimport type { ColumnSorting } from \"@webiny/app-utils\";\nimport { SortingMapper } from \"@webiny/app-utils\";\nimport type { IListItemsUseCase, ISortItemsUseCase } from \"~/UseCases/index.js\";\nimport type { ISortItemsController } from \"./ISortItemsController.js\";\n\nexport class SortItemsController implements ISortItemsController {\n private readonly listItemsUseCaseFactory: () => IListItemsUseCase;\n private readonly sortItemsUseCaseFactory: () => ISortItemsUseCase;\n\n constructor(\n listItemsUseCaseFactory: () => IListItemsUseCase,\n sortItemsUseCaseFactory: () => ISortItemsUseCase\n ) {\n this.listItemsUseCaseFactory = listItemsUseCaseFactory;\n this.sortItemsUseCaseFactory = sortItemsUseCaseFactory;\n }\n\n public execute: OnDataTableSortingChange = async updaterOrValue => {\n let newSorts: ColumnSorting[] = [];\n\n if (typeof updaterOrValue === \"function\") {\n newSorts = updaterOrValue(newSorts || []);\n }\n\n const sortItemsUseCase = this.sortItemsUseCaseFactory();\n const listItemsUseCase = this.listItemsUseCaseFactory();\n\n await sortItemsUseCase.execute(newSorts.map(sort => SortingMapper.fromColumnToDTO(sort)));\n await listItemsUseCase.execute();\n };\n}\n"],"mappings":"AAEA,SAASA,aAAa,QAAQ,mBAAmB;AAIjD,OAAO,MAAMC,mBAAmB,CAAiC;EAI7DC,WAAWA,CACPC,uBAAgD,EAChDC,uBAAgD,EAClD;IACE,IAAI,CAACD,uBAAuB,GAAGA,uBAAuB;IACtD,IAAI,CAACC,uBAAuB,GAAGA,uBAAuB;EAC1D;EAEOC,OAAO,GAA6B,MAAMC,cAAc,IAAI;IAC/D,IAAIC,QAAyB,GAAG,EAAE;IAElC,IAAI,OAAOD,cAAc,KAAK,UAAU,EAAE;MACtCC,QAAQ,GAAGD,cAAc,CAACC,QAAQ,IAAI,EAAE,CAAC;IAC7C;IAEA,MAAMC,gBAAgB,GAAG,IAAI,CAACJ,uBAAuB,CAAC,CAAC;IACvD,MAAMK,gBAAgB,GAAG,IAAI,CAACN,uBAAuB,CAAC,CAAC;IAEvD,MAAMK,gBAAgB,CAACH,OAAO,CAACE,QAAQ,CAACG,GAAG,CAACC,IAAI,IAAIX,aAAa,CAACY,eAAe,CAACD,IAAI,CAAC,CAAC,CAAC;IACzF,MAAMF,gBAAgB,CAACJ,OAAO,CAAC,CAAC;EACpC,CAAC;AACL","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Loader } from "@webiny/admin-ui";
|
|
3
3
|
import { CircularProgressHolder, StatusWrapper, UploadingLabel } from "./BottomInfoBar.styled.js";
|
|
4
4
|
export const ListStatus = ({
|
|
5
5
|
loading
|
|
@@ -7,9 +7,8 @@ export const ListStatus = ({
|
|
|
7
7
|
if (!loading) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
return /*#__PURE__*/React.createElement(StatusWrapper, null, /*#__PURE__*/React.createElement(UploadingLabel, null, "Loading more items..."), /*#__PURE__*/React.createElement(CircularProgressHolder, null, /*#__PURE__*/React.createElement(
|
|
11
|
-
size:
|
|
12
|
-
spinnerWidth: 1
|
|
10
|
+
return /*#__PURE__*/React.createElement(StatusWrapper, null, /*#__PURE__*/React.createElement(UploadingLabel, null, "Loading more items..."), /*#__PURE__*/React.createElement(CircularProgressHolder, null, /*#__PURE__*/React.createElement(Loader, {
|
|
11
|
+
size: "xs"
|
|
13
12
|
})));
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","Loader","CircularProgressHolder","StatusWrapper","UploadingLabel","ListStatus","loading","createElement","size"],"sources":["ListStatus.tsx"],"sourcesContent":["import React from \"react\";\nimport { Loader } from \"@webiny/admin-ui\";\nimport { CircularProgressHolder, StatusWrapper, UploadingLabel } from \"./BottomInfoBar.styled.js\";\n\nexport interface ListStatusProps {\n loading: boolean;\n}\n\nexport const ListStatus = ({ loading }: ListStatusProps) => {\n if (!loading) {\n return null;\n }\n\n return (\n <StatusWrapper>\n <UploadingLabel>{\"Loading more items...\"}</UploadingLabel>\n <CircularProgressHolder>\n <Loader size={\"xs\"} />\n </CircularProgressHolder>\n </StatusWrapper>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,sBAAsB,EAAEC,aAAa,EAAEC,cAAc;AAM9D,OAAO,MAAMC,UAAU,GAAGA,CAAC;EAAEC;AAAyB,CAAC,KAAK;EACxD,IAAI,CAACA,OAAO,EAAE;IACV,OAAO,IAAI;EACf;EAEA,oBACIN,KAAA,CAAAO,aAAA,CAACJ,aAAa,qBACVH,KAAA,CAAAO,aAAA,CAACH,cAAc,QAAE,uBAAwC,CAAC,eAC1DJ,KAAA,CAAAO,aAAA,CAACL,sBAAsB,qBACnBF,KAAA,CAAAO,aAAA,CAACN,MAAM;IAACO,IAAI,EAAE;EAAK,CAAE,CACD,CACb,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","RowText","RowTitle","SchedulerListConfig","parseIdentifier","CellRevision","useTableRow","Browser","Table","Column","row","version","data","targetId","createElement","
|
|
1
|
+
{"version":3,"names":["React","RowText","RowTitle","SchedulerListConfig","parseIdentifier","CellRevision","useTableRow","Browser","Table","Column","row","version","data","targetId","createElement","size"],"sources":["CellRevision.tsx"],"sourcesContent":["import React from \"react\";\nimport { RowText, RowTitle } from \"./CellRevision.styled.js\";\nimport { SchedulerListConfig } from \"~/Presentation/configs/index.js\";\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.data.targetId);\n return (\n <RowTitle>\n <RowText size={\"sm\"}>{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,IAAI,CAACC,QAAQ,CAAC;EACtD,oBACIb,KAAA,CAAAc,aAAA,CAACZ,QAAQ,qBACLF,KAAA,CAAAc,aAAA,CAACb,OAAO;IAACc,IAAI,EAAE;EAAK,GAAEJ,OAAiB,CACjC,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,6 @@ export declare const RowIcon: import("@emotion/styled").StyledComponent<{
|
|
|
6
6
|
theme?: import("@emotion/react").Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
-
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/ui
|
|
9
|
+
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/admin-ui").TextProps & {
|
|
10
10
|
theme?: import("@emotion/react").Theme;
|
|
11
11
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
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 {
|
|
3
|
+
import { Text } from "@webiny/admin-ui";
|
|
4
4
|
export const RowTitle = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
5
5
|
target: "eylbj5e2"
|
|
6
6
|
} : {
|
|
@@ -11,7 +11,7 @@ export const RowTitle = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "pr
|
|
|
11
11
|
styles: "display:flex;align-items:center"
|
|
12
12
|
} : {
|
|
13
13
|
name: "s5xdrg",
|
|
14
|
-
styles: "display:flex;align-items:center/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
14
|
+
styles: "display:flex;align-items:center/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxSZXZpc2lvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdxQyIsImZpbGUiOiJDZWxsUmV2aXNpb24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJAd2ViaW55L2FkbWluLXVpXCI7XG5cbmV4cG9ydCBjb25zdCBSb3dUaXRsZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
15
15
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
16
|
});
|
|
17
17
|
export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -24,10 +24,10 @@ export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "pro
|
|
|
24
24
|
styles: "margin-right:8px;height:24px"
|
|
25
25
|
} : {
|
|
26
26
|
name: "1hpq26k",
|
|
27
|
-
styles: "margin-right:8px;height:24px/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
styles: "margin-right:8px;height:24px/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxSZXZpc2lvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFvQyIsImZpbGUiOiJDZWxsUmV2aXNpb24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJAd2ViaW55L2FkbWluLXVpXCI7XG5cbmV4cG9ydCBjb25zdCBSb3dUaXRsZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
28
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
29
|
});
|
|
30
|
-
export const RowText = /*#__PURE__*/_styled(
|
|
30
|
+
export const RowText = /*#__PURE__*/_styled(Text, process.env.NODE_ENV === "production" ? {
|
|
31
31
|
target: "eylbj5e0"
|
|
32
32
|
} : {
|
|
33
33
|
target: "eylbj5e0",
|
|
@@ -37,7 +37,7 @@ export const RowText = /*#__PURE__*/_styled(Typography, process.env.NODE_ENV ===
|
|
|
37
37
|
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
38
38
|
} : {
|
|
39
39
|
name: "l8l8b8",
|
|
40
|
-
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
40
|
+
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxSZXZpc2lvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFtQyIsImZpbGUiOiJDZWxsUmV2aXNpb24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJAd2ViaW55L2FkbWluLXVpXCI7XG5cbmV4cG9ydCBjb25zdCBSb3dUaXRsZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
41
41
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Text","RowTitle","_styled","process","env","NODE_ENV","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","RowIcon","RowText"],"sources":["CellRevision.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Text } from \"@webiny/admin-ui\";\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(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;AACA,SAASA,IAAI,QAAQ,kBAAkB;AAEvC,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,QAAA,EAAAC;AAAA,EAGpC;AAED,OAAO,MAAMC,OAAO,gBAAGV,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,QAAA,EAAAC;AAAA,EAGnC;AAED,OAAO,MAAME,OAAO,gBAAGX,OAAA,CAAOF,IAAI,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,QAAA,EAAAC;AAAA,EAIlC","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ export const CellTitle = () => {
|
|
|
10
10
|
row
|
|
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
|
+
size: "sm"
|
|
14
14
|
}, row.data.title));
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","File","RowIcon","RowText","RowTitle","SchedulerListConfig","CellTitle","useTableRow","Browser","Table","Column","row","createElement","
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","File","RowIcon","RowText","RowTitle","SchedulerListConfig","CellTitle","useTableRow","Browser","Table","Column","row","createElement","size","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.js\";\nimport { SchedulerListConfig } from \"~/Presentation/configs/index.js\";\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 size={\"sm\"}>{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,IAAI,EAAE;EAAK,GAAEF,GAAG,CAACG,IAAI,CAACC,KAAe,CACxC,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,6 @@ export declare const RowIcon: import("@emotion/styled").StyledComponent<{
|
|
|
6
6
|
theme?: import("@emotion/react").Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
-
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/ui
|
|
9
|
+
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/admin-ui").TextProps & {
|
|
10
10
|
theme?: import("@emotion/react").Theme;
|
|
11
11
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
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 {
|
|
3
|
+
import { Text } from "@webiny/admin-ui";
|
|
4
4
|
export const RowTitle = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
5
5
|
target: "e16g9ulc2"
|
|
6
6
|
} : {
|
|
@@ -11,7 +11,7 @@ export const RowTitle = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "pr
|
|
|
11
11
|
styles: "display:flex;align-items:center"
|
|
12
12
|
} : {
|
|
13
13
|
name: "s5xdrg",
|
|
14
|
-
styles: "display:flex;align-items:center/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
14
|
+
styles: "display:flex;align-items:center/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxUaXRsZS5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdxQyIsImZpbGUiOiJDZWxsVGl0bGUuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJAd2ViaW55L2FkbWluLXVpXCI7XG5cbmV4cG9ydCBjb25zdCBSb3dUaXRsZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
15
15
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
16
|
});
|
|
17
17
|
export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -24,10 +24,10 @@ export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "pro
|
|
|
24
24
|
styles: "margin-right:8px;height:24px"
|
|
25
25
|
} : {
|
|
26
26
|
name: "1hpq26k",
|
|
27
|
-
styles: "margin-right:8px;height:24px/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
styles: "margin-right:8px;height:24px/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxUaXRsZS5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFvQyIsImZpbGUiOiJDZWxsVGl0bGUuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJAd2ViaW55L2FkbWluLXVpXCI7XG5cbmV4cG9ydCBjb25zdCBSb3dUaXRsZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
28
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
29
|
});
|
|
30
|
-
export const RowText = /*#__PURE__*/_styled(
|
|
30
|
+
export const RowText = /*#__PURE__*/_styled(Text, process.env.NODE_ENV === "production" ? {
|
|
31
31
|
target: "e16g9ulc0"
|
|
32
32
|
} : {
|
|
33
33
|
target: "e16g9ulc0",
|
|
@@ -37,7 +37,7 @@ export const RowText = /*#__PURE__*/_styled(Typography, process.env.NODE_ENV ===
|
|
|
37
37
|
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
38
38
|
} : {
|
|
39
39
|
name: "l8l8b8",
|
|
40
|
-
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
40
|
+
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxUaXRsZS5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFtQyIsImZpbGUiOiJDZWxsVGl0bGUuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJAd2ViaW55L2FkbWluLXVpXCI7XG5cbmV4cG9ydCBjb25zdCBSb3dUaXRsZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
41
41
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Text","RowTitle","_styled","process","env","NODE_ENV","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","RowIcon","RowText"],"sources":["CellTitle.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Text } from \"@webiny/admin-ui\";\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(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;AACA,SAASA,IAAI,QAAQ,kBAAkB;AAEvC,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,QAAA,EAAAC;AAAA,EAGpC;AAED,OAAO,MAAMC,OAAO,gBAAGV,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,QAAA,EAAAC;AAAA,EAGnC;AAED,OAAO,MAAME,OAAO,gBAAGX,OAAA,CAAOF,IAAI,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,QAAA,EAAAC;AAAA,EAIlC","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ export const CellActionType = () => {
|
|
|
11
11
|
row
|
|
12
12
|
} = useTableRow();
|
|
13
13
|
return /*#__PURE__*/React.createElement(RowType, null, /*#__PURE__*/React.createElement(RowIcon, null, row.data.actionType === "publish" ? /*#__PURE__*/React.createElement(Publish, null) : /*#__PURE__*/React.createElement(Unpublish, null)), /*#__PURE__*/React.createElement(RowText, {
|
|
14
|
-
|
|
14
|
+
size: "sm"
|
|
15
15
|
}, row.data.actionType));
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","Publish","Unpublish","RowIcon","RowText","RowType","SchedulerListConfig","CellActionType","useTableRow","Browser","Table","Column","row","createElement","data","actionType","
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","Publish","Unpublish","RowIcon","RowText","RowType","SchedulerListConfig","CellActionType","useTableRow","Browser","Table","Column","row","createElement","data","actionType","size"],"sources":["CellActionType.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as Publish } from \"@webiny/icons/publish.svg\";\nimport { ReactComponent as Unpublish } from \"@webiny/icons/unpublished.svg\";\nimport { RowIcon, RowText, RowType } from \"./CellActionType.styled.js\";\nimport { SchedulerListConfig } from \"~/Presentation/configs/index.js\";\n\nexport const CellActionType = () => {\n const { useTableRow } = SchedulerListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n return (\n <RowType>\n <RowIcon>{row.data.actionType === \"publish\" ? <Publish /> : <Unpublish />}</RowIcon>\n <RowText size={\"sm\"}>{row.data.actionType}</RowText>\n </RowType>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,IAAIC,OAAO,QAAQ,2BAA2B;AACrE,SAASD,cAAc,IAAIE,SAAS,QAAQ,+BAA+B;AAC3E,SAASC,OAAO,EAAEC,OAAO,EAAEC,OAAO;AAClC,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAM;IAAEC;EAAY,CAAC,GAAGF,mBAAmB,CAACG,OAAO,CAACC,KAAK,CAACC,MAAM;EAChE,MAAM;IAAEC;EAAI,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAE7B,oBACIT,KAAA,CAAAc,aAAA,CAACR,OAAO,qBACJN,KAAA,CAAAc,aAAA,CAACV,OAAO,QAAES,GAAG,CAACE,IAAI,CAACC,UAAU,KAAK,SAAS,gBAAGhB,KAAA,CAAAc,aAAA,CAACZ,OAAO,MAAE,CAAC,gBAAGF,KAAA,CAAAc,aAAA,CAACX,SAAS,MAAE,CAAW,CAAC,eACpFH,KAAA,CAAAc,aAAA,CAACT,OAAO;IAACY,IAAI,EAAE;EAAK,GAAEJ,GAAG,CAACE,IAAI,CAACC,UAAoB,CAC9C,CAAC;AAElB,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,6 @@ export declare const RowIcon: import("@emotion/styled").StyledComponent<{
|
|
|
6
6
|
theme?: import("@emotion/react").Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
-
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/ui
|
|
9
|
+
export declare const RowText: import("@emotion/styled").StyledComponent<import("@webiny/admin-ui").TextProps & {
|
|
10
10
|
theme?: import("@emotion/react").Theme;
|
|
11
11
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
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 {
|
|
3
|
+
import { Text } from "@webiny/admin-ui";
|
|
4
4
|
export const RowType = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
5
5
|
target: "e1fmcif12"
|
|
6
6
|
} : {
|
|
@@ -11,7 +11,7 @@ export const RowType = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "pro
|
|
|
11
11
|
styles: "display:flex;align-items:center"
|
|
12
12
|
} : {
|
|
13
13
|
name: "s5xdrg",
|
|
14
|
-
styles: "display:flex;align-items:center/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
14
|
+
styles: "display:flex;align-items:center/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxBY3Rpb25UeXBlLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR29DIiwiZmlsZSI6IkNlbGxBY3Rpb25UeXBlLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IFRleHQgfSBmcm9tIFwiQHdlYmlueS9hZG1pbi11aVwiO1xuXG5leHBvcnQgY29uc3QgUm93VHlwZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
15
15
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
16
|
});
|
|
17
17
|
export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -24,10 +24,10 @@ export const RowIcon = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "pro
|
|
|
24
24
|
styles: "margin-right:8px;height:24px"
|
|
25
25
|
} : {
|
|
26
26
|
name: "1hpq26k",
|
|
27
|
-
styles: "margin-right:8px;height:24px/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
styles: "margin-right:8px;height:24px/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxBY3Rpb25UeXBlLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUW9DIiwiZmlsZSI6IkNlbGxBY3Rpb25UeXBlLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IFRleHQgfSBmcm9tIFwiQHdlYmlueS9hZG1pbi11aVwiO1xuXG5leHBvcnQgY29uc3QgUm93VHlwZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
28
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
29
|
});
|
|
30
|
-
export const RowText = /*#__PURE__*/_styled(
|
|
30
|
+
export const RowText = /*#__PURE__*/_styled(Text, process.env.NODE_ENV === "production" ? {
|
|
31
31
|
target: "e1fmcif10"
|
|
32
32
|
} : {
|
|
33
33
|
target: "e1fmcif10",
|
|
@@ -37,7 +37,7 @@ export const RowText = /*#__PURE__*/_styled(Typography, process.env.NODE_ENV ===
|
|
|
37
37
|
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
38
38
|
} : {
|
|
39
39
|
name: "l8l8b8",
|
|
40
|
-
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
40
|
+
styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNlbGxBY3Rpb25UeXBlLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYW1DIiwiZmlsZSI6IkNlbGxBY3Rpb25UeXBlLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IFRleHQgfSBmcm9tIFwiQHdlYmlueS9hZG1pbi11aVwiO1xuXG5leHBvcnQgY29uc3QgUm93VHlwZSA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93SWNvbiA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tcmlnaHQ6IDhweDtcbiAgICBoZWlnaHQ6IDI0cHg7XG5gO1xuXG5leHBvcnQgY29uc3QgUm93VGV4dCA9IHN0eWxlZChUZXh0KWBcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
41
41
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Text","RowType","_styled","process","env","NODE_ENV","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","RowIcon","RowText"],"sources":["CellActionType.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Text } from \"@webiny/admin-ui\";\n\nexport const RowType = 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(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;AACA,SAASA,IAAI,QAAQ,kBAAkB;AAEvC,OAAO,MAAMC,OAAO,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,QAAA,EAAAC;AAAA,EAGnC;AAED,OAAO,MAAMC,OAAO,gBAAGV,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,QAAA,EAAAC;AAAA,EAGnC;AAED,OAAO,MAAME,OAAO,gBAAGX,OAAA,CAAOF,IAAI,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,QAAA,EAAAC;AAAA,EAIlC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ScheduleActionType, SchedulerEntry } from "../../../types.js";
|
|
2
|
+
export interface IScheduleDialogPresenterViewModel {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
entry: SchedulerEntry | null;
|
|
5
|
+
}
|
|
6
|
+
export interface IScheduleDialogPresenterLoadParams {
|
|
7
|
+
namespace: string;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IScheduleDialogPresenterScheduleParams {
|
|
11
|
+
targetId: string;
|
|
12
|
+
namespace: string;
|
|
13
|
+
scheduleOn: Date;
|
|
14
|
+
actionType: ScheduleActionType;
|
|
15
|
+
}
|
|
16
|
+
export interface IScheduleDialogPresenterCancelParams {
|
|
17
|
+
id: string;
|
|
18
|
+
namespace: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IScheduleDialogPresenter {
|
|
21
|
+
get vm(): IScheduleDialogPresenterViewModel;
|
|
22
|
+
load(params: IScheduleDialogPresenterLoadParams): Promise<void>;
|
|
23
|
+
schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void>;
|
|
24
|
+
cancel(params: IScheduleDialogPresenterCancelParams): Promise<void>;
|
|
25
|
+
reset(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["IScheduleDialogPresenter.ts"],"sourcesContent":["import type { ScheduleActionType, SchedulerEntry } from \"~/types.js\";\n\nexport interface IScheduleDialogPresenterViewModel {\n loading: boolean;\n entry: SchedulerEntry | null;\n}\n\nexport interface IScheduleDialogPresenterLoadParams {\n namespace: string;\n id: string;\n}\n\nexport interface IScheduleDialogPresenterScheduleParams {\n targetId: string;\n namespace: string;\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\nexport interface IScheduleDialogPresenterCancelParams {\n id: string;\n namespace: string;\n}\n\nexport interface IScheduleDialogPresenter {\n get vm(): IScheduleDialogPresenterViewModel;\n load(params: IScheduleDialogPresenterLoadParams): Promise<void>;\n schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void>;\n cancel(params: IScheduleDialogPresenterCancelParams): Promise<void>;\n reset(): void;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ICancelScheduledActionGateway, IGetScheduledActionGateway, ISchedulePublishActionGateway, IScheduleUnpublishActionGateway } from "../../../Gateways/index.js";
|
|
2
|
+
import type { IScheduleDialogPresenter, IScheduleDialogPresenterCancelParams, IScheduleDialogPresenterLoadParams, IScheduleDialogPresenterScheduleParams, IScheduleDialogPresenterViewModel } from "./IScheduleDialogPresenter.js";
|
|
3
|
+
export interface IScheduleDialogPresenterParams {
|
|
4
|
+
getGateway: IGetScheduledActionGateway;
|
|
5
|
+
cancelGateway: ICancelScheduledActionGateway;
|
|
6
|
+
publishGateway: ISchedulePublishActionGateway;
|
|
7
|
+
unpublishGateway: IScheduleUnpublishActionGateway;
|
|
8
|
+
}
|
|
9
|
+
export declare class ScheduleDialogPresenter implements IScheduleDialogPresenter {
|
|
10
|
+
private loading;
|
|
11
|
+
private entry;
|
|
12
|
+
private readonly getGateway;
|
|
13
|
+
private readonly cancelGateway;
|
|
14
|
+
private readonly publishGateway;
|
|
15
|
+
private readonly unpublishGateway;
|
|
16
|
+
constructor(params: IScheduleDialogPresenterParams);
|
|
17
|
+
get vm(): IScheduleDialogPresenterViewModel;
|
|
18
|
+
load(params: IScheduleDialogPresenterLoadParams): Promise<void>;
|
|
19
|
+
schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void>;
|
|
20
|
+
cancel(params: IScheduleDialogPresenterCancelParams): Promise<void>;
|
|
21
|
+
reset(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { makeAutoObservable, runInAction } from "mobx";
|
|
2
|
+
import { ScheduleActionType } from "../../../types.js";
|
|
3
|
+
export class ScheduleDialogPresenter {
|
|
4
|
+
loading = false;
|
|
5
|
+
entry = null;
|
|
6
|
+
constructor(params) {
|
|
7
|
+
this.getGateway = params.getGateway;
|
|
8
|
+
this.cancelGateway = params.cancelGateway;
|
|
9
|
+
this.publishGateway = params.publishGateway;
|
|
10
|
+
this.unpublishGateway = params.unpublishGateway;
|
|
11
|
+
makeAutoObservable(this);
|
|
12
|
+
}
|
|
13
|
+
get vm() {
|
|
14
|
+
return {
|
|
15
|
+
loading: this.loading,
|
|
16
|
+
entry: this.entry
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async load(params) {
|
|
20
|
+
this.loading = true;
|
|
21
|
+
try {
|
|
22
|
+
const entry = await this.getGateway.execute(params);
|
|
23
|
+
runInAction(() => {
|
|
24
|
+
this.entry = entry;
|
|
25
|
+
this.loading = false;
|
|
26
|
+
});
|
|
27
|
+
} catch {
|
|
28
|
+
runInAction(() => {
|
|
29
|
+
this.loading = false;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async schedule(params) {
|
|
34
|
+
const {
|
|
35
|
+
targetId,
|
|
36
|
+
namespace,
|
|
37
|
+
scheduleOn,
|
|
38
|
+
actionType
|
|
39
|
+
} = params;
|
|
40
|
+
this.loading = true;
|
|
41
|
+
try {
|
|
42
|
+
switch (actionType) {
|
|
43
|
+
case ScheduleActionType.publish:
|
|
44
|
+
await this.publishGateway.execute({
|
|
45
|
+
namespace,
|
|
46
|
+
targetId,
|
|
47
|
+
scheduleOn
|
|
48
|
+
});
|
|
49
|
+
break;
|
|
50
|
+
case ScheduleActionType.unpublish:
|
|
51
|
+
await this.unpublishGateway.execute({
|
|
52
|
+
namespace,
|
|
53
|
+
targetId,
|
|
54
|
+
scheduleOn
|
|
55
|
+
});
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
throw new Error(`Unsupported action type "${actionType}".`);
|
|
59
|
+
}
|
|
60
|
+
runInAction(() => {
|
|
61
|
+
this.entry = null;
|
|
62
|
+
this.loading = false;
|
|
63
|
+
});
|
|
64
|
+
} catch {
|
|
65
|
+
runInAction(() => {
|
|
66
|
+
this.loading = false;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async cancel(params) {
|
|
71
|
+
this.loading = true;
|
|
72
|
+
try {
|
|
73
|
+
await this.cancelGateway.execute(params);
|
|
74
|
+
runInAction(() => {
|
|
75
|
+
this.entry = null;
|
|
76
|
+
this.loading = false;
|
|
77
|
+
});
|
|
78
|
+
} catch {
|
|
79
|
+
runInAction(() => {
|
|
80
|
+
this.loading = false;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
reset() {
|
|
85
|
+
this.entry = null;
|
|
86
|
+
this.loading = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=ScheduleDialogPresenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","runInAction","ScheduleActionType","ScheduleDialogPresenter","loading","entry","constructor","params","getGateway","cancelGateway","publishGateway","unpublishGateway","vm","load","execute","schedule","targetId","namespace","scheduleOn","actionType","publish","unpublish","Error","cancel","reset"],"sources":["ScheduleDialogPresenter.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\nimport type {\n ICancelScheduledActionGateway,\n IGetScheduledActionGateway,\n ISchedulePublishActionGateway,\n IScheduleUnpublishActionGateway\n} from \"~/Gateways/index.js\";\nimport type {\n IScheduleDialogPresenter,\n IScheduleDialogPresenterCancelParams,\n IScheduleDialogPresenterLoadParams,\n IScheduleDialogPresenterScheduleParams,\n IScheduleDialogPresenterViewModel\n} from \"./IScheduleDialogPresenter.js\";\n\nexport interface IScheduleDialogPresenterParams {\n getGateway: IGetScheduledActionGateway;\n cancelGateway: ICancelScheduledActionGateway;\n publishGateway: ISchedulePublishActionGateway;\n unpublishGateway: IScheduleUnpublishActionGateway;\n}\n\nexport class ScheduleDialogPresenter implements IScheduleDialogPresenter {\n private loading = false;\n private entry: SchedulerEntry | null = null;\n\n private readonly getGateway: IGetScheduledActionGateway;\n private readonly cancelGateway: ICancelScheduledActionGateway;\n private readonly publishGateway: ISchedulePublishActionGateway;\n private readonly unpublishGateway: IScheduleUnpublishActionGateway;\n\n public constructor(params: IScheduleDialogPresenterParams) {\n this.getGateway = params.getGateway;\n this.cancelGateway = params.cancelGateway;\n this.publishGateway = params.publishGateway;\n this.unpublishGateway = params.unpublishGateway;\n makeAutoObservable(this);\n }\n\n public get vm(): IScheduleDialogPresenterViewModel {\n return {\n loading: this.loading,\n entry: this.entry\n };\n }\n\n public async load(params: IScheduleDialogPresenterLoadParams): Promise<void> {\n this.loading = true;\n\n try {\n const entry = await this.getGateway.execute(params);\n runInAction(() => {\n this.entry = entry;\n this.loading = false;\n });\n } catch {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n public async schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void> {\n const { targetId, namespace, scheduleOn, actionType } = params;\n this.loading = true;\n\n try {\n switch (actionType) {\n case ScheduleActionType.publish:\n await this.publishGateway.execute({ namespace, targetId, scheduleOn });\n break;\n case ScheduleActionType.unpublish:\n await this.unpublishGateway.execute({ namespace, targetId, scheduleOn });\n break;\n default:\n throw new Error(`Unsupported action type \"${actionType}\".`);\n }\n runInAction(() => {\n this.entry = null;\n this.loading = false;\n });\n } catch {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n public async cancel(params: IScheduleDialogPresenterCancelParams): Promise<void> {\n this.loading = true;\n\n try {\n await this.cancelGateway.execute(params);\n runInAction(() => {\n this.entry = null;\n this.loading = false;\n });\n } catch {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n public reset(): void {\n this.entry = null;\n this.loading = false;\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AACtD,SAASC,kBAAkB;AAuB3B,OAAO,MAAMC,uBAAuB,CAAqC;EAC7DC,OAAO,GAAG,KAAK;EACfC,KAAK,GAA0B,IAAI;EAOpCC,WAAWA,CAACC,MAAsC,EAAE;IACvD,IAAI,CAACC,UAAU,GAAGD,MAAM,CAACC,UAAU;IACnC,IAAI,CAACC,aAAa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U,IAAI,CAAC;MACnE;MACAlB,WAAW,CAAC,MAAM;QACd,IAAI,CAACI,KAAK,GAAG,IAAI;QACjB,IAAI,CAACD,OAAO,GAAG,KAAK;MACxB,CAAC,CAAC;IACN,CAAC,CAAC,MAAM;MACJH,WAAW,CAAC,MAAM;QACd,IAAI,CAACG,OAAO,GAAG,KAAK;MACxB,CAAC,CAAC;IACN;EACJ;EAEA,MAAamB,MAAMA,CAAChB,MAA4C,EAAiB;IAC7E,IAAI,CAACH,OAAO,GAAG,IAAI;IAEnB,IAAI;MACA,MAAM,IAAI,CAACK,aAAa,CAACK,OAAO,CAACP,MAAM,CAAC;MACxCN,WAAW,CAAC,MAAM;QACd,IAAI,CAACI,KAAK,GAAG,IAAI;QACjB,IAAI,CAACD,OAAO,GAAG,KAAK;MACxB,CAAC,CAAC;IACN,CAAC,CAAC,MAAM;MACJH,WAAW,CAAC,MAAM;QACd,IAAI,CAACG,OAAO,GAAG,KAAK;MACxB,CAAC,CAAC;IACN;EACJ;EAEOoB,KAAKA,CAAA,EAAS;IACjB,IAAI,CAACnB,KAAK,GAAG,IAAI;IACjB,IAAI,CAACD,OAAO,GAAG,KAAK;EACxB;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useScheduleDialog.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type BindComponentRenderProp } from "@webiny/form";
|
|
3
|
-
import type { CmsContentEntryStatusType } from "@webiny/app-headless-cms-common/types/index.js";
|
|
4
3
|
import ApolloClient from "apollo-client/ApolloClient.js";
|
|
5
|
-
export type ShowDialogParamsEntryStatus =
|
|
4
|
+
export type ShowDialogParamsEntryStatus = "published" | "unpublished" | "draft" | string;
|
|
6
5
|
export interface IShowDialogParamsEntry {
|
|
7
6
|
id: string;
|
|
8
7
|
status: ShowDialogParamsEntryStatus;
|
|
@@ -27,7 +26,7 @@ export declare const SchedulerDialogFormComponentDateTimeInput: ((props: ISchedu
|
|
|
27
26
|
originalName: string;
|
|
28
27
|
displayName: string;
|
|
29
28
|
} & {
|
|
30
|
-
createDecorator: (decorator: import("@webiny/
|
|
29
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element) & {
|
|
31
30
|
original: (props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element;
|
|
32
31
|
originalName: string;
|
|
33
32
|
displayName: string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useRef } from "react";
|
|
2
|
-
import { Alert, Grid, Input } from "@webiny/admin-ui";
|
|
2
|
+
import { Alert, Button, Grid, Input } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent as DeleteIcon } from "@webiny/icons/delete.svg";
|
|
3
4
|
import { useDialogs, useSnackbar } from "@webiny/app-admin";
|
|
4
5
|
import { Bind } from "@webiny/form";
|
|
5
6
|
import { validation } from "@webiny/validation";
|
|
6
7
|
import { ScheduleActionType } from "../../../types.js";
|
|
7
8
|
import ValidationError from "@webiny/validation/validationError.js";
|
|
8
9
|
import { makeDecoratable } from "@webiny/react-composition";
|
|
9
|
-
import { ScheduleDialogAction } from "../../index.js";
|
|
10
10
|
import { SchedulerCancelGraphQLGateway } from "../../../Gateways/SchedulerCancelGraphQLGateway.js";
|
|
11
11
|
import { SchedulerPublishGraphQLGateway } from "../../../Gateways/SchedulerPublishGraphQLGateway.js";
|
|
12
12
|
import { SchedulerUnpublishGraphQLGateway } from "../../../Gateways/SchedulerUnpublishGraphQLGateway.js";
|
|
13
|
-
import { useGetScheduledAction } from "./useGetScheduledAction.js";
|
|
14
13
|
import { SchedulerGetGraphQLGateway } from "../../../Gateways/SchedulerGetGraphQLGateway.js";
|
|
14
|
+
import { ScheduleDialogPresenter } from "./ScheduleDialogPresenter.js";
|
|
15
15
|
const dateToLocaleStringFormatter = new Intl.DateTimeFormat(undefined, {
|
|
16
16
|
year: "numeric",
|
|
17
17
|
month: "2-digit",
|
|
@@ -61,6 +61,22 @@ const minDateValidator = input => {
|
|
|
61
61
|
throw new ValidationError(`The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(minDate)}.`);
|
|
62
62
|
};
|
|
63
63
|
minDateValidator.validatorName = "minDateValidator";
|
|
64
|
+
const CancelButtonComponent = ({
|
|
65
|
+
enabled,
|
|
66
|
+
onCancel
|
|
67
|
+
}) => {
|
|
68
|
+
if (!enabled) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
72
|
+
variant: "ghost",
|
|
73
|
+
onClick: onCancel,
|
|
74
|
+
text: "Cancel Schedule",
|
|
75
|
+
size: "md",
|
|
76
|
+
icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
|
|
77
|
+
iconPosition: "start"
|
|
78
|
+
});
|
|
79
|
+
};
|
|
64
80
|
export const SchedulerDialogFormComponentDateTimeInput = makeDecoratable("SchedulerDialogFormComponentDateTimeInput", props => {
|
|
65
81
|
const {
|
|
66
82
|
bind
|
|
@@ -77,13 +93,11 @@ export const SchedulerDialogFormComponentDateTimeInput = makeDecoratable("Schedu
|
|
|
77
93
|
});
|
|
78
94
|
const FormComponent = ({
|
|
79
95
|
scheduleOn,
|
|
80
|
-
onCancel,
|
|
81
96
|
actionType
|
|
82
97
|
}) => {
|
|
83
98
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ReschedulingAlert, {
|
|
84
99
|
actionType: actionType,
|
|
85
|
-
scheduleOn: scheduleOn
|
|
86
|
-
onCancel: onCancel
|
|
100
|
+
scheduleOn: scheduleOn
|
|
87
101
|
}), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
|
|
88
102
|
span: 12
|
|
89
103
|
}, /*#__PURE__*/React.createElement(Bind, {
|
|
@@ -105,24 +119,14 @@ export const useScheduleDialog = props => {
|
|
|
105
119
|
const {
|
|
106
120
|
showSnackbar
|
|
107
121
|
} = useSnackbar();
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
publishGateway,
|
|
115
|
-
unpublishGateway
|
|
122
|
+
const presenter = useMemo(() => {
|
|
123
|
+
return new ScheduleDialogPresenter({
|
|
124
|
+
getGateway: new SchedulerGetGraphQLGateway(client),
|
|
125
|
+
cancelGateway: new SchedulerCancelGraphQLGateway(client),
|
|
126
|
+
publishGateway: new SchedulerPublishGraphQLGateway(client),
|
|
127
|
+
unpublishGateway: new SchedulerUnpublishGraphQLGateway(client)
|
|
116
128
|
});
|
|
117
129
|
}, [client]);
|
|
118
|
-
const getGateway = useMemo(() => {
|
|
119
|
-
return new SchedulerGetGraphQLGateway(client);
|
|
120
|
-
}, [client]);
|
|
121
|
-
const schedulerEntry = useGetScheduledAction({
|
|
122
|
-
gateway: getGateway,
|
|
123
|
-
namespace,
|
|
124
|
-
id: target.id
|
|
125
|
-
});
|
|
126
130
|
const dialogClose = useRef(() => {
|
|
127
131
|
return;
|
|
128
132
|
});
|
|
@@ -132,7 +136,7 @@ export const useScheduleDialog = props => {
|
|
|
132
136
|
actionType
|
|
133
137
|
} = params;
|
|
134
138
|
try {
|
|
135
|
-
await
|
|
139
|
+
await presenter.schedule({
|
|
136
140
|
targetId: target.id,
|
|
137
141
|
namespace,
|
|
138
142
|
scheduleOn,
|
|
@@ -143,9 +147,10 @@ export const useScheduleDialog = props => {
|
|
|
143
147
|
showSnackbar(error.message);
|
|
144
148
|
console.error(error);
|
|
145
149
|
}
|
|
146
|
-
}, []);
|
|
150
|
+
}, [presenter.vm]);
|
|
147
151
|
const onCancel = useCallback(async () => {
|
|
148
|
-
|
|
152
|
+
const entry = presenter.vm.entry;
|
|
153
|
+
if (!entry) {
|
|
149
154
|
showSnackbar(`No scheduled action found for "${target.title}"!`);
|
|
150
155
|
if (dialogClose.current) {
|
|
151
156
|
dialogClose.current();
|
|
@@ -154,11 +159,11 @@ export const useScheduleDialog = props => {
|
|
|
154
159
|
return;
|
|
155
160
|
}
|
|
156
161
|
try {
|
|
157
|
-
await
|
|
158
|
-
id:
|
|
159
|
-
namespace:
|
|
162
|
+
await presenter.cancel({
|
|
163
|
+
id: entry.id,
|
|
164
|
+
namespace: entry.namespace
|
|
160
165
|
});
|
|
161
|
-
showSnackbar(`Canceled scheduled ${
|
|
166
|
+
showSnackbar(`Canceled scheduled ${entry.actionType} on "${entry.title}"!`);
|
|
162
167
|
} catch (error) {
|
|
163
168
|
showSnackbar(error.message);
|
|
164
169
|
}
|
|
@@ -167,16 +172,20 @@ export const useScheduleDialog = props => {
|
|
|
167
172
|
}
|
|
168
173
|
dialogClose.current();
|
|
169
174
|
dialogClose.current = null;
|
|
170
|
-
}, []);
|
|
171
|
-
const showDialog = () => {
|
|
175
|
+
}, [presenter.vm]);
|
|
176
|
+
const showDialog = async () => {
|
|
177
|
+
await presenter.load({
|
|
178
|
+
namespace,
|
|
179
|
+
id: target.id
|
|
180
|
+
});
|
|
172
181
|
const isPublished = target.status === "published";
|
|
173
|
-
const
|
|
182
|
+
const entry = presenter.vm.entry;
|
|
183
|
+
const scheduleOn = entry?.publishOn || entry?.unpublishOn;
|
|
174
184
|
dialogClose.current = dialog.showDialog({
|
|
175
185
|
title: `Schedule "${target.title}"`,
|
|
176
186
|
content: /*#__PURE__*/React.createElement(FormComponent, {
|
|
177
|
-
actionType:
|
|
178
|
-
scheduleOn: scheduleOn
|
|
179
|
-
onCancel: onCancel
|
|
187
|
+
actionType: entry?.actionType,
|
|
188
|
+
scheduleOn: scheduleOn
|
|
180
189
|
}),
|
|
181
190
|
formData: {
|
|
182
191
|
scheduleOn
|
|
@@ -184,6 +193,10 @@ export const useScheduleDialog = props => {
|
|
|
184
193
|
acceptLabel: isPublished ? "Schedule Unpublish" : "Schedule Publish",
|
|
185
194
|
cancelLabel: "Discard",
|
|
186
195
|
loadingLabel: "Scheduling...",
|
|
196
|
+
info: /*#__PURE__*/React.createElement(CancelButtonComponent, {
|
|
197
|
+
enabled: !!scheduleOn,
|
|
198
|
+
onCancel: onCancel
|
|
199
|
+
}),
|
|
187
200
|
onAccept: data => {
|
|
188
201
|
if (!data.scheduleOn) {
|
|
189
202
|
showSnackbar(`Missing "Schedule On" date!`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","useRef","Alert","Grid","Input","useDialogs","useSnackbar","Bind","validation","ScheduleActionType","ValidationError","makeDecoratable","ScheduleDialogAction","SchedulerCancelGraphQLGateway","SchedulerPublishGraphQLGateway","SchedulerUnpublishGraphQLGateway","useGetScheduledAction","SchedulerGetGraphQLGateway","dateToLocaleStringFormatter","Intl","DateTimeFormat","undefined","year","month","day","hour","minute","second","hour12","ReschedulingAlert","scheduleOn","actionType","actionName","publish","createElement","type","Fragment","format","padLeft","num","String","padStart","formatDateForDateTimeLocal","date","Date","getFullYear","getMonth","getDate","hours","getHours","minutes","getMinutes","minDateValidator","input","value","minDate","getTime","validatorName","SchedulerDialogFormComponentDateTimeInput","props","bind","Object","assign","title","label","size","required","autoFocus","FormComponent","onCancel","Column","span","name","validators","create","useScheduleDialog","client","target","namespace","dialog","showSnackbar","action","cancelGateway","publishGateway","unpublishGateway","getGateway","schedulerEntry","gateway","id","dialogClose","onAccept","params","schedule","targetId","error","message","console","current","cancel","showDialog","isPublished","status","publishOn","unpublishOn","content","formData","acceptLabel","cancelLabel","loadingLabel","data","ex","unpublish"],"sources":["useScheduleDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\nimport { Alert, Grid, Input } from \"@webiny/admin-ui\";\nimport { useDialogs, useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, type BindComponentRenderProp } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport type { CmsContentEntryStatusType } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport type { Validator } from \"@webiny/validation/types.js\";\nimport ValidationError from \"@webiny/validation/validationError.js\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport ApolloClient from \"apollo-client/ApolloClient.js\";\nimport { ScheduleDialogAction } from \"~/Presentation/index.js\";\nimport { SchedulerCancelGraphQLGateway } from \"~/Gateways/SchedulerCancelGraphQLGateway.js\";\nimport { SchedulerPublishGraphQLGateway } from \"~/Gateways/SchedulerPublishGraphQLGateway.js\";\nimport { SchedulerUnpublishGraphQLGateway } from \"~/Gateways/SchedulerUnpublishGraphQLGateway.js\";\nimport { useGetScheduledAction } from \"~/Presentation/components/ScheduleDialog/useGetScheduledAction.js\";\nimport { SchedulerGetGraphQLGateway } from \"~/Gateways/SchedulerGetGraphQLGateway.js\";\n\nexport type ShowDialogParamsEntryStatus = CmsContentEntryStatusType;\n\nexport interface IShowDialogParamsEntry {\n id: string;\n status: ShowDialogParamsEntryStatus;\n title: string;\n}\n\ninterface UseShowScheduleDialogResponse {\n showDialog: () => void;\n}\n\ninterface FormComponentProps {\n scheduleOn: Date | undefined;\n actionType: ScheduleActionType | undefined;\n onCancel: OnCancelCallable;\n}\n\nconst dateToLocaleStringFormatter = new Intl.DateTimeFormat(undefined, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: undefined,\n hour12: false\n});\n\nconst ReschedulingAlert = ({ scheduleOn, actionType }: FormComponentProps) => {\n if (!scheduleOn || !actionType) {\n return null;\n }\n const actionName = actionType === ScheduleActionType.publish ? \"publish\" : \"unpublish\";\n return (\n <Alert type={\"danger\"}>\n <>\n A {actionName} is already scheduled at\n <br />\n <strong>{dateToLocaleStringFormatter.format(scheduleOn)}</strong>.\n </>\n </Alert>\n );\n};\n/**\n * DO NOT use a library for this!\n */\nconst padLeft = (num: number) => {\n return String(num).padStart(2, \"0\");\n};\n\nconst formatDateForDateTimeLocal = (date?: Date | string): string | undefined => {\n if (!date) {\n return undefined;\n } else if (typeof date === \"string\") {\n date = new Date(date);\n }\n\n const year = date.getFullYear();\n const month = padLeft(date.getMonth() + 1);\n const day = padLeft(date.getDate());\n const hours = padLeft(date.getHours());\n const minutes = padLeft(date.getMinutes());\n\n return `${year}-${month}-${day}T${hours}:${minutes}`;\n};\n\nconst minDateValidator: Validator = (input: string) => {\n const value = new Date(input);\n const minDate = new Date(new Date().getTime() + 120 * 1000);\n if (minDate < value) {\n return;\n }\n throw new ValidationError(\n `The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(\n minDate\n )}.`\n );\n};\n\nminDateValidator.validatorName = \"minDateValidator\";\n\nexport interface ISchedulerDialogFormComponentDateTimeInputProps {\n bind: BindComponentRenderProp<Date>;\n}\n\nexport const SchedulerDialogFormComponentDateTimeInput = makeDecoratable(\n \"SchedulerDialogFormComponentDateTimeInput\",\n (props: ISchedulerDialogFormComponentDateTimeInputProps) => {\n const { bind } = props;\n\n return (\n <Input\n {...bind}\n value={formatDateForDateTimeLocal(bind.value)}\n title={\"Schedule On\"}\n label={\"Schedule On\"}\n size={\"lg\"}\n type={\"datetime-local\"}\n required\n autoFocus\n />\n );\n }\n);\n\nconst FormComponent = ({ scheduleOn, onCancel, actionType }: FormComponentProps) => {\n return (\n <>\n {\n <ReschedulingAlert\n actionType={actionType}\n scheduleOn={scheduleOn}\n onCancel={onCancel}\n />\n }\n <Grid>\n <Grid.Column span={12}>\n <Bind\n name={\"scheduleOn\"}\n validators={[validation.create(\"required\"), minDateValidator]}\n >\n {bind => {\n return <SchedulerDialogFormComponentDateTimeInput bind={bind} />;\n }}\n </Bind>\n </Grid.Column>\n </Grid>\n </>\n );\n};\n\ninterface ScheduleFormData {\n scheduleOn?: string;\n}\n\ninterface IOnAcceptParams {\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\ninterface OnCancelCallable {\n (): Promise<void>;\n}\n\nexport interface IUseScheduleDialogProps {\n client: ApolloClient<object>;\n namespace: string;\n target: IShowDialogParamsEntry;\n}\n\nexport const useScheduleDialog = (\n props: IUseScheduleDialogProps\n): UseShowScheduleDialogResponse => {\n const { client, target, namespace } = props;\n const dialog = useDialogs();\n const { showSnackbar } = useSnackbar();\n\n const action = useMemo(() => {\n const cancelGateway = new SchedulerCancelGraphQLGateway(client);\n const publishGateway = new SchedulerPublishGraphQLGateway(client);\n const unpublishGateway = new SchedulerUnpublishGraphQLGateway(client);\n\n return new ScheduleDialogAction({\n cancelGateway,\n publishGateway,\n unpublishGateway\n });\n }, [client]);\n\n const getGateway = useMemo(() => {\n return new SchedulerGetGraphQLGateway(client);\n }, [client]);\n\n const schedulerEntry = useGetScheduledAction({\n gateway: getGateway,\n namespace,\n id: target.id\n });\n\n const dialogClose = useRef<null | (() => void)>(() => {\n return;\n });\n\n const onAccept = useCallback(async (params: IOnAcceptParams) => {\n const { scheduleOn, actionType } = params;\n\n try {\n await action.schedule({\n targetId: target.id,\n namespace,\n scheduleOn,\n actionType\n });\n showSnackbar(`Scheduled ${actionType} action for \"${target.title}\"!`);\n } catch (error) {\n showSnackbar(error.message);\n console.error(error);\n }\n }, []);\n\n const onCancel = useCallback(async () => {\n if (!schedulerEntry) {\n showSnackbar(`No scheduled action found for \"${target.title}\"!`);\n if (dialogClose.current) {\n dialogClose.current();\n dialogClose.current = null;\n }\n return;\n }\n try {\n await action.cancel({\n id: schedulerEntry.id,\n namespace: schedulerEntry.namespace\n });\n showSnackbar(\n `Canceled scheduled ${schedulerEntry.actionType} on \"${schedulerEntry.title}\"!`\n );\n } catch (error) {\n showSnackbar(error.message);\n }\n if (!dialogClose.current) {\n return;\n }\n dialogClose.current();\n dialogClose.current = null;\n }, []);\n\n const showDialog = () => {\n const isPublished = target.status === \"published\";\n const scheduleOn = schedulerEntry?.publishOn || schedulerEntry?.unpublishOn;\n\n dialogClose.current = dialog.showDialog({\n title: `Schedule \"${target.title}\"`,\n content: (\n <FormComponent\n actionType={schedulerEntry?.actionType}\n scheduleOn={scheduleOn}\n onCancel={onCancel}\n />\n ),\n formData: {\n scheduleOn\n },\n acceptLabel: isPublished ? \"Schedule Unpublish\" : \"Schedule Publish\",\n cancelLabel: \"Discard\",\n loadingLabel: \"Scheduling...\",\n onAccept: (data: Partial<ScheduleFormData>) => {\n if (!data.scheduleOn) {\n showSnackbar(`Missing \"Schedule On\" date!`);\n return;\n }\n /**\n * We need to convert scheduleOn from local string to the ISO String (UTC) format.\n * This is important because the date will be stored in the database in UTC format.\n *\n * We display the date (in the UI) in users timezone time.\n */\n let scheduleOn: Date;\n try {\n scheduleOn = new Date(data.scheduleOn);\n } catch (ex) {\n showSnackbar(`Invalid \"Schedule On\" date!`, {\n value: data.scheduleOn\n });\n console.error(ex);\n return;\n }\n\n const actionType = isPublished\n ? ScheduleActionType.unpublish\n : ScheduleActionType.publish;\n\n return onAccept({\n scheduleOn,\n actionType\n });\n }\n });\n };\n\n return {\n showDialog\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC3D,SAASC,KAAK,EAAEC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;AACrD,SAASC,UAAU,EAAEC,WAAW,QAAQ,mBAAmB;AAC3D,SAASC,IAAI,QAAsC,cAAc;AACjE,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,kBAAkB;AAG3B,OAAOC,eAAe,MAAM,uCAAuC;AACnE,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,SAASC,oBAAoB;AAC7B,SAASC,6BAA6B;AACtC,SAASC,8BAA8B;AACvC,SAASC,gCAAgC;AACzC,SAASC,qBAAqB;AAC9B,SAASC,0BAA0B;AAoBnC,MAAMC,2BAA2B,GAAG,IAAIC,IAAI,CAACC,cAAc,CAACC,SAAS,EAAE;EACnEC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IAAI,CAACiE,IAAI,CAAC/E,UAAU,CAAC;QAC1C,CAAC,CAAC,OAAOgF,EAAE,EAAE;UACT9B,YAAY,CAAC,6BAA6B,EAAE;YACxC1B,KAAK,EAAEuD,IAAI,CAAC/E;UAChB,CAAC,CAAC;UACFkE,OAAO,CAACF,KAAK,CAACgB,EAAE,CAAC;UACjB;QACJ;QAEA,MAAM/E,UAAU,GAAGqE,WAAW,GACxB3F,kBAAkB,CAACsG,SAAS,GAC5BtG,kBAAkB,CAACwB,OAAO;QAEhC,OAAOyD,QAAQ,CAAC;UACZ5D,UAAU;UACVC;QACJ,CAAC,CAAC;MACN;IACJ,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHoE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useRef","Alert","Button","Grid","Input","ReactComponent","DeleteIcon","useDialogs","useSnackbar","Bind","validation","ScheduleActionType","ValidationError","makeDecoratable","SchedulerCancelGraphQLGateway","SchedulerPublishGraphQLGateway","SchedulerUnpublishGraphQLGateway","SchedulerGetGraphQLGateway","ScheduleDialogPresenter","dateToLocaleStringFormatter","Intl","DateTimeFormat","undefined","year","month","day","hour","minute","second","hour12","ReschedulingAlert","scheduleOn","actionType","actionName","publish","createElement","type","Fragment","format","padLeft","num","String","padStart","formatDateForDateTimeLocal","date","Date","getFullYear","getMonth","getDate","hours","getHours","minutes","getMinutes","minDateValidator","input","value","minDate","getTime","validatorName","CancelButtonComponent","enabled","onCancel","variant","onClick","text","size","icon","iconPosition","SchedulerDialogFormComponentDateTimeInput","props","bind","Object","assign","title","label","required","autoFocus","FormComponent","Column","span","name","validators","create","useScheduleDialog","client","target","namespace","dialog","showSnackbar","presenter","getGateway","cancelGateway","publishGateway","unpublishGateway","dialogClose","onAccept","params","schedule","targetId","id","error","message","console","vm","entry","current","cancel","showDialog","load","isPublished","status","publishOn","unpublishOn","content","formData","acceptLabel","cancelLabel","loadingLabel","info","data","ex","unpublish"],"sources":["useScheduleDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\nimport { Alert, Button, Grid, Input } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useDialogs, useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, type BindComponentRenderProp } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport type { Validator } from \"@webiny/validation/types.js\";\nimport ValidationError from \"@webiny/validation/validationError.js\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport ApolloClient from \"apollo-client/ApolloClient.js\";\nimport { SchedulerCancelGraphQLGateway } from \"~/Gateways/SchedulerCancelGraphQLGateway.js\";\nimport { SchedulerPublishGraphQLGateway } from \"~/Gateways/SchedulerPublishGraphQLGateway.js\";\nimport { SchedulerUnpublishGraphQLGateway } from \"~/Gateways/SchedulerUnpublishGraphQLGateway.js\";\nimport { SchedulerGetGraphQLGateway } from \"~/Gateways/SchedulerGetGraphQLGateway.js\";\nimport { ScheduleDialogPresenter } from \"./ScheduleDialogPresenter.js\";\n\nexport type ShowDialogParamsEntryStatus = \"published\" | \"unpublished\" | \"draft\" | string;\n\nexport interface IShowDialogParamsEntry {\n id: string;\n status: ShowDialogParamsEntryStatus;\n title: string;\n}\n\ninterface UseShowScheduleDialogResponse {\n showDialog: () => void;\n}\n\ninterface FormComponentProps {\n scheduleOn: Date | undefined;\n actionType: ScheduleActionType | undefined;\n}\n\nconst dateToLocaleStringFormatter = new Intl.DateTimeFormat(undefined, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: undefined,\n hour12: false\n});\n\ninterface IReschedulingAlertProps {\n scheduleOn: Date | undefined;\n actionType: ScheduleActionType | undefined;\n}\n\nconst ReschedulingAlert = ({ scheduleOn, actionType }: IReschedulingAlertProps) => {\n if (!scheduleOn || !actionType) {\n return null;\n }\n const actionName = actionType === ScheduleActionType.publish ? \"publish\" : \"unpublish\";\n return (\n <Alert type={\"danger\"}>\n <>\n A {actionName} is already scheduled at\n <br />\n <strong>{dateToLocaleStringFormatter.format(scheduleOn)}</strong>.\n </>\n </Alert>\n );\n};\n/**\n * DO NOT use a library for this!\n */\nconst padLeft = (num: number) => {\n return String(num).padStart(2, \"0\");\n};\n\nconst formatDateForDateTimeLocal = (date?: Date | string): string | undefined => {\n if (!date) {\n return undefined;\n } else if (typeof date === \"string\") {\n date = new Date(date);\n }\n\n const year = date.getFullYear();\n const month = padLeft(date.getMonth() + 1);\n const day = padLeft(date.getDate());\n const hours = padLeft(date.getHours());\n const minutes = padLeft(date.getMinutes());\n\n return `${year}-${month}-${day}T${hours}:${minutes}`;\n};\n\nconst minDateValidator: Validator = (input: string) => {\n const value = new Date(input);\n const minDate = new Date(new Date().getTime() + 120 * 1000);\n if (minDate < value) {\n return;\n }\n throw new ValidationError(\n `The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(\n minDate\n )}.`\n );\n};\n\nminDateValidator.validatorName = \"minDateValidator\";\n\nexport interface ISchedulerDialogFormComponentDateTimeInputProps {\n bind: BindComponentRenderProp<Date>;\n}\n\ninterface ICancelButtonComponentProps {\n enabled: boolean;\n onCancel: OnCancelCallable;\n}\nconst CancelButtonComponent = ({ enabled, onCancel }: ICancelButtonComponentProps) => {\n if (!enabled) {\n return null;\n }\n return (\n <Button\n variant=\"ghost\"\n onClick={onCancel}\n text={\"Cancel Schedule\"}\n size=\"md\"\n icon={<DeleteIcon />}\n iconPosition=\"start\"\n />\n );\n};\n\nexport const SchedulerDialogFormComponentDateTimeInput = makeDecoratable(\n \"SchedulerDialogFormComponentDateTimeInput\",\n (props: ISchedulerDialogFormComponentDateTimeInputProps) => {\n const { bind } = props;\n\n return (\n <Input\n {...bind}\n value={formatDateForDateTimeLocal(bind.value)}\n title={\"Schedule On\"}\n label={\"Schedule On\"}\n size={\"lg\"}\n type={\"datetime-local\"}\n required\n autoFocus\n />\n );\n }\n);\n\nconst FormComponent = ({ scheduleOn, actionType }: FormComponentProps) => {\n return (\n <>\n {<ReschedulingAlert actionType={actionType} scheduleOn={scheduleOn} />}\n <Grid>\n <Grid.Column span={12}>\n <Bind\n name={\"scheduleOn\"}\n validators={[validation.create(\"required\"), minDateValidator]}\n >\n {bind => {\n return <SchedulerDialogFormComponentDateTimeInput bind={bind} />;\n }}\n </Bind>\n </Grid.Column>\n </Grid>\n </>\n );\n};\n\ninterface ScheduleFormData {\n scheduleOn?: string;\n}\n\ninterface IOnAcceptParams {\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\ninterface OnCancelCallable {\n (): Promise<void>;\n}\n\nexport interface IUseScheduleDialogProps {\n client: ApolloClient<object>;\n namespace: string;\n target: IShowDialogParamsEntry;\n}\n\nexport const useScheduleDialog = (\n props: IUseScheduleDialogProps\n): UseShowScheduleDialogResponse => {\n const { client, target, namespace } = props;\n const dialog = useDialogs();\n const { showSnackbar } = useSnackbar();\n\n const presenter = useMemo(() => {\n return new ScheduleDialogPresenter({\n getGateway: new SchedulerGetGraphQLGateway(client),\n cancelGateway: new SchedulerCancelGraphQLGateway(client),\n publishGateway: new SchedulerPublishGraphQLGateway(client),\n unpublishGateway: new SchedulerUnpublishGraphQLGateway(client)\n });\n }, [client]);\n\n const dialogClose = useRef<null | (() => void)>(() => {\n return;\n });\n\n const onAccept = useCallback(\n async (params: IOnAcceptParams) => {\n const { scheduleOn, actionType } = params;\n\n try {\n await presenter.schedule({\n targetId: target.id,\n namespace,\n scheduleOn,\n actionType\n });\n showSnackbar(`Scheduled ${actionType} action for \"${target.title}\"!`);\n } catch (error) {\n showSnackbar(error.message);\n console.error(error);\n }\n },\n [presenter.vm]\n );\n\n const onCancel = useCallback(async () => {\n const entry = presenter.vm.entry;\n if (!entry) {\n showSnackbar(`No scheduled action found for \"${target.title}\"!`);\n if (dialogClose.current) {\n dialogClose.current();\n dialogClose.current = null;\n }\n return;\n }\n try {\n await presenter.cancel({\n id: entry.id,\n namespace: entry.namespace\n });\n showSnackbar(`Canceled scheduled ${entry.actionType} on \"${entry.title}\"!`);\n } catch (error) {\n showSnackbar(error.message);\n }\n if (!dialogClose.current) {\n return;\n }\n dialogClose.current();\n dialogClose.current = null;\n }, [presenter.vm]);\n\n const showDialog = async () => {\n await presenter.load({ namespace, id: target.id });\n\n const isPublished = target.status === \"published\";\n const entry = presenter.vm.entry;\n const scheduleOn = entry?.publishOn || entry?.unpublishOn;\n\n dialogClose.current = dialog.showDialog({\n title: `Schedule \"${target.title}\"`,\n content: <FormComponent actionType={entry?.actionType} scheduleOn={scheduleOn} />,\n formData: {\n scheduleOn\n },\n acceptLabel: isPublished ? \"Schedule Unpublish\" : \"Schedule Publish\",\n cancelLabel: \"Discard\",\n loadingLabel: \"Scheduling...\",\n info: <CancelButtonComponent enabled={!!scheduleOn} onCancel={onCancel} />,\n onAccept: (data: Partial<ScheduleFormData>) => {\n if (!data.scheduleOn) {\n showSnackbar(`Missing \"Schedule On\" date!`);\n return;\n }\n /**\n * We need to convert scheduleOn from local string to the ISO String (UTC) format.\n * This is important because the date will be stored in the database in UTC format.\n *\n * We display the date (in the UI) in users timezone time.\n */\n let scheduleOn: Date;\n try {\n scheduleOn = new Date(data.scheduleOn);\n } catch (ex) {\n showSnackbar(`Invalid \"Schedule On\" date!`, {\n value: data.scheduleOn\n });\n console.error(ex);\n return;\n }\n\n const actionType = isPublished\n ? ScheduleActionType.unpublish\n : ScheduleActionType.publish;\n\n return onAccept({\n scheduleOn,\n actionType\n });\n }\n });\n };\n\n return {\n showDialog\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC3D,SAASC,KAAK,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;AAC7D,SAASC,cAAc,IAAIC,UAAU,QAAQ,0BAA0B;AACvE,SAAS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CAAC;EACN,CAAC;EAED,OAAO;IACH2E;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import debounce from "lodash/debounce.js";
|
|
3
3
|
import { OverlayLayout } from "@webiny/app-admin";
|
|
4
|
-
import { Scrollbar } from "@webiny/ui
|
|
4
|
+
import { Scrollbar } from "@webiny/admin-ui";
|
|
5
5
|
import { Title } from "../Title/index.js";
|
|
6
6
|
import { SearchInput } from "../SearchInput/index.js";
|
|
7
7
|
import { Empty } from "../Empty/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","debounce","OverlayLayout","Scrollbar","Title","SearchInput","Empty","Table","BottomInfoBar","useScheduler","SchedulerOverlay","props","listMoreItems","vm","onTableScroll","scrollFrame","top","createElement","onExited","barLeft","title","barMiddle","onScrollFrame","isEmptyView"],"sources":["SchedulerOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport debounce from \"lodash/debounce.js\";\nimport { OverlayLayout } from \"@webiny/app-admin\";\nimport { Scrollbar } from \"@webiny/ui
|
|
1
|
+
{"version":3,"names":["React","debounce","OverlayLayout","Scrollbar","Title","SearchInput","Empty","Table","BottomInfoBar","useScheduler","SchedulerOverlay","props","listMoreItems","vm","onTableScroll","scrollFrame","top","createElement","onExited","barLeft","title","barMiddle","onScrollFrame","isEmptyView"],"sources":["SchedulerOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport debounce from \"lodash/debounce.js\";\nimport { OverlayLayout } from \"@webiny/app-admin\";\nimport { Scrollbar } from \"@webiny/admin-ui\";\nimport { Title } from \"~/Presentation/components/Title/index.js\";\nimport { SearchInput } from \"~/Presentation/components/SearchInput/index.js\";\nimport { Empty } from \"~/Presentation/components/Empty/index.js\";\nimport { Table } from \"~/Presentation/components/Table/index.js\";\nimport { BottomInfoBar } from \"~/Presentation/components/BottomInfoBar/index.js\";\nimport { useScheduler } from \"~/Presentation/hooks/index.js\";\n\ninterface SchedulerOverlayProps {\n title: string;\n onExited: () => void;\n}\n\nexport const SchedulerOverlay = (props: SchedulerOverlayProps) => {\n const { listMoreItems, vm } = useScheduler();\n\n const onTableScroll = debounce(async ({ scrollFrame }) => {\n if (scrollFrame.top > 0.8) {\n await listMoreItems();\n }\n }, 200);\n\n return (\n <OverlayLayout\n onExited={props.onExited}\n barLeft={<Title title={props.title} />}\n barMiddle={<SearchInput />}\n >\n <Scrollbar onScrollFrame={scrollFrame => onTableScroll({ scrollFrame })}>\n {vm.isEmptyView ? <Empty /> : <Table />}\n </Scrollbar>\n <BottomInfoBar />\n </OverlayLayout>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,oBAAoB;AACzC,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,KAAK;AACd,SAASC,WAAW;AACpB,SAASC,KAAK;AACd,SAASC,KAAK;AACd,SAASC,aAAa;AACtB,SAASC,YAAY;AAOrB,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAC9D,MAAM;IAAEC,aAAa;IAAEC;EAAG,CAAC,GAAGJ,YAAY,CAAC,CAAC;EAE5C,MAAMK,aAAa,GAAGb,QAAQ,CAAC,OAAO;IAAEc;EAAY,CAAC,KAAK;IACtD,IAAIA,WAAW,CAACC,GAAG,GAAG,GAAG,EAAE;MACvB,MAAMJ,aAAa,CAAC,CAAC;IACzB;EACJ,CAAC,EAAE,GAAG,CAAC;EAEP,oBACIZ,KAAA,CAAAiB,aAAA,CAACf,aAAa;IACVgB,QAAQ,EAAEP,KAAK,CAACO,QAAS;IACzBC,OAAO,eAAEnB,KAAA,CAAAiB,aAAA,CAACb,KAAK;MAACgB,KAAK,EAAET,KAAK,CAACS;IAAM,CAAE,CAAE;IACvCC,SAAS,eAAErB,KAAA,CAAAiB,aAAA,CAACZ,WAAW,MAAE;EAAE,gBAE3BL,KAAA,CAAAiB,aAAA,CAACd,SAAS;IAACmB,aAAa,EAAEP,WAAW,IAAID,aAAa,CAAC;MAAEC;IAAY,CAAC;EAAE,GACnEF,EAAE,CAACU,WAAW,gBAAGvB,KAAA,CAAAiB,aAAA,CAACX,KAAK,MAAE,CAAC,gBAAGN,KAAA,CAAAiB,aAAA,CAACV,KAAK,MAAE,CAC/B,CAAC,eACZP,KAAA,CAAAiB,aAAA,CAACT,aAAa,MAAE,CACL,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Skeleton } from "@webiny/ui
|
|
2
|
+
import { Skeleton } from "@webiny/admin-ui";
|
|
3
3
|
import { Name } from "./Title.styled.js";
|
|
4
4
|
export const Title = ({
|
|
5
5
|
title
|
|
6
6
|
}) => {
|
|
7
7
|
return /*#__PURE__*/React.createElement(Name, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, title || /*#__PURE__*/React.createElement(Skeleton,
|
|
11
|
-
theme: "dark"
|
|
12
|
-
}));
|
|
8
|
+
level: 6,
|
|
9
|
+
as: "h1"
|
|
10
|
+
}, title || /*#__PURE__*/React.createElement(Skeleton, null));
|
|
13
11
|
};
|
|
14
12
|
|
|
15
13
|
//# sourceMappingURL=Title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Skeleton","Name","Title","title","createElement","
|
|
1
|
+
{"version":3,"names":["React","Skeleton","Name","Title","title","createElement","level","as"],"sources":["Title.tsx"],"sourcesContent":["import React from \"react\";\nimport { Skeleton } from \"@webiny/admin-ui\";\nimport { Name } from \"./Title.styled.js\";\n\nexport interface TitleProps {\n title?: string;\n}\n\nexport const Title = ({ title }: TitleProps) => {\n return (\n <Name level={6} as={\"h1\"}>\n {title || <Skeleton />}\n </Name>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,IAAI;AAMb,OAAO,MAAMC,KAAK,GAAGA,CAAC;EAAEC;AAAkB,CAAC,KAAK;EAC5C,oBACIJ,KAAA,CAAAK,aAAA,CAACH,IAAI;IAACI,KAAK,EAAE,CAAE;IAACC,EAAE,EAAE;EAAK,GACpBH,KAAK,iBAAIJ,KAAA,CAAAK,aAAA,CAACJ,QAAQ,MAAE,CACnB,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Name: import("@emotion/styled").StyledComponent<TypographyProps & {
|
|
1
|
+
export declare const Name: import("@emotion/styled").StyledComponent<import("@webiny/admin-ui").HeadingProps & {
|
|
3
2
|
theme?: import("@emotion/react").Theme;
|
|
4
3
|
}, {}, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
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 {
|
|
4
|
-
export const Name = /*#__PURE__*/_styled(
|
|
3
|
+
import { Heading } from "@webiny/admin-ui";
|
|
4
|
+
export const Name = /*#__PURE__*/_styled(Heading, process.env.NODE_ENV === "production" ? {
|
|
5
5
|
target: "e1k7ad610"
|
|
6
6
|
} : {
|
|
7
7
|
target: "e1k7ad610",
|
|
@@ -11,7 +11,7 @@ export const Name = /*#__PURE__*/_styled(Typography, process.env.NODE_ENV === "p
|
|
|
11
11
|
styles: "color:var(--mdc-theme-text-primary-on-background);padding-left:8px;line-height:48px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
12
12
|
} : {
|
|
13
13
|
name: "jtvt2b",
|
|
14
|
-
styles: "color:var(--mdc-theme-text-primary-on-background);padding-left:8px;line-height:48px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
14
|
+
styles: "color:var(--mdc-theme-text-primary-on-background);padding-left:8px;line-height:48px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRpdGxlLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR21DIiwiZmlsZSI6IlRpdGxlLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IEhlYWRpbmcgfSBmcm9tIFwiQHdlYmlueS9hZG1pbi11aVwiO1xuXG5leHBvcnQgY29uc3QgTmFtZSA9IHN0eWxlZChIZWFkaW5nKWBcbiAgICBjb2xvcjogdmFyKC0tbWRjLXRoZW1lLXRleHQtcHJpbWFyeS1vbi1iYWNrZ3JvdW5kKTtcbiAgICBwYWRkaW5nLWxlZnQ6IDhweDtcbiAgICBsaW5lLWhlaWdodDogNDhweDtcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5gO1xuIl19 */",
|
|
15
15
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Heading","Name","_styled","process","env","NODE_ENV","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__"],"sources":["Title.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Heading } from \"@webiny/admin-ui\";\n\nexport const Name = styled(Heading)`\n color: var(--mdc-theme-text-primary-on-background);\n padding-left: 8px;\n line-height: 48px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;AACA,SAASA,OAAO,QAAQ,kBAAkB;AAE1C,OAAO,MAAMC,IAAI,gBAAGC,OAAA,CAAOF,OAAO,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,QAAA,EAAAC;AAAA,EAOlC","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@ export const useCancelSchedulerItem = ({
|
|
|
14
14
|
showConfirmation
|
|
15
15
|
} = useConfirmationDialog({
|
|
16
16
|
title: "Cancel scheduled action?",
|
|
17
|
-
message: /*#__PURE__*/React.createElement("p", null, "You are about to cancel scheduled action for this item!", /*#__PURE__*/React.createElement("br", null), "Are you sure you want to cancel scheduled ", /*#__PURE__*/React.createElement("strong", null, item.actionType), " for ", /*#__PURE__*/React.createElement("strong", null, item.title), "?")
|
|
17
|
+
message: /*#__PURE__*/React.createElement("p", null, "You are about to cancel scheduled action for this item!", /*#__PURE__*/React.createElement("br", null), "Are you sure you want to cancel scheduled ", /*#__PURE__*/React.createElement("strong", null, item.actionType), " for", " ", /*#__PURE__*/React.createElement("strong", null, item.title), "?")
|
|
18
18
|
});
|
|
19
19
|
const openDialogCancelSchedulerItem = useCallback(() => showConfirmation(async () => {
|
|
20
20
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useConfirmationDialog","useSnackbar","useScheduler","useCancelSchedulerItem","item","cancelItem","showSnackbar","showConfirmation","title","message","createElement","actionType","openDialogCancelSchedulerItem","id","ex"],"sources":["useCancelSchedulerItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { useConfirmationDialog, useSnackbar } from \"@webiny/app-admin\";\nimport { useScheduler } from \"./useScheduler.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\ninterface UseCancelScheduleItemParams {\n item: Pick<SchedulerEntry, \"id\" | \"title\" | \"actionType\">;\n}\n\nexport const useCancelSchedulerItem = ({ item }: UseCancelScheduleItemParams) => {\n const { cancelItem } = useScheduler();\n const { showSnackbar } = useSnackbar();\n\n const { showConfirmation } = useConfirmationDialog({\n title: \"Cancel scheduled action?\",\n message: (\n <p>\n You are about to cancel scheduled action for this item!\n <br />\n Are you sure you want to cancel scheduled <strong
|
|
1
|
+
{"version":3,"names":["React","useCallback","useConfirmationDialog","useSnackbar","useScheduler","useCancelSchedulerItem","item","cancelItem","showSnackbar","showConfirmation","title","message","createElement","actionType","openDialogCancelSchedulerItem","id","ex"],"sources":["useCancelSchedulerItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { useConfirmationDialog, useSnackbar } from \"@webiny/app-admin\";\nimport { useScheduler } from \"./useScheduler.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\ninterface UseCancelScheduleItemParams {\n item: Pick<SchedulerEntry, \"id\" | \"title\" | \"actionType\">;\n}\n\nexport const useCancelSchedulerItem = ({ item }: UseCancelScheduleItemParams) => {\n const { cancelItem } = useScheduler();\n const { showSnackbar } = useSnackbar();\n\n const { showConfirmation } = useConfirmationDialog({\n title: \"Cancel scheduled action?\",\n message: (\n <p>\n You are about to cancel scheduled action for this item!\n <br />\n Are you sure you want to cancel scheduled <strong>{item.actionType}</strong> for{\" \"}\n <strong>{item.title}</strong>?\n </p>\n )\n });\n\n const openDialogCancelSchedulerItem = useCallback(\n () =>\n showConfirmation(async () => {\n try {\n await cancelItem(item.id);\n showSnackbar(`Action on item \"${item.title}\" was canceled successfully!`);\n } catch (ex) {\n showSnackbar(ex.message || `Error while canceling action for \"${item.title}\".`);\n }\n }),\n [item]\n );\n\n return { openDialogCancelSchedulerItem };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,qBAAqB,EAAEC,WAAW,QAAQ,mBAAmB;AACtE,SAASC,YAAY;AAOrB,OAAO,MAAMC,sBAAsB,GAAGA,CAAC;EAAEC;AAAkC,CAAC,KAAK;EAC7E,MAAM;IAAEC;EAAW,CAAC,GAAGH,YAAY,CAAC,CAAC;EACrC,MAAM;IAAEI;EAAa,CAAC,GAAGL,WAAW,CAAC,CAAC;EAEtC,MAAM;IAAEM;EAAiB,CAAC,GAAGP,qBAAqB,CAAC;IAC/CQ,KAAK,EAAE,0BAA0B;IACjCC,OAAO,eACHX,KAAA,CAAAY,aAAA,YAAG,yDAEC,eAAAZ,KAAA,CAAAY,aAAA,WAAK,CAAC,8CACoC,eAAAZ,KAAA,CAAAY,aAAA,iBAASN,IAAI,CAACO,UAAmB,CAAC,QAAI,EAAC,GAAG,eACpFb,KAAA,CAAAY,aAAA,iBAASN,IAAI,CAACI,KAAc,CAAC,KAC9B;EAEX,CAAC,CAAC;EAEF,MAAMI,6BAA6B,GAAGb,WAAW,CAC7C,MACIQ,gBAAgB,CAAC,YAAY;IACzB,IAAI;MACA,MAAMF,UAAU,CAACD,IAAI,CAACS,EAAE,CAAC;MACzBP,YAAY,CAAC,mBAAmBF,IAAI,CAACI,KAAK,8BAA8B,CAAC;IAC7E,CAAC,CAAC,OAAOM,EAAE,EAAE;MACTR,YAAY,CAACQ,EAAE,CAACL,OAAO,IAAI,qCAAqCL,IAAI,CAACI,KAAK,IAAI,CAAC;IACnF;EACJ,CAAC,CAAC,EACN,CAACJ,IAAI,CACT,CAAC;EAED,OAAO;IAAEQ;EAA8B,CAAC;AAC5C,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-scheduler",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.e6f0dc8ca7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -13,34 +16,32 @@
|
|
|
13
16
|
"@emotion/react": "11.14.0",
|
|
14
17
|
"@emotion/styled": "11.14.1",
|
|
15
18
|
"@material-design-icons/svg": "0.14.15",
|
|
16
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
17
|
-
"@webiny/app-aco": "0.0.0-unstable.
|
|
18
|
-
"@webiny/app-admin": "0.0.0-unstable.
|
|
19
|
-
"@webiny/app-headless-cms-common": "0.0.0-unstable.
|
|
20
|
-
"@webiny/app-utils": "0.0.0-unstable.
|
|
21
|
-
"@webiny/form": "0.0.0-unstable.
|
|
22
|
-
"@webiny/icons": "0.0.0-unstable.
|
|
23
|
-
"@webiny/react-composition": "0.0.0-unstable.
|
|
24
|
-
"@webiny/react-properties": "0.0.0-unstable.
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/validation": "0.0.0-unstable.c27f4d8a31",
|
|
19
|
+
"@webiny/admin-ui": "0.0.0-unstable.e6f0dc8ca7",
|
|
20
|
+
"@webiny/app-aco": "0.0.0-unstable.e6f0dc8ca7",
|
|
21
|
+
"@webiny/app-admin": "0.0.0-unstable.e6f0dc8ca7",
|
|
22
|
+
"@webiny/app-headless-cms-common": "0.0.0-unstable.e6f0dc8ca7",
|
|
23
|
+
"@webiny/app-utils": "0.0.0-unstable.e6f0dc8ca7",
|
|
24
|
+
"@webiny/form": "0.0.0-unstable.e6f0dc8ca7",
|
|
25
|
+
"@webiny/icons": "0.0.0-unstable.e6f0dc8ca7",
|
|
26
|
+
"@webiny/react-composition": "0.0.0-unstable.e6f0dc8ca7",
|
|
27
|
+
"@webiny/react-properties": "0.0.0-unstable.e6f0dc8ca7",
|
|
28
|
+
"@webiny/utils": "0.0.0-unstable.e6f0dc8ca7",
|
|
29
|
+
"@webiny/validation": "0.0.0-unstable.e6f0dc8ca7",
|
|
28
30
|
"apollo-client": "2.6.10",
|
|
29
31
|
"graphql-tag": "2.12.6",
|
|
30
|
-
"lodash": "4.
|
|
31
|
-
"mobx": "6.15.
|
|
32
|
-
"mobx-react-lite": "
|
|
33
|
-
"prop-types": "15.8.1",
|
|
32
|
+
"lodash": "4.18.1",
|
|
33
|
+
"mobx": "6.15.3",
|
|
34
|
+
"mobx-react-lite": "4.1.1",
|
|
34
35
|
"react": "18.3.1",
|
|
35
36
|
"react-dom": "18.3.1",
|
|
36
|
-
"zod": "4.3
|
|
37
|
+
"zod": "4.4.3"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@emotion/babel-plugin": "11.13.5",
|
|
40
41
|
"@types/react": "18.3.28",
|
|
41
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
42
|
+
"@webiny/build-tools": "0.0.0-unstable.e6f0dc8ca7",
|
|
42
43
|
"rimraf": "6.1.3",
|
|
43
|
-
"typescript": "
|
|
44
|
+
"typescript": "6.0.3"
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public",
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"removeViewBox": false
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e6f0dc8ca741c1fcc3fec9a5b9e86fdd49544641"
|
|
55
56
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ICancelScheduledActionGateway, ISchedulePublishActionGateway, IScheduleUnpublishActionGateway } from "../../../Gateways/index.js";
|
|
2
|
-
import type { IScheduleDialogAction, IScheduleDialogCancelActionExecuteParams, IScheduleDialogScheduledActionExecuteParams } from "./types.js";
|
|
3
|
-
export interface IScheduleDialogActionParams {
|
|
4
|
-
cancelGateway: ICancelScheduledActionGateway;
|
|
5
|
-
publishGateway: ISchedulePublishActionGateway;
|
|
6
|
-
unpublishGateway: IScheduleUnpublishActionGateway;
|
|
7
|
-
}
|
|
8
|
-
export declare class ScheduleDialogAction implements IScheduleDialogAction {
|
|
9
|
-
readonly cancelGateway: ICancelScheduledActionGateway;
|
|
10
|
-
readonly publishGateway: ISchedulePublishActionGateway;
|
|
11
|
-
readonly unpublishGateway: IScheduleUnpublishActionGateway;
|
|
12
|
-
constructor(params: IScheduleDialogActionParams);
|
|
13
|
-
schedule(params: IScheduleDialogScheduledActionExecuteParams): Promise<void>;
|
|
14
|
-
cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ScheduleActionType } 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
|
-
targetId,
|
|
16
|
-
namespace,
|
|
17
|
-
actionType,
|
|
18
|
-
scheduleOn
|
|
19
|
-
} = params;
|
|
20
|
-
switch (actionType) {
|
|
21
|
-
case ScheduleActionType.publish:
|
|
22
|
-
await this.publishGateway.execute({
|
|
23
|
-
namespace,
|
|
24
|
-
targetId,
|
|
25
|
-
scheduleOn
|
|
26
|
-
});
|
|
27
|
-
return;
|
|
28
|
-
case ScheduleActionType.unpublish:
|
|
29
|
-
await this.unpublishGateway.execute({
|
|
30
|
-
namespace,
|
|
31
|
-
targetId,
|
|
32
|
-
scheduleOn
|
|
33
|
-
});
|
|
34
|
-
return;
|
|
35
|
-
default:
|
|
36
|
-
throw new Error(`Unsupported schedule type "${actionType}" for target "${targetId}" and namespace "${namespace}".`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async cancel(params) {
|
|
40
|
-
const {
|
|
41
|
-
id,
|
|
42
|
-
namespace
|
|
43
|
-
} = params;
|
|
44
|
-
await this.cancelGateway.execute({
|
|
45
|
-
namespace,
|
|
46
|
-
id
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=ScheduleDialogAction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ScheduleActionType","ScheduleDialogAction","constructor","params","publishGateway","unpublishGateway","cancelGateway","schedule","targetId","namespace","actionType","scheduleOn","publish","execute","unpublish","Error","cancel","id"],"sources":["ScheduleDialogAction.ts"],"sourcesContent":["import { ScheduleActionType } from \"~/types.js\";\nimport type {\n ICancelScheduledActionGateway,\n ISchedulePublishActionGateway,\n IScheduleUnpublishActionGateway\n} from \"~/Gateways/index.js\";\nimport type {\n IScheduleDialogAction,\n IScheduleDialogCancelActionExecuteParams,\n IScheduleDialogScheduledActionExecuteParams\n} from \"./types.js\";\n\nexport interface IScheduleDialogActionParams {\n cancelGateway: ICancelScheduledActionGateway;\n publishGateway: ISchedulePublishActionGateway;\n unpublishGateway: IScheduleUnpublishActionGateway;\n}\n\nexport class ScheduleDialogAction implements IScheduleDialogAction {\n public readonly cancelGateway: ICancelScheduledActionGateway;\n public readonly publishGateway: ISchedulePublishActionGateway;\n public readonly unpublishGateway: IScheduleUnpublishActionGateway;\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: IScheduleDialogScheduledActionExecuteParams): Promise<void> {\n const { targetId, namespace, actionType, scheduleOn } = params;\n\n switch (actionType) {\n case ScheduleActionType.publish:\n await this.publishGateway.execute({\n namespace,\n targetId,\n scheduleOn\n });\n return;\n case ScheduleActionType.unpublish:\n await this.unpublishGateway.execute({\n namespace,\n targetId,\n scheduleOn\n });\n return;\n default:\n throw new Error(\n `Unsupported schedule type \"${actionType}\" for target \"${targetId}\" and namespace \"${namespace}\".`\n );\n }\n }\n\n public async cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void> {\n const { id, namespace } = params;\n await this.cancelGateway.execute({\n namespace,\n id\n });\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB;AAkB3B,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,MAAmD,EAAiB;IACtF,MAAM;MAAEK,QAAQ;MAAEC,SAAS;MAAEC,UAAU;MAAEC;IAAW,CAAC,GAAGR,MAAM;IAE9D,QAAQO,UAAU;MACd,KAAKV,kBAAkB,CAACY,OAAO;QAC3B,MAAM,IAAI,CAACR,cAAc,CAACS,OAAO,CAAC;UAC9BJ,SAAS;UACTD,QAAQ;UACRG;QACJ,CAAC,CAAC;QACF;MACJ,KAAKX,kBAAkB,CAACc,SAAS;QAC7B,MAAM,IAAI,CAACT,gBAAgB,CAACQ,OAAO,CAAC;UAChCJ,SAAS;UACTD,QAAQ;UACRG;QACJ,CAAC,CAAC;QACF;MACJ;QACI,MAAM,IAAII,KAAK,CACX,8BAA8BL,UAAU,iBAAiBF,QAAQ,oBAAoBC,SAAS,IAClG,CAAC;IACT;EACJ;EAEA,MAAaO,MAAMA,CAACb,MAAgD,EAAiB;IACjF,MAAM;MAAEc,EAAE;MAAER;IAAU,CAAC,GAAGN,MAAM;IAChC,MAAM,IAAI,CAACG,aAAa,CAACO,OAAO,CAAC;MAC7BJ,SAAS;MACTQ;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IGetScheduledActionGateway, IGetScheduledActionGatewayResponse } from "../../../Gateways/index.js";
|
|
2
|
-
export interface IGetScheduledActionParams {
|
|
3
|
-
namespace: string;
|
|
4
|
-
id: string;
|
|
5
|
-
gateway: IGetScheduledActionGateway;
|
|
6
|
-
}
|
|
7
|
-
export declare const useGetScheduledAction: (params: IGetScheduledActionParams) => IGetScheduledActionGatewayResponse | null;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { useSnackbar } from "@webiny/app-admin";
|
|
3
|
-
export const useGetScheduledAction = params => {
|
|
4
|
-
const {
|
|
5
|
-
gateway,
|
|
6
|
-
namespace,
|
|
7
|
-
id
|
|
8
|
-
} = params;
|
|
9
|
-
const {
|
|
10
|
-
showSnackbar
|
|
11
|
-
} = useSnackbar();
|
|
12
|
-
const [response, setResponse] = useState(null);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const fetchData = async () => {
|
|
15
|
-
try {
|
|
16
|
-
const data = await gateway.execute({
|
|
17
|
-
namespace,
|
|
18
|
-
id
|
|
19
|
-
});
|
|
20
|
-
setResponse(data);
|
|
21
|
-
} catch (err) {
|
|
22
|
-
console.error(err);
|
|
23
|
-
showSnackbar(err.message);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
fetchData();
|
|
27
|
-
}, []);
|
|
28
|
-
return response;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=useGetScheduledAction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","useSnackbar","useGetScheduledAction","params","gateway","namespace","id","showSnackbar","response","setResponse","fetchData","data","execute","err","console","error","message"],"sources":["useGetScheduledAction.ts"],"sourcesContent":["import type {\n IGetScheduledActionGateway,\n IGetScheduledActionGatewayResponse\n} from \"~/Gateways/index.js\";\nimport { useEffect, useState } from \"react\";\nimport { useSnackbar } from \"@webiny/app-admin\";\n\nexport interface IGetScheduledActionParams {\n namespace: string;\n id: string;\n gateway: IGetScheduledActionGateway;\n}\n\nexport const useGetScheduledAction = (\n params: IGetScheduledActionParams\n): IGetScheduledActionGatewayResponse | null => {\n const { gateway, namespace, id } = params;\n\n const { showSnackbar } = useSnackbar();\n\n const [response, setResponse] = useState<IGetScheduledActionGatewayResponse | null>(null);\n\n useEffect(() => {\n const fetchData = async () => {\n try {\n const data = await gateway.execute({\n namespace,\n id\n });\n setResponse(data);\n } catch (err) {\n console.error(err);\n showSnackbar(err.message);\n }\n };\n fetchData();\n }, []);\n\n return response;\n};\n"],"mappings":"AAIA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,WAAW,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,qBAAqB,GAC9BC,MAAiC,IACW;EAC5C,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAG,CAAC,GAAGH,MAAM;EAEzC,MAAM;IAAEI;EAAa,CAAC,GAAGN,WAAW,CAAC,CAAC;EAEtC,MAAM,CAACO,QAAQ,EAAEC,WAAW,CAAC,GAAGT,QAAQ,CAA4C,IAAI,CAAC;EAEzFD,SAAS,CAAC,MAAM;IACZ,MAAMW,SAAS,GAAG,MAAAA,CAAA,KAAY;MAC1B,IAAI;QACA,MAAMC,IAAI,GAAG,MAAMP,OAAO,CAACQ,OAAO,CAAC;UAC/BP,SAAS;UACTC;QACJ,CAAC,CAAC;QACFG,WAAW,CAACE,IAAI,CAAC;MACrB,CAAC,CAAC,OAAOE,GAAG,EAAE;QACVC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;QAClBN,YAAY,CAACM,GAAG,CAACG,OAAO,CAAC;MAC7B;IACJ,CAAC;IACDN,SAAS,CAAC,CAAC;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,QAAQ;AACnB,CAAC","ignoreList":[]}
|