@webiny/app-scheduler 0.0.0-unstable.c27f4d8a31 → 6.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
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";
@@ -61,6 +62,22 @@ const minDateValidator = input => {
61
62
  throw new ValidationError(`The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(minDate)}.`);
62
63
  };
63
64
  minDateValidator.validatorName = "minDateValidator";
65
+ const CancelButtonComponent = ({
66
+ enabled,
67
+ onCancel
68
+ }) => {
69
+ if (!enabled) {
70
+ return null;
71
+ }
72
+ return /*#__PURE__*/React.createElement(Button, {
73
+ variant: "ghost",
74
+ onClick: onCancel,
75
+ text: "Cancel Schedule",
76
+ size: "md",
77
+ icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
78
+ iconPosition: "start"
79
+ });
80
+ };
64
81
  export const SchedulerDialogFormComponentDateTimeInput = makeDecoratable("SchedulerDialogFormComponentDateTimeInput", props => {
65
82
  const {
66
83
  bind
@@ -77,13 +94,11 @@ export const SchedulerDialogFormComponentDateTimeInput = makeDecoratable("Schedu
77
94
  });
78
95
  const FormComponent = ({
79
96
  scheduleOn,
80
- onCancel,
81
97
  actionType
82
98
  }) => {
83
99
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ReschedulingAlert, {
84
100
  actionType: actionType,
85
- scheduleOn: scheduleOn,
86
- onCancel: onCancel
101
+ scheduleOn: scheduleOn
87
102
  }), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Grid.Column, {
88
103
  span: 12
89
104
  }, /*#__PURE__*/React.createElement(Bind, {
@@ -167,7 +182,7 @@ export const useScheduleDialog = props => {
167
182
  }
168
183
  dialogClose.current();
169
184
  dialogClose.current = null;
170
- }, []);
185
+ }, [schedulerEntry?.id]);
171
186
  const showDialog = () => {
172
187
  const isPublished = target.status === "published";
173
188
  const scheduleOn = schedulerEntry?.publishOn || schedulerEntry?.unpublishOn;
@@ -175,8 +190,7 @@ export const useScheduleDialog = props => {
175
190
  title: `Schedule "${target.title}"`,
176
191
  content: /*#__PURE__*/React.createElement(FormComponent, {
177
192
  actionType: schedulerEntry?.actionType,
178
- scheduleOn: scheduleOn,
179
- onCancel: onCancel
193
+ scheduleOn: scheduleOn
180
194
  }),
181
195
  formData: {
182
196
  scheduleOn
@@ -184,6 +198,10 @@ export const useScheduleDialog = props => {
184
198
  acceptLabel: isPublished ? "Schedule Unpublish" : "Schedule Publish",
185
199
  cancelLabel: "Discard",
186
200
  loadingLabel: "Scheduling...",
201
+ info: /*#__PURE__*/React.createElement(CancelButtonComponent, {
202
+ enabled: !!scheduleOn,
203
+ onCancel: onCancel
204
+ }),
187
205
  onAccept: data => {
188
206
  if (!data.scheduleOn) {
189
207
  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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EvD,UAAW;QACvCD,UAAU,EAAEA,UAAW;QACvBuC,QAAQ,EAAEA;MAAS,CACtB,CACJ;MACDoC,QAAQ,EAAE;QACN3E;MACJ,CAAC;MACD4E,WAAW,EAAEN,WAAW,GAAG,oBAAoB,GAAG,kBAAkB;MACpEO,WAAW,EAAE,SAAS;MACtBC,YAAY,EAAE,eAAe;MAC7BlB,QAAQ,EAAGmB,IAA+B,IAAK;QAC3C,IAAI,CAACA,IAAI,CAAC/E,UAAU,EAAE;UAClBkD,YAAY,CAAC,6BAA6B,CAAC;UAC3C;QACJ;QACA;AAChB;AACA;AACA;AACA;AACA;QACgB,IAAIlD,UAAgB;QACpB,IAAI;UACAA,UAAU,GAAG,IAAIc,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","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","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","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","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 { 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}\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 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 }, [schedulerEntry?.id]);\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 actionType={schedulerEntry?.actionType} scheduleOn={scheduleOn} />\n ),\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,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;AAmBnC,MAAMC,2BAA2B,GAAG,IAAIC,IAAI,CAACC,cAAc,CAACC,SAAS,EAAE;EACnEC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,SAAS;EAChBC,GAAG,EAAE,SAAS;EACdC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,MAAM,EAAEN,SAAS;EACjBO,MAAM,EAAE;AACZ,CAAC,CAAC;AAOF,MAAMC,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AAO,EAAE,CAAC,CAAC7B,UAAW;QAAC8B,QAAQ,EAAEA;MAAS,CAAE,CAAC;MAC1EqC,QAAQ,EAAGoB,IAA+B,IAAK;QAC3C,IAAI,CAACA,IAAI,CAACvF,UAAU,EAAE;UAClByD,YAAY,CAAC,6BAA6B,CAAC;UAC3C;QACJ;QACA;AAChB;AACA;AACA;AACA;AACA;QACgB,IAAIzD,UAAgB;QACpB,IAAI;UACAA,UAAU,GAAG,IAAIc,IAAI,CAACyE,IAAI,CAACvF,UAAU,CAAC;QAC1C,CAAC,CAAC,OAAOwF,EAAE,EAAE;UACT/B,YAAY,CAAC,6BAA6B,EAAE;YACxCjC,KAAK,EAAE+D,IAAI,CAACvF;UAChB,CAAC,CAAC;UACFyE,OAAO,CAACF,KAAK,CAACiB,EAAE,CAAC;UACjB;QACJ;QAEA,MAAMvF,UAAU,GAAG4E,WAAW,GACxBlG,kBAAkB,CAAC8G,SAAS,GAC5B9G,kBAAkB,CAACwB,OAAO;QAEhC,OAAOgE,QAAQ,CAAC;UACZnE,UAAU;UACVC;QACJ,CAAC,CAAC;MACN;IACJ,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACH2E;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-scheduler",
3
- "version": "0.0.0-unstable.c27f4d8a31",
3
+ "version": "6.1.0-beta.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -13,32 +13,32 @@
13
13
  "@emotion/react": "11.14.0",
14
14
  "@emotion/styled": "11.14.1",
15
15
  "@material-design-icons/svg": "0.14.15",
16
- "@webiny/admin-ui": "0.0.0-unstable.c27f4d8a31",
17
- "@webiny/app-aco": "0.0.0-unstable.c27f4d8a31",
18
- "@webiny/app-admin": "0.0.0-unstable.c27f4d8a31",
19
- "@webiny/app-headless-cms-common": "0.0.0-unstable.c27f4d8a31",
20
- "@webiny/app-utils": "0.0.0-unstable.c27f4d8a31",
21
- "@webiny/form": "0.0.0-unstable.c27f4d8a31",
22
- "@webiny/icons": "0.0.0-unstable.c27f4d8a31",
23
- "@webiny/react-composition": "0.0.0-unstable.c27f4d8a31",
24
- "@webiny/react-properties": "0.0.0-unstable.c27f4d8a31",
25
- "@webiny/ui": "0.0.0-unstable.c27f4d8a31",
26
- "@webiny/utils": "0.0.0-unstable.c27f4d8a31",
27
- "@webiny/validation": "0.0.0-unstable.c27f4d8a31",
16
+ "@webiny/admin-ui": "6.1.0-beta.1",
17
+ "@webiny/app-aco": "6.1.0-beta.1",
18
+ "@webiny/app-admin": "6.1.0-beta.1",
19
+ "@webiny/app-headless-cms-common": "6.1.0-beta.1",
20
+ "@webiny/app-utils": "6.1.0-beta.1",
21
+ "@webiny/form": "6.1.0-beta.1",
22
+ "@webiny/icons": "6.1.0-beta.1",
23
+ "@webiny/react-composition": "6.1.0-beta.1",
24
+ "@webiny/react-properties": "6.1.0-beta.1",
25
+ "@webiny/ui": "6.1.0-beta.1",
26
+ "@webiny/utils": "6.1.0-beta.1",
27
+ "@webiny/validation": "6.1.0-beta.1",
28
28
  "apollo-client": "2.6.10",
29
29
  "graphql-tag": "2.12.6",
30
30
  "lodash": "4.17.23",
31
31
  "mobx": "6.15.0",
32
- "mobx-react-lite": "3.4.3",
32
+ "mobx-react-lite": "4.1.1",
33
33
  "prop-types": "15.8.1",
34
- "react": "18.3.1",
35
- "react-dom": "18.3.1",
34
+ "react": "18.2.0",
35
+ "react-dom": "18.2.0",
36
36
  "zod": "4.3.6"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@emotion/babel-plugin": "11.13.5",
40
- "@types/react": "18.3.28",
41
- "@webiny/build-tools": "0.0.0-unstable.c27f4d8a31",
40
+ "@types/react": "18.2.79",
41
+ "@webiny/build-tools": "6.1.0-beta.1",
42
42
  "rimraf": "6.1.3",
43
43
  "typescript": "5.9.3"
44
44
  },
@@ -51,5 +51,5 @@
51
51
  "removeViewBox": false
52
52
  }
53
53
  },
54
- "gitHead": "c27f4d8a31c3af1570817797441855292b6c1f20"
54
+ "gitHead": "3c1293ba17a14f239fb1cbf5d80cd66846849309"
55
55
  }