@docsvision/management-console 6.2.0-beta.5 → 6.2.0-beta.7

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
  }));
@@ -59068,7 +59062,7 @@ const WarningIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59068
59062
  }));
59069
59063
  function DatabaseSettingsCard(props) {
59070
59064
  const { title, label, isDefault, children, size = "sm", error } = props;
59071
- return /* @__PURE__ */ jsx(Grid$1, { className: classNames("database-settings-card__wrapper", { "database-settings-card__wrapper_medium": size === "md" }), children: /* @__PURE__ */ jsxs(Paper$3, { className: "database-settings-card__container", children: [
59065
+ return /* @__PURE__ */ jsx(Grid$1, { className: classNames("database-settings-card__wrapper", { "database-settings-card__wrapper_medium": size === "md" }), children: /* @__PURE__ */ jsxs(Paper$3, { children: [
59072
59066
  /* @__PURE__ */ jsxs(Grid$1, { container: true, alignItems: "center", justifyContent: "space-between", wrap: "nowrap", className: "database-settings-card__head", children: [
59073
59067
  /* @__PURE__ */ jsxs(Grid$1, { container: true, alignItems: "center", children: [
59074
59068
  /* @__PURE__ */ jsx(StorageRounded, { color: "secondary", fontSize: "large" }),
@@ -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,8 +85307,16 @@ class ProcessTemplatesLogic extends ComponentLogic {
85303
85307
  { hasSelected: this.$hasSelectedTemplate, isPending: this.reinstallProcessTemplatesFx.pending },
85304
85308
  ({ hasSelected, isPending }) => hasSelected && !isPending
85305
85309
  );
85310
+ this.inProcessChanged = this.domain.event("inProcessChanged");
85311
+ this.$inProcess = this.domain.store(false, { name: "$inProcess" });
85306
85312
  }
85307
85313
  init() {
85314
+ v({
85315
+ clock: this.inProcessChanged,
85316
+ fn: (value) => !!value,
85317
+ target: this.$inProcess
85318
+ });
85319
+ this.inProcessChanged(!!this.options.inProcess);
85308
85320
  v({
85309
85321
  clock: this.processTemplatesLoaded,
85310
85322
  fn: () => ({ ...this.options.value, templates: this.options.value.templates.map((template) => ({ ...template, selected: false })) }),
@@ -85321,9 +85333,14 @@ class ProcessTemplatesLogic extends ComponentLogic {
85321
85333
  v({
85322
85334
  clock: this.processTemplatesReinstalled,
85323
85335
  source: this.$processTemplates,
85324
- fn: (value) => ({ value, services: this.options.services }),
85336
+ fn: (value) => ({ value, services: this.options.services, elementId: this.options.id }),
85325
85337
  target: this.reinstallProcessTemplatesFx
85326
85338
  });
85339
+ v({
85340
+ clock: this.reinstallProcessTemplatesFx.done,
85341
+ fn: () => true,
85342
+ target: this.$inProcess
85343
+ });
85327
85344
  }
85328
85345
  }
85329
85346
  function handleSelectProcessTemplate(value, id) {
@@ -85336,11 +85353,12 @@ function handleSelectProcessTemplate(value, id) {
85336
85353
  };
85337
85354
  return newValue;
85338
85355
  }
85339
- async function reinstallProcessTemplates({ value, services }) {
85356
+ async function reinstallProcessTemplates({ value, services, elementId }) {
85340
85357
  const { messageWindow, resources, routingService, processTemplatesController } = services;
85341
85358
  await messageWindow.showConfirmation(resources.ConfirmTemplatesReinstall);
85342
85359
  const { data } = routingService.getLastRouteResolvedParams() || {};
85343
85360
  const serviceId = data?.serviceId;
85361
+ const pageId = data?.layoutId;
85344
85362
  const templateIds = value.templates.reduce((selectedTemplatesIds, template) => {
85345
85363
  if (template.selected) {
85346
85364
  selectedTemplatesIds.push(template.id);
@@ -85348,9 +85366,7 @@ async function reinstallProcessTemplates({ value, services }) {
85348
85366
  return selectedTemplatesIds;
85349
85367
  }, []);
85350
85368
  const requestData = { timestamp: value.timestamp, templateIds };
85351
- await processTemplatesController.installProcessTemplates(serviceId, requestData);
85352
- await messageWindow.showConfirmation(resources.TemplatesReinstalledReloadPageConfirm);
85353
- location.reload();
85369
+ await processTemplatesController.installProcessTemplates(serviceId, pageId, elementId, requestData);
85354
85370
  }
85355
85371
  function ProcessTemplates(props) {
85356
85372
  const services = React__default.useContext(ServicesContext);
@@ -85359,8 +85375,9 @@ function ProcessTemplates(props) {
85359
85375
  const logic = useLogic(logicProps, ProcessTemplatesLogic);
85360
85376
  const processTemplatesValue = e(logic.$processTemplates);
85361
85377
  const canReinstallProcessTemplates = e(logic.$canReinstallProcessTemplates);
85378
+ const inProcess = e(logic.$inProcess);
85362
85379
  const handleSelectProcessTemplate2 = (templateId) => () => logic.processTemplateSelected(templateId);
85363
- return /* @__PURE__ */ jsxs(EditorContainer, { ...props, children: [
85380
+ return /* @__PURE__ */ jsx(EditorContainer, { ...props, inProcess: true, isEditable: !inProcess, children: /* @__PURE__ */ jsxs(ProcessOverlay, { inProcess, message: resources.OperationInProgress, children: [
85364
85381
  /* @__PURE__ */ jsx(TableContainer, { component: Paper$3, className: "process-templates__table-container", children: /* @__PURE__ */ jsxs(Table$1, { className: "process-templates__table", children: [
85365
85382
  /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow$1, { children: [
85366
85383
  /* @__PURE__ */ jsx(TableCell$2, { className: "process-templates__cell_with_padding", children: resources.TemplateName }),
@@ -85391,12 +85408,12 @@ function ProcessTemplates(props) {
85391
85408
  size: "small",
85392
85409
  color: "secondary",
85393
85410
  disabled: !canReinstallProcessTemplates,
85394
- onClick: logic.processTemplatesReinstalled,
85395
85411
  "data-testid": "reload-button",
85412
+ onClick: logic.processTemplatesReinstalled,
85396
85413
  children: resources.Reinstall
85397
85414
  }
85398
85415
  ) })
85399
- ] });
85416
+ ] }) });
85400
85417
  }
85401
85418
  function TenantsProcessShare(props) {
85402
85419
  const { required, id: fieldName, value } = props;
@@ -88072,6 +88089,11 @@ var ILongOperationCompleteStatus = /* @__PURE__ */ ((ILongOperationCompleteStatu
88072
88089
  ILongOperationCompleteStatus2[ILongOperationCompleteStatus2["Error"] = 1] = "Error";
88073
88090
  return ILongOperationCompleteStatus2;
88074
88091
  })(ILongOperationCompleteStatus || {});
88092
+ var ILongOperationScope = /* @__PURE__ */ ((ILongOperationScope2) => {
88093
+ ILongOperationScope2[ILongOperationScope2["Global"] = 0] = "Global";
88094
+ ILongOperationScope2[ILongOperationScope2["Local"] = 1] = "Local";
88095
+ return ILongOperationScope2;
88096
+ })(ILongOperationScope || {});
88075
88097
  class SettingsPageLogic extends ComponentLogic {
88076
88098
  constructor() {
88077
88099
  super(...arguments);
@@ -88089,6 +88111,8 @@ class SettingsPageLogic extends ComponentLogic {
88089
88111
  realtimeCommunication.on("ReceiveLongOperationCompleteNotification", (notification) => {
88090
88112
  const { data, route } = routingService.getLastRouteResolvedParams() || {};
88091
88113
  const isCurrentService = data?.serviceId === notification.serviceId;
88114
+ const isLocalScope = notification.scope === ILongOperationScope.Local;
88115
+ if (isLocalScope && !isCurrentService) return;
88092
88116
  const buttonsProps = isCurrentService ? [{ text: resources.RefreshPage, onClick: () => location.reload(), dataTestId: "reload-button" }] : [];
88093
88117
  const notyType = notification.status === ILongOperationCompleteStatus.Success ? "info" : "error";
88094
88118
  const note = showNote({ type: notyType, timeout: 0, text: notification.message, buttonsProps });
@@ -127714,8 +127738,8 @@ class ProcessTemplatesController {
127714
127738
  this.meta = null;
127715
127739
  this.baseUrl = "api/workflow/processTemplate";
127716
127740
  }
127717
- installProcessTemplates(serviceId, data) {
127718
- return this.requestService.post(`${this.baseUrl}?serviceId=${serviceId}`, data);
127741
+ installProcessTemplates(serviceId, pageId, elementId, data) {
127742
+ return this.requestService.post(`${this.baseUrl}?serviceId=${serviceId}&pageId=${pageId}&elementId=${elementId}`, data);
127719
127743
  }
127720
127744
  }
127721
127745
  class Application extends ServiceContainer {
@@ -127922,121 +127946,6 @@ function SectionContentWrapper(props) {
127922
127946
  }) })
127923
127947
  ] });
127924
127948
  }
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
127949
  export {
128041
127950
  $AboutSettings,
128042
127951
  $ApplicationSettings,
@@ -128070,7 +127979,6 @@ export {
128070
127979
  DEFAULT_PAGE_SIZE,
128071
127980
  DOCSVISION_CONNECTION_SETTINGS_LAYOUT,
128072
127981
  DashboardConfigurationService,
128073
- DatabaseSelectionModal,
128074
127982
  DatabaseSettingsCard,
128075
127983
  DateRangeCalendarIcon,
128076
127984
  DateRangeContainer,
@@ -128089,7 +127997,6 @@ export {
128089
127997
  EditorInnerWrapper,
128090
127998
  EditorName,
128091
127999
  EditorWrapper,
128092
- EngineType,
128093
128000
  ErrorBlock,
128094
128001
  ErrorIcon$1 as ErrorIcon,
128095
128002
  ErrorMessage,
@@ -128119,6 +128026,7 @@ export {
128119
128026
  PageTabPanel,
128120
128027
  PageTable,
128121
128028
  PageTitle,
128029
+ ProcessOverlay,
128122
128030
  ResourcesManagement,
128123
128031
  RouteContentRenderService,
128124
128032
  SavePageStatus,