@docsvision/management-console 6.2.0-beta.5 → 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
@@ -494,8 +494,6 @@ export declare class DashboardConfigurationService implements IDashboardConfigur
494
494
  removeDashboardConfiguration(dashboardId: string): Promise<void>;
495
495
  }
496
496
 
497
- export declare function DatabaseSelectionModal(props: IDatabaseSelectionModalProps): JSX.Element;
498
-
499
497
  export declare function DatabaseSettingsCard(props: IDatabaseSettingsCardProps): JSX.Element;
500
498
 
501
499
  export declare type DatabaseSettingsCardSize = "sm" | "md";
@@ -589,11 +587,6 @@ declare type EffectCallbackAsync = () => (Promise<void> | (() => Promise<void |
589
587
 
590
588
  export declare const EMAIL_CONNECTION_SETTINGS_LAYOUT = "ea883b59-bb95-446e-879b-97874ac4d82b";
591
589
 
592
- export declare enum EngineType {
593
- MsSQL = 0,
594
- PgSQL = 1
595
- }
596
-
597
590
  export declare const ERROR_ROW_CLASS_NAME = "page-table__row-error";
598
591
 
599
592
  export declare function ErrorBlock({ text, close }: IErrorBlockProps): JSX.Element;
@@ -1212,16 +1205,6 @@ declare enum IDatabaseMasterState {
1212
1205
  SolutionProcessFinished = 4
1213
1206
  }
1214
1207
 
1215
- export declare interface IDatabaseModel {
1216
- baseName: string;
1217
- sqlServerName: string;
1218
- serverType: EngineType;
1219
- usesFileService: boolean;
1220
- hash: string;
1221
- serverNames: string[];
1222
- error?: string;
1223
- }
1224
-
1225
1208
  declare interface IDatabaseParameters {
1226
1209
  alias: string;
1227
1210
  databaseName: string;
@@ -1252,14 +1235,6 @@ declare interface IDatabasesController extends Service {
1252
1235
  installSolutions(serviceId: string, databaseAlias: string, solutions: string[]): Promise<void>;
1253
1236
  }
1254
1237
 
1255
- export declare interface IDatabaseSelectionModalProps {
1256
- open: boolean;
1257
- databases: IDatabaseModel[];
1258
- onCancel: () => void;
1259
- onApply: (selected: IDatabaseModel[]) => void;
1260
- resources: IResourcesMap_2;
1261
- }
1262
-
1263
1238
  export declare interface IDatabaseSettingsCardProps {
1264
1239
  title: string;
1265
1240
  label: string;
@@ -1890,6 +1865,7 @@ export declare interface IPageLayoutModelElement {
1890
1865
  elements?: IPageModelElement[];
1891
1866
  extendedLayoutId?: string;
1892
1867
  readonly?: boolean;
1868
+ inProcess?: boolean;
1893
1869
  parameters?: Record<string, string>;
1894
1870
  }
1895
1871
 
@@ -1907,6 +1883,7 @@ declare interface IPageLayoutModelElement_2 {
1907
1883
  elements?: IPageModelElement_2[];
1908
1884
  extendedLayoutId?: string;
1909
1885
  readonly?: boolean;
1886
+ inProcess?: boolean;
1910
1887
  parameters?: Record<string, string>;
1911
1888
  }
1912
1889
 
@@ -2014,13 +1991,21 @@ export declare interface IPopupNotificationProps extends Noty_2.Options {
2014
1991
  buttonsProps?: IButtonsProps[];
2015
1992
  }
2016
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
+
2017
2002
  declare interface IProcessStatus {
2018
2003
  state: ProcessState;
2019
2004
  errorMessage?: string
2020
2005
  }
2021
2006
 
2022
2007
  declare interface IProcessTemplatesController extends Service {
2023
- installProcessTemplates(serviceId: string, data: IInstallProcessTemplatesRequestModel): Promise<void>;
2008
+ installProcessTemplates(serviceId: string, pageId: string, elementId: string, data: IInstallProcessTemplatesRequestModel): Promise<void>;
2024
2009
  }
2025
2010
 
2026
2011
  declare interface IRealtimeCommunicationService {
@@ -2699,6 +2684,8 @@ declare enum PeriodType {
2699
2684
  DateRange
2700
2685
  }
2701
2686
 
2687
+ export declare function ProcessOverlay(props: IProcessOverlayProps): JSX.Element;
2688
+
2702
2689
  declare enum ProcessState {
2703
2690
  Running = 0,
2704
2691
  Finished = 1,
package/index.js CHANGED
@@ -59033,12 +59033,6 @@ const CheckIcon$1 = createSvgIcon(/* @__PURE__ */ jsx("path", {
59033
59033
  const Clear = createSvgIcon(/* @__PURE__ */ jsx("path", {
59034
59034
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
59035
59035
  }));
59036
- const Close = createSvgIcon(/* @__PURE__ */ jsx("path", {
59037
- d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
59038
- }));
59039
- const ComputerRounded = createSvgIcon(/* @__PURE__ */ jsx("path", {
59040
- d: "M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H1c-.55 0-1 .45-1 1s.45 1 1 1h22c.55 0 1-.45 1-1s-.45-1-1-1zM5 6h14c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1"
59041
- }));
59042
59036
  const DeleteIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59043
59037
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
59044
59038
  }));
@@ -76683,6 +76677,16 @@ function NumberComponent(props) {
76683
76677
  errorMessage && /* @__PURE__ */ jsx(ErrorMessage, { message: errorMessage })
76684
76678
  ] });
76685
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
+ }
76686
76690
  class EditorFactory {
76687
76691
  constructor() {
76688
76692
  this.editorMap = {};
@@ -85303,6 +85307,7 @@ class ProcessTemplatesLogic extends ComponentLogic {
85303
85307
  { hasSelected: this.$hasSelectedTemplate, isPending: this.reinstallProcessTemplatesFx.pending },
85304
85308
  ({ hasSelected, isPending }) => hasSelected && !isPending
85305
85309
  );
85310
+ this.$inProcess = this.domain.store(this.options.inProcess || false, { name: "$inProcess" });
85306
85311
  }
85307
85312
  init() {
85308
85313
  v({
@@ -85321,9 +85326,14 @@ class ProcessTemplatesLogic extends ComponentLogic {
85321
85326
  v({
85322
85327
  clock: this.processTemplatesReinstalled,
85323
85328
  source: this.$processTemplates,
85324
- fn: (value) => ({ value, services: this.options.services }),
85329
+ fn: (value) => ({ value, services: this.options.services, elementId: this.options.id }),
85325
85330
  target: this.reinstallProcessTemplatesFx
85326
85331
  });
85332
+ v({
85333
+ clock: this.reinstallProcessTemplatesFx.done,
85334
+ fn: () => true,
85335
+ target: this.$inProcess
85336
+ });
85327
85337
  }
85328
85338
  }
85329
85339
  function handleSelectProcessTemplate(value, id) {
@@ -85336,11 +85346,12 @@ function handleSelectProcessTemplate(value, id) {
85336
85346
  };
85337
85347
  return newValue;
85338
85348
  }
85339
- async function reinstallProcessTemplates({ value, services }) {
85349
+ async function reinstallProcessTemplates({ value, services, elementId }) {
85340
85350
  const { messageWindow, resources, routingService, processTemplatesController } = services;
85341
85351
  await messageWindow.showConfirmation(resources.ConfirmTemplatesReinstall);
85342
85352
  const { data } = routingService.getLastRouteResolvedParams() || {};
85343
85353
  const serviceId = data?.serviceId;
85354
+ const pageId = data?.layoutId;
85344
85355
  const templateIds = value.templates.reduce((selectedTemplatesIds, template) => {
85345
85356
  if (template.selected) {
85346
85357
  selectedTemplatesIds.push(template.id);
@@ -85348,7 +85359,7 @@ async function reinstallProcessTemplates({ value, services }) {
85348
85359
  return selectedTemplatesIds;
85349
85360
  }, []);
85350
85361
  const requestData = { timestamp: value.timestamp, templateIds };
85351
- await processTemplatesController.installProcessTemplates(serviceId, requestData);
85362
+ await processTemplatesController.installProcessTemplates(serviceId, pageId, elementId, requestData);
85352
85363
  await messageWindow.showConfirmation(resources.TemplatesReinstalledReloadPageConfirm);
85353
85364
  location.reload();
85354
85365
  }
@@ -85359,8 +85370,9 @@ function ProcessTemplates(props) {
85359
85370
  const logic = useLogic(logicProps, ProcessTemplatesLogic);
85360
85371
  const processTemplatesValue = e(logic.$processTemplates);
85361
85372
  const canReinstallProcessTemplates = e(logic.$canReinstallProcessTemplates);
85373
+ const inProcess = e(logic.$inProcess);
85362
85374
  const handleSelectProcessTemplate2 = (templateId) => () => logic.processTemplateSelected(templateId);
85363
- 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: [
85364
85376
  /* @__PURE__ */ jsx(TableContainer, { component: Paper$3, className: "process-templates__table-container", children: /* @__PURE__ */ jsxs(Table$1, { className: "process-templates__table", children: [
85365
85377
  /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow$1, { children: [
85366
85378
  /* @__PURE__ */ jsx(TableCell$2, { className: "process-templates__cell_with_padding", children: resources.TemplateName }),
@@ -85391,12 +85403,12 @@ function ProcessTemplates(props) {
85391
85403
  size: "small",
85392
85404
  color: "secondary",
85393
85405
  disabled: !canReinstallProcessTemplates,
85394
- onClick: logic.processTemplatesReinstalled,
85395
85406
  "data-testid": "reload-button",
85407
+ onClick: logic.processTemplatesReinstalled,
85396
85408
  children: resources.Reinstall
85397
85409
  }
85398
85410
  ) })
85399
- ] });
85411
+ ] }) });
85400
85412
  }
85401
85413
  function TenantsProcessShare(props) {
85402
85414
  const { required, id: fieldName, value } = props;
@@ -88072,6 +88084,11 @@ var ILongOperationCompleteStatus = /* @__PURE__ */ ((ILongOperationCompleteStatu
88072
88084
  ILongOperationCompleteStatus2[ILongOperationCompleteStatus2["Error"] = 1] = "Error";
88073
88085
  return ILongOperationCompleteStatus2;
88074
88086
  })(ILongOperationCompleteStatus || {});
88087
+ var ILongOperationScope = /* @__PURE__ */ ((ILongOperationScope2) => {
88088
+ ILongOperationScope2[ILongOperationScope2["Global"] = 0] = "Global";
88089
+ ILongOperationScope2[ILongOperationScope2["Local"] = 1] = "Local";
88090
+ return ILongOperationScope2;
88091
+ })(ILongOperationScope || {});
88075
88092
  class SettingsPageLogic extends ComponentLogic {
88076
88093
  constructor() {
88077
88094
  super(...arguments);
@@ -88089,6 +88106,8 @@ class SettingsPageLogic extends ComponentLogic {
88089
88106
  realtimeCommunication.on("ReceiveLongOperationCompleteNotification", (notification) => {
88090
88107
  const { data, route } = routingService.getLastRouteResolvedParams() || {};
88091
88108
  const isCurrentService = data?.serviceId === notification.serviceId;
88109
+ const isLocalScope = notification.scope === ILongOperationScope.Local;
88110
+ if (isLocalScope && !isCurrentService) return;
88092
88111
  const buttonsProps = isCurrentService ? [{ text: resources.RefreshPage, onClick: () => location.reload(), dataTestId: "reload-button" }] : [];
88093
88112
  const notyType = notification.status === ILongOperationCompleteStatus.Success ? "info" : "error";
88094
88113
  const note = showNote({ type: notyType, timeout: 0, text: notification.message, buttonsProps });
@@ -127714,8 +127733,8 @@ class ProcessTemplatesController {
127714
127733
  this.meta = null;
127715
127734
  this.baseUrl = "api/workflow/processTemplate";
127716
127735
  }
127717
- installProcessTemplates(serviceId, data) {
127718
- 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);
127719
127738
  }
127720
127739
  }
127721
127740
  class Application extends ServiceContainer {
@@ -127922,121 +127941,6 @@ function SectionContentWrapper(props) {
127922
127941
  }) })
127923
127942
  ] });
127924
127943
  }
127925
- var EngineType = /* @__PURE__ */ ((EngineType2) => {
127926
- EngineType2[EngineType2["MsSQL"] = 0] = "MsSQL";
127927
- EngineType2[EngineType2["PgSQL"] = 1] = "PgSQL";
127928
- return EngineType2;
127929
- })(EngineType || {});
127930
- function renderColumn(values2, iconComponent) {
127931
- const Icon2 = iconComponent;
127932
- return values2.map((value, index) => /* @__PURE__ */ jsxs("div", { className: "database-selection-modal__value", children: [
127933
- /* @__PURE__ */ jsx(Icon2, { fontSize: "small", color: "secondary" }),
127934
- /* @__PURE__ */ jsx(CellTextContent, { content: value, multiline: true })
127935
- ] }, `${value}-${index}`));
127936
- }
127937
- function DatabaseSelectionModal(props) {
127938
- const { open, databases, onCancel, onApply, resources } = props;
127939
- const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
127940
- useEffect(() => {
127941
- if (open) {
127942
- setSelectedIds(/* @__PURE__ */ new Set());
127943
- }
127944
- }, [open]);
127945
- const handleToggle = (id) => {
127946
- setSelectedIds((prev) => {
127947
- const next = new Set(prev);
127948
- if (next.has(id)) {
127949
- next.delete(id);
127950
- } else {
127951
- next.add(id);
127952
- }
127953
- return next;
127954
- });
127955
- };
127956
- const handleApply = () => {
127957
- const selectedItems = databases.filter((database) => selectedIds.has(database.hash));
127958
- onApply(selectedItems);
127959
- };
127960
- const handleKeyDown2 = (event, databaseHash) => {
127961
- if (event.key === "Enter") {
127962
- handleToggle(databaseHash);
127963
- }
127964
- };
127965
- const hasDatabases = databases.length > 0;
127966
- const isApplyDisabled = !hasDatabases || !selectedIds.size;
127967
- const columns = [resources.Alias, resources.ApplicationServer, resources.SqlServer, ""];
127968
- return /* @__PURE__ */ jsxs(
127969
- Dialog$2,
127970
- {
127971
- open,
127972
- onClose: onCancel,
127973
- fullWidth: true,
127974
- maxWidth: "md",
127975
- scroll: "paper",
127976
- className: "database-selection-modal__dialog",
127977
- slotProps: { paper: { className: "database-selection-modal__paper" } },
127978
- children: [
127979
- /* @__PURE__ */ jsxs(DialogTitle, { variant: "h6", className: "database-selection-modal__title", children: [
127980
- resources.ConnectDatabase,
127981
- /* @__PURE__ */ jsx(IconButton$3, { onClick: onCancel, children: /* @__PURE__ */ jsx(Close, {}) })
127982
- ] }),
127983
- /* @__PURE__ */ jsxs(DialogContent$2, { className: "database-selection-modal__content", children: [
127984
- /* @__PURE__ */ jsx(Typography$3, { variant: "body1", className: "database-selection-modal__description", children: resources.SelectDatabasesToConnect }),
127985
- !hasDatabases ? /* @__PURE__ */ jsx(Typography$3, { variant: "body2", className: "database-selection-modal__empty", children: resources.NoDatabasesAvailableForConnection }) : /* @__PURE__ */ jsx("div", { className: "database-selection-modal__table-wrapper", children: /* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(Table$1, { size: "small", children: [
127986
- /* @__PURE__ */ jsx(TableHead, { children: columns.map((column) => /* @__PURE__ */ jsx(TableCell$2, { children: column }, column)) }),
127987
- /* @__PURE__ */ jsx(TableBody$1, { children: databases.map((database) => {
127988
- const hasError = !!database.error;
127989
- const isSelected = selectedIds.has(database.hash);
127990
- const handleRowClick = hasError ? void 0 : () => handleToggle(database.hash);
127991
- return /* @__PURE__ */ jsx(
127992
- LightTooltip,
127993
- {
127994
- title: database.error ?? "",
127995
- arrow: true,
127996
- placement: "top",
127997
- disableHoverListener: !hasError,
127998
- disableFocusListener: !hasError,
127999
- disableTouchListener: !hasError,
128000
- children: /* @__PURE__ */ jsxs(
128001
- TableRow$1,
128002
- {
128003
- hover: !hasError,
128004
- onClick: handleRowClick,
128005
- className: classNames(
128006
- "database-selection-modal__row",
128007
- { "database-selection-modal__row_error": hasError }
128008
- ),
128009
- children: [
128010
- /* @__PURE__ */ jsx(TableCell$2, { className: "database-selection-modal__cell", width: "30%", children: renderColumn([database.baseName], StorageRounded) }),
128011
- /* @__PURE__ */ jsx(TableCell$2, { className: "database-selection-modal__cell", width: "30%", children: renderColumn(database.serverNames, ComputerRounded) }),
128012
- /* @__PURE__ */ jsx(CellWithFixedWidth, { content: database.sqlServerName, maxWidth: "30%" }),
128013
- /* @__PURE__ */ jsx(TableCell$2, { className: "database-selection-modal__cell", width: "10%", children: /* @__PURE__ */ jsx(
128014
- Checkbox$1,
128015
- {
128016
- checked: isSelected,
128017
- onChange: () => handleToggle(database.hash),
128018
- onClick: (event) => event.stopPropagation(),
128019
- onKeyDown: (event) => handleKeyDown2(event, database.hash),
128020
- disabled: hasError
128021
- }
128022
- ) })
128023
- ]
128024
- }
128025
- )
128026
- },
128027
- database.hash
128028
- );
128029
- }) })
128030
- ] }) }) })
128031
- ] }),
128032
- /* @__PURE__ */ jsxs(DialogActions$2, { className: "database-selection-modal__actions", children: [
128033
- /* @__PURE__ */ jsx(Button$3, { onClick: onCancel, color: "primary", children: resources.DialogButton_Cancel }),
128034
- /* @__PURE__ */ jsx(Button$3, { onClick: handleApply, color: "primary", variant: "contained", disabled: isApplyDisabled, children: resources.DialogButton_Accept })
128035
- ] })
128036
- ]
128037
- }
128038
- );
128039
- }
128040
127944
  export {
128041
127945
  $AboutSettings,
128042
127946
  $ApplicationSettings,
@@ -128070,7 +127974,6 @@ export {
128070
127974
  DEFAULT_PAGE_SIZE,
128071
127975
  DOCSVISION_CONNECTION_SETTINGS_LAYOUT,
128072
127976
  DashboardConfigurationService,
128073
- DatabaseSelectionModal,
128074
127977
  DatabaseSettingsCard,
128075
127978
  DateRangeCalendarIcon,
128076
127979
  DateRangeContainer,
@@ -128089,7 +127992,6 @@ export {
128089
127992
  EditorInnerWrapper,
128090
127993
  EditorName,
128091
127994
  EditorWrapper,
128092
- EngineType,
128093
127995
  ErrorBlock,
128094
127996
  ErrorIcon$1 as ErrorIcon,
128095
127997
  ErrorMessage,
@@ -128119,6 +128021,7 @@ export {
128119
128021
  PageTabPanel,
128120
128022
  PageTable,
128121
128023
  PageTitle,
128024
+ ProcessOverlay,
128122
128025
  ResourcesManagement,
128123
128026
  RouteContentRenderService,
128124
128027
  SavePageStatus,