@docsvision/management-console 6.2.0-beta.4 → 6.2.0-beta.6

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/index.d.ts CHANGED
@@ -1865,6 +1865,7 @@ export declare interface IPageLayoutModelElement {
1865
1865
  elements?: IPageModelElement[];
1866
1866
  extendedLayoutId?: string;
1867
1867
  readonly?: boolean;
1868
+ inProcess?: boolean;
1868
1869
  parameters?: Record<string, string>;
1869
1870
  }
1870
1871
 
@@ -1882,6 +1883,7 @@ declare interface IPageLayoutModelElement_2 {
1882
1883
  elements?: IPageModelElement_2[];
1883
1884
  extendedLayoutId?: string;
1884
1885
  readonly?: boolean;
1886
+ inProcess?: boolean;
1885
1887
  parameters?: Record<string, string>;
1886
1888
  }
1887
1889
 
@@ -1989,13 +1991,21 @@ export declare interface IPopupNotificationProps extends Noty_2.Options {
1989
1991
  buttonsProps?: IButtonsProps[];
1990
1992
  }
1991
1993
 
1994
+ export declare interface IProcessOverlayProps {
1995
+ children: React_2.ReactNode;
1996
+ inProcess?: boolean;
1997
+ message?: string;
1998
+ spinnerSize?: number;
1999
+ className?: string;
2000
+ }
2001
+
1992
2002
  declare interface IProcessStatus {
1993
2003
  state: ProcessState;
1994
2004
  errorMessage?: string
1995
2005
  }
1996
2006
 
1997
2007
  declare interface IProcessTemplatesController extends Service {
1998
- installProcessTemplates(serviceId: string, data: IInstallProcessTemplatesRequestModel): Promise<void>;
2008
+ installProcessTemplates(serviceId: string, pageId: string, elementId: string, data: IInstallProcessTemplatesRequestModel): Promise<void>;
1999
2009
  }
2000
2010
 
2001
2011
  declare interface IRealtimeCommunicationService {
@@ -2674,6 +2684,8 @@ declare enum PeriodType {
2674
2684
  DateRange
2675
2685
  }
2676
2686
 
2687
+ export declare function ProcessOverlay(props: IProcessOverlayProps): JSX.Element;
2688
+
2677
2689
  declare enum ProcessState {
2678
2690
  Running = 0,
2679
2691
  Finished = 1,
package/index.js CHANGED
@@ -76677,6 +76677,16 @@ function NumberComponent(props) {
76677
76677
  errorMessage && /* @__PURE__ */ jsx(ErrorMessage, { message: errorMessage })
76678
76678
  ] });
76679
76679
  }
76680
+ function ProcessOverlay(props) {
76681
+ const { children, inProcess, message, spinnerSize = 60, className } = props;
76682
+ return /* @__PURE__ */ jsxs("div", { className: classNames("process-overlay", className), children: [
76683
+ /* @__PURE__ */ jsx("div", { className: classNames({ "process-overlay__content_blur": inProcess }), children }),
76684
+ inProcess && /* @__PURE__ */ jsxs("div", { className: "process-overlay__process", children: [
76685
+ /* @__PURE__ */ jsx(CircularProgress$3, { size: spinnerSize, thickness: 4, color: "primary" }),
76686
+ message && /* @__PURE__ */ jsx(Typography$3, { color: "primary", fontWeight: "bold", children: message })
76687
+ ] })
76688
+ ] });
76689
+ }
76680
76690
  class EditorFactory {
76681
76691
  constructor() {
76682
76692
  this.editorMap = {};
@@ -85297,6 +85307,7 @@ class ProcessTemplatesLogic extends ComponentLogic {
85297
85307
  { hasSelected: this.$hasSelectedTemplate, isPending: this.reinstallProcessTemplatesFx.pending },
85298
85308
  ({ hasSelected, isPending }) => hasSelected && !isPending
85299
85309
  );
85310
+ this.$inProcess = this.domain.store(this.options.inProcess || false, { name: "$inProcess" });
85300
85311
  }
85301
85312
  init() {
85302
85313
  v({
@@ -85315,9 +85326,14 @@ class ProcessTemplatesLogic extends ComponentLogic {
85315
85326
  v({
85316
85327
  clock: this.processTemplatesReinstalled,
85317
85328
  source: this.$processTemplates,
85318
- fn: (value) => ({ value, services: this.options.services }),
85329
+ fn: (value) => ({ value, services: this.options.services, elementId: this.options.id }),
85319
85330
  target: this.reinstallProcessTemplatesFx
85320
85331
  });
85332
+ v({
85333
+ clock: this.reinstallProcessTemplatesFx.done,
85334
+ fn: () => true,
85335
+ target: this.$inProcess
85336
+ });
85321
85337
  }
85322
85338
  }
85323
85339
  function handleSelectProcessTemplate(value, id) {
@@ -85330,11 +85346,12 @@ function handleSelectProcessTemplate(value, id) {
85330
85346
  };
85331
85347
  return newValue;
85332
85348
  }
85333
- async function reinstallProcessTemplates({ value, services }) {
85349
+ async function reinstallProcessTemplates({ value, services, elementId }) {
85334
85350
  const { messageWindow, resources, routingService, processTemplatesController } = services;
85335
85351
  await messageWindow.showConfirmation(resources.ConfirmTemplatesReinstall);
85336
85352
  const { data } = routingService.getLastRouteResolvedParams() || {};
85337
85353
  const serviceId = data?.serviceId;
85354
+ const pageId = data?.layoutId;
85338
85355
  const templateIds = value.templates.reduce((selectedTemplatesIds, template) => {
85339
85356
  if (template.selected) {
85340
85357
  selectedTemplatesIds.push(template.id);
@@ -85342,7 +85359,7 @@ async function reinstallProcessTemplates({ value, services }) {
85342
85359
  return selectedTemplatesIds;
85343
85360
  }, []);
85344
85361
  const requestData = { timestamp: value.timestamp, templateIds };
85345
- await processTemplatesController.installProcessTemplates(serviceId, requestData);
85362
+ await processTemplatesController.installProcessTemplates(serviceId, pageId, elementId, requestData);
85346
85363
  await messageWindow.showConfirmation(resources.TemplatesReinstalledReloadPageConfirm);
85347
85364
  location.reload();
85348
85365
  }
@@ -85353,8 +85370,9 @@ function ProcessTemplates(props) {
85353
85370
  const logic = useLogic(logicProps, ProcessTemplatesLogic);
85354
85371
  const processTemplatesValue = e(logic.$processTemplates);
85355
85372
  const canReinstallProcessTemplates = e(logic.$canReinstallProcessTemplates);
85373
+ const inProcess = e(logic.$inProcess);
85356
85374
  const handleSelectProcessTemplate2 = (templateId) => () => logic.processTemplateSelected(templateId);
85357
- return /* @__PURE__ */ jsxs(EditorContainer, { ...props, children: [
85375
+ return /* @__PURE__ */ jsx(EditorContainer, { ...props, inProcess: true, isEditable: !inProcess, children: /* @__PURE__ */ jsxs(ProcessOverlay, { inProcess, message: resources.OperationInProgress, children: [
85358
85376
  /* @__PURE__ */ jsx(TableContainer, { component: Paper$3, className: "process-templates__table-container", children: /* @__PURE__ */ jsxs(Table$1, { className: "process-templates__table", children: [
85359
85377
  /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow$1, { children: [
85360
85378
  /* @__PURE__ */ jsx(TableCell$2, { className: "process-templates__cell_with_padding", children: resources.TemplateName }),
@@ -85385,12 +85403,12 @@ function ProcessTemplates(props) {
85385
85403
  size: "small",
85386
85404
  color: "secondary",
85387
85405
  disabled: !canReinstallProcessTemplates,
85388
- onClick: logic.processTemplatesReinstalled,
85389
85406
  "data-testid": "reload-button",
85407
+ onClick: logic.processTemplatesReinstalled,
85390
85408
  children: resources.Reinstall
85391
85409
  }
85392
85410
  ) })
85393
- ] });
85411
+ ] }) });
85394
85412
  }
85395
85413
  function TenantsProcessShare(props) {
85396
85414
  const { required, id: fieldName, value } = props;
@@ -88066,6 +88084,11 @@ var ILongOperationCompleteStatus = /* @__PURE__ */ ((ILongOperationCompleteStatu
88066
88084
  ILongOperationCompleteStatus2[ILongOperationCompleteStatus2["Error"] = 1] = "Error";
88067
88085
  return ILongOperationCompleteStatus2;
88068
88086
  })(ILongOperationCompleteStatus || {});
88087
+ var ILongOperationScope = /* @__PURE__ */ ((ILongOperationScope2) => {
88088
+ ILongOperationScope2[ILongOperationScope2["Global"] = 0] = "Global";
88089
+ ILongOperationScope2[ILongOperationScope2["Local"] = 1] = "Local";
88090
+ return ILongOperationScope2;
88091
+ })(ILongOperationScope || {});
88069
88092
  class SettingsPageLogic extends ComponentLogic {
88070
88093
  constructor() {
88071
88094
  super(...arguments);
@@ -88083,6 +88106,8 @@ class SettingsPageLogic extends ComponentLogic {
88083
88106
  realtimeCommunication.on("ReceiveLongOperationCompleteNotification", (notification) => {
88084
88107
  const { data, route } = routingService.getLastRouteResolvedParams() || {};
88085
88108
  const isCurrentService = data?.serviceId === notification.serviceId;
88109
+ const isLocalScope = notification.scope === ILongOperationScope.Local;
88110
+ if (isLocalScope && !isCurrentService) return;
88086
88111
  const buttonsProps = isCurrentService ? [{ text: resources.RefreshPage, onClick: () => location.reload(), dataTestId: "reload-button" }] : [];
88087
88112
  const notyType = notification.status === ILongOperationCompleteStatus.Success ? "info" : "error";
88088
88113
  const note = showNote({ type: notyType, timeout: 0, text: notification.message, buttonsProps });
@@ -127708,8 +127733,8 @@ class ProcessTemplatesController {
127708
127733
  this.meta = null;
127709
127734
  this.baseUrl = "api/workflow/processTemplate";
127710
127735
  }
127711
- installProcessTemplates(serviceId, data) {
127712
- return this.requestService.post(`${this.baseUrl}?serviceId=${serviceId}`, data);
127736
+ installProcessTemplates(serviceId, pageId, elementId, data) {
127737
+ return this.requestService.post(`${this.baseUrl}?serviceId=${serviceId}&pageId=${pageId}&elementId=${elementId}`, data);
127713
127738
  }
127714
127739
  }
127715
127740
  class Application extends ServiceContainer {
@@ -127996,6 +128021,7 @@ export {
127996
128021
  PageTabPanel,
127997
128022
  PageTable,
127998
128023
  PageTitle,
128024
+ ProcessOverlay,
127999
128025
  ResourcesManagement,
128000
128026
  RouteContentRenderService,
128001
128027
  SavePageStatus,