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

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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import React__default, { useState, useEffect, createElement, useRef, useMemo, useContext, memo, isValidElement, cloneElement, Children, createContext, useCallback, useDebugValue, useLayoutEffect, forwardRef as forwardRef$1, Fragment as Fragment$1, Component, useReducer } from "react";
3
3
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
4
- import { Accordion as Accordion$1, AccordionSummary, AccordionDetails, Typography as Typography$3, Button as Button$3, Box, CircularProgress as CircularProgress$3, Tooltip as Tooltip$2, Breadcrumbs, IconButton as IconButton$3, Popover as Popover$4, SvgIcon as SvgIcon$3, TableCell as TableCell$2, Grid as Grid$1, Paper as Paper$3, Chip as Chip$1, MenuItem as MenuItem$2, List as List$4, ListItemButton, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, ListItem as ListItem$1, Input as Input$3, TextField as TextField$3, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, RadioGroup, Radio, createTheme as createTheme$3, TableContainer, Table as Table$1, TableHead, TableRow as TableRow$1, TableBody as TableBody$1, capitalize as capitalize$2, ThemeProvider as ThemeProvider$1, InputAdornment as InputAdornment$3, Dialog as Dialog$2, DialogTitle, DialogContent as DialogContent$2, DialogActions as DialogActions$2, FormControl as FormControl$3, Select as Select$3, LinearProgress as LinearProgress$1 } from "@mui/material";
4
+ import { Accordion as Accordion$1, AccordionSummary, AccordionDetails, Typography as Typography$3, Button as Button$3, Box, CircularProgress as CircularProgress$3, Tooltip as Tooltip$2, Breadcrumbs, IconButton as IconButton$3, Popover as Popover$4, SvgIcon as SvgIcon$3, TableCell as TableCell$2, Grid as Grid$1, Paper as Paper$3, Chip as Chip$1, MenuItem as MenuItem$2, List as List$4, ListItemButton, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, ListItem as ListItem$1, Input as Input$3, TextField as TextField$3, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, RadioGroup, Radio, createTheme as createTheme$3, TableContainer, Table as Table$1, TableHead, TableRow as TableRow$1, TableBody as TableBody$1, capitalize as capitalize$2, ThemeProvider as ThemeProvider$1, InputAdornment as InputAdornment$3, Dialog as Dialog$2, DialogTitle, DialogContent as DialogContent$2, DialogActions as DialogActions$2 } from "@mui/material";
5
5
  import * as ReactDOM from "react-dom";
6
6
  import ReactDOM__default, { flushSync } from "react-dom";
7
7
  import { unstable_createGetCssVar, createSpacing as createSpacing$2, useTheme as useTheme$4, GlobalStyles as GlobalStyles$1, unstable_memoTheme, keyframes, css as css$2, styled as styled$1, alpha as alpha$2, lighten as lighten$2, darken as darken$2, decomposeColor as decomposeColor$2, recomposeColor as recomposeColor$2, getThemeProps as getThemeProps$2 } from "@mui/system";
@@ -45,7 +45,7 @@ const useOutsideClick = (ref2, callback) => {
45
45
  };
46
46
  });
47
47
  };
48
- function ExpandMoreIcon$1(props) {
48
+ function ExpandMoreIcon(props) {
49
49
  const { onClick, color: color2 = "#757575" } = props;
50
50
  return /* @__PURE__ */ jsx("div", { className: "expand-more-icon", "data-testid": "expand-more-icon", onClick, children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: color2, children: /* @__PURE__ */ jsx("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }) }) });
51
51
  }
@@ -55,7 +55,7 @@ function Accordion(props) {
55
55
  /* @__PURE__ */ jsx(
56
56
  AccordionSummary,
57
57
  {
58
- expandIcon: /* @__PURE__ */ jsx(ExpandMoreIcon$1, {}),
58
+ expandIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
59
59
  "aria-controls": ariaControls,
60
60
  id,
61
61
  children: summary()
@@ -52786,7 +52786,7 @@ function ClearButton(props) {
52786
52786
  function DeleteIcon$1({ onClick }) {
52787
52787
  return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", width: "24", height: "24", viewBox: "0 0 24 24", onClick, children: /* @__PURE__ */ jsx("path", { d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z", fill: "#607d8b" }) });
52788
52788
  }
52789
- function ErrorIcon$1() {
52789
+ function ErrorIcon() {
52790
52790
  return /* @__PURE__ */ jsx("svg", { width: "24px", height: "24px", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("g", { "data-name": "Layer 2", children: /* @__PURE__ */ jsxs("g", { "data-name": "close", children: [
52791
52791
  /* @__PURE__ */ jsx("rect", { width: "24", height: "24", transform: "rotate(180 12 12)", opacity: "0" }),
52792
52792
  /* @__PURE__ */ jsx("path", { d: "M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z" })
@@ -52794,7 +52794,7 @@ function ErrorIcon$1() {
52794
52794
  }
52795
52795
  function ErrorBlock({ text, close }) {
52796
52796
  return /* @__PURE__ */ jsxs("div", { className: "error-block", children: [
52797
- /* @__PURE__ */ jsx("div", { className: "error-block__button_close", onClick: close, children: /* @__PURE__ */ jsx(ErrorIcon$1, {}) }),
52797
+ /* @__PURE__ */ jsx("div", { className: "error-block__button_close", onClick: close, children: /* @__PURE__ */ jsx(ErrorIcon, {}) }),
52798
52798
  /* @__PURE__ */ jsx("p", { className: "error-block__text", children: text })
52799
52799
  ] });
52800
52800
  }
@@ -59027,24 +59027,12 @@ function CellWithTwoLineClamping(props) {
59027
59027
  };
59028
59028
  return /* @__PURE__ */ jsx(Cell, { className, style: { maxWidth: maxWidth2 }, align: props.align || "left", onClick, children: /* @__PURE__ */ jsx(LightTooltip, { title: content, placement: "top-start", disableHoverListener: !showTooltip, children: /* @__PURE__ */ jsx("div", { ref: contentRef, className: "mui-table__cell-clamp-two-line", children: content }) }) });
59029
59029
  }
59030
- const CheckIcon$1 = createSvgIcon(/* @__PURE__ */ jsx("path", {
59031
- d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
59032
- }));
59033
59030
  const Clear = createSvgIcon(/* @__PURE__ */ jsx("path", {
59034
59031
  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
59032
  }));
59036
59033
  const DeleteIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59037
59034
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
59038
59035
  }));
59039
- const ErrorIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59040
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"
59041
- }));
59042
- const ExpandMoreIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59043
- d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
59044
- }));
59045
- const ForwardIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59046
- d: "M12 8V4l8 8-8 8v-4H4V8z"
59047
- }));
59048
59036
  const GroupIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59049
59037
  d: "M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"
59050
59038
  }));
@@ -59062,7 +59050,7 @@ const WarningIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59062
59050
  }));
59063
59051
  function DatabaseSettingsCard(props) {
59064
59052
  const { title, label, isDefault, children, size = "sm", error } = props;
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: [
59053
+ 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: [
59066
59054
  /* @__PURE__ */ jsxs(Grid$1, { container: true, alignItems: "center", justifyContent: "space-between", wrap: "nowrap", className: "database-settings-card__head", children: [
59067
59055
  /* @__PURE__ */ jsxs(Grid$1, { container: true, alignItems: "center", children: [
59068
59056
  /* @__PURE__ */ jsx(StorageRounded, { color: "secondary", fontSize: "large" }),
@@ -59196,8 +59184,7 @@ function ListItem(props) {
59196
59184
  return /* @__PURE__ */ jsx(ListItem$1, { secondaryAction: /* @__PURE__ */ jsx(DeleteIconButton, { onClick: deleteItem }), children: /* @__PURE__ */ jsx(ListItemText$1, { primary: renderContent() }) });
59197
59185
  }
59198
59186
  function ListPanel(props) {
59199
- const services = useContext(ServicesContext);
59200
- const { items, setItems, disabled, validate: validate2, className, errorMessage } = props;
59187
+ const { items, setItems, disabled, validate: validate2, className, errorMessage, services } = props;
59201
59188
  const [value, setValue] = useState("");
59202
59189
  const addItem = async () => {
59203
59190
  const isValid2 = await validate2?.(value) ?? true;
@@ -76677,16 +76664,6 @@ function NumberComponent(props) {
76677
76664
  errorMessage && /* @__PURE__ */ jsx(ErrorMessage, { message: errorMessage })
76678
76665
  ] });
76679
76666
  }
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
- }
76690
76667
  class EditorFactory {
76691
76668
  constructor() {
76692
76669
  this.editorMap = {};
@@ -82254,36 +82231,10 @@ function List$1(props) {
82254
82231
  defaultValue: value
82255
82232
  });
82256
82233
  return /* @__PURE__ */ jsxs(EditorContainer, { isChanged: isDirty, resetValue: () => resetField(fieldName, { defaultValue: value }), ...props, children: [
82257
- /* @__PURE__ */ jsx(ListPanel, { className: "list__list-panel", items: field.value, setItems: field.onChange }),
82234
+ /* @__PURE__ */ jsx(ListPanel, { className: "list__list-panel", items: field.value, setItems: field.onChange, services }),
82258
82235
  error && /* @__PURE__ */ jsx(ErrorMessage, { message: services.resources.Dialog_ValidationRequired })
82259
82236
  ] });
82260
82237
  }
82261
- function UserGroups(props) {
82262
- const { required, id: fieldName, value } = props;
82263
- const { control, resetField } = useCustomFormContext();
82264
- const [selectedGroup, setSelectedGroup] = useState(value ? Object.keys(value)[0] : null);
82265
- const {
82266
- field,
82267
- fieldState: { isDirty }
82268
- } = useController({
82269
- name: fieldName,
82270
- control,
82271
- rules: { required },
82272
- defaultValue: value
82273
- });
82274
- return /* @__PURE__ */ jsx(EditorContainer, { isChanged: isDirty, resetValue: () => resetField(fieldName, { defaultValue: value }), ...props, children: field.value && /* @__PURE__ */ jsxs("div", { className: "user-groups", children: [
82275
- /* @__PURE__ */ jsx(GroupPanel, { groups: field.value, selectedGroup, selectGroup: setSelectedGroup }),
82276
- /* @__PURE__ */ jsx(ForwardIcon, { fontSize: "large", className: "user-groups__forward-icon" }),
82277
- /* @__PURE__ */ jsx(
82278
- ListPanel,
82279
- {
82280
- items: field.value[selectedGroup],
82281
- setItems: (items) => field.onChange({ ...field.value, [selectedGroup]: items })
82282
- },
82283
- selectedGroup
82284
- )
82285
- ] }) });
82286
- }
82287
82238
  const commonMuiProps = {
82288
82239
  select: {
82289
82240
  displayEmpty: true,
@@ -82576,724 +82527,6 @@ function LdapCatalogs(props) {
82576
82527
  /* @__PURE__ */ jsx("div", { className: "ldap-catalogs__button-panel", children: /* @__PURE__ */ jsx(Button$3, { variant: "contained", size: "small", color: "secondary", onClick: (e2) => goToLdapCatalogPage(e2, "", resources.NewCatalog), children: resources.NewCatalog }) })
82577
82528
  ] });
82578
82529
  }
82579
- const DATE_FORMAT = "LL";
82580
- const CREATION_DATE_STRING_KEY = "creationDate";
82581
- const EXPIRATION_DATE_STRING_KEY = "expirationDate";
82582
- const EMPTY_OPTION_VALUE = "—";
82583
- function LicenseOptions(props) {
82584
- const { features, activationResultText, creationDate, customerName, name, serialNumber, expirationDate } = props.value ?? {};
82585
- const gridValues = { name, customerName, creationDate, expirationDate, serialNumber };
82586
- const services = useContext(ServicesContext);
82587
- if (!props.value) {
82588
- return /* @__PURE__ */ jsx(EditorContainer, { isChanged: false, resetValue: () => {
82589
- }, ...props, children: /* @__PURE__ */ jsx("p", { className: "license-options__text", children: services.resources.NoLicenseKeyInformation }) });
82590
- }
82591
- const featuresList = Object.values(features);
82592
- const getOptionDisplayValue = (key, value) => {
82593
- switch (key) {
82594
- case CREATION_DATE_STRING_KEY:
82595
- return formatDateToString(new Date(value), DATE_FORMAT);
82596
- case EXPIRATION_DATE_STRING_KEY:
82597
- return value ? formatDateToString(new Date(value), DATE_FORMAT) : EMPTY_OPTION_VALUE;
82598
- default:
82599
- return value;
82600
- }
82601
- };
82602
- return /* @__PURE__ */ jsxs(EditorContainer, { isChanged: false, resetValue: () => {
82603
- }, ...props, children: [
82604
- /* @__PURE__ */ jsx("div", { className: "license-options__grid", children: Object.entries(gridValues).map(([key, value]) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
82605
- /* @__PURE__ */ jsxs("p", { className: "license-options__text", children: [
82606
- services.resources[capitalize$2(key)],
82607
- ":"
82608
- ] }),
82609
- /* @__PURE__ */ jsx("p", { className: "license-options__text", children: getOptionDisplayValue(key, value) })
82610
- ] }, key)) }),
82611
- /* @__PURE__ */ jsx("p", { className: "license-options__text license-options__text_bold", children: activationResultText }),
82612
- !!featuresList.length && /* @__PURE__ */ jsxs("div", { className: "license-options__additional", children: [
82613
- /* @__PURE__ */ jsxs("p", { className: "license-options__text", children: [
82614
- services.resources.AdditionalOptions,
82615
- ":"
82616
- ] }),
82617
- /* @__PURE__ */ jsx("ul", { className: "license-options__options", children: featuresList.map((feature) => /* @__PURE__ */ jsxs("li", { className: "license-options__option", children: [
82618
- /* @__PURE__ */ jsx("p", { className: "license-options__text", children: feature.name }),
82619
- feature.restriction?.allowedConnections && /* @__PURE__ */ jsxs("p", { className: "license-options__text license-options__text_shifted", children: [
82620
- services.resources.MaximumNumberOfConnections,
82621
- ": ",
82622
- feature.restriction.allowedConnections
82623
- ] })
82624
- ] }, feature.id)) })
82625
- ] })
82626
- ] });
82627
- }
82628
- const VALIDATION_REGEXP = /\S+?\\\S+/gm;
82629
- function PersonalLicenses(props) {
82630
- const { required, id: fieldName, value } = props;
82631
- const { resources } = useContext(ServicesContext);
82632
- const { resetField, control } = useCustomFormContext();
82633
- const [error, setError] = React__default.useState("");
82634
- const {
82635
- field,
82636
- fieldState: { isDirty }
82637
- } = useController({
82638
- name: fieldName,
82639
- control,
82640
- rules: { required },
82641
- defaultValue: value
82642
- });
82643
- function handleReset() {
82644
- resetField(fieldName, { defaultValue: value });
82645
- }
82646
- function handleChange(users) {
82647
- field.onChange({ ...field.value, users });
82648
- }
82649
- async function validate2(username) {
82650
- if (!username.match(VALIDATION_REGEXP)) {
82651
- setError(resources.AccountNameFormatError);
82652
- return false;
82653
- }
82654
- if (field.value.users.some((user) => user === username)) {
82655
- setError(resources.UniqueUsernameError);
82656
- return false;
82657
- }
82658
- setError("");
82659
- return true;
82660
- }
82661
- const isDisabled = field.value.users?.length >= field.value.maxCount;
82662
- if (!props.value.users) {
82663
- return /* @__PURE__ */ jsx(EditorContainer, { isChanged: false, resetValue: () => {
82664
- }, ...props, children: /* @__PURE__ */ jsx("p", { className: "personal-licenses__text", children: resources.NoPersonalLicensesInformation }) });
82665
- }
82666
- return /* @__PURE__ */ jsxs(EditorContainer, { resetValue: handleReset, isChanged: isDirty, ...props, children: [
82667
- /* @__PURE__ */ jsx(
82668
- ListPanel,
82669
- {
82670
- className: "personal-licenses__container",
82671
- items: field.value.users,
82672
- setItems: handleChange,
82673
- validate: validate2,
82674
- disabled: isDisabled,
82675
- errorMessage: error
82676
- }
82677
- ),
82678
- /* @__PURE__ */ jsx("p", { className: "personal-licenses__footer", children: formatString$1(resources.PersonalLicensesCount, field.value.users.length, field.value.maxCount) })
82679
- ] });
82680
- }
82681
- var IDatabaseMasterState = /* @__PURE__ */ ((IDatabaseMasterState2) => {
82682
- IDatabaseMasterState2[IDatabaseMasterState2["Preparing"] = 0] = "Preparing";
82683
- IDatabaseMasterState2[IDatabaseMasterState2["DatabaseInProcess"] = 1] = "DatabaseInProcess";
82684
- IDatabaseMasterState2[IDatabaseMasterState2["DatabaseProcessFinished"] = 2] = "DatabaseProcessFinished";
82685
- IDatabaseMasterState2[IDatabaseMasterState2["SolutionInProcess"] = 3] = "SolutionInProcess";
82686
- IDatabaseMasterState2[IDatabaseMasterState2["SolutionProcessFinished"] = 4] = "SolutionProcessFinished";
82687
- return IDatabaseMasterState2;
82688
- })(IDatabaseMasterState || {});
82689
- var ServerType = /* @__PURE__ */ ((ServerType2) => {
82690
- ServerType2[ServerType2["PostgreSQL"] = 0] = "PostgreSQL";
82691
- ServerType2[ServerType2["MS SQL SERVER"] = 1] = "MS SQL SERVER";
82692
- return ServerType2;
82693
- })(ServerType || {});
82694
- var TableLocationType = /* @__PURE__ */ ((TableLocationType2) => {
82695
- TableLocationType2[TableLocationType2["UseDefaultOrCurrent"] = 0] = "UseDefaultOrCurrent";
82696
- TableLocationType2[TableLocationType2["UseOwnDatabase"] = 1] = "UseOwnDatabase";
82697
- TableLocationType2[TableLocationType2["UseOuterDatabase"] = 2] = "UseOuterDatabase";
82698
- TableLocationType2[TableLocationType2["UseTemporaryDatabase"] = 3] = "UseTemporaryDatabase";
82699
- return TableLocationType2;
82700
- })(TableLocationType || {});
82701
- var TableLocationTypeExtended = /* @__PURE__ */ ((TableLocationTypeExtended2) => {
82702
- TableLocationTypeExtended2[TableLocationTypeExtended2["UseDefaultOrCurrent"] = 0] = "UseDefaultOrCurrent";
82703
- TableLocationTypeExtended2[TableLocationTypeExtended2["UseOwnDatabase"] = 1] = "UseOwnDatabase";
82704
- TableLocationTypeExtended2[TableLocationTypeExtended2["UseOuterDatabase"] = 2] = "UseOuterDatabase";
82705
- TableLocationTypeExtended2[TableLocationTypeExtended2["UseTemporaryDatabase"] = 3] = "UseTemporaryDatabase";
82706
- TableLocationTypeExtended2[TableLocationTypeExtended2["InMemoryTableOwnDatabase"] = 4] = "InMemoryTableOwnDatabase";
82707
- TableLocationTypeExtended2[TableLocationTypeExtended2["InMemoryTableOwnDatabaseNotPersistData"] = 5] = "InMemoryTableOwnDatabaseNotPersistData";
82708
- return TableLocationTypeExtended2;
82709
- })(TableLocationTypeExtended || {});
82710
- var DatabaseWizardMode = /* @__PURE__ */ ((DatabaseWizardMode2) => {
82711
- DatabaseWizardMode2[DatabaseWizardMode2["Create"] = 0] = "Create";
82712
- DatabaseWizardMode2[DatabaseWizardMode2["Add"] = 1] = "Add";
82713
- DatabaseWizardMode2[DatabaseWizardMode2["Update"] = 2] = "Update";
82714
- return DatabaseWizardMode2;
82715
- })(DatabaseWizardMode || {});
82716
- class DatabaseSettingsPanelLogic extends ComponentLogic {
82717
- constructor() {
82718
- super(...arguments);
82719
- this.domain = y("DatabaseSettingsPanelLogic");
82720
- this.componentDidMount = this.domain.event("componentDidMount");
82721
- this.loadDatabases = this.domain.event("loadDatabases");
82722
- this.loadDatabasesFx = this.domain.effect("loadDatabasesFx");
82723
- this.getDatabasesInfoFx = this.domain.effect("getDatabasesInfoFx");
82724
- this.setDefaultDatabase = this.domain.event("setDefaultDatabase");
82725
- this.deleteDatabase = this.domain.event("deleteDatabase");
82726
- this.confirmDeleting = this.domain.event("confirmDeleting");
82727
- this.confirmPageSaving = this.domain.event("confirmDeleting");
82728
- this.confirmDeletingFx = this.domain.effect("confirmDeletingFx");
82729
- this.confirmPageSavingFx = this.domain.effect("confirmPageSavingFx");
82730
- this.openCreateWizard = this.domain.event("openCreateWizard");
82731
- this.openUpdateWizard = this.domain.event("openUpdateWizard");
82732
- this.openConnectWizard = this.domain.event("openConnectWizard");
82733
- this.openCreateWizardFx = this.domain.effect("openCreateWizardFx");
82734
- this.openUpdateWizardFx = this.domain.effect("openUpdateWizardFx");
82735
- this.openConnectWizardFx = this.domain.effect("openConnectWizardFx");
82736
- }
82737
- initStores() {
82738
- this.$loaded = this.domain.createStore(false, { name: "$loaded" });
82739
- const serviceId = location.href.match(new RegExp(new RegExp("(?<=\\/)\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}(?=\\/)"), "g"))?.[0] || null;
82740
- this.$serviceId = this.domain.createStore(serviceId, { name: "$serviceId" });
82741
- }
82742
- initDataLoading() {
82743
- if (!this.options) {
82744
- return;
82745
- }
82746
- this.getDatabasesInfoFx.use(async () => {
82747
- return await this.options.services.databasesController.info(this.$serviceId.getState());
82748
- });
82749
- this.loadDatabasesFx.use(async () => {
82750
- return await this.options.services.databasesConfigurationController.all(this.$serviceId.getState());
82751
- });
82752
- this.confirmDeletingFx.use(async (alias) => {
82753
- await this.options.services.messageWindow.showConfirmation(
82754
- this.options.services.resources.DeleteDatabaseConfirmation
82755
- );
82756
- return alias;
82757
- });
82758
- this.confirmPageSavingFx.use(async ({ mode, pageWasChanged, data }) => {
82759
- if (pageWasChanged) {
82760
- await this.options.services.messageWindow.showConfirmation(
82761
- this.options.services.resources.SavePageForDatabaseConfirmation
82762
- );
82763
- await this.options.services.formControl.onSubmit({ confirm: false });
82764
- if (this.options.services.formControl.isDirty) return;
82765
- }
82766
- switch (mode) {
82767
- case DatabaseWizardMode.Create:
82768
- this.openCreateWizard();
82769
- break;
82770
- case DatabaseWizardMode.Update:
82771
- this.openUpdateWizard(data.alias);
82772
- break;
82773
- case DatabaseWizardMode.Add:
82774
- this.openConnectWizard();
82775
- break;
82776
- }
82777
- });
82778
- const infoLoaded = b([this.getDatabasesInfoFx.doneData, this.loadDatabasesFx.doneData]);
82779
- const infoLoadingFail = b([this.getDatabasesInfoFx.failData, this.loadDatabasesFx.failData]);
82780
- const initialLoading = [this.getDatabasesInfoFx];
82781
- ct({ from: this.componentDidMount, to: initialLoading });
82782
- ct({ from: this.loadDatabases, to: this.loadDatabasesFx });
82783
- ct({ from: this.loadDatabasesFx.doneData, to: initialLoading });
82784
- ct({ from: this.deleteDatabase, to: this.confirmDeletingFx });
82785
- ct({ from: this.confirmPageSaving, to: this.confirmPageSavingFx });
82786
- v({
82787
- clock: infoLoaded,
82788
- fn: (info) => this.options.resetField(this.options.id, { defaultValue: combineInfo(info) })
82789
- });
82790
- v({
82791
- clock: infoLoadingFail,
82792
- fn: (error) => console.log(error)
82793
- });
82794
- v({
82795
- clock: this.loadDatabases,
82796
- fn: () => false,
82797
- target: this.$loaded
82798
- });
82799
- v({
82800
- clock: this.getDatabasesInfoFx.doneData,
82801
- fn: () => true,
82802
- target: this.$loaded
82803
- });
82804
- v({
82805
- clock: this.confirmDeletingFx.doneData,
82806
- fn: (alias) => this.options.field.onChange(deleteDatabase(alias))
82807
- });
82808
- v({
82809
- clock: this.setDefaultDatabase,
82810
- fn: (defaultAlias) => this.options.field.onChange(setDefault(defaultAlias))
82811
- });
82812
- const deleteDatabase = (alias) => this.options.field.value.map(
82813
- (base) => base.alias === alias ? { ...base, deleted: true } : base
82814
- );
82815
- const setDefault = (defaultAlias) => this.options.field.value.map((base) => ({ ...base, isDefault: defaultAlias === base.alias }));
82816
- const combineInfo = (info) => info.reduce((databases, baseInfo) => {
82817
- const base = databases.find(
82818
- (base2) => base2.alias?.toLowerCase() === baseInfo.databaseAlias?.toLowerCase() || base2.alias?.toLowerCase() === baseInfo.alias?.toLowerCase()
82819
- );
82820
- if (base) {
82821
- databases = databases.map(
82822
- (storeDatabase) => storeDatabase.alias === base.alias ? { ...storeDatabase, ...baseInfo } : storeDatabase
82823
- );
82824
- } else {
82825
- databases.push(baseInfo);
82826
- }
82827
- return databases;
82828
- }, this.options.field.value);
82829
- }
82830
- initWizard() {
82831
- ct({ from: this.openCreateWizard, to: this.openCreateWizardFx });
82832
- ct({ from: this.openConnectWizard, to: this.openConnectWizardFx });
82833
- ct({ from: this.openUpdateWizard, to: this.openUpdateWizardFx });
82834
- this.openCreateWizardFx.use(async () => {
82835
- await this.options.services.databaseWizardService.openCreateMode(
82836
- this.$serviceId.getState(),
82837
- this.loadDatabases
82838
- );
82839
- });
82840
- this.openConnectWizardFx.use(async () => {
82841
- await this.options.services.databaseWizardService.openConnectMode(
82842
- this.$serviceId.getState(),
82843
- this.loadDatabases
82844
- );
82845
- });
82846
- this.openUpdateWizardFx.use(async (alias) => {
82847
- await this.options.services.databaseWizardService.openUpdateMode(
82848
- this.$serviceId.getState(),
82849
- alias
82850
- );
82851
- });
82852
- }
82853
- init() {
82854
- this.initStores();
82855
- this.initDataLoading();
82856
- this.initWizard();
82857
- }
82858
- }
82859
- function Databases(props) {
82860
- return /* @__PURE__ */ jsx(Fragment, { children: props.children });
82861
- }
82862
- var DatabaseState = /* @__PURE__ */ ((DatabaseState2) => {
82863
- DatabaseState2[DatabaseState2["Attached"] = 0] = "Attached";
82864
- DatabaseState2[DatabaseState2["Updating"] = 1] = "Updating";
82865
- DatabaseState2[DatabaseState2["Creating"] = 2] = "Creating";
82866
- DatabaseState2[DatabaseState2["Attaching"] = 3] = "Attaching";
82867
- return DatabaseState2;
82868
- })(DatabaseState || {});
82869
- var DatabaseStatusIndicator = /* @__PURE__ */ ((DatabaseStatusIndicator2) => {
82870
- DatabaseStatusIndicator2[DatabaseStatusIndicator2["Available"] = 0] = "Available";
82871
- DatabaseStatusIndicator2[DatabaseStatusIndicator2["NotAvailable"] = 1] = "NotAvailable";
82872
- DatabaseStatusIndicator2[DatabaseStatusIndicator2["Creating"] = 2] = "Creating";
82873
- DatabaseStatusIndicator2[DatabaseStatusIndicator2["Updating"] = 3] = "Updating";
82874
- DatabaseStatusIndicator2[DatabaseStatusIndicator2["Attaching"] = 4] = "Attaching";
82875
- return DatabaseStatusIndicator2;
82876
- })(DatabaseStatusIndicator || {});
82877
- var DatabaseType = /* @__PURE__ */ ((DatabaseType2) => {
82878
- DatabaseType2[DatabaseType2["Postgre"] = 0] = "Postgre";
82879
- DatabaseType2[DatabaseType2["SQL"] = 1] = "SQL";
82880
- return DatabaseType2;
82881
- })(DatabaseType || {});
82882
- function DatabaseOutlineIcon(props) {
82883
- const { size = 20, color: color2 = "hsl(205, 67%, 55%)" } = props;
82884
- return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { stroke: color2, fill: color2, d: "M20 13.09V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.46 21 12.9 21 13.33 20.94C13.12 20.33 13 19.68 13 19L13 18.95C12.68 19 12.35 19 12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.65 16 13.27 15.96 13.88 15.89C14.93 14.16 16.83 13 19 13C19.34 13 19.67 13.04 20 13.09M18 12.45C16.7 13.4 14.42 14 12 14S7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5 18 6.5 18 7 15.87 9 12 9M20.41 19L22.54 21.12L21.12 22.54L19 20.41L16.88 22.54L15.47 21.12L17.59 19L15.47 16.88L16.88 15.47L19 17.59L21.12 15.47L22.54 16.88L20.41 19" }) });
82885
- }
82886
- var ProcessState = /* @__PURE__ */ ((ProcessState2) => {
82887
- ProcessState2[ProcessState2["Running"] = 0] = "Running";
82888
- ProcessState2[ProcessState2["Finished"] = 1] = "Finished";
82889
- ProcessState2[ProcessState2["Error"] = 2] = "Error";
82890
- ProcessState2[ProcessState2["Canceled"] = 3] = "Canceled";
82891
- return ProcessState2;
82892
- })(ProcessState || {});
82893
- var ConnectionStatus = /* @__PURE__ */ ((ConnectionStatus2) => {
82894
- ConnectionStatus2[ConnectionStatus2["Unknown"] = -1] = "Unknown";
82895
- ConnectionStatus2[ConnectionStatus2["Succesfull"] = 0] = "Succesfull";
82896
- ConnectionStatus2[ConnectionStatus2["DatabaseNotExist"] = 1] = "DatabaseNotExist";
82897
- ConnectionStatus2[ConnectionStatus2["ServerNotExist"] = 2] = "ServerNotExist";
82898
- ConnectionStatus2[ConnectionStatus2["LoginFailed"] = 3] = "LoginFailed";
82899
- ConnectionStatus2[ConnectionStatus2["AuthNotSupported"] = 4] = "AuthNotSupported";
82900
- ConnectionStatus2[ConnectionStatus2["AliasAlreadyExists"] = 100] = "AliasAlreadyExists";
82901
- ConnectionStatus2[ConnectionStatus2["DatabaseAlreadyExists"] = 101] = "DatabaseAlreadyExists";
82902
- return ConnectionStatus2;
82903
- })(ConnectionStatus || {});
82904
- function DatabaseUpdateIcon(props) {
82905
- const { size = 20, color: color2 = "hsl(205, 67%, 55%)" } = props;
82906
- return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { stroke: color2, fill: color2, d: "M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z" }) });
82907
- }
82908
- function CheckIcon(props) {
82909
- const { size = 20, color: color2 = "hsl(205, 67%, 55%)", onClick } = props;
82910
- return /* @__PURE__ */ jsx("svg", { onClick, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { stroke: color2, fill: color2, d: "M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z" }) });
82911
- }
82912
- function DatabaseDefaultButton(props) {
82913
- const { isDefault, buttonText, tooltip, onClick, alias, disabled } = props;
82914
- if (isDefault) {
82915
- return /* @__PURE__ */ jsx("div", { style: { margin: "0 auto", display: "block", width: "min-content" }, children: /* @__PURE__ */ jsx(CheckIcon, {}) });
82916
- } else {
82917
- return /* @__PURE__ */ jsx(LightTooltip, { title: disabled ? "" : tooltip, placement: "top", disableFocusListener: true, disableTouchListener: true, children: /* @__PURE__ */ jsx(Button$3, { className: "databases-table-cell-button", color: "primary", disabled, onClick: (e2) => onClick(e2, alias), children: buttonText }) });
82918
- }
82919
- }
82920
- const TEXT_BUTTON_DISABLED_COLOR = "rgba(0, 0, 0, 0.26)";
82921
- function DatabaseTableButton(props) {
82922
- const { icon: Icon2, buttonText, tooltip, onClick, alias, disabled } = props;
82923
- const getIconColor = (disabled2) => {
82924
- if (disabled2) {
82925
- return TEXT_BUTTON_DISABLED_COLOR;
82926
- } else return;
82927
- };
82928
- const wrapWithTooltip = (node, tooltip2) => {
82929
- return tooltip2 ? /* @__PURE__ */ jsx(LightTooltip, { title: tooltip2, placement: "top", disableFocusListener: true, disableTouchListener: true, children: node }) : node;
82930
- };
82931
- return wrapWithTooltip(
82932
- /* @__PURE__ */ jsx(
82933
- Button$3,
82934
- {
82935
- className: "databases-table-cell-button",
82936
- color: "primary",
82937
- disabled,
82938
- startIcon: /* @__PURE__ */ jsx(Icon2, { color: getIconColor(disabled) }),
82939
- onClick,
82940
- children: buttonText
82941
- }
82942
- ),
82943
- disabled ? "" : tooltip
82944
- );
82945
- }
82946
- function DatabaseStatusPoint(props) {
82947
- const { value, resources } = props;
82948
- const status = getStatus(value, resources);
82949
- return /* @__PURE__ */ jsx(LightTooltip, { title: status.tooltip, placement: "top", disableFocusListener: true, disableTouchListener: true, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
82950
- StatusPoint,
82951
- {
82952
- className: `settings-panel__status-point_small settings-panel__status-point_no_margin ${status.className}`,
82953
- overlay: false,
82954
- active: value === DatabaseStatusIndicator.Available
82955
- }
82956
- ) }) });
82957
- }
82958
- function getStatus(statusType, resources) {
82959
- let tooltip, className;
82960
- switch (Number(statusType)) {
82961
- case DatabaseStatusIndicator.Available:
82962
- tooltip = resources.DatabaseStatusAvailable;
82963
- className = "available";
82964
- break;
82965
- case DatabaseStatusIndicator.NotAvailable:
82966
- tooltip = resources.DatabaseStatusNotAvailable;
82967
- className = "not-available";
82968
- break;
82969
- case DatabaseStatusIndicator.Creating:
82970
- tooltip = resources.DatabaseStatusCreating;
82971
- className = "progress";
82972
- break;
82973
- case DatabaseStatusIndicator.Updating:
82974
- tooltip = resources.DatabaseStatusUpdating;
82975
- className = "progress";
82976
- break;
82977
- case DatabaseStatusIndicator.Attaching:
82978
- tooltip = resources.DatabaseStatusAttaching;
82979
- className = "progress";
82980
- break;
82981
- }
82982
- return { tooltip, className };
82983
- }
82984
- const IS_DEFAULT_COLUMN_ID = "isDefault";
82985
- const UPDATE_DATABASE_COLUMN_ID = "update";
82986
- const DISCONNECT_DATABASE_COLUMN_ID = "disconnect";
82987
- const STATUS_COLUMN_ID = "status";
82988
- const BASE_VERSION_COLUMN_ID = "baseVersion";
82989
- const ALIAS_COLUMN_ID = "alias";
82990
- const SERVER_NAME_COLUMN_ID = "serverName";
82991
- const DATABASE_TYPE_COLUMN_ID = "databaseType";
82992
- const UPDATE_DATE_COLUMN_ID = "updateDate";
82993
- const FULL_TEXT_SEARCH_ENABLED_COLUMN_ID = "fullTextSearchEnabled";
82994
- const DATABASE_PAGE_NAVIGATE_COLUMN_ID = "databasePageNavigateArrow";
82995
- const CENTER_ALIGN_COLUMN_IDS = [
82996
- IS_DEFAULT_COLUMN_ID,
82997
- DISCONNECT_DATABASE_COLUMN_ID
82998
- ];
82999
- const REDIRECT_CLICK_HANDLER_COLUMN_IDS = [
83000
- BASE_VERSION_COLUMN_ID,
83001
- ALIAS_COLUMN_ID,
83002
- SERVER_NAME_COLUMN_ID,
83003
- DATABASE_TYPE_COLUMN_ID,
83004
- FULL_TEXT_SEARCH_ENABLED_COLUMN_ID,
83005
- DATABASE_PAGE_NAVIGATE_COLUMN_ID,
83006
- UPDATE_DATE_COLUMN_ID
83007
- ];
83008
- async function goToDatabasePage(alias, dataBaseType, services, parameters) {
83009
- const layoutId = dataBaseType === DatabaseType.Postgre ? parameters?.pgsqlLayoutId : parameters?.mssqlLayoutId;
83010
- if (!layoutId) return;
83011
- services.settingsNavigation.goToItemSettingsPage(layoutId, alias, alias);
83012
- }
83013
- function prepareTableData(settings, logic) {
83014
- const resources = logic.options.services.resources || {};
83015
- return {
83016
- id: "DatabaseSettingsTable",
83017
- rows: getRows(settings, logic, resources)
83018
- };
83019
- }
83020
- function getRows(settings, logic, resources) {
83021
- const rows = settings.filter((data) => !data.deleted).map((data) => ({
83022
- ...data,
83023
- status: getStatusPointComponent(data, resources),
83024
- updateDate: getDateFormatString(data.updateDate),
83025
- fullTextSearchEnabled: getBooleanDisplayName(data.fullTextSearchEnabled, resources),
83026
- databaseType: getDatabaseTypeDisplayName(data.databaseType, resources),
83027
- databaseTypeValue: data.databaseType,
83028
- isDefault: getDefaultButtonComponent(logic, data, resources),
83029
- update: getUpdateButtonComponent(logic, data, resources),
83030
- disconnect: getDisconnectButtonComponent(logic, data, resources),
83031
- databasePageNavigateArrow: getNavigateButtonComponent(logic, data)
83032
- })).map((data, index) => ({
83033
- id: index.toString(),
83034
- entityId: data.alias,
83035
- disabled: data.databaseState !== DatabaseState.Attached,
83036
- available: data.connectionStatus?.status === ConnectionStatus.Succesfull,
83037
- databaseType: data.databaseTypeValue,
83038
- cells: getDatabaseSettingsColumns(resources).map((column) => ({
83039
- columnId: column.id,
83040
- value: data[column.id]
83041
- }))
83042
- }));
83043
- return rows;
83044
- }
83045
- function getBooleanDisplayName(value, resources) {
83046
- if (value === void 0) return;
83047
- return value ? resources.Yes : resources.No;
83048
- }
83049
- function getDateFormatString(date) {
83050
- return date ? hooks(date).format("DD.MM.YYYY") : void 0;
83051
- }
83052
- function getDatabaseTypeDisplayName(value, resources) {
83053
- if (value === void 0) return;
83054
- switch (value) {
83055
- case DatabaseType.Postgre:
83056
- return resources.PostgreDatabaseType;
83057
- case DatabaseType.SQL:
83058
- return resources.SQLDatabaseType;
83059
- default:
83060
- return "";
83061
- }
83062
- }
83063
- function getDefaultButtonComponent(logic, data, resources) {
83064
- return /* @__PURE__ */ jsx(
83065
- DatabaseDefaultButton,
83066
- {
83067
- isDefault: data.isDefault,
83068
- onClick: (e2, alias) => {
83069
- e2.stopPropagation();
83070
- logic?.setDefaultDatabase(alias);
83071
- },
83072
- disabled: data.databaseState !== DatabaseState.Attached || data.connectionStatus?.status !== ConnectionStatus.Succesfull,
83073
- buttonText: resources.Set,
83074
- tooltip: resources.SetDefaultDatabaseButtonTitle,
83075
- alias: data.alias
83076
- }
83077
- );
83078
- }
83079
- function getUpdateButtonComponent(logic, data, resources) {
83080
- return /* @__PURE__ */ jsx(
83081
- DatabaseTableButton,
83082
- {
83083
- alias: data.alias,
83084
- disabled: data.databaseState !== DatabaseState.Attached || data.connectionStatus?.status !== ConnectionStatus.Succesfull,
83085
- tooltip: "",
83086
- onClick: (e2) => {
83087
- e2.stopPropagation();
83088
- logic.confirmPageSaving({
83089
- mode: DatabaseWizardMode.Update,
83090
- pageWasChanged: logic.options.services.formControl.isDirty,
83091
- data: { alias: data.alias }
83092
- });
83093
- },
83094
- buttonText: resources.Update,
83095
- icon: DatabaseUpdateIcon
83096
- }
83097
- );
83098
- }
83099
- function getDisconnectButtonComponent(logic, data, resources) {
83100
- return /* @__PURE__ */ jsx(
83101
- DatabaseTableButton,
83102
- {
83103
- disabled: data.isDefault || data.databaseState !== DatabaseState.Attached,
83104
- tooltip: resources.DeleteDatabaseButtonTitle,
83105
- alias: data.alias,
83106
- onClick: (e2) => {
83107
- e2.stopPropagation();
83108
- logic?.deleteDatabase(data.alias);
83109
- },
83110
- buttonText: resources.Disconnect,
83111
- icon: DatabaseOutlineIcon
83112
- }
83113
- );
83114
- }
83115
- function getStatusPointComponent(data, resources) {
83116
- const value = getDatabaseStatusValue({
83117
- state: data.databaseState,
83118
- connectionStatus: data.connectionStatus?.status
83119
- });
83120
- if (value === void 0) return;
83121
- return /* @__PURE__ */ jsx(DatabaseStatusPoint, { value, resources });
83122
- }
83123
- function getDatabaseStatusValue(data) {
83124
- if (!data) return;
83125
- const { state, connectionStatus } = data;
83126
- if (state === DatabaseState.Attached && connectionStatus === void 0) return;
83127
- if (state === DatabaseState.Attached && connectionStatus === ConnectionStatus.Succesfull) {
83128
- return DatabaseStatusIndicator.Available;
83129
- } else if (state === DatabaseState.Attached && connectionStatus !== ConnectionStatus.Succesfull) {
83130
- return DatabaseStatusIndicator.NotAvailable;
83131
- } else if (state === DatabaseState.Creating) {
83132
- return DatabaseStatusIndicator.Creating;
83133
- } else if (state === DatabaseState.Updating) {
83134
- return DatabaseStatusIndicator.Updating;
83135
- } else if (state === DatabaseState.Attaching) {
83136
- return DatabaseStatusIndicator.Attaching;
83137
- }
83138
- }
83139
- function getNavigateButtonComponent(logic, data, resources) {
83140
- return /* @__PURE__ */ jsx(
83141
- ArrowIconButton,
83142
- {
83143
- onClick: (e2) => {
83144
- e2.stopPropagation();
83145
- goToDatabasePage(data.alias, data.databaseType, logic.options.services, logic.options.parameters);
83146
- },
83147
- disabled: data.databaseState !== DatabaseState.Attached || data.connectionStatus?.status !== ConnectionStatus.Succesfull
83148
- }
83149
- );
83150
- }
83151
- function getDatabaseSettingsColumns(resources = {}) {
83152
- return [
83153
- {
83154
- id: STATUS_COLUMN_ID,
83155
- name: ""
83156
- },
83157
- {
83158
- id: ALIAS_COLUMN_ID,
83159
- name: resources.Alias
83160
- },
83161
- {
83162
- id: SERVER_NAME_COLUMN_ID,
83163
- name: resources.DatabaseSettingsPanel_ServerName
83164
- },
83165
- {
83166
- id: DATABASE_TYPE_COLUMN_ID,
83167
- name: resources.ServerType
83168
- },
83169
- {
83170
- id: FULL_TEXT_SEARCH_ENABLED_COLUMN_ID,
83171
- name: resources.FullTextSearchEnabled
83172
- },
83173
- {
83174
- id: BASE_VERSION_COLUMN_ID,
83175
- name: firstLetterToUppercase(resources.Version)
83176
- },
83177
- {
83178
- id: UPDATE_DATE_COLUMN_ID,
83179
- name: resources.DateOfUpdate
83180
- },
83181
- {
83182
- id: IS_DEFAULT_COLUMN_ID,
83183
- name: resources.Default
83184
- },
83185
- {
83186
- id: UPDATE_DATABASE_COLUMN_ID,
83187
- name: ""
83188
- },
83189
- {
83190
- id: DISCONNECT_DATABASE_COLUMN_ID,
83191
- name: ""
83192
- },
83193
- {
83194
- id: DATABASE_PAGE_NAVIGATE_COLUMN_ID,
83195
- name: ""
83196
- }
83197
- ];
83198
- }
83199
- function SettingsPageButtonPanel(props) {
83200
- const { buttons, ...rest } = props;
83201
- return /* @__PURE__ */ jsx("div", { className: "settings-page__button-panel", ...rest, children: buttons.map(
83202
- (buttonProps) => /* @__PURE__ */ jsx(
83203
- Button$3,
83204
- {
83205
- onClick: buttonProps.onClick,
83206
- variant: "contained",
83207
- size: "small",
83208
- color: "secondary",
83209
- children: buttonProps.value
83210
- },
83211
- buttonProps.value?.toString()
83212
- )
83213
- ) });
83214
- }
83215
- function DatabaseSettingsPanel(props) {
83216
- props = { ...props, services: useContext(ServicesContext) };
83217
- const { resetField, control } = useCustomFormContext();
83218
- const { field, fieldState } = useController({
83219
- name: props.id,
83220
- control,
83221
- defaultValue: props.value || []
83222
- });
83223
- const logic = useLogic({ ...props, resetField, field }, DatabaseSettingsPanelLogic);
83224
- const resources = props.services.resources || {};
83225
- const $loaded = e(logic.$loaded);
83226
- useEffect(() => {
83227
- logic.componentDidMount();
83228
- }, [logic]);
83229
- return /* @__PURE__ */ jsx(
83230
- EditorContainer,
83231
- {
83232
- resetValue: () => {
83233
- resetField(props.id);
83234
- },
83235
- isChanged: fieldState.isDirty,
83236
- ...props,
83237
- children: /* @__PURE__ */ jsxs(Databases, { ...field, value: field.value, children: [
83238
- /* @__PURE__ */ jsx(TableContainer, { component: Paper$3, children: /* @__PURE__ */ jsxs(Table$1, { size: "small", "aria-label": "database-settings-panel", children: [
83239
- /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow$1, { children: getDatabaseSettingsColumns(props.services.resources).map((column) => /* @__PURE__ */ jsx(
83240
- TableCell$2,
83241
- {
83242
- className: "databases-header-cell",
83243
- align: column.id === IS_DEFAULT_COLUMN_ID ? "center" : "left",
83244
- children: column.name
83245
- },
83246
- column.id
83247
- )) }) }),
83248
- /* @__PURE__ */ jsx(TableBody$1, { children: prepareTableData(field.value, logic).rows.map((row) => /* @__PURE__ */ jsx(
83249
- TableRow$1,
83250
- {
83251
- className: "databases-table-row" + classIf(row.disabled, "disabled") + classIfElse(row.available, "available", "not-available"),
83252
- selected: field.value.find((d2) => d2.isDefault)?.alias === row.entityId,
83253
- children: row.cells.map(
83254
- (cell) => cell.value === void 0 && !$loaded ? /* @__PURE__ */ jsx(TableCell$2, { className: "databases-loading-table-cell", children: /* @__PURE__ */ jsx(CellPreloader, {}) }, `${row.entityId}_${cell.columnId}`) : /* @__PURE__ */ jsx(
83255
- CellWithTwoLineClamping,
83256
- {
83257
- className: "databases-clamping-table-cell" + classIfElse(
83258
- REDIRECT_CLICK_HANDLER_COLUMN_IDS.includes(cell.columnId) && !row.disabled && row.available,
83259
- "clickable",
83260
- "not-clickable"
83261
- ),
83262
- maxWidth: 150,
83263
- content: cell.value,
83264
- align: CENTER_ALIGN_COLUMN_IDS.includes(cell.columnId) ? "center" : "left",
83265
- onClick: () => REDIRECT_CLICK_HANDLER_COLUMN_IDS.includes(cell.columnId) && !row.disabled && row.available && goToDatabasePage(row.entityId, row.databaseType, props.services, props.parameters),
83266
- component: TableCell$2
83267
- },
83268
- `${row.entityId}_${cell.columnId}`
83269
- )
83270
- )
83271
- },
83272
- row.entityId
83273
- )) })
83274
- ] }) }),
83275
- /* @__PURE__ */ jsx(SettingsPageButtonPanel, { buttons: [
83276
- {
83277
- key: "create",
83278
- value: resources.Create,
83279
- onClick: () => logic.confirmPageSaving({
83280
- mode: DatabaseWizardMode.Create,
83281
- pageWasChanged: props.services.formControl.isDirty
83282
- })
83283
- },
83284
- {
83285
- key: "connect",
83286
- value: resources.Connect,
83287
- onClick: () => logic.confirmPageSaving({
83288
- mode: DatabaseWizardMode.Add,
83289
- pageWasChanged: props.services.formControl.isDirty
83290
- })
83291
- }
83292
- ] })
83293
- ] })
83294
- }
83295
- );
83296
- }
83297
82530
  function ReadonlyEditor(props) {
83298
82531
  const { id, value, options } = props;
83299
82532
  const { resources } = React__default.useContext(ServicesContext);
@@ -83331,116 +82564,6 @@ function AdvancedSettings(props) {
83331
82564
  };
83332
82565
  return /* @__PURE__ */ jsx("div", { className: "advanced-settings", children: /* @__PURE__ */ jsx(Button$3, { name: id, variant: "contained", size: "small", color: "secondary", hidden, onClick: goToConfigurationPage, children: label }) });
83333
82566
  }
83334
- function OpenIdCatalogs(props) {
83335
- const { value, id: fieldName, extendedLayoutId } = props;
83336
- const services = useContext(ServicesContext);
83337
- const { resources, settingsNavigation, messageWindow } = services;
83338
- const { resetField, control } = useCustomFormContext();
83339
- const {
83340
- field,
83341
- fieldState: { isDirty },
83342
- formState: { dirtyFields }
83343
- } = useController({
83344
- name: fieldName,
83345
- control,
83346
- defaultValue: value
83347
- });
83348
- const columns = [resources.ExtensionName, resources.ExtensionId, "", ""];
83349
- const goToOpenIdCatalogPage = async (e2, id, label) => {
83350
- e2.stopPropagation();
83351
- if (!id) {
83352
- id = generateGuid().toLowerCase();
83353
- }
83354
- settingsNavigation.goToItemSettingsPage(extendedLayoutId, id, label);
83355
- };
83356
- const deleteRow = async (e2, id) => {
83357
- e2.stopPropagation();
83358
- await messageWindow.showConfirmation(resources.DeletionConfirmation);
83359
- field.onChange(field.value.filter((element) => element.itemId !== id));
83360
- };
83361
- return /* @__PURE__ */ jsxs(EditorContainer, { isChanged: isDirty, resetValue: () => resetField(fieldName, { defaultValue: value }), ...props, children: [
83362
- /* @__PURE__ */ jsx(TableContainer, { component: Paper$3, children: /* @__PURE__ */ jsxs(Table$1, { size: "small", children: [
83363
- /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow$1, { children: columns.map((column) => /* @__PURE__ */ jsx(TableCell$2, { children: column }, column)) }) }),
83364
- /* @__PURE__ */ jsx(TableBody$1, { children: field.value && field.value.map((row) => /* @__PURE__ */ jsxs(
83365
- TableRow$1,
83366
- {
83367
- hover: true,
83368
- onClick: (e2) => goToOpenIdCatalogPage(e2, row.itemId, row.configuration.name),
83369
- className: "open-id-catalogs__row",
83370
- children: [
83371
- /* @__PURE__ */ jsx(CellWithFixedWidth, { content: row.configuration.name, maxWidth: 230 }),
83372
- /* @__PURE__ */ jsx(CellWithFixedWidth, { content: row.configuration.id, maxWidth: 230 }),
83373
- /* @__PURE__ */ jsx(TableCell$2, { children: /* @__PURE__ */ jsx(DeleteIconButton, { onClick: (e2) => deleteRow(e2, row.itemId) }) }),
83374
- /* @__PURE__ */ jsx(TableCell$2, { children: /* @__PURE__ */ jsx(ArrowIconButton, { onClick: (e2) => goToOpenIdCatalogPage(e2, row.itemId, row.configuration.name) }) })
83375
- ]
83376
- },
83377
- row.itemId
83378
- )) })
83379
- ] }) }),
83380
- /* @__PURE__ */ jsx("div", { className: "open-id-catalogs__button-panel", children: /* @__PURE__ */ jsx(Button$3, { variant: "contained", size: "small", color: "secondary", onClick: (e2) => goToOpenIdCatalogPage(e2, "", resources.NewExtension), children: resources.AddExtension }) })
83381
- ] });
83382
- }
83383
- function TenantsOpenIdSettings(props) {
83384
- const { required, id: fieldName, value } = props;
83385
- const { resources } = React__default.useContext(ServicesContext);
83386
- const { control, resetField } = useCustomFormContext();
83387
- const {
83388
- field,
83389
- fieldState: { isDirty }
83390
- } = useController({
83391
- name: fieldName,
83392
- control,
83393
- rules: { required },
83394
- defaultValue: value
83395
- });
83396
- const handleCheck = (name, extensionName) => (_2, checked) => {
83397
- const newValue = field.value.map((value2) => {
83398
- if (value2.databaseAlias !== name) return value2;
83399
- return { ...value2, extensions: value2.extensions.map((extension) => {
83400
- if (extension.extensionName !== extensionName) return extension;
83401
- return { ...extension, enable: checked };
83402
- }) };
83403
- });
83404
- field.onChange(newValue);
83405
- };
83406
- const handleReset = () => {
83407
- resetField(fieldName, { defaultValue: value });
83408
- };
83409
- return /* @__PURE__ */ jsx(EditorContainer, { isChanged: isDirty, resetValue: handleReset, ...props, children: /* @__PURE__ */ jsx(Grid$1, { container: true, spacing: 2, children: field.value?.map((value2) => /* @__PURE__ */ jsx(
83410
- DatabaseSettingsCard,
83411
- {
83412
- title: value2.databaseAlias,
83413
- label: resources.DefaultDatabase,
83414
- isDefault: value2.isDefaultDatabase,
83415
- children: /* @__PURE__ */ jsxs(Table$1, { children: [
83416
- /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow$1, { children: /* @__PURE__ */ jsx(TableCell$2, { children: /* @__PURE__ */ jsx("p", { className: "tenants-open-id-settings__database-extensions", children: resources.AvailableExtensions }) }) }) }),
83417
- /* @__PURE__ */ jsx(TableBody$1, { children: value2.extensions?.map((extension) => /* @__PURE__ */ jsx(TableRow$1, { children: /* @__PURE__ */ jsxs(TableCell$2, { padding: "normal", children: [
83418
- /* @__PURE__ */ jsx(
83419
- Checkbox$1,
83420
- {
83421
- id: value2.databaseAlias + "-" + extension.extensionId,
83422
- color: "primary",
83423
- size: "medium",
83424
- name: value2.databaseAlias + "-" + extension.extensionName,
83425
- checked: extension.enable,
83426
- "data-testid": value2.databaseAlias + "-" + extension.extensionId,
83427
- onChange: handleCheck(value2.databaseAlias, extension.extensionName)
83428
- }
83429
- ),
83430
- /* @__PURE__ */ jsx(
83431
- "label",
83432
- {
83433
- className: "tenants-open-id-settings__extension-label",
83434
- htmlFor: value2.databaseAlias + "-" + extension.extensionId,
83435
- children: extension.extensionName
83436
- }
83437
- )
83438
- ] }) }, value2.databaseAlias + "-" + extension.extensionId)) })
83439
- ] })
83440
- },
83441
- value2.databaseAlias
83442
- )) }) });
83443
- }
83444
82567
  function MailList(props) {
83445
82568
  const { required, id: fieldName, value, label } = props;
83446
82569
  const services = React__default.useContext(ServicesContext);
@@ -83533,6 +82656,22 @@ function ServerAppList(props) {
83533
82656
  error && /* @__PURE__ */ jsx(ErrorMessage, { message: error.message })
83534
82657
  ] });
83535
82658
  }
82659
+ var TableLocationType = /* @__PURE__ */ ((TableLocationType2) => {
82660
+ TableLocationType2[TableLocationType2["UseDefaultOrCurrent"] = 0] = "UseDefaultOrCurrent";
82661
+ TableLocationType2[TableLocationType2["UseOwnDatabase"] = 1] = "UseOwnDatabase";
82662
+ TableLocationType2[TableLocationType2["UseOuterDatabase"] = 2] = "UseOuterDatabase";
82663
+ TableLocationType2[TableLocationType2["UseTemporaryDatabase"] = 3] = "UseTemporaryDatabase";
82664
+ return TableLocationType2;
82665
+ })(TableLocationType || {});
82666
+ var TableLocationTypeExtended = /* @__PURE__ */ ((TableLocationTypeExtended2) => {
82667
+ TableLocationTypeExtended2[TableLocationTypeExtended2["UseDefaultOrCurrent"] = 0] = "UseDefaultOrCurrent";
82668
+ TableLocationTypeExtended2[TableLocationTypeExtended2["UseOwnDatabase"] = 1] = "UseOwnDatabase";
82669
+ TableLocationTypeExtended2[TableLocationTypeExtended2["UseOuterDatabase"] = 2] = "UseOuterDatabase";
82670
+ TableLocationTypeExtended2[TableLocationTypeExtended2["UseTemporaryDatabase"] = 3] = "UseTemporaryDatabase";
82671
+ TableLocationTypeExtended2[TableLocationTypeExtended2["InMemoryTableOwnDatabase"] = 4] = "InMemoryTableOwnDatabase";
82672
+ TableLocationTypeExtended2[TableLocationTypeExtended2["InMemoryTableOwnDatabaseNotPersistData"] = 5] = "InMemoryTableOwnDatabaseNotPersistData";
82673
+ return TableLocationTypeExtended2;
82674
+ })(TableLocationTypeExtended || {});
83536
82675
  const databaseGenerationSettingsValueType = {
83537
82676
  searchDataBaseType: TableLocationType,
83538
82677
  changedObjectDataBaseType: TableLocationTypeExtended,
@@ -85307,16 +84446,8 @@ class ProcessTemplatesLogic extends ComponentLogic {
85307
84446
  { hasSelected: this.$hasSelectedTemplate, isPending: this.reinstallProcessTemplatesFx.pending },
85308
84447
  ({ hasSelected, isPending }) => hasSelected && !isPending
85309
84448
  );
85310
- this.inProcessChanged = this.domain.event("inProcessChanged");
85311
- this.$inProcess = this.domain.store(false, { name: "$inProcess" });
85312
84449
  }
85313
84450
  init() {
85314
- v({
85315
- clock: this.inProcessChanged,
85316
- fn: (value) => !!value,
85317
- target: this.$inProcess
85318
- });
85319
- this.inProcessChanged(!!this.options.inProcess);
85320
84451
  v({
85321
84452
  clock: this.processTemplatesLoaded,
85322
84453
  fn: () => ({ ...this.options.value, templates: this.options.value.templates.map((template) => ({ ...template, selected: false })) }),
@@ -85333,14 +84464,9 @@ class ProcessTemplatesLogic extends ComponentLogic {
85333
84464
  v({
85334
84465
  clock: this.processTemplatesReinstalled,
85335
84466
  source: this.$processTemplates,
85336
- fn: (value) => ({ value, services: this.options.services, elementId: this.options.id }),
84467
+ fn: (value) => ({ value, services: this.options.services }),
85337
84468
  target: this.reinstallProcessTemplatesFx
85338
84469
  });
85339
- v({
85340
- clock: this.reinstallProcessTemplatesFx.done,
85341
- fn: () => true,
85342
- target: this.$inProcess
85343
- });
85344
84470
  }
85345
84471
  }
85346
84472
  function handleSelectProcessTemplate(value, id) {
@@ -85353,12 +84479,11 @@ function handleSelectProcessTemplate(value, id) {
85353
84479
  };
85354
84480
  return newValue;
85355
84481
  }
85356
- async function reinstallProcessTemplates({ value, services, elementId }) {
84482
+ async function reinstallProcessTemplates({ value, services }) {
85357
84483
  const { messageWindow, resources, routingService, processTemplatesController } = services;
85358
84484
  await messageWindow.showConfirmation(resources.ConfirmTemplatesReinstall);
85359
84485
  const { data } = routingService.getLastRouteResolvedParams() || {};
85360
84486
  const serviceId = data?.serviceId;
85361
- const pageId = data?.layoutId;
85362
84487
  const templateIds = value.templates.reduce((selectedTemplatesIds, template) => {
85363
84488
  if (template.selected) {
85364
84489
  selectedTemplatesIds.push(template.id);
@@ -85366,7 +84491,9 @@ async function reinstallProcessTemplates({ value, services, elementId }) {
85366
84491
  return selectedTemplatesIds;
85367
84492
  }, []);
85368
84493
  const requestData = { timestamp: value.timestamp, templateIds };
85369
- await processTemplatesController.installProcessTemplates(serviceId, pageId, elementId, requestData);
84494
+ await processTemplatesController.installProcessTemplates(serviceId, requestData);
84495
+ await messageWindow.showConfirmation(resources.TemplatesReinstalledReloadPageConfirm);
84496
+ location.reload();
85370
84497
  }
85371
84498
  function ProcessTemplates(props) {
85372
84499
  const services = React__default.useContext(ServicesContext);
@@ -85375,9 +84502,8 @@ function ProcessTemplates(props) {
85375
84502
  const logic = useLogic(logicProps, ProcessTemplatesLogic);
85376
84503
  const processTemplatesValue = e(logic.$processTemplates);
85377
84504
  const canReinstallProcessTemplates = e(logic.$canReinstallProcessTemplates);
85378
- const inProcess = e(logic.$inProcess);
85379
84505
  const handleSelectProcessTemplate2 = (templateId) => () => logic.processTemplateSelected(templateId);
85380
- return /* @__PURE__ */ jsx(EditorContainer, { ...props, inProcess: true, isEditable: !inProcess, children: /* @__PURE__ */ jsxs(ProcessOverlay, { inProcess, message: resources.OperationInProgress, children: [
84506
+ return /* @__PURE__ */ jsxs(EditorContainer, { ...props, children: [
85381
84507
  /* @__PURE__ */ jsx(TableContainer, { component: Paper$3, className: "process-templates__table-container", children: /* @__PURE__ */ jsxs(Table$1, { className: "process-templates__table", children: [
85382
84508
  /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow$1, { children: [
85383
84509
  /* @__PURE__ */ jsx(TableCell$2, { className: "process-templates__cell_with_padding", children: resources.TemplateName }),
@@ -85408,12 +84534,12 @@ function ProcessTemplates(props) {
85408
84534
  size: "small",
85409
84535
  color: "secondary",
85410
84536
  disabled: !canReinstallProcessTemplates,
85411
- "data-testid": "reload-button",
85412
84537
  onClick: logic.processTemplatesReinstalled,
84538
+ "data-testid": "reload-button",
85413
84539
  children: resources.Reinstall
85414
84540
  }
85415
84541
  ) })
85416
- ] }) });
84542
+ ] });
85417
84543
  }
85418
84544
  function TenantsProcessShare(props) {
85419
84545
  const { required, id: fieldName, value } = props;
@@ -85525,19 +84651,13 @@ function registerEditors() {
85525
84651
  editorFactory.register("TextArea", TextArea);
85526
84652
  editorFactory.register("RadioButton", RadioButton);
85527
84653
  editorFactory.register("Password", Password);
85528
- editorFactory.register("Databases", DatabaseSettingsPanel);
85529
84654
  editorFactory.register("List", List$1);
85530
84655
  editorFactory.register("Dropdown", Dropdown);
85531
84656
  editorFactory.register("Header", Header);
85532
- editorFactory.register("UserGroups", UserGroups);
85533
84657
  editorFactory.register("Number", Number$1);
85534
84658
  editorFactory.register("LdapCatalogs", LdapCatalogs);
85535
- editorFactory.register("LicenseOptions", LicenseOptions);
85536
- editorFactory.register("PersonalLicenses", PersonalLicenses);
85537
84659
  editorFactory.register("ReadonlyEditor", ReadonlyEditor);
85538
84660
  editorFactory.register("AdvancedSettings", AdvancedSettings);
85539
- editorFactory.register("OpenIdCatalogs", OpenIdCatalogs);
85540
- editorFactory.register("TenantsOpenIdSettings", TenantsOpenIdSettings);
85541
84661
  editorFactory.register("MailList", MailList);
85542
84662
  editorFactory.register("ServerAppList", ServerAppList);
85543
84663
  editorFactory.register("DatabaseGenerationSettings", DatabaseGenerationSettings);
@@ -88089,11 +87209,6 @@ var ILongOperationCompleteStatus = /* @__PURE__ */ ((ILongOperationCompleteStatu
88089
87209
  ILongOperationCompleteStatus2[ILongOperationCompleteStatus2["Error"] = 1] = "Error";
88090
87210
  return ILongOperationCompleteStatus2;
88091
87211
  })(ILongOperationCompleteStatus || {});
88092
- var ILongOperationScope = /* @__PURE__ */ ((ILongOperationScope2) => {
88093
- ILongOperationScope2[ILongOperationScope2["Global"] = 0] = "Global";
88094
- ILongOperationScope2[ILongOperationScope2["Local"] = 1] = "Local";
88095
- return ILongOperationScope2;
88096
- })(ILongOperationScope || {});
88097
87212
  class SettingsPageLogic extends ComponentLogic {
88098
87213
  constructor() {
88099
87214
  super(...arguments);
@@ -88111,8 +87226,6 @@ class SettingsPageLogic extends ComponentLogic {
88111
87226
  realtimeCommunication.on("ReceiveLongOperationCompleteNotification", (notification) => {
88112
87227
  const { data, route } = routingService.getLastRouteResolvedParams() || {};
88113
87228
  const isCurrentService = data?.serviceId === notification.serviceId;
88114
- const isLocalScope = notification.scope === ILongOperationScope.Local;
88115
- if (isLocalScope && !isCurrentService) return;
88116
87229
  const buttonsProps = isCurrentService ? [{ text: resources.RefreshPage, onClick: () => location.reload(), dataTestId: "reload-button" }] : [];
88117
87230
  const notyType = notification.status === ILongOperationCompleteStatus.Success ? "info" : "error";
88118
87231
  const note = showNote({ type: notyType, timeout: 0, text: notification.message, buttonsProps });
@@ -88712,7 +87825,7 @@ function ComponentList(props) {
88712
87825
  onClick: (event) => onDeleteIconClick(event, component)
88713
87826
  }
88714
87827
  ),
88715
- /* @__PURE__ */ jsx(ExpandMoreIcon$1, { color: ICON_COLOR })
87828
+ /* @__PURE__ */ jsx(ExpandMoreIcon, { color: ICON_COLOR })
88716
87829
  ] }, component.serviceId);
88717
87830
  })
88718
87831
  ] });
@@ -100097,7 +99210,7 @@ const useGridVirtualScroller = () => {
100097
99210
  const handleTouchMove = useEventCallback((event) => {
100098
99211
  apiRef.current.publishEvent("virtualScrollerTouchMove", {}, event);
100099
99212
  });
100100
- const getRows2 = (params = {}) => {
99213
+ const getRows = (params = {}) => {
100101
99214
  if (!params.rows && !currentPage.range) {
100102
99215
  return [];
100103
99216
  }
@@ -100336,7 +99449,7 @@ const useGridVirtualScroller = () => {
100336
99449
  return {
100337
99450
  renderContext,
100338
99451
  setPanels,
100339
- getRows: getRows2,
99452
+ getRows,
100340
99453
  getContainerProps: () => ({
100341
99454
  ref: mainRefCallback
100342
99455
  }),
@@ -101228,10 +100341,10 @@ function GridVirtualScroller(props) {
101228
100341
  getRenderZoneProps,
101229
100342
  getScrollbarVerticalProps,
101230
100343
  getScrollbarHorizontalProps,
101231
- getRows: getRows2,
100344
+ getRows,
101232
100345
  getScrollAreaProps
101233
100346
  } = virtualScroller;
101234
- const rows = getRows2();
100347
+ const rows = getRows();
101235
100348
  return /* @__PURE__ */ jsxs(GridMainContainer, _extends$2({
101236
100349
  className: classes2.root
101237
100350
  }, getContainerProps(), {
@@ -122372,2316 +121485,6 @@ class ExtendedConfigurationController {
122372
121485
  return this.requestService.post(`api/extendedServiceConfiguration/${serviceId}`, changes);
122373
121486
  }
122374
121487
  }
122375
- var DatabaseWizardStepStatus = /* @__PURE__ */ ((DatabaseWizardStepStatus2) => {
122376
- DatabaseWizardStepStatus2[DatabaseWizardStepStatus2["Active"] = 0] = "Active";
122377
- DatabaseWizardStepStatus2[DatabaseWizardStepStatus2["New"] = 1] = "New";
122378
- DatabaseWizardStepStatus2[DatabaseWizardStepStatus2["Finished"] = 2] = "Finished";
122379
- return DatabaseWizardStepStatus2;
122380
- })(DatabaseWizardStepStatus || {});
122381
- var DatabaseWizardSteps = /* @__PURE__ */ ((DatabaseWizardSteps2) => {
122382
- DatabaseWizardSteps2[DatabaseWizardSteps2["SQLServer"] = 0] = "SQLServer";
122383
- DatabaseWizardSteps2[DatabaseWizardSteps2["Database"] = 1] = "Database";
122384
- DatabaseWizardSteps2[DatabaseWizardSteps2["Configuration"] = 2] = "Configuration";
122385
- DatabaseWizardSteps2[DatabaseWizardSteps2["Confirmation"] = 3] = "Confirmation";
122386
- DatabaseWizardSteps2[DatabaseWizardSteps2["Update"] = 4] = "Update";
122387
- DatabaseWizardSteps2[DatabaseWizardSteps2["UploadSettings"] = 5] = "UploadSettings";
122388
- return DatabaseWizardSteps2;
122389
- })(DatabaseWizardSteps || {});
122390
- var DBFIleLocationType = /* @__PURE__ */ ((DBFIleLocationType2) => {
122391
- DBFIleLocationType2[DBFIleLocationType2["Standard"] = 0] = "Standard";
122392
- DBFIleLocationType2[DBFIleLocationType2["Other"] = 1] = "Other";
122393
- return DBFIleLocationType2;
122394
- })(DBFIleLocationType || {});
122395
- var LocaleId = /* @__PURE__ */ ((LocaleId2) => {
122396
- LocaleId2[LocaleId2["Default"] = -1] = "Default";
122397
- LocaleId2[LocaleId2["ENU"] = 1033] = "ENU";
122398
- LocaleId2[LocaleId2["RUS"] = 1049] = "RUS";
122399
- LocaleId2[LocaleId2["KKZ"] = 1049.1] = "KKZ";
122400
- LocaleId2[LocaleId2["EST"] = 1061] = "EST";
122401
- LocaleId2[LocaleId2["LVI"] = 1062] = "LVI";
122402
- return LocaleId2;
122403
- })(LocaleId || {});
122404
- var AuthenticationType = /* @__PURE__ */ ((AuthenticationType2) => {
122405
- AuthenticationType2[AuthenticationType2["SQLServer"] = 0] = "SQLServer";
122406
- return AuthenticationType2;
122407
- })(AuthenticationType || {});
122408
- const DEFAULT_LOCALE_ID = LocaleId.RUS;
122409
- ServerType.PostgreSQL;
122410
- AuthenticationType.SQLServer;
122411
- DBFIleLocationType.Standard;
122412
- const DEFAULT_PORT = 5432;
122413
- const DEFAULT_OPERATION_TIMEOUT = 600;
122414
- const PLATFORM_SOLUTION_ID = "26dbf2c0-e72e-4e9e-ab99-816758387ae2";
122415
- const OFFICE_WORK_LIBRARY_ID = "c0afdac0-d533-4fd6-b7da-c8d4f5969379";
122416
- const getStepFormComponent = (step) => {
122417
- switch (step) {
122418
- case DatabaseWizardSteps.SQLServer:
122419
- return "sqlServerForm";
122420
- case DatabaseWizardSteps.Database:
122421
- return "databaseForm";
122422
- case DatabaseWizardSteps.Configuration:
122423
- return "configurationForm";
122424
- case DatabaseWizardSteps.Confirmation:
122425
- return "confirmationForm";
122426
- case DatabaseWizardSteps.Update:
122427
- return "updateForm";
122428
- case DatabaseWizardSteps.UploadSettings:
122429
- return "uploadSettingsForm";
122430
- default:
122431
- return "sqlServerForm";
122432
- }
122433
- };
122434
- const getDatabaseWizardSteps = (services) => {
122435
- const steps = [];
122436
- steps[DatabaseWizardSteps.SQLServer] = {
122437
- status: DatabaseWizardStepStatus.New,
122438
- step: DatabaseWizardSteps.SQLServer,
122439
- active: true,
122440
- finished: false,
122441
- name: services.resources.DatabaseWizardLabelStep_SQLServer
122442
- };
122443
- steps[DatabaseWizardSteps.Database] = {
122444
- status: DatabaseWizardStepStatus.New,
122445
- step: DatabaseWizardSteps.Database,
122446
- active: false,
122447
- finished: false,
122448
- name: services.resources.DatabaseWizardLabelStep_Database
122449
- };
122450
- steps[DatabaseWizardSteps.Configuration] = {
122451
- status: DatabaseWizardStepStatus.New,
122452
- step: DatabaseWizardSteps.Configuration,
122453
- active: false,
122454
- finished: false,
122455
- name: services.resources.DatabaseWizardLabelStep_Configuration
122456
- };
122457
- steps[DatabaseWizardSteps.Confirmation] = {
122458
- status: DatabaseWizardStepStatus.New,
122459
- step: DatabaseWizardSteps.Confirmation,
122460
- active: false,
122461
- finished: false,
122462
- name: services.resources.DatabaseWizardLabelStep_Confirmation
122463
- };
122464
- steps[DatabaseWizardSteps.Update] = {
122465
- status: DatabaseWizardStepStatus.New,
122466
- step: DatabaseWizardSteps.Update,
122467
- active: false,
122468
- finished: false,
122469
- name: services.resources.DatabaseWizardLabelStep_Update
122470
- };
122471
- steps[DatabaseWizardSteps.UploadSettings] = {
122472
- status: DatabaseWizardStepStatus.New,
122473
- step: DatabaseWizardSteps.UploadSettings,
122474
- active: false,
122475
- finished: false,
122476
- name: services.resources.DatabaseWizardLabelStep_UploadSettings
122477
- };
122478
- return steps;
122479
- };
122480
- const databaseWizardCreateModeStepsList = [
122481
- DatabaseWizardSteps.SQLServer,
122482
- DatabaseWizardSteps.Database,
122483
- DatabaseWizardSteps.Configuration,
122484
- DatabaseWizardSteps.Confirmation,
122485
- DatabaseWizardSteps.UploadSettings
122486
- ];
122487
- const databaseWizardUpdateModeStepsList = [
122488
- DatabaseWizardSteps.Configuration,
122489
- DatabaseWizardSteps.Confirmation,
122490
- DatabaseWizardSteps.Update,
122491
- DatabaseWizardSteps.UploadSettings
122492
- ];
122493
- const databaseWizardAddModeStepsList = [
122494
- DatabaseWizardSteps.SQLServer,
122495
- DatabaseWizardSteps.Database,
122496
- DatabaseWizardSteps.Confirmation,
122497
- DatabaseWizardSteps.Configuration,
122498
- DatabaseWizardSteps.Update,
122499
- DatabaseWizardSteps.UploadSettings
122500
- ];
122501
- const getDatabaseWizardModeSteps = (mode, services) => {
122502
- let modeStepsList;
122503
- let databaseWizardAllSteps = getDatabaseWizardSteps(services);
122504
- switch (mode) {
122505
- case DatabaseWizardMode.Create:
122506
- modeStepsList = databaseWizardCreateModeStepsList;
122507
- databaseWizardAllSteps = databaseWizardCreateModeStepsList.map((step) => getDatabaseWizardSteps(services)[step]);
122508
- break;
122509
- case DatabaseWizardMode.Update:
122510
- modeStepsList = databaseWizardUpdateModeStepsList;
122511
- databaseWizardAllSteps = databaseWizardUpdateModeStepsList.map((step) => getDatabaseWizardSteps(services)[step]);
122512
- break;
122513
- case DatabaseWizardMode.Add:
122514
- modeStepsList = databaseWizardAddModeStepsList;
122515
- databaseWizardAllSteps = databaseWizardAddModeStepsList.map((step) => getDatabaseWizardSteps(services)[step]);
122516
- }
122517
- return modeStepsList.map((step, index) => {
122518
- return {
122519
- ...databaseWizardAllSteps[index],
122520
- order: index + 1
122521
- };
122522
- });
122523
- };
122524
- const getDefaultPlacementsTables = () => {
122525
- const placementsTables = {
122526
- changedObjectDataBaseType: TableLocationTypeExtended.UseTemporaryDatabase,
122527
- cursorDataBaseType: TableLocationType.UseTemporaryDatabase,
122528
- fileCursorDataBaseType: TableLocationType.UseOwnDatabase,
122529
- iconDataBaseType: TableLocationType.UseTemporaryDatabase,
122530
- keysetDataBaseType: TableLocationType.UseTemporaryDatabase,
122531
- searchDataBaseType: TableLocationType.UseTemporaryDatabase,
122532
- useOuterArchive: false,
122533
- useOuterLog: false,
122534
- useOuterMetadata: false
122535
- };
122536
- return placementsTables;
122537
- };
122538
- const getTextKeysFromEnum = (enumType) => {
122539
- const textKeys = [];
122540
- Object.keys(enumType).forEach((key) => {
122541
- const isValueProperty = !isNaN(Number(key));
122542
- if (isValueProperty) return;
122543
- textKeys.push(key);
122544
- });
122545
- return textKeys;
122546
- };
122547
- const getTableLocationTypeNames = () => {
122548
- return getTextKeysFromEnum(TableLocationType);
122549
- };
122550
- const getTableLocationTypeExtendedNames = () => {
122551
- return getTextKeysFromEnum(TableLocationTypeExtended);
122552
- };
122553
- const getServerTypeNames = () => {
122554
- return getTextKeysFromEnum(ServerType);
122555
- };
122556
- const getDBFileLocationTypeNames = () => {
122557
- return getTextKeysFromEnum(DBFIleLocationType);
122558
- };
122559
- const getLocaleIdNames = () => {
122560
- return getTextKeysFromEnum(LocaleId);
122561
- };
122562
- const getAuthenticationTypeNames = () => {
122563
- return getTextKeysFromEnum(AuthenticationType);
122564
- };
122565
- const getDatabaseWizardFormName = (services, step, mode, form) => {
122566
- const resourceKey = `DatabaseWizard${DatabaseWizardSteps[step]}${DatabaseWizardMode[mode] || ""}Form${form || ""}`;
122567
- return services.resources[resourceKey];
122568
- };
122569
- const isStepClickable = (step, logic) => {
122570
- const activeStep = logic.$activeStep.getState();
122571
- if (activeStep.step === step.step) {
122572
- return false;
122573
- }
122574
- if (activeStep.order <= step.order) {
122575
- return false;
122576
- }
122577
- if (logic.$loading.getState() || !!logic.$processStatus.getState()) {
122578
- return false;
122579
- }
122580
- if (logic.$mode.getState() === DatabaseWizardMode.Add && activeStep.step === DatabaseWizardSteps.Update) {
122581
- return false;
122582
- }
122583
- if (activeStep.step === DatabaseWizardSteps.UploadSettings) {
122584
- return false;
122585
- }
122586
- return true;
122587
- };
122588
- const isCancelButtonDisabled = (step, logic) => {
122589
- if (logic.$loading.getState() || logic.$processStatus.getState()?.state === ProcessState.Running) {
122590
- return true;
122591
- }
122592
- return false;
122593
- };
122594
- const isBackButtonDisabled = (step, logic) => {
122595
- if (step === logic.$steps.getState()[0]) {
122596
- return true;
122597
- }
122598
- if (logic.$loading.getState() || logic.$processStatus.getState()?.state === ProcessState.Running) {
122599
- return true;
122600
- }
122601
- if (!!logic.$processStatus.getState()) {
122602
- return true;
122603
- }
122604
- return false;
122605
- };
122606
- const isNextButtonDisabled = (step, logic) => {
122607
- const $steps = logic.$steps.getState();
122608
- const $loading = logic.$loading.getState();
122609
- const $processStatus = logic.$processStatus.getState();
122610
- return step === $steps[$steps.length - 1] || $loading || $processStatus?.state === ProcessState.Running || $processStatus?.state === ProcessState.Error;
122611
- };
122612
- const isDoneButtonDisabled = (step, logic) => {
122613
- const $loading = logic.$loading.getState();
122614
- const $processStatus = logic.$processStatus.getState();
122615
- const $haveCheckedSolutions = logic.$haveCheckedSolutions.getState();
122616
- if (!$haveCheckedSolutions) {
122617
- return false;
122618
- }
122619
- return $loading || !$processStatus || $processStatus?.state === ProcessState.Running;
122620
- };
122621
- const getSelectedLibrariesArray = (logic) => {
122622
- const disabledLibraries = logic.$disabledLibraries.getState().map((item) => item.id);
122623
- const libraries = logic.$selectedLibraries.getState().reduce((acc, item) => {
122624
- if (!disabledLibraries.includes(item.id)) {
122625
- acc.push(item.id);
122626
- }
122627
- return acc;
122628
- }, []);
122629
- return libraries;
122630
- };
122631
- const isRequiredSolution = (solution) => {
122632
- if (solution.id !== PLATFORM_SOLUTION_ID || !solution.canUpdate) {
122633
- return false;
122634
- }
122635
- return true;
122636
- };
122637
- const checkRequiredLibrary = (availableLibraries, selectedLibraries) => {
122638
- const requiredLibrary = availableLibraries.find((library) => library.id?.toLowerCase() === OFFICE_WORK_LIBRARY_ID && library.canUpdate && !selectedLibraries.some((selectedLibrary) => selectedLibrary.id === library.id));
122639
- if (requiredLibrary && requiredLibrary.libraryDependencies.every((dependency) => selectedLibraries.some((selectedLibrary) => selectedLibrary.id === dependency.id))) {
122640
- selectedLibraries.push(requiredLibrary);
122641
- }
122642
- return selectedLibraries;
122643
- };
122644
- const getLibraryTooltip = (library, services) => {
122645
- if (library.id?.toLowerCase() === OFFICE_WORK_LIBRARY_ID) {
122646
- return services.resources.DatabaseWizard_OfficeWorkLibraryTooltip;
122647
- }
122648
- return "";
122649
- };
122650
- async function createModeSQlServerFromSubmit(logic) {
122651
- logic.setLoading(true);
122652
- const result = await logic.options.services.databasesController.checkSqlServerConnection(logic.$serviceId.getState(), logic.getServerParameters());
122653
- if (result.status === ConnectionStatus.Succesfull) {
122654
- const result2 = await logic.options.services.databasesController.databases(logic.$serviceId.getState(), logic.getServerParameters());
122655
- logic.setExistingBases(result2);
122656
- logic.nextStep();
122657
- } else if (result.status === ConnectionStatus.LoginFailed) {
122658
- logic.setSubmitErrorMessage(formatString$1(logic.options.services.resources.DatabaseWizardErrors_InvalidPassword, logic.$login.getState()));
122659
- } else if (result.status === ConnectionStatus.ServerNotExist) {
122660
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_ServerNotExist);
122661
- } else if (result.status === ConnectionStatus.AuthNotSupported) {
122662
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_AuthNotSupported);
122663
- } else {
122664
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_Unknown);
122665
- }
122666
- logic.setLoading(false);
122667
- }
122668
- async function createModeDatabaseFromSubmit(logic) {
122669
- const isExistingBase = logic.$existingBases.getState().includes(logic.$databaseName.getState());
122670
- if (isExistingBase) {
122671
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_DatabaseAlreadyExist);
122672
- logic.setLoading(false);
122673
- return;
122674
- }
122675
- logic.setLoading(true);
122676
- try {
122677
- const allBases = await logic.options.services.databasesConfigurationController.all(logic.$serviceId.getState());
122678
- const isExistingAlias = allBases.some((item) => item.alias?.toLowerCase() === logic.$alias.getState() && item.databaseState !== DatabaseState.Creating);
122679
- if (isExistingAlias) {
122680
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_AliasAlreadyExist);
122681
- logic.setLoading(false);
122682
- return;
122683
- }
122684
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122685
- serverParameters: logic.getServerParameters(),
122686
- databaseParameters: logic.getDatabaseParameters(),
122687
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122688
- currentPageName: "Configuration",
122689
- masterType: logic.$mode.getState()
122690
- });
122691
- logic.setStateWasChanged(true);
122692
- await logic.getLibraries();
122693
- logic.setLoading(false);
122694
- logic.nextStep();
122695
- } catch (error) {
122696
- logic.setSubmitErrorMessage(error.message);
122697
- logic.setLoading(false);
122698
- }
122699
- }
122700
- async function createModeConfigurationFromSubmit(logic) {
122701
- const libraries = getSelectedLibrariesArray(logic);
122702
- logic.setLoading(true);
122703
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122704
- serverParameters: logic.getServerParameters(),
122705
- databaseParameters: logic.getDatabaseParameters(),
122706
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122707
- currentPageName: "Confirmation",
122708
- masterType: logic.$mode.getState(),
122709
- libraries
122710
- });
122711
- logic.setStateWasChanged(true);
122712
- logic.setLoading(false);
122713
- logic.nextStep();
122714
- }
122715
- async function createModeConfirmationFromSubmit(logic) {
122716
- if (logic.$processStatus.getState()?.state === ProcessState.Finished) {
122717
- await logic.options.services.messageWindow.showConfirmation(logic.options.services.resources.DatabaseWizard_BeforeUploadSettingsStepAttention);
122718
- logic.setLoading(true);
122719
- await logic.getSolutions();
122720
- logic.setLoading(false);
122721
- logic.setProcessStatus(null);
122722
- logic.nextStep();
122723
- return;
122724
- }
122725
- const libraries = getSelectedLibrariesArray(logic);
122726
- logic.setLoading(true);
122727
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122728
- serverParameters: logic.getServerParameters(),
122729
- databaseParameters: logic.getDatabaseParameters(),
122730
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122731
- currentPageName: "Confirmation",
122732
- masterType: logic.$mode.getState(),
122733
- libraries,
122734
- timeout: logic.$operationTimeout.getState(),
122735
- localeId: logic.$localeId.getState() && Math.round(logic.$localeId.getState())
122736
- });
122737
- const checkStatus = async () => {
122738
- const status = await logic.options.services.databasesController.status(logic.$serviceId.getState(), logic.$alias.getState());
122739
- if (status.state === ProcessState.Running) {
122740
- setTimeout(checkStatus, 5e3);
122741
- } else if (status.state === ProcessState.Error) {
122742
- logic.setSubmitErrorMessage(status.errorMessage);
122743
- } else if (status.state === ProcessState.Finished) {
122744
- await logic.options.services.databasesConfigurationController.add(logic.$serviceId.getState(), logic.$alias.getState());
122745
- } else if (status.state === ProcessState.Canceled) {
122746
- logic.setProcessIsCancelling(false);
122747
- }
122748
- logic.setProcessStatus(status);
122749
- };
122750
- try {
122751
- await logic.options.services.databasesController.create(logic.$serviceId.getState(), logic.$alias.getState());
122752
- logic.setProcessStatus({ state: ProcessState.Running });
122753
- await checkStatus();
122754
- } catch (e2) {
122755
- logic.setSubmitErrorMessage(e2.message);
122756
- }
122757
- logic.setStateWasChanged(true);
122758
- logic.setLoading(false);
122759
- }
122760
- async function cancelDatabaseProcess(logic) {
122761
- logic.options.services.databasesController.stop(logic.$serviceId.getState(), logic.$alias.getState());
122762
- logic.setProcessIsCancelling(true);
122763
- logic.setStateWasChanged(true);
122764
- }
122765
- async function createModeUploadSettingsFromSubmit(logic) {
122766
- const solutions = logic.$solutions.getState().reduce((acc, item) => {
122767
- if (item.selected) {
122768
- acc.push(item.id);
122769
- }
122770
- return acc;
122771
- }, []);
122772
- logic.setLoading(true);
122773
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122774
- serverParameters: logic.getServerParameters(),
122775
- databaseParameters: logic.getDatabaseParameters(),
122776
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122777
- currentPageName: "UploadSettings",
122778
- masterType: logic.$mode.getState(),
122779
- timeout: logic.$operationTimeout.getState(),
122780
- localeId: logic.$localeId.getState() && Math.round(logic.$localeId.getState())
122781
- });
122782
- const checkStatus = async () => {
122783
- const status = await logic.options.services.databasesController.status(logic.$serviceId.getState(), logic.$alias.getState());
122784
- if (status.state === ProcessState.Running) {
122785
- setTimeout(checkStatus, 5e3);
122786
- } else if (status.state === ProcessState.Error) {
122787
- logic.setSubmitErrorMessage(status.errorMessage);
122788
- } else if (status.state === ProcessState.Canceled) {
122789
- logic.setProcessIsCancelling(false);
122790
- }
122791
- logic.setProcessStatus(status);
122792
- };
122793
- try {
122794
- await logic.options.services.databasesController.installSolutions(
122795
- logic.$serviceId.getState(),
122796
- logic.$alias.getState(),
122797
- solutions
122798
- );
122799
- logic.setProcessStatus({ state: ProcessState.Running });
122800
- await checkStatus();
122801
- } catch (e2) {
122802
- logic.setSubmitErrorMessage(e2.message);
122803
- }
122804
- logic.setStateWasChanged(true);
122805
- logic.setLoading(false);
122806
- }
122807
- async function addModeConfigurationFromSubmit(logic) {
122808
- const libraries = getSelectedLibrariesArray(logic);
122809
- logic.setLoading(true);
122810
- try {
122811
- await logic.options.services.databasesConfigurationController.add(logic.$serviceId.getState(), logic.$alias.getState());
122812
- } catch (e2) {
122813
- logic.setSubmitErrorMessage(e2.message);
122814
- }
122815
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122816
- serverParameters: logic.getServerParameters(),
122817
- databaseParameters: logic.getDatabaseParameters(),
122818
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122819
- currentPageName: "Update",
122820
- masterType: logic.$mode.getState(),
122821
- libraries,
122822
- timeout: logic.$operationTimeout.getState(),
122823
- localeId: logic.$localeId.getState() && Math.round(logic.$localeId.getState())
122824
- });
122825
- logic.setLoading(false);
122826
- logic.nextStep();
122827
- }
122828
- async function addModeConfirmationFromSubmit(logic) {
122829
- logic.setLoading(true);
122830
- try {
122831
- await logic.getLibraries();
122832
- const libraries = getSelectedLibrariesArray(logic);
122833
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122834
- serverParameters: logic.getServerParameters(),
122835
- databaseParameters: logic.getDatabaseParameters(),
122836
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122837
- currentPageName: "Configuration",
122838
- masterType: logic.$mode.getState(),
122839
- libraries,
122840
- timeout: logic.$operationTimeout.getState(),
122841
- localeId: logic.$localeId.getState() && Math.round(logic.$localeId.getState())
122842
- });
122843
- logic.setStateWasChanged(true);
122844
- logic.setLoading(false);
122845
- logic.nextStep();
122846
- } catch (error) {
122847
- logic.setSubmitErrorMessage(error.message);
122848
- logic.setLoading(false);
122849
- }
122850
- }
122851
- async function addModeDatabaseFromSubmit(logic) {
122852
- const isExistingBase = logic.$existingBases.getState().includes(logic.$databaseName.getState());
122853
- if (!isExistingBase) {
122854
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizard_DatabaseDoesNotExistError);
122855
- logic.setLoading(false);
122856
- return;
122857
- }
122858
- logic.setLoading(true);
122859
- const databaseConnectionStatus = await logic.options.services.databasesController.checkSqlDatabaseConnectionFull(
122860
- logic.$serviceId.getState(),
122861
- logic.getServerParameters(),
122862
- logic.getDatabaseParameters()
122863
- );
122864
- if (databaseConnectionStatus.status === ConnectionStatus.DatabaseAlreadyExists) {
122865
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_DatabaseAlreadyExist);
122866
- logic.setLoading(false);
122867
- return;
122868
- }
122869
- if (databaseConnectionStatus.status === ConnectionStatus.AliasAlreadyExists) {
122870
- logic.setSubmitErrorMessage(logic.options.services.resources.DatabaseWizardErrors_AliasAlreadyExist);
122871
- logic.setLoading(false);
122872
- return;
122873
- }
122874
- const libraries = getSelectedLibrariesArray(logic);
122875
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122876
- serverParameters: logic.getServerParameters(),
122877
- databaseParameters: logic.getDatabaseParameters(),
122878
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122879
- currentPageName: "Confirmation",
122880
- masterType: logic.$mode.getState(),
122881
- libraries
122882
- });
122883
- logic.setLoading(false);
122884
- logic.nextStep();
122885
- }
122886
- async function addModeUpdateFromSubmit(logic) {
122887
- if (logic.$processStatus.getState()?.state === ProcessState.Finished) {
122888
- await logic.options.services.messageWindow.showConfirmation(logic.options.services.resources.DatabaseWizard_BeforeUploadSettingsStepAttention);
122889
- logic.setLoading(true);
122890
- await logic.getSolutions();
122891
- logic.setLoading(false);
122892
- logic.setProcessStatus(null);
122893
- logic.nextStep();
122894
- return;
122895
- }
122896
- logic.setLoading(true);
122897
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122898
- serverParameters: logic.getServerParameters(),
122899
- databaseParameters: logic.getDatabaseParameters(),
122900
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122901
- currentPageName: "Update",
122902
- masterType: logic.$mode.getState(),
122903
- libraries: getSelectedLibrariesArray(logic),
122904
- timeout: logic.$operationTimeout.getState(),
122905
- localeId: logic.$localeId.getState() && Math.round(logic.$localeId.getState())
122906
- });
122907
- await logic.options.services.databasesController.update(logic.$serviceId.getState(), logic.$alias.getState());
122908
- const checkStatus = async () => {
122909
- const status = await logic.options.services.databasesController.status(logic.$serviceId.getState(), logic.$alias.getState());
122910
- if (status.state === ProcessState.Running) {
122911
- setTimeout(checkStatus, 5e3);
122912
- } else if (status.state === ProcessState.Error) {
122913
- logic.setSubmitErrorMessage(status.errorMessage);
122914
- } else if (status.state === ProcessState.Canceled) {
122915
- logic.setProcessIsCancelling(false);
122916
- }
122917
- logic.setProcessStatus(status);
122918
- };
122919
- try {
122920
- logic.setProcessStatus({ state: ProcessState.Running });
122921
- await checkStatus();
122922
- } catch (e2) {
122923
- logic.setSubmitErrorMessage(e2.message);
122924
- }
122925
- logic.setStateWasChanged(true);
122926
- logic.setLoading(false);
122927
- }
122928
- async function updateModeConfigurationFromSubmit(logic) {
122929
- const libraries = getSelectedLibrariesArray(logic);
122930
- logic.setLoading(true);
122931
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122932
- databaseParameters: logic.getDatabaseParameters(),
122933
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122934
- currentPageName: "Confirmation",
122935
- masterType: logic.$mode.getState(),
122936
- libraries
122937
- });
122938
- logic.setStateWasChanged(true);
122939
- logic.setLoading(false);
122940
- logic.nextStep();
122941
- }
122942
- async function updateModeConfirmationFromSubmit(logic) {
122943
- logic.setLoading(true);
122944
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122945
- databaseParameters: logic.getDatabaseParameters(),
122946
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122947
- currentPageName: "Update",
122948
- masterType: logic.$mode.getState(),
122949
- libraries: getSelectedLibrariesArray(logic)
122950
- });
122951
- logic.setStateWasChanged(true);
122952
- logic.setLoading(false);
122953
- logic.nextStep();
122954
- }
122955
- async function updateModeUpdateFromSubmit(logic) {
122956
- if (logic.$processStatus.getState()?.state === ProcessState.Finished) {
122957
- await logic.options.services.messageWindow.showConfirmation(logic.options.services.resources.DatabaseWizard_BeforeUploadSettingsStepAttention);
122958
- logic.setLoading(true);
122959
- await logic.getSolutions();
122960
- logic.setLoading(false);
122961
- logic.setProcessStatus(null);
122962
- logic.nextStep();
122963
- return;
122964
- }
122965
- logic.setLoading(true);
122966
- await logic.options.services.databaseMasterController.setState(logic.$serviceId.getState(), {
122967
- databaseParameters: logic.getDatabaseParameters(),
122968
- scriptGenerationParameters: logic.$tablesPlacements.getState(),
122969
- currentPageName: "Update",
122970
- masterType: logic.$mode.getState(),
122971
- libraries: getSelectedLibrariesArray(logic)
122972
- });
122973
- await logic.options.services.databasesController.update(logic.$serviceId.getState(), logic.$alias.getState());
122974
- const checkStatus = async () => {
122975
- const status = await logic.options.services.databasesController.status(logic.$serviceId.getState(), logic.$alias.getState());
122976
- if (status.state === ProcessState.Running) {
122977
- setTimeout(checkStatus, 5e3);
122978
- } else if (status.state === ProcessState.Error) {
122979
- logic.setSubmitErrorMessage(status.errorMessage);
122980
- } else if (status.state === ProcessState.Canceled) {
122981
- logic.setProcessIsCancelling(false);
122982
- }
122983
- logic.setProcessStatus(status);
122984
- };
122985
- try {
122986
- logic.setProcessStatus({ state: ProcessState.Running });
122987
- await checkStatus();
122988
- } catch (e2) {
122989
- logic.setSubmitErrorMessage(e2.message);
122990
- }
122991
- logic.setStateWasChanged(true);
122992
- logic.setLoading(false);
122993
- }
122994
- class DatabaseWizardLogic extends ComponentLogic {
122995
- constructor() {
122996
- super(...arguments);
122997
- this.domain = y("DatabaseSettingsPanelLogic");
122998
- this.$steps = this.domain.createStore([], { name: "$steps" });
122999
- this.$isOpen = this.domain.createStore(true, { name: "$isOpen" });
123000
- this.setIsOpen = this.domain.event("setIsOpen");
123001
- this.setSteps = this.domain.event("setSteps");
123002
- this.currentFormRef = React__default.createRef();
123003
- this.$activeStep = this.domain.createStore(null, { name: "$activeStep" });
123004
- this.setActiveStep = this.domain.event("setActiveStep");
123005
- this.$serviceId = this.domain.createStore(null, { name: "$serviceId" });
123006
- this.setServiceId = this.domain.event("setServiceId");
123007
- this.$submitErrorMessage = this.domain.createStore(null, { name: "$submitErrorMessage" });
123008
- this.setSubmitErrorMessage = this.domain.event("setSubmitErrorMessage");
123009
- this.$existingBases = this.domain.createStore([], { name: "$existingBases" });
123010
- this.setExistingBases = this.domain.event("setExistingBases");
123011
- this.$loading = this.domain.createStore(false, { name: "$loading" });
123012
- this.setLoading = this.domain.event("setLoading");
123013
- this.$passwordChanged = this.domain.createStore(false, { name: "$passwordChanged" });
123014
- this.setPasswordChanged = this.domain.event("setPasswordChanged");
123015
- this.$processStatus = this.domain.createStore(null, { name: "$ProcessStatus" });
123016
- this.setProcessStatus = this.domain.event("setProcessStatus");
123017
- this.$processIsCancelling = this.domain.createStore(false, { name: "$processIsCancelling" });
123018
- this.setProcessIsCancelling = this.domain.event("setProcessIsCancelling");
123019
- this.$mode = this.domain.createStore(null, { name: "$mode" });
123020
- this.setMode = this.domain.event("setMode");
123021
- this.$scriptGeneratorVersion = this.domain.createStore(null, { name: "$scriptGeneratorVersion" });
123022
- this.setScriptGeneratorVersion = this.domain.event("setScriptGeneratorVersion");
123023
- this.$stateWasChanged = this.domain.createStore(false, { name: "$stateWasChanged" });
123024
- this.setStateWasChanged = this.domain.event("setStateWasChanged");
123025
- this.nextStep = this.domain.event("nextStep");
123026
- this.previousStep = this.domain.event("previousStep");
123027
- this.goToStep = this.domain.event("goToStep");
123028
- this.componentDidMount = this.domain.event("componentDidMount");
123029
- this.markStepsStatusFx = this.domain.effect((step) => {
123030
- const steps = this.$steps.getState();
123031
- steps.forEach((item) => {
123032
- if (item.order > step.order) {
123033
- item.status = DatabaseWizardStepStatus.New;
123034
- } else if (item.order < step.order) {
123035
- item.status = DatabaseWizardStepStatus.Finished;
123036
- } else {
123037
- item.status = DatabaseWizardStepStatus.Active;
123038
- }
123039
- });
123040
- this.setSteps([...steps]);
123041
- });
123042
- this.stepFormSubmit = this.domain.event("stepFormOnsubmit");
123043
- this.stepFormSubmitFx = this.domain.effect(async () => {
123044
- const step = this.$activeStep.getState().step;
123045
- if (this.$mode.getState() === DatabaseWizardMode.Create) {
123046
- switch (step) {
123047
- case DatabaseWizardSteps.SQLServer:
123048
- await createModeSQlServerFromSubmit(this);
123049
- break;
123050
- case DatabaseWizardSteps.Database:
123051
- await createModeDatabaseFromSubmit(this);
123052
- break;
123053
- case DatabaseWizardSteps.Configuration:
123054
- await createModeConfigurationFromSubmit(this);
123055
- break;
123056
- case DatabaseWizardSteps.Confirmation:
123057
- this.$processStatus.getState()?.state === ProcessState.Running ? await cancelDatabaseProcess(this) : await createModeConfirmationFromSubmit(this);
123058
- break;
123059
- case DatabaseWizardSteps.UploadSettings:
123060
- await createModeUploadSettingsFromSubmit(this);
123061
- break;
123062
- }
123063
- } else if (this.$mode.getState() === DatabaseWizardMode.Add) {
123064
- switch (step) {
123065
- case DatabaseWizardSteps.SQLServer:
123066
- await createModeSQlServerFromSubmit(this);
123067
- break;
123068
- case DatabaseWizardSteps.Database:
123069
- await addModeDatabaseFromSubmit(this);
123070
- break;
123071
- case DatabaseWizardSteps.Configuration:
123072
- await addModeConfigurationFromSubmit(this);
123073
- break;
123074
- case DatabaseWizardSteps.Confirmation:
123075
- await addModeConfirmationFromSubmit(this);
123076
- break;
123077
- case DatabaseWizardSteps.Update:
123078
- await addModeUpdateFromSubmit(this);
123079
- break;
123080
- case DatabaseWizardSteps.UploadSettings:
123081
- await createModeUploadSettingsFromSubmit(this);
123082
- break;
123083
- }
123084
- } else if (this.$mode.getState() === DatabaseWizardMode.Update) {
123085
- switch (step) {
123086
- case DatabaseWizardSteps.Configuration:
123087
- await updateModeConfigurationFromSubmit(this);
123088
- break;
123089
- case DatabaseWizardSteps.Confirmation:
123090
- await updateModeConfirmationFromSubmit(this);
123091
- break;
123092
- case DatabaseWizardSteps.Update:
123093
- await updateModeUpdateFromSubmit(this);
123094
- break;
123095
- case DatabaseWizardSteps.UploadSettings:
123096
- await createModeUploadSettingsFromSubmit(this);
123097
- break;
123098
- }
123099
- }
123100
- });
123101
- this.stepFormCancel = this.domain.event("stepFormCancel");
123102
- this.stepFormCancelFx = this.domain.effect(async () => {
123103
- if (this.$mode.getState() === DatabaseWizardMode.Create) {
123104
- if (this.$activeStep.getState().step === DatabaseWizardSteps.Confirmation && this.$processStatus.getState()?.state === ProcessState.Running) {
123105
- await this.options.services.messageWindow.showConfirmation(this.options.services.resources.DatabaseWizard_CancelCreationConfirmation);
123106
- await cancelDatabaseProcess(this);
123107
- }
123108
- } else {
123109
- if (this.$activeStep.getState().step === DatabaseWizardSteps.Update && this.$processStatus.getState()?.state === ProcessState.Running) {
123110
- await this.options.services.messageWindow.showConfirmation(this.options.services.resources.DatabaseWizard_CancelCreationConfirmation);
123111
- await cancelDatabaseProcess(this);
123112
- }
123113
- }
123114
- if (!!this.$alias.getState()) {
123115
- this.options.services.databaseMasterController.deleteState(this.$serviceId.getState(), this.$alias.getState());
123116
- }
123117
- this.setIsOpen(false);
123118
- if (this.$stateWasChanged.getState()) {
123119
- this.options.databaseChangeStateEvent?.();
123120
- }
123121
- });
123122
- this.stepFormDone = this.domain.event("stepFormOnsubmit");
123123
- this.stepFormDoneFx = this.domain.effect(async () => {
123124
- this.options.services.databaseMasterController.deleteState(this.$serviceId.getState(), this.$alias.getState());
123125
- this.setIsOpen(false);
123126
- if (this.$stateWasChanged.getState()) {
123127
- this.options.databaseChangeStateEvent?.();
123128
- }
123129
- });
123130
- this.toggleLibrary = this.domain.event("toggleLibrary");
123131
- this.toggleLibraryFx = this.domain.effect(async (library) => {
123132
- let selectedLibraries = [...this.$selectedLibraries.getState()];
123133
- const availableLibraries = this.$availableLibraries.getState();
123134
- let haveDependencyLibrary = false;
123135
- let confirmationMessage = "";
123136
- let isUncheck = false;
123137
- const toggleSelectedLibraries = (library2) => {
123138
- if (isUncheck || selectedLibraries.find((l) => l.name === library2.name)) {
123139
- selectedLibraries = selectedLibraries.filter((l) => l.name !== library2.name);
123140
- isUncheck = true;
123141
- selectedLibraries.forEach((selectedLibrary) => {
123142
- selectedLibrary.libraryDependencies.forEach((dependency) => {
123143
- if (library2.alias === dependency.alias) {
123144
- const availableLibrary = availableLibraries.find((l) => selectedLibrary.alias === l.alias);
123145
- if (availableLibrary) {
123146
- haveDependencyLibrary = true;
123147
- confirmationMessage = this.options.services.resources.DatabaseWizard_UncheckLibraryConfirmation;
123148
- toggleSelectedLibraries(availableLibrary);
123149
- }
123150
- }
123151
- });
123152
- });
123153
- } else {
123154
- selectedLibraries.push(library2);
123155
- library2.libraryDependencies.forEach((dependency) => {
123156
- if (!selectedLibraries.some((selectedLibrary) => selectedLibrary.alias === dependency.alias)) {
123157
- const availableLibrary = availableLibraries.find((l) => dependency.alias === l.alias);
123158
- if (availableLibrary && availableLibrary.canUpdate) {
123159
- haveDependencyLibrary = true;
123160
- confirmationMessage = this.options.services.resources.DatabaseWizard_CheckLibraryConfirmation;
123161
- toggleSelectedLibraries(availableLibrary);
123162
- }
123163
- }
123164
- });
123165
- }
123166
- };
123167
- toggleSelectedLibraries(library);
123168
- if (!isUncheck) {
123169
- selectedLibraries = checkRequiredLibrary(availableLibraries, selectedLibraries);
123170
- }
123171
- if (haveDependencyLibrary) {
123172
- if (haveDependencyLibrary) {
123173
- try {
123174
- await this.options.services.messageWindow.showConfirmation(confirmationMessage);
123175
- } catch (e2) {
123176
- console.log("unconfirmed check library");
123177
- return;
123178
- }
123179
- }
123180
- }
123181
- this.setSelectedLibraries([...selectedLibraries]);
123182
- });
123183
- this.$serverType = this.domain.createStore(ServerType.PostgreSQL, { name: "$serverType" });
123184
- this.$serverName = this.domain.createStore("", { name: "$serverName" });
123185
- this.$authentication = this.domain.createStore("SQLServer", { name: "$authentication" });
123186
- this.$port = this.domain.createStore(DEFAULT_PORT, { name: "$port" });
123187
- this.$login = this.domain.createStore("", { name: "$login" });
123188
- this.$password = this.domain.createStore("", { name: "$password" });
123189
- this.$databaseName = this.domain.createStore("", { name: "$databaseName" });
123190
- this.$alias = this.domain.createStore("", { name: "$alias" });
123191
- this.$locationType = this.domain.createStore(DBFIleLocationType.Standard, { name: "$placementType" });
123192
- this.$locationPath = this.domain.createStore("", { name: "$placementPath" });
123193
- this.$tablesPlacements = this.domain.createStore(getDefaultPlacementsTables(), { name: "$placementPath" });
123194
- this.$localeId = this.domain.createStore(DEFAULT_LOCALE_ID, { name: "$language" });
123195
- this.$availableLibraries = this.domain.createStore([], { name: "$availableLibraries" });
123196
- this.$selectedLibraries = this.domain.createStore([], { name: "$selectedLibraries" });
123197
- this.$disabledLibraries = this.domain.createStore([], { name: "$disabledLibraries" });
123198
- this.$operationTimeout = this.domain.createStore(DEFAULT_OPERATION_TIMEOUT, { name: "$operationTimeout" });
123199
- this.$solutions = this.domain.createStore([], { name: "$modules" });
123200
- this.$haveCheckedSolutions = this.domain.createStore(false, { name: "$haveCheckedSolutions" });
123201
- this.setServerType = this.domain.event();
123202
- this.setServerName = this.domain.event();
123203
- this.setAuthentication = this.domain.event();
123204
- this.setPort = this.domain.event();
123205
- this.setLogin = this.domain.event();
123206
- this.setPassword = this.domain.event();
123207
- this.setDatabaseName = this.domain.event();
123208
- this.setAlias = this.domain.event();
123209
- this.setLocationType = this.domain.event();
123210
- this.setLocationPath = this.domain.event();
123211
- this.setTablesPlacements = this.domain.event();
123212
- this.setLocaleId = this.domain.event();
123213
- this.setAvailableLibraries = this.domain.event();
123214
- this.setSelectedLibraries = this.domain.event();
123215
- this.setDisabledLibraries = this.domain.event();
123216
- this.setOperationTimeout = this.domain.event();
123217
- this.setSolutions = this.domain.event();
123218
- this.setHaveCheckedSolutions = this.domain.event();
123219
- this.onBeforeWindowUnload = (e2) => {
123220
- if (this.$processStatus.getState()?.state !== ProcessState.Running) {
123221
- if (e2) {
123222
- e2.returnValue = this.options.services.resources.TabCloseConfirmation || true;
123223
- }
123224
- return this.options.services.resources.TabCloseConfirmation || true;
123225
- }
123226
- };
123227
- }
123228
- getServerParameters() {
123229
- return {
123230
- serverName: this.$serverName.getState(),
123231
- serverType: this.$serverType.getState(),
123232
- user: this.$login.getState(),
123233
- password: this.$password.getState(),
123234
- port: this.$port.getState(),
123235
- integratedSecurity: this.$authentication.getState() === "SQL Server",
123236
- passwordChanged: this.$password.getState() ? true : false
123237
- };
123238
- }
123239
- getDatabaseParameters() {
123240
- return {
123241
- alias: this.$alias.getState(),
123242
- databaseName: this.$databaseName.getState()
123243
- };
123244
- }
123245
- initSettings() {
123246
- if (!this.options?.services) {
123247
- return;
123248
- }
123249
- }
123250
- async initUpdateMode() {
123251
- if (this.options.alias) {
123252
- this.setAlias(this.options.alias);
123253
- this.setLoading(true);
123254
- const allDatabaseConfigurations = await this.options.services.databasesConfigurationController.all(this.options.serviceId);
123255
- const databaseConfiguration = allDatabaseConfigurations.find((item) => item.alias === this.options.alias);
123256
- if (!databaseConfiguration || databaseConfiguration.databaseState !== DatabaseState.Attached) {
123257
- this.setSubmitErrorMessage(this.options.services.resources.DatabaseWizardErrors_DatabaseNotAttached);
123258
- return;
123259
- }
123260
- this.setServerType(databaseConfiguration.databaseType === DatabaseType.SQL ? ServerType["MS SQL SERVER"] : ServerType.PostgreSQL);
123261
- this.setServerName(databaseConfiguration.serverName);
123262
- this.setDatabaseName(databaseConfiguration.databaseName);
123263
- await this.options.services.databaseMasterController.setState(this.options.serviceId, {
123264
- masterType: DatabaseWizardMode.Update,
123265
- currentPageName: "Configuration",
123266
- databaseParameters: {
123267
- alias: this.options.alias,
123268
- databaseName: databaseConfiguration.databaseName
123269
- },
123270
- scriptGenerationParameters: this.$tablesPlacements.getState()
123271
- });
123272
- await this.getLibraries();
123273
- this.setLoading(false);
123274
- }
123275
- }
123276
- async getLibraries() {
123277
- const alias = this.$alias.getState() || this.options.alias;
123278
- const scriptModel = await this.options.services.databasesController.libraries(this.options.serviceId, alias);
123279
- this.setAvailableLibraries(scriptModel.libraries);
123280
- const selectedLibraries = [];
123281
- const disabledLibraries = [];
123282
- scriptModel.libraries.forEach((library) => {
123283
- if (library.canUpdate) {
123284
- selectedLibraries.push(library);
123285
- } else {
123286
- disabledLibraries.push(library);
123287
- }
123288
- if (library.id?.toLowerCase() === OFFICE_WORK_LIBRARY_ID) {
123289
- disabledLibraries.push(library);
123290
- }
123291
- });
123292
- this.setSelectedLibraries(selectedLibraries);
123293
- this.setDisabledLibraries(disabledLibraries);
123294
- this.setScriptGeneratorVersion(scriptModel.scriptGeneratorVersion);
123295
- }
123296
- async getSolutions() {
123297
- const alias = this.$alias.getState() || this.options.alias;
123298
- let availableSolutions;
123299
- try {
123300
- availableSolutions = await this.options.services.databasesController.solutions(this.options.serviceId, alias);
123301
- } catch (e2) {
123302
- this.setSubmitErrorMessage(e2.message);
123303
- }
123304
- const solutions = availableSolutions.map((solution) => {
123305
- return {
123306
- ...solution,
123307
- selected: solution.canUpdate || this.$mode.getState() === DatabaseWizardMode.Create || isRequiredSolution(solution),
123308
- disabled: !solution.canUpdate && this.$mode.getState() !== DatabaseWizardMode.Create || isRequiredSolution(solution)
123309
- };
123310
- });
123311
- this.setSolutions(solutions);
123312
- }
123313
- toggleSolution(solution) {
123314
- if (solution.disabled) {
123315
- return;
123316
- }
123317
- if (solution.selected) {
123318
- solution.selected = false;
123319
- } else {
123320
- solution.selected = true;
123321
- }
123322
- this.setSolutions([...this.$solutions.getState()]);
123323
- }
123324
- initExitingModel() {
123325
- const model = this.options.model;
123326
- if (!model) return;
123327
- model.databaseParameters?.alias && this.setAlias(model.databaseParameters.alias);
123328
- model.databaseParameters?.databaseName && this.setDatabaseName(model.databaseParameters.databaseName);
123329
- model.serverParameters?.serverName && this.setServerName(model.serverParameters.serverName);
123330
- model.serverParameters?.serverType && this.setServerType(model.serverParameters.serverType);
123331
- model.serverParameters?.user && this.setLogin(model.serverParameters.user);
123332
- model.serverParameters?.port && this.setPort(model.serverParameters.port);
123333
- model.serverParameters?.password && this.setPassword(model.serverParameters.password);
123334
- model.serverParameters?.integratedSecurity && this.setAuthentication(model.serverParameters.integratedSecurity ? "SQL Server" : "Windows");
123335
- model.scriptGenerationParameters && this.setTablesPlacements(model.scriptGenerationParameters);
123336
- model.masterType && this.setMode(model.masterType);
123337
- model.scriptGenerationParameters && this.setTablesPlacements(model.scriptGenerationParameters);
123338
- model.localeId && this.setLocaleId(model.localeId);
123339
- model.dbFilePath && this.setLocationPath(model.dbFilePath);
123340
- model.timeout && this.setOperationTimeout(model.timeout);
123341
- if (model.lastProcessError) {
123342
- this.setSubmitErrorMessage(model.lastProcessError);
123343
- this.setProcessStatus({ state: ProcessState.Error, errorMessage: model.lastProcessError });
123344
- }
123345
- if (model.state) {
123346
- let processStatusState = null;
123347
- switch (model.state) {
123348
- case IDatabaseMasterState.SolutionInProcess:
123349
- case IDatabaseMasterState.DatabaseInProcess:
123350
- processStatusState = ProcessState.Running;
123351
- break;
123352
- case IDatabaseMasterState.SolutionProcessFinished:
123353
- case IDatabaseMasterState.DatabaseProcessFinished:
123354
- processStatusState = ProcessState.Finished;
123355
- break;
123356
- }
123357
- this.setProcessStatus({ state: processStatusState });
123358
- }
123359
- if (model.currentPageName) {
123360
- const step = this.$steps.getState().find((step2) => step2.step === DatabaseWizardSteps[model.currentPageName]);
123361
- this.setActiveStep(step);
123362
- }
123363
- }
123364
- init(options) {
123365
- this.initSettings();
123366
- this.$steps.on(this.setSteps, (_2, steps2) => steps2);
123367
- this.$activeStep.on(this.setActiveStep, (_2, newStep) => newStep).on(this.goToStep, (_2, targetStep) => {
123368
- return this.$steps.getState().find((step) => step.step === targetStep);
123369
- });
123370
- const steps = getDatabaseWizardModeSteps(options.mode, options.services);
123371
- this.setActiveStep(steps[0]);
123372
- this.setSteps(steps);
123373
- this.markStepsStatusFx(steps[0]);
123374
- this.stepFormSubmit.watch(() => {
123375
- this.stepFormSubmitFx();
123376
- });
123377
- this.stepFormCancel.watch(() => {
123378
- this.stepFormCancelFx();
123379
- });
123380
- this.stepFormDone.watch(() => {
123381
- this.stepFormDoneFx();
123382
- });
123383
- v({
123384
- source: this.$activeStep,
123385
- target: [this.markStepsStatusFx]
123386
- });
123387
- this.nextStep.watch(() => {
123388
- this.setSubmitErrorMessage(null);
123389
- const currentStep = this.$activeStep.getState();
123390
- const steps2 = this.$steps.getState();
123391
- this.goToStep(steps2[currentStep.order].step);
123392
- });
123393
- this.previousStep.watch(() => {
123394
- const currentStep = this.$activeStep.getState();
123395
- const steps2 = this.$steps.getState();
123396
- this.goToStep(steps2[currentStep.order - 2].step);
123397
- });
123398
- this.$existingBases.on(this.setExistingBases, (_2, value) => value);
123399
- this.$serviceId.on(this.setServiceId, (_2, value) => value);
123400
- this.$loading.on(this.setLoading, (_2, value) => value);
123401
- this.$isOpen.on(this.setIsOpen, (_2, value) => value);
123402
- this.$stateWasChanged.on(this.setStateWasChanged, (_2, value) => value);
123403
- this.$serverType.on(this.setServerType, (_2, value) => value);
123404
- this.$serverName.on(this.setServerName, (_2, value) => value);
123405
- this.$authentication.on(this.setAuthentication, (_2, value) => value);
123406
- this.$port.on(this.setPort, (_2, value) => value);
123407
- this.$login.on(this.setLogin, (_2, value) => value);
123408
- this.$password.on(this.setPassword, (_2, value) => value);
123409
- this.$databaseName.on(this.setDatabaseName, (_2, value) => value);
123410
- this.$alias.on(this.setAlias, (_2, value) => value?.toLowerCase());
123411
- this.$locationType.on(this.setLocationType, (_2, value) => value);
123412
- this.$locationPath.on(this.setLocationPath, (_2, value) => value);
123413
- this.$tablesPlacements.on(this.setTablesPlacements, (_2, value) => value);
123414
- this.$localeId.on(this.setLocaleId, (_2, value) => value);
123415
- this.$availableLibraries.on(this.setAvailableLibraries, (_2, value) => value.sort((a2, b2) => a2.name.localeCompare(b2.name)));
123416
- this.$selectedLibraries.on(this.setSelectedLibraries, (_2, value) => value);
123417
- this.$disabledLibraries.on(this.setDisabledLibraries, (_2, value) => value);
123418
- this.$operationTimeout.on(this.setOperationTimeout, (_2, value) => value);
123419
- this.$solutions.on(this.setSolutions, (_2, value) => {
123420
- this.setHaveCheckedSolutions(value.some((s2) => s2.selected));
123421
- return value;
123422
- });
123423
- this.$haveCheckedSolutions.on(this.setHaveCheckedSolutions, (_2, value) => value);
123424
- this.$passwordChanged.on(this.setPassword, () => true);
123425
- this.$submitErrorMessage.on(this.setSubmitErrorMessage, (_2, value) => value);
123426
- this.$processStatus.on(this.setProcessStatus, (_2, value) => value);
123427
- this.$scriptGeneratorVersion.on(this.setScriptGeneratorVersion, (_2, value) => value);
123428
- this.$mode.on(this.setMode, (_2, value) => value);
123429
- this.setMode(options.mode);
123430
- this.$processIsCancelling.on(this.setProcessIsCancelling, (_2, value) => value);
123431
- this.setServiceId(options.serviceId);
123432
- this.toggleLibrary.watch((library) => {
123433
- this.toggleLibraryFx(library);
123434
- });
123435
- if (options.mode === DatabaseWizardMode.Update) {
123436
- this.initUpdateMode();
123437
- }
123438
- if (options.model) {
123439
- this.initExitingModel();
123440
- }
123441
- this.$isOpen.watch((value) => {
123442
- if (!value) {
123443
- window.removeEventListener("beforeunload", this.onBeforeWindowUnload);
123444
- } else {
123445
- window.addEventListener("beforeunload", this.onBeforeWindowUnload);
123446
- }
123447
- });
123448
- }
123449
- }
123450
- function DatabaseWizardStepLabel(props) {
123451
- let iconComponent = null;
123452
- switch (props.stepStatus) {
123453
- case DatabaseWizardStepStatus.Active:
123454
- iconComponent = /* @__PURE__ */ jsx("svg", { className: "database-wizard__step-label-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { fill: "white", d: "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" }) });
123455
- break;
123456
- case DatabaseWizardStepStatus.Finished:
123457
- iconComponent = /* @__PURE__ */ jsx("svg", { className: "database-wizard__step-label-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { fill: "white", d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) });
123458
- break;
123459
- default:
123460
- iconComponent = /* @__PURE__ */ jsx("span", { className: "database-wizard__step-label-number", children: props.number });
123461
- }
123462
- return /* @__PURE__ */ jsxs("div", { className: classNames("database-wizard__step-label-wrapper", {
123463
- "database-wizard__step-label-wrapper_active": props.stepStatus === DatabaseWizardStepStatus.Active,
123464
- "database-wizard__step-label-wrapper_finished": props.stepStatus === DatabaseWizardStepStatus.Finished,
123465
- "database-wizard__step-label-wrapper_no-clickable": !props.clickable
123466
- }), ...props, children: [
123467
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-label-icon-circle", children: iconComponent }),
123468
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-label-text", children: props.text })
123469
- ] });
123470
- }
123471
- function DatabaseWizardModal(props) {
123472
- return /* @__PURE__ */ jsx(
123473
- ModalDialog$2,
123474
- {
123475
- className: "database-wizard__modal",
123476
- headerClass: "database-wizard__modal-header",
123477
- closeButtonClass: "database-wizard__modal-close-button",
123478
- showButtonsPanel: false,
123479
- ...props
123480
- }
123481
- );
123482
- }
123483
- function DatabaseWizardHeader(props) {
123484
- return /* @__PURE__ */ jsxs("h2", { className: "database-wizard__modal-header", ...props, children: [
123485
- /* @__PURE__ */ jsx("svg", { className: "database-wizard__modal-header-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M21 22H3V20H21V22M19 19H5L11.1 2.6C11.3 2.2 11.6 2 12 2L18 5H13.9L19 19M10 7.5L11.04 7.97L11.5 9L11.97 7.97L13 7.5L11.97 7.03L11.5 6L11.04 7.03L10 7.5M13 15L10.94 14.07L10 12L9.07 14.07L7 15L9.07 15.93L10 18L10.94 15.93L13 15M13.97 11.97L15 11.5L13.97 11.03L13.5 10L13.04 11.03L12 11.5L13.04 11.97L13.5 13L13.97 11.97M15.97 15.97L17 15.5L15.97 15.03L15.5 14L15.04 15.03L14 15.5L15.04 15.97L15.5 17L15.97 15.97Z" }) }),
123486
- props.text
123487
- ] });
123488
- }
123489
- function DatabaseWizardStepLabelsWrapper(props) {
123490
- return /* @__PURE__ */ jsx("div", { ...props, className: "database-wizard__step-labels-wrapper" });
123491
- }
123492
- function DatabaseWizardContentBlock(props) {
123493
- const { expandable, expanded, header, ...divProps } = props;
123494
- const [isExpanded, setIsExpanded] = useState(expandable || expanded);
123495
- useEffect(() => {
123496
- setIsExpanded(!expandable || expanded);
123497
- }, [expanded]);
123498
- const onExpand = () => {
123499
- expandable && setIsExpanded(!isExpanded);
123500
- };
123501
- return /* @__PURE__ */ jsxs("div", { ...divProps, className: classNames("database-wizard__content-block", props.className, {
123502
- "database-wizard__content-block_expandable": expandable,
123503
- "database-wizard__content-block_expanded": isExpanded
123504
- }), children: [
123505
- header && /* @__PURE__ */ jsxs(
123506
- "div",
123507
- {
123508
- className: classNames(
123509
- "database-wizard__content-block-header",
123510
- { "database-wizard__content-block-header_expandable": expandable }
123511
- ),
123512
- onClick: onExpand,
123513
- children: [
123514
- expandable && /* @__PURE__ */ jsx("svg", { className: "database-wizard__content-block-expand-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z" }) }),
123515
- header
123516
- ]
123517
- }
123518
- ),
123519
- divProps.children
123520
- ] });
123521
- }
123522
- function DatabaseWizardButtonPanel(props) {
123523
- const { active, ...divProps } = props;
123524
- const activeClass = active ? "database-wizard__buttons-panel_active" : "";
123525
- return /* @__PURE__ */ jsx("div", { className: `database-wizard__buttons-panel ${activeClass}`, ...divProps });
123526
- }
123527
- function DatabaseForm(props) {
123528
- const { logic, view } = props;
123529
- const $databaseName = e(logic.$databaseName);
123530
- const $alias = e(logic.$alias);
123531
- const $locationType = e(logic.$locationType);
123532
- const $locationPath = e(logic.$locationPath);
123533
- const $localeId = e(logic.$localeId);
123534
- const $tablesPlacements = e(logic.$tablesPlacements);
123535
- const $existingBases = e(logic.$existingBases);
123536
- const $serverType = e(logic.$serverType);
123537
- const $loading = e(logic.$loading);
123538
- const $submitErrorMessage = e(logic.$submitErrorMessage);
123539
- const $mode = e(logic.$mode);
123540
- const { register, handleSubmit, control, ...methods } = useForm(
123541
- {
123542
- mode: "onTouched",
123543
- values: {
123544
- databaseName: $databaseName,
123545
- alias: $alias,
123546
- locationType: $locationType,
123547
- locationPath: $locationPath,
123548
- localeId: $localeId,
123549
- tablesPlacements: $tablesPlacements
123550
- }
123551
- }
123552
- );
123553
- const onTablePlacementItemChange = (item, value) => {
123554
- if (typeof value === "boolean") {
123555
- $tablesPlacements[item] = value;
123556
- } else {
123557
- $tablesPlacements[item] = TableLocationTypeExtended[value];
123558
- }
123559
- logic.setTablesPlacements({ ...$tablesPlacements });
123560
- };
123561
- const getTableLocationItems = () => {
123562
- const items = [];
123563
- Object.keys($tablesPlacements).map((param, index) => {
123564
- let options = [];
123565
- let selectedDisplayValue = null;
123566
- if (typeof $tablesPlacements[param] === "boolean") {
123567
- options.push({ displayValue: props.services.resources.On, value: true });
123568
- options.push({ displayValue: props.services.resources.Off, value: false });
123569
- selectedDisplayValue = $tablesPlacements[param] ? true : false;
123570
- } else if (param === "changedObjectDataBaseType") {
123571
- options = getTableLocationTypeExtendedNames().map((typeLocationName) => {
123572
- return { displayValue: typeLocationName, value: typeLocationName };
123573
- });
123574
- selectedDisplayValue = TableLocationTypeExtended[$tablesPlacements[param]];
123575
- } else {
123576
- options = getTableLocationTypeNames().map((typeLocationName) => {
123577
- return { displayValue: typeLocationName, value: typeLocationName };
123578
- });
123579
- selectedDisplayValue = TableLocationType[$tablesPlacements[param]];
123580
- }
123581
- items.push(
123582
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper database-wizard__step-form-row-wrapper_table-location", children: [
123583
- /* @__PURE__ */ jsxs("label", { className: "database-wizard__step-form-option-label-select", id: param, htmlFor: param, children: [
123584
- /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-option-title", children: [
123585
- props.services.resources[`DatabaseWizardTableLocation_${param}`],
123586
- ":"
123587
- ] }),
123588
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-option-description", children: param })
123589
- ] }),
123590
- /* @__PURE__ */ jsx(FormControl$3, { disabled: $loading, size: "small", children: /* @__PURE__ */ jsx(
123591
- Select$3,
123592
- {
123593
- ...commonMuiProps.select,
123594
- variant: "outlined",
123595
- name: param,
123596
- labelId: param,
123597
- value: selectedDisplayValue,
123598
- onChange: (e2) => {
123599
- onTablePlacementItemChange(param, e2.target.value);
123600
- },
123601
- disabled: $loading,
123602
- children: options.map((option, index2) => /* @__PURE__ */ jsx(MenuItem$2, { value: option.value, children: option.displayValue }, index2))
123603
- }
123604
- ) })
123605
- ] }, index)
123606
- );
123607
- });
123608
- return items;
123609
- };
123610
- const getDBFileLocationOptions = () => {
123611
- return getDBFileLocationTypeNames().map((typeLocationName) => {
123612
- return {
123613
- displayValue: props.services.resources[`DBFileLocation_${typeLocationName}`],
123614
- value: DBFIleLocationType[typeLocationName]
123615
- };
123616
- });
123617
- };
123618
- const getLocaleIdOptions = () => {
123619
- return getLocaleIdNames().map((localeIdOption) => {
123620
- return {
123621
- displayValue: props.services.resources[`Locale_${localeIdOption}`],
123622
- value: LocaleId[localeIdOption]
123623
- };
123624
- });
123625
- };
123626
- const onDataBaseNameChange = (value) => {
123627
- logic.setDatabaseName(value);
123628
- logic.setAlias(value);
123629
- };
123630
- const databaseNameField = register("databaseName", {
123631
- required: props.services.resources.Dialog_ValidationRequired,
123632
- onChange: (e2) => onDataBaseNameChange(e2.target.value)
123633
- });
123634
- const locationPathField = register("locationPath", {
123635
- disabled: $locationType !== DBFIleLocationType.Other,
123636
- required: props.services.resources.Dialog_ValidationRequired,
123637
- onChange: (e2) => logic.setLocationPath(e2.target.value)
123638
- });
123639
- const aliasInputRef = React__default.useRef(null);
123640
- const [aliasInputSelection, setAliasInputSelection] = React__default.useState({ start: 0, end: 0, direction: "forward" });
123641
- useLayoutEffect(() => {
123642
- aliasInputRef.current.setSelectionRange(aliasInputSelection.start, aliasInputSelection.end, aliasInputSelection.direction);
123643
- }, [aliasInputSelection.start, aliasInputSelection.end, aliasInputSelection.direction]);
123644
- const aliasField = register("alias", {
123645
- required: props.services.resources.Dialog_ValidationRequired,
123646
- onChange: (e2) => {
123647
- const startPos = e2.target.selectionStart;
123648
- const endPos = e2.target.selectionEnd;
123649
- logic.setAlias(e2.target.value);
123650
- setAliasInputSelection({ start: startPos, end: endPos, direction: "forward" });
123651
- }
123652
- });
123653
- return /* @__PURE__ */ jsxs("form", { className: "database-wizard__step-form", ref: props.currentFormRef, onSubmit: handleSubmit(props.onSubmit), children: [
123654
- /* @__PURE__ */ jsxs("fieldset", { disabled: $loading, className: "database-wizard__step-form-fieldset", children: [
123655
- /* @__PURE__ */ jsxs(view.contentBlock, { header: getDatabaseWizardFormName(
123656
- props.services,
123657
- DatabaseWizardSteps.Database,
123658
- $serverType === ServerType["MS SQL SERVER"] ? props.mode : DatabaseWizardMode.Add,
123659
- "DBLocation"
123660
- ), children: [
123661
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123662
- /* @__PURE__ */ jsxs("label", { htmlFor: "databaseName", children: [
123663
- props.services.resources.DatabaseWizardLabel_DatabaseName,
123664
- ":"
123665
- ] }),
123666
- /* @__PURE__ */ jsx(
123667
- TextField$3,
123668
- {
123669
- ...databaseNameField,
123670
- id: "databaseName",
123671
- value: $databaseName,
123672
- error: !!methods.formState.errors.databaseName,
123673
- helperText: methods.formState.errors.databaseName?.message,
123674
- autoComplete: "off",
123675
- variant: "outlined",
123676
- size: "small",
123677
- slotProps: { htmlInput: { list: "existing-bases" } },
123678
- placeholder: props.services.resources.DatabaseWizard_DatabaseNamePlaceholder
123679
- }
123680
- ),
123681
- /* @__PURE__ */ jsx("datalist", { id: "existing-bases", children: $existingBases && $existingBases.map((item, index) => /* @__PURE__ */ jsx("option", { value: item }, index)) })
123682
- ] }),
123683
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123684
- /* @__PURE__ */ jsxs("label", { htmlFor: "alias", children: [
123685
- props.services.resources.DatabaseWizardLabel_Alias,
123686
- ":"
123687
- ] }),
123688
- /* @__PURE__ */ jsx(
123689
- TextField$3,
123690
- {
123691
- ...aliasField,
123692
- id: "alias",
123693
- value: $alias,
123694
- error: !!methods.formState.errors.alias,
123695
- helperText: methods.formState.errors.alias?.message,
123696
- autoComplete: "off",
123697
- variant: "outlined",
123698
- size: "small",
123699
- slotProps: {
123700
- htmlInput: { ref: aliasInputRef },
123701
- input: { style: { textTransform: "lowercase" } }
123702
- }
123703
- }
123704
- )
123705
- ] }),
123706
- $mode === DatabaseWizardMode.Create && $serverType === ServerType["MS SQL SERVER"] && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123707
- /* @__PURE__ */ jsx("label", { id: "locationTypeLabel", htmlFor: "locationType", children: props.services.resources.DatabaseWizardLabel_LocationType }),
123708
- /* @__PURE__ */ jsx(FormControl$3, { disabled: $loading, size: "small", children: /* @__PURE__ */ jsx(
123709
- Select$3,
123710
- {
123711
- ...commonMuiProps.select,
123712
- variant: "outlined",
123713
- name: "locationType",
123714
- labelId: "locationTypeLabel",
123715
- value: $locationType,
123716
- onChange: (e2) => {
123717
- logic.setLocationType(e2.target.value);
123718
- },
123719
- disabled: $loading,
123720
- children: getDBFileLocationOptions().map((option, index) => /* @__PURE__ */ jsx(MenuItem$2, { value: option.value, children: option.displayValue }, index))
123721
- }
123722
- ) })
123723
- ] }),
123724
- $locationType === DBFIleLocationType.Other && $serverType === ServerType["MS SQL SERVER"] && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123725
- /* @__PURE__ */ jsx("label", { htmlFor: "locationPath", children: props.services.resources.DatabaseWizardLabel_LocationPath }),
123726
- /* @__PURE__ */ jsx(
123727
- TextField$3,
123728
- {
123729
- ...locationPathField,
123730
- id: "locationPath",
123731
- value: $locationPath,
123732
- error: !!methods.formState.errors.locationPath,
123733
- helperText: methods.formState.errors.locationPath?.message,
123734
- autoComplete: "off",
123735
- variant: "outlined",
123736
- size: "small"
123737
- }
123738
- )
123739
- ] }),
123740
- $serverType === ServerType["MS SQL SERVER"] && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123741
- /* @__PURE__ */ jsx("label", { id: "localeIdLabel", htmlFor: "localeId", children: props.services.resources.DatabaseWizardLabel_LocaleId }),
123742
- /* @__PURE__ */ jsx(FormControl$3, { disabled: $loading, size: "small", children: /* @__PURE__ */ jsx(
123743
- Select$3,
123744
- {
123745
- ...commonMuiProps.select,
123746
- variant: "outlined",
123747
- labelId: "localeIdLabel",
123748
- name: "localeId",
123749
- value: $localeId,
123750
- onChange: (e2) => {
123751
- logic.setLocaleId(e2.target.value);
123752
- },
123753
- disabled: $loading,
123754
- children: getLocaleIdOptions().map((option, index) => /* @__PURE__ */ jsx(MenuItem$2, { value: option.value, children: option.displayValue }, index))
123755
- }
123756
- ) })
123757
- ] })
123758
- ] }),
123759
- $serverType === ServerType["MS SQL SERVER"] && /* @__PURE__ */ jsx(
123760
- view.contentBlock,
123761
- {
123762
- header: getDatabaseWizardFormName(props.services, DatabaseWizardSteps.Database, null, "TableLocation"),
123763
- expandable: true,
123764
- expanded: false,
123765
- children: getTableLocationItems()
123766
- }
123767
- )
123768
- ] }),
123769
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-submit-error", children: $submitErrorMessage })
123770
- ] });
123771
- }
123772
- function ConfigurationForm(props) {
123773
- const { logic, view } = props;
123774
- const $availableLibraries = e(logic.$availableLibraries);
123775
- const $selectedLibraries = e(logic.$selectedLibraries);
123776
- const $disabledLibraries = e(logic.$disabledLibraries);
123777
- const $loading = e(logic.$loading);
123778
- const $submitErrorMessage = e(logic.$submitErrorMessage);
123779
- const $scriptGeneratorVersion = e(logic.$scriptGeneratorVersion);
123780
- const { register, handleSubmit, control, ...methods } = useForm();
123781
- return /* @__PURE__ */ jsxs("form", { className: "database-wizard__step-form", ref: props.currentFormRef, onSubmit: handleSubmit(props.onSubmit), children: [
123782
- /* @__PURE__ */ jsx("fieldset", { disabled: $loading, className: "database-wizard__step-form-fieldset", children: /* @__PURE__ */ jsx(
123783
- view.contentBlock,
123784
- {
123785
- className: "database-wizard__content-block_configuration",
123786
- header: getDatabaseWizardFormName(props.services, DatabaseWizardSteps.Configuration),
123787
- children: !!$availableLibraries.length ? $availableLibraries.map((library) => /* @__PURE__ */ jsx(
123788
- view.library,
123789
- {
123790
- services: props.services,
123791
- scriptGeneratorVersion: $scriptGeneratorVersion,
123792
- library,
123793
- checked: !!$selectedLibraries.some((selectedLibrary) => selectedLibrary.name === library.name),
123794
- disabled: !!$disabledLibraries.some((disabledLibrary) => disabledLibrary.name === library.name),
123795
- disabledLibraries: $disabledLibraries,
123796
- onChange: () => logic.toggleLibrary(library),
123797
- selectedLibraries: $selectedLibraries
123798
- },
123799
- library.name
123800
- )) : /* @__PURE__ */ jsxs(Fragment, { children: [
123801
- /* @__PURE__ */ jsx(
123802
- ContentLoader,
123803
- {
123804
- style: { width: "100%", height: "50px" },
123805
- width: "100px",
123806
- height: "50px",
123807
- viewBox: "0 0 100 35",
123808
- preserveAspectRatio: "none",
123809
- children: /* @__PURE__ */ jsx("rect", { x: "4", y: "12", rx: "5", ry: "5", width: "93", height: "50px" })
123810
- }
123811
- ),
123812
- /* @__PURE__ */ jsx(
123813
- ContentLoader,
123814
- {
123815
- style: { width: "100%", height: "50px" },
123816
- width: "100px",
123817
- height: "50px",
123818
- viewBox: "0 0 100 35",
123819
- preserveAspectRatio: "none",
123820
- children: /* @__PURE__ */ jsx("rect", { x: "4", y: "12", rx: "5", ry: "5", width: "93", height: "50px" })
123821
- }
123822
- ),
123823
- /* @__PURE__ */ jsx(
123824
- ContentLoader,
123825
- {
123826
- style: { width: "100%", height: "50px" },
123827
- width: "100px",
123828
- height: "50px",
123829
- viewBox: "0 0 100 35",
123830
- preserveAspectRatio: "none",
123831
- children: /* @__PURE__ */ jsx("rect", { x: "4", y: "12", rx: "5", ry: "5", width: "93", height: "50px" })
123832
- }
123833
- ),
123834
- /* @__PURE__ */ jsx(
123835
- ContentLoader,
123836
- {
123837
- style: { width: "100%", height: "50px" },
123838
- width: "100px",
123839
- height: "50px",
123840
- viewBox: "0 0 100 35",
123841
- preserveAspectRatio: "none",
123842
- children: /* @__PURE__ */ jsx("rect", { x: "4", y: "12", rx: "5", ry: "5", width: "93", height: "50px" })
123843
- }
123844
- )
123845
- ] })
123846
- }
123847
- ) }),
123848
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-submit-error", children: $submitErrorMessage })
123849
- ] });
123850
- }
123851
- function ConfirmationForm(props) {
123852
- const { logic, view } = props;
123853
- const $operationTimeout = e(logic.$operationTimeout);
123854
- const $databaseName = e(logic.$databaseName);
123855
- const $alias = e(logic.$alias);
123856
- const $localeId = e(logic.$localeId);
123857
- const $serverType = e(logic.$serverType);
123858
- const $serverName = e(logic.$serverName);
123859
- const $loading = e(logic.$loading);
123860
- const $submitErrorMessage = e(logic.$submitErrorMessage);
123861
- const $processStatus = e(logic.$processStatus);
123862
- const $processIsCancelling = e(logic.$processIsCancelling);
123863
- const $mode = e(logic.$mode);
123864
- const $port = e(logic.$port);
123865
- const { register, handleSubmit, control, formState: { errors }, ...methods } = useForm(
123866
- {
123867
- mode: "onTouched",
123868
- values: {
123869
- operationTimeout: $operationTimeout
123870
- }
123871
- }
123872
- );
123873
- const operationTimeoutField = register("operationTimeout", {
123874
- required: props.services.resources.Dialog_ValidationRequired,
123875
- onChange: (e2) => logic.setOperationTimeout(e2.target.value)
123876
- });
123877
- const isStartBlockVisible = () => {
123878
- return !$processStatus || $processStatus?.state === ProcessState.Canceled;
123879
- };
123880
- return /* @__PURE__ */ jsxs("form", { className: "database-wizard__step-form", ref: props.currentFormRef, onSubmit: handleSubmit(props.onSubmit), children: [
123881
- /* @__PURE__ */ jsxs("fieldset", { disabled: $loading, className: "database-wizard__step-form-fieldset", children: [
123882
- /* @__PURE__ */ jsxs(view.contentBlock, { header: getDatabaseWizardFormName(props.services, DatabaseWizardSteps.Confirmation, $mode), children: [
123883
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123884
- /* @__PURE__ */ jsx("label", { htmlFor: "databaseName", children: props.services.resources.DatabaseWizardLabel_DatabaseName }),
123885
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-confirm-value", children: $databaseName })
123886
- ] }),
123887
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123888
- /* @__PURE__ */ jsx("label", { htmlFor: "alias", children: props.services.resources.DatabaseWizardLabel_Alias }),
123889
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-confirm-value", children: $alias })
123890
- ] }),
123891
- $serverType === ServerType["MS SQL SERVER"] && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123892
- /* @__PURE__ */ jsx("label", { children: props.services.resources.DatabaseWizardLabel_LocaleId }),
123893
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-confirm-value", children: props.services.resources[`Locale_${LocaleId[$localeId]}`] })
123894
- ] }),
123895
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123896
- /* @__PURE__ */ jsx("label", { htmlFor: "serverType", children: props.services.resources.DatabaseWizardLabel_ServerType }),
123897
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-confirm-value", children: ServerType[$serverType] })
123898
- ] }),
123899
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123900
- /* @__PURE__ */ jsx("label", { htmlFor: "serverName", children: props.services.resources.DatabaseWizardLabel_ServerName }),
123901
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-confirm-value", children: $serverName })
123902
- ] }),
123903
- $serverType === ServerType.PostgreSQL && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123904
- /* @__PURE__ */ jsx("label", { htmlFor: "port", children: props.services.resources.DatabaseWizardLabel_Port }),
123905
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-confirm-value", children: $port })
123906
- ] }),
123907
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
123908
- /* @__PURE__ */ jsx("label", { htmlFor: "operationTimeout", children: props.services.resources.DatabaseWizardLabel_OperationTimeout }),
123909
- /* @__PURE__ */ jsx(
123910
- TextField$3,
123911
- {
123912
- size: "small",
123913
- className: "database-wizard__step-form-input database-wizard__step-form-input_timeout",
123914
- variant: "outlined",
123915
- type: "number",
123916
- ...operationTimeoutField,
123917
- value: $operationTimeout
123918
- }
123919
- ),
123920
- errors.operationTimeout && /* @__PURE__ */ jsx(ErrorMessage, { message: errors.operationTimeout.message?.toString() })
123921
- ] })
123922
- ] }),
123923
- $mode === DatabaseWizardMode.Create && /* @__PURE__ */ jsxs(view.contentBlock, { header: null, className: "database-wizard__step-form-confirmation-wrapper", children: [
123924
- (!$processStatus || $processStatus?.state === ProcessState.Canceled) && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-attention-wrapper", children: [
123925
- /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text", children: [
123926
- /* @__PURE__ */ jsx(WarningIcon, { fontSize: "large" }),
123927
- props.services.resources.Attention
123928
- ] }),
123929
- props.services.resources.DatabaseWizard_StartAttention
123930
- ] }),
123931
- $processStatus?.state === ProcessState.Error && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-attention-wrapper", children: [
123932
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_warning", children: /* @__PURE__ */ jsx(ErrorIcon, { fontSize: "large", color: "error" }) }),
123933
- props.services.resources.DatabaseWizard_CreateError
123934
- ] }),
123935
- isStartBlockVisible() && /* @__PURE__ */ jsx(
123936
- Button$3,
123937
- {
123938
- disabled: $processIsCancelling || $loading && $processStatus?.state !== ProcessState.Running,
123939
- type: "submit",
123940
- color: "primary",
123941
- variant: "contained",
123942
- className: "database-wizard__step-form-start-button",
123943
- children: $processStatus?.state === ProcessState.Running ? props.services.resources.Cancel : props.services.resources.StartCreation
123944
- }
123945
- ),
123946
- $processStatus?.state === ProcessState.Finished && /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_finished", children: [
123947
- /* @__PURE__ */ jsx(CheckIcon$1, { fontSize: "large" }),
123948
- " ",
123949
- props.services.resources.DatabaseWizard_CreateFinished
123950
- ] }),
123951
- $processStatus?.state === ProcessState.Running && /* @__PURE__ */ jsx(LinearProgress$1, { className: "database-wizard__step-form-progress" })
123952
- ] }),
123953
- $processStatus?.state === ProcessState.Finished && /* @__PURE__ */ jsx(
123954
- view.contentBlock,
123955
- {
123956
- header: null,
123957
- className: "database-wizard__step-form-confirmation-wrapper database-wizard__step-form-confirmation-wrapper_finished",
123958
- children: /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_finished-attention", children: [
123959
- /* @__PURE__ */ jsx(HandPointRightIcon, { fontSize: "large" }),
123960
- " ",
123961
- props.services.resources.DatabaseWizard_FinishAttention
123962
- ] })
123963
- }
123964
- )
123965
- ] }),
123966
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-submit-error", children: $submitErrorMessage })
123967
- ] });
123968
- }
123969
- function UpdateForm(props) {
123970
- const { logic, view } = props;
123971
- const $submitErrorMessage = e(logic.$submitErrorMessage);
123972
- const $processStatus = e(logic.$processStatus);
123973
- const $loading = e(logic.$loading);
123974
- e(logic.$mode);
123975
- const { register, handleSubmit, control, formState: { errors }, ...methods } = useForm();
123976
- const isStartBlockVisible = () => !$processStatus || $processStatus?.state === ProcessState.Canceled;
123977
- return /* @__PURE__ */ jsxs("form", { className: "database-wizard__step-form", ref: props.currentFormRef, onSubmit: handleSubmit(props.onSubmit), children: [
123978
- /* @__PURE__ */ jsxs(view.contentBlock, { header: null, className: "database-wizard__step-form-confirmation-wrapper", children: [
123979
- (!$processStatus || $processStatus?.state === ProcessState.Canceled) && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-attention-wrapper", children: [
123980
- /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_warning", children: [
123981
- /* @__PURE__ */ jsx(WarningIcon, { fontSize: "large" }),
123982
- props.services.resources.Attention
123983
- ] }),
123984
- props.services.resources.DatabaseWizard_UpdateAttention
123985
- ] }),
123986
- $processStatus?.state === ProcessState.Error && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-attention-wrapper", children: [
123987
- /* @__PURE__ */ jsx("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_warning", children: /* @__PURE__ */ jsx(ErrorIcon, { fontSize: "large", color: "error" }) }),
123988
- props.services.resources.DatabaseWizard_UpdateError
123989
- ] }),
123990
- isStartBlockVisible() && /* @__PURE__ */ jsx(
123991
- Button$3,
123992
- {
123993
- disabled: $loading,
123994
- type: "submit",
123995
- color: "primary",
123996
- variant: "contained",
123997
- className: "database-wizard__step-form-start-button",
123998
- children: props.services.resources.StartUpdate
123999
- }
124000
- ),
124001
- $processStatus?.state === ProcessState.Finished && /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_finished", children: [
124002
- /* @__PURE__ */ jsx(CheckIcon, { fontSize: "large" }),
124003
- " ",
124004
- props.services.resources.DatabaseWizard_UpdateFinished
124005
- ] }),
124006
- $processStatus?.state === ProcessState.Running && /* @__PURE__ */ jsx(LinearProgress$1, { className: "database-wizard__step-form-progress" })
124007
- ] }),
124008
- $processStatus?.state === ProcessState.Finished && /* @__PURE__ */ jsx(
124009
- view.contentBlock,
124010
- {
124011
- header: null,
124012
- className: "database-wizard__step-form-confirmation-wrapper database-wizard__step-form-confirmation-wrapper_finished",
124013
- children: /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_finished-attention", children: [
124014
- /* @__PURE__ */ jsx(HandPointRightIcon, { fontSize: "large" }),
124015
- " ",
124016
- props.services.resources.DatabaseWizard_FinishAttention
124017
- ] })
124018
- }
124019
- ),
124020
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-submit-error", children: $submitErrorMessage })
124021
- ] });
124022
- }
124023
- function UploadSettingsForm(props) {
124024
- const { logic, view } = props;
124025
- const $loading = e(logic.$loading);
124026
- const $submitErrorMessage = e(logic.$submitErrorMessage);
124027
- const $solutions = e(logic.$solutions);
124028
- const $processStatus = e(logic.$processStatus);
124029
- const $haveCheckedSolutions = e(logic.$haveCheckedSolutions);
124030
- const { register, handleSubmit, control, formState: { errors }, ...methods } = useForm(
124031
- {
124032
- mode: "onTouched"
124033
- }
124034
- );
124035
- return /* @__PURE__ */ jsxs("form", { className: "database-wizard__step-form", ref: props.currentFormRef, onSubmit: handleSubmit(props.onSubmit), children: [
124036
- /* @__PURE__ */ jsxs("fieldset", { disabled: $loading, className: "database-wizard__step-form-fieldset", children: [
124037
- (!$processStatus || $processStatus?.state === ProcessState.Canceled) && /* @__PURE__ */ jsx(view.contentBlock, { header: null, className: "database-wizard__step-form-confirmation-wrapper", children: /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-attention-wrapper", children: [
124038
- /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text", children: [
124039
- /* @__PURE__ */ jsx(WarningIcon, { fontSize: "large" }),
124040
- props.services.resources.Attention
124041
- ] }),
124042
- props.services.resources.DatabaseWizard_BeforeUploadSettingsAttention
124043
- ] }) }),
124044
- /* @__PURE__ */ jsxs(
124045
- view.contentBlock,
124046
- {
124047
- className: "database-wizard__content-block_configuration",
124048
- header: getDatabaseWizardFormName(props.services, DatabaseWizardSteps.UploadSettings),
124049
- children: [
124050
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-content-wrapper database-wizard__step-form-content-wrapper_modules", children: $solutions.map((module2) => /* @__PURE__ */ jsxs("div", { className: classNames(
124051
- "database-wizard__step-form-row-wrapper",
124052
- "database-wizard__step-form-row-wrapper_modules",
124053
- { "database-wizard__step-form-row-wrapper_modules-disabled": module2.disabled }
124054
- ), children: [
124055
- /* @__PURE__ */ jsx(
124056
- Checkbox$1,
124057
- {
124058
- disabled: module2.disabled || !!$processStatus,
124059
- name: module2.name,
124060
- className: "database-wizard__step-form-fieldset-checkbox",
124061
- checked: module2.selected,
124062
- onChange: () => logic.toggleSolution(module2),
124063
- id: module2.name
124064
- }
124065
- ),
124066
- /* @__PURE__ */ jsx("label", { htmlFor: module2.name, className: "database-wizard__step-form-fieldset-label", children: module2.name })
124067
- ] }, module2.name)) }),
124068
- !$processStatus && /* @__PURE__ */ jsx(
124069
- Button$3,
124070
- {
124071
- disabled: !$haveCheckedSolutions || $loading,
124072
- type: "submit",
124073
- color: "primary",
124074
- variant: "contained",
124075
- className: "database-wizard__step-form-start-upload-button",
124076
- "data-testId": "upload-button",
124077
- children: $processStatus?.state === ProcessState.Running ? props.services.resources.Cancel : props.services.resources.StartUpload
124078
- }
124079
- ),
124080
- $processStatus?.state === ProcessState.Running && /* @__PURE__ */ jsx(LinearProgress$1, { className: "database-wizard__step-form-progress" }),
124081
- $processStatus?.state === ProcessState.Finished && /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_finished", children: [
124082
- /* @__PURE__ */ jsx(CheckIcon$1, { fontSize: "large" }),
124083
- " ",
124084
- props.services.resources.DatabaseWizard_CompletedSuccessfully
124085
- ] }),
124086
- $processStatus?.state === ProcessState.Error && /* @__PURE__ */ jsxs("span", { className: "database-wizard__step-form-attention-text database-wizard__step-form-attention-text_warning", children: [
124087
- /* @__PURE__ */ jsx(ErrorIcon, { fontSize: "large", color: "error" }),
124088
- " ",
124089
- props.services.resources.DatabaseWizard_UploadError
124090
- ] })
124091
- ]
124092
- }
124093
- )
124094
- ] }),
124095
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-submit-error", children: $submitErrorMessage })
124096
- ] });
124097
- }
124098
- function SqlServerForm(props) {
124099
- const { logic, view } = props;
124100
- const $serverType = e(logic.$serverType);
124101
- const $authentication = e(logic.$authentication);
124102
- const $serverName = e(logic.$serverName);
124103
- const $port = e(logic.$port);
124104
- const $login = e(logic.$login);
124105
- const $password = e(logic.$password);
124106
- const $loading = e(logic.$loading);
124107
- const $submitErrorMessage = e(logic.$submitErrorMessage);
124108
- const { register, handleSubmit, control, formState: { errors }, ...methods } = useForm(
124109
- {
124110
- mode: "onTouched",
124111
- values: {
124112
- authentication: $authentication,
124113
- serverName: $serverName,
124114
- serverType: $serverType,
124115
- port: $port,
124116
- login: $login,
124117
- password: $password
124118
- }
124119
- }
124120
- );
124121
- const getServerTypeOptions = () => {
124122
- return getServerTypeNames().map((serverTypeName) => {
124123
- return { displayValue: serverTypeName, value: ServerType[serverTypeName] };
124124
- });
124125
- };
124126
- const getAuthenticationOptions = () => {
124127
- return getAuthenticationTypeNames().map((authenticationTypeName) => {
124128
- return { displayValue: authenticationTypeName, value: authenticationTypeName };
124129
- });
124130
- };
124131
- const portField = register("port", {
124132
- required: props.services.resources.Dialog_ValidationRequired,
124133
- onChange: (e2) => logic.setPort(e2.target.value)
124134
- });
124135
- const serverNameField = register("serverName", {
124136
- required: props.services.resources.Dialog_ValidationRequired,
124137
- onChange: (e2) => logic.setServerName(e2.target.value)
124138
- });
124139
- const loginField = register("login", {
124140
- required: props.services.resources.Dialog_ValidationRequired,
124141
- onChange: (e2) => logic.setLogin(e2.target.value)
124142
- });
124143
- const passwordField = register("password", {
124144
- required: props.services.resources.Dialog_ValidationRequired,
124145
- onChange: (e2) => logic.setPassword(e2.target.value)
124146
- });
124147
- return /* @__PURE__ */ jsxs("form", { className: "database-wizard__step-form", ref: props.currentFormRef, onSubmit: handleSubmit(props.onSubmit), children: [
124148
- /* @__PURE__ */ jsx("fieldset", { disabled: $loading, className: "database-wizard__step-form-fieldset", children: /* @__PURE__ */ jsxs(view.contentBlock, { header: getDatabaseWizardFormName(props.services, DatabaseWizardSteps.SQLServer, props.mode), children: [
124149
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
124150
- /* @__PURE__ */ jsxs("label", { id: "serverTypeLabel", htmlFor: "serverType", children: [
124151
- props.services.resources.DatabaseWizardLabel_ServerType,
124152
- ":"
124153
- ] }),
124154
- /* @__PURE__ */ jsx(FormControl$3, { disabled: $loading, size: "small", children: /* @__PURE__ */ jsx(
124155
- Select$3,
124156
- {
124157
- ...commonMuiProps.select,
124158
- variant: "outlined",
124159
- id: "serverType",
124160
- name: "serverType",
124161
- labelId: "serverTypeLabel",
124162
- value: $serverType,
124163
- onChange: (e2) => {
124164
- logic.setServerType(e2.target.value);
124165
- },
124166
- disabled: $loading,
124167
- children: getServerTypeOptions().map((option, index) => /* @__PURE__ */ jsx(MenuItem$2, { value: option.value, children: option.displayValue }, index))
124168
- }
124169
- ) })
124170
- ] }),
124171
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
124172
- /* @__PURE__ */ jsxs("label", { htmlFor: "serverName", children: [
124173
- props.services.resources.DatabaseWizardLabel_ServerName,
124174
- ":"
124175
- ] }),
124176
- /* @__PURE__ */ jsx(
124177
- TextField$3,
124178
- {
124179
- ...serverNameField,
124180
- id: "serverName",
124181
- value: $serverName,
124182
- error: !!errors.serverName,
124183
- helperText: errors.serverName?.message,
124184
- autoComplete: "off",
124185
- variant: "outlined",
124186
- size: "small"
124187
- }
124188
- )
124189
- ] }),
124190
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
124191
- /* @__PURE__ */ jsxs("label", { id: "authenticationLabel", htmlFor: "authentication", children: [
124192
- props.services.resources.DatabaseWizardLabel_Authentication,
124193
- ":"
124194
- ] }),
124195
- /* @__PURE__ */ jsx(FormControl$3, { disabled: $loading, size: "small", children: /* @__PURE__ */ jsx(
124196
- Select$3,
124197
- {
124198
- ...commonMuiProps.select,
124199
- variant: "outlined",
124200
- name: "authentication",
124201
- labelId: "authenticationLabel",
124202
- value: $authentication,
124203
- defaultValue: getAuthenticationOptions()[0].displayValue,
124204
- onChange: (e2) => {
124205
- logic.setAuthentication(e2.target.value);
124206
- },
124207
- disabled: $loading,
124208
- children: getAuthenticationOptions().map((option, index) => /* @__PURE__ */ jsx(MenuItem$2, { value: option.value, children: option.displayValue }, index))
124209
- }
124210
- ) })
124211
- ] }),
124212
- $serverType === ServerType.PostgreSQL && /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
124213
- /* @__PURE__ */ jsxs("label", { htmlFor: "port", children: [
124214
- props.services.resources.DatabaseWizardLabel_Port,
124215
- ":"
124216
- ] }),
124217
- /* @__PURE__ */ jsx(
124218
- TextField$3,
124219
- {
124220
- ...portField,
124221
- id: "port",
124222
- value: $port,
124223
- error: !!errors.port,
124224
- helperText: errors.port?.message,
124225
- autoComplete: "off",
124226
- variant: "outlined",
124227
- type: "number",
124228
- size: "small"
124229
- }
124230
- )
124231
- ] }),
124232
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
124233
- /* @__PURE__ */ jsxs("label", { htmlFor: "login", children: [
124234
- props.services.resources.DatabaseWizardLabel_Login,
124235
- ":"
124236
- ] }),
124237
- /* @__PURE__ */ jsx(
124238
- TextField$3,
124239
- {
124240
- ...loginField,
124241
- id: "login",
124242
- value: $login,
124243
- error: !!errors.login,
124244
- helperText: errors.login?.message,
124245
- autoComplete: "off",
124246
- variant: "outlined",
124247
- size: "small"
124248
- }
124249
- )
124250
- ] }),
124251
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__step-form-row-wrapper", children: [
124252
- /* @__PURE__ */ jsxs("label", { htmlFor: "password", children: [
124253
- props.services.resources.DatabaseWizardLabel_Password,
124254
- ":"
124255
- ] }),
124256
- /* @__PURE__ */ jsx(
124257
- TextField$3,
124258
- {
124259
- ...passwordField,
124260
- id: "password",
124261
- value: $password,
124262
- error: !!errors.password,
124263
- helperText: errors.password?.message,
124264
- autoComplete: "off",
124265
- variant: "outlined",
124266
- size: "small",
124267
- type: "password"
124268
- }
124269
- )
124270
- ] })
124271
- ] }) }),
124272
- /* @__PURE__ */ jsx("div", { className: "database-wizard__step-form-submit-error", children: $submitErrorMessage })
124273
- ] });
124274
- }
124275
- function DatabaseWizardLibrary(props) {
124276
- const { library, checked, disabled, onChange } = props;
124277
- const [isExpanded, setIsExpanded] = useState(false);
124278
- const [unexpandedDependencies, setUnexpandedDependencies] = useState(/* @__PURE__ */ new Set());
124279
- const onExpand = () => {
124280
- setIsExpanded(!isExpanded);
124281
- };
124282
- const onDependencyClick = (dependency, level) => {
124283
- if (level !== 0) {
124284
- return;
124285
- }
124286
- if (unexpandedDependencies.has(dependency)) {
124287
- unexpandedDependencies.delete(dependency);
124288
- setUnexpandedDependencies(new Set(unexpandedDependencies));
124289
- return;
124290
- }
124291
- setUnexpandedDependencies(new Set(unexpandedDependencies.add(dependency)));
124292
- };
124293
- const isDependencyExpanded = (dependency, level) => {
124294
- return !unexpandedDependencies.has(dependency) && isExpandable(dependency, level);
124295
- };
124296
- const isDependencyChecked = (dependency) => {
124297
- return props.selectedLibraries.some((selectedLibrary) => selectedLibrary.alias === dependency.alias) && !props.disabledLibraries.some((disabledLibrary) => disabledLibrary.alias === dependency.alias);
124298
- };
124299
- const getDescriptionClassNames = () => classNames(
124300
- "database-wizard__library-description",
124301
- { "database-wizard__library-description_expanded": isExpanded }
124302
- );
124303
- const isExpandable = (library2, level) => library2.libraryDependencies?.length > 0 && level === 0;
124304
- const renderDependencies = (library2, level = 0) => {
124305
- const dependencyClassNames = classNames(
124306
- "database-wizard__library-dependency",
124307
- { "database-wizard__library-dependency_level": level > 0 }
124308
- );
124309
- return library2.libraryDependencies.map(
124310
- (dependency) => {
124311
- const dependencyWrapperClassNames = classNames(
124312
- "database-wizard__library-dependency-wrapper",
124313
- {
124314
- "database-wizard__library-dependency-wrapper_expandable": isExpandable(dependency, level),
124315
- "database-wizard__library-dependency-wrapper_expanded": isDependencyExpanded(dependency, level),
124316
- "database-wizard__library-dependency-wrapper_with-dependencies": level > 1 && dependency.libraryDependencies?.length > 0
124317
- }
124318
- );
124319
- return /* @__PURE__ */ jsxs("div", { className: dependencyWrapperClassNames, children: [
124320
- /* @__PURE__ */ jsxs("div", { onClick: () => onDependencyClick(dependency, level), className: dependencyClassNames, children: [
124321
- isExpandable(dependency, level) && /* @__PURE__ */ jsx("svg", { className: "database-wizard__library-expand-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z" }) }),
124322
- /* @__PURE__ */ jsx(
124323
- Checkbox$1,
124324
- {
124325
- style: { padding: 0 },
124326
- "data-testid": `dependency-checkbox-${dependency.alias}`,
124327
- className: "database-wizard__library-dependency-checkbox",
124328
- checked: isDependencyChecked(dependency),
124329
- disabled: true
124330
- }
124331
- ),
124332
- dependency.alias
124333
- ] }, dependency.alias),
124334
- !!dependency.libraryDependencies?.length && level < 1 && renderDependencies(dependency, level + 1)
124335
- ] }, dependency.alias);
124336
- }
124337
- );
124338
- };
124339
- let libraryName = library.name;
124340
- if (libraryName !== library.alias) {
124341
- libraryName += ` (${library.alias})`;
124342
- }
124343
- return /* @__PURE__ */ jsxs("div", { className: classNames("database-wizard__library", { "database-wizard__library_disabled": disabled }), children: [
124344
- /* @__PURE__ */ jsx(LightTooltip, { title: getLibraryTooltip(library, props.services), placement: "top", children: /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-header", onClick: onExpand, children: [
124345
- /* @__PURE__ */ jsx(
124346
- Checkbox$1,
124347
- {
124348
- className: "database-wizard__library-checkbox",
124349
- "data-testid": `library-checkbox-${library.alias}`,
124350
- inputProps: {
124351
- "data-testid": `input-library-checkbox-${library.alias}`
124352
- },
124353
- checked,
124354
- disabled,
124355
- name: library.name,
124356
- onChange: (e2) => onChange(e2),
124357
- onClick: (e2) => e2.stopPropagation(),
124358
- color: "primary"
124359
- }
124360
- ),
124361
- /* @__PURE__ */ jsx("label", { className: "database-wizard__library-name", children: libraryName }),
124362
- /* @__PURE__ */ jsx(ExpandMoreIcon, { "data-testid": "expand-icon", className: classNames(
124363
- "database-wizard__library-expand-header-icon",
124364
- { "database-wizard__library-expand-header-icon_expanded": isExpanded }
124365
- ) })
124366
- ] }) }),
124367
- /* @__PURE__ */ jsxs("div", { className: getDescriptionClassNames(), children: [
124368
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-params", children: [
124369
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-params-label", children: [
124370
- props.services.resources.DatabaseWizardLibraryParams_CardLibVersion,
124371
- ":"
124372
- ] }),
124373
- /* @__PURE__ */ jsx("div", { className: "database-wizard__library-params-value", children: library.cardLibVersion || "-" }),
124374
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-params-label", children: [
124375
- props.services.resources.DatabaseWizardLibraryParams_GeneratorVersion,
124376
- ":"
124377
- ] }),
124378
- /* @__PURE__ */ jsx("div", { className: "database-wizard__library-params-value", children: props.scriptGeneratorVersion || "-" }),
124379
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-params-label", children: [
124380
- props.services.resources.DatabaseWizardLibraryParams_DatabaseVersion,
124381
- ":"
124382
- ] }),
124383
- /* @__PURE__ */ jsx("div", { className: "database-wizard__library-params-value", children: library.dbVersion || "-" }),
124384
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-params-label", children: [
124385
- props.services.resources.DatabaseWizardLibraryParams_DatabaseSysVersion,
124386
- ":"
124387
- ] }),
124388
- /* @__PURE__ */ jsx("div", { className: "database-wizard__library-params-value", children: library.dbSysVersion || "-" }),
124389
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-params-label", children: [
124390
- props.services.resources.DatabaseWizardLibraryParams_HaveUserMetadata,
124391
- ":"
124392
- ] }),
124393
- /* @__PURE__ */ jsx("div", { className: "database-wizard__library-params-value", children: library.haveUserMetadata ? props.services.resources.Yes : props.services.resources.No })
124394
- ] }),
124395
- /* @__PURE__ */ jsxs("div", { className: "database-wizard__library-dependencies", children: [
124396
- /* @__PURE__ */ jsx("div", { className: "database-wizard__library-dependencies-title", children: props.services.resources.DatabaseWizardLibraryParams_Dependencies }),
124397
- renderDependencies(library)
124398
- ] })
124399
- ] })
124400
- ] });
124401
- }
124402
- function DatabaseWizardLoadingIcon(props) {
124403
- return /* @__PURE__ */ jsx("div", { ...props, className: classNames("database-wizard__loading-icon-wrapper", props.className), children: /* @__PURE__ */ jsx(CircularProgress$3, { size: 20, color: "primary", className: "database-wizard__loading-icon" }) });
124404
- }
124405
- class DatabaseWizardParamsView {
124406
- constructor() {
124407
- this.modal = DatabaseWizardModal;
124408
- this.header = DatabaseWizardHeader;
124409
- this.labelsWrapper = DatabaseWizardStepLabelsWrapper;
124410
- this.stepLabel = DatabaseWizardStepLabel;
124411
- this.contentBlock = DatabaseWizardContentBlock;
124412
- this.buttonsPanel = DatabaseWizardButtonPanel;
124413
- this.sqlServerForm = SqlServerForm;
124414
- this.databaseForm = DatabaseForm;
124415
- this.configurationForm = ConfigurationForm;
124416
- this.confirmationForm = ConfirmationForm;
124417
- this.updateForm = UpdateForm;
124418
- this.uploadSettingsForm = UploadSettingsForm;
124419
- this.library = DatabaseWizardLibrary;
124420
- this.loadingIcon = DatabaseWizardLoadingIcon;
124421
- }
124422
- }
124423
- function DatabaseWizard(props) {
124424
- const view = useView(props, DatabaseWizardParamsView);
124425
- const logic = useLogic(props, DatabaseWizardLogic);
124426
- const $activeStep = e(logic.$activeStep);
124427
- const $steps = e(logic.$steps);
124428
- const $loading = e(logic.$loading);
124429
- const $isOpen = e(logic.$isOpen);
124430
- e(logic.$processStatus);
124431
- const currentFormRef = React__default.useRef(null);
124432
- e(logic.$solutions);
124433
- const handleStepClick = (step) => {
124434
- logic.goToStep(step);
124435
- };
124436
- useEffect(() => {
124437
- logic.componentDidMount();
124438
- }, [logic]);
124439
- const getActiveForm = () => {
124440
- const ActiveForm = view[getStepFormComponent($activeStep.step)];
124441
- return /* @__PURE__ */ jsx(
124442
- ActiveForm,
124443
- {
124444
- services: props.services,
124445
- mode: props.mode,
124446
- onSubmit: () => logic.stepFormSubmit(),
124447
- logic,
124448
- currentFormRef,
124449
- view
124450
- }
124451
- );
124452
- };
124453
- const getHeaderText = () => {
124454
- return `${props.services.resources.DatabaseWizard} (${props.services.resources[`DatabaseWizard_${DatabaseWizardMode[props.mode]}`]})`;
124455
- };
124456
- return /* @__PURE__ */ jsxs(
124457
- view.modal,
124458
- {
124459
- isOpen: $isOpen,
124460
- onClickCloseButton: () => logic.stepFormCancel(),
124461
- header: /* @__PURE__ */ jsx(view.header, { text: getHeaderText() }),
124462
- children: [
124463
- /* @__PURE__ */ jsx(view.labelsWrapper, { children: $steps.map((step) => /* @__PURE__ */ jsx(
124464
- view.stepLabel,
124465
- {
124466
- text: step.name,
124467
- number: step.order,
124468
- stepStatus: step.status,
124469
- onClick: () => handleStepClick(step.step),
124470
- clickable: !!isStepClickable(step, logic)
124471
- },
124472
- step.step
124473
- )) }),
124474
- getActiveForm(),
124475
- /* @__PURE__ */ jsxs(view.buttonsPanel, { active: true, children: [
124476
- $activeStep !== $steps[$steps.length - 1] && /* @__PURE__ */ jsxs(Fragment, { children: [
124477
- /* @__PURE__ */ jsx(
124478
- Button$3,
124479
- {
124480
- color: "primary",
124481
- className: "database-wizard__modal-button database-wizard__modal-button_cancel",
124482
- onClick: () => logic.stepFormCancel(),
124483
- disabled: isCancelButtonDisabled($activeStep, logic),
124484
- type: "button",
124485
- "data-testId": "cancel-button",
124486
- children: props.services.resources.Cancel
124487
- }
124488
- ),
124489
- /* @__PURE__ */ jsx(
124490
- Button$3,
124491
- {
124492
- className: "database-wizard__modal-button database-wizard__modal-button_previous",
124493
- color: "primary",
124494
- onClick: () => logic.previousStep(),
124495
- disabled: isBackButtonDisabled($activeStep, logic),
124496
- type: "button",
124497
- "data-testId": "previous-button",
124498
- children: props.services.resources.Back
124499
- }
124500
- ),
124501
- /* @__PURE__ */ jsx(
124502
- Button$3,
124503
- {
124504
- variant: "contained",
124505
- className: "database-wizard__modal-button database-wizard__modal-button_next",
124506
- color: "primary",
124507
- onClick: () => currentFormRef.current?.requestSubmit(),
124508
- disabled: isNextButtonDisabled($activeStep, logic),
124509
- type: "button",
124510
- "data-testId": "next-button",
124511
- children: props.services.resources.Next
124512
- }
124513
- )
124514
- ] }),
124515
- $loading && /* @__PURE__ */ jsx(view.loadingIcon, {}),
124516
- $activeStep === $steps[$steps.length - 1] && /* @__PURE__ */ jsx(
124517
- Button$3,
124518
- {
124519
- variant: "contained",
124520
- className: "database-wizard__modal-button database-wizard__modal-button_next",
124521
- color: "primary",
124522
- onClick: () => logic.stepFormDone(),
124523
- disabled: isDoneButtonDisabled($activeStep, logic),
124524
- type: "button",
124525
- children: props.services.resources.Done
124526
- }
124527
- )
124528
- ] })
124529
- ]
124530
- }
124531
- );
124532
- }
124533
- class DatabaseWizardService {
124534
- constructor(services, rootElementId) {
124535
- this.services = services;
124536
- this.rootElementId = rootElementId;
124537
- this.name = "DatabaseWizard";
124538
- this.meta = null;
124539
- }
124540
- getRootElement() {
124541
- const modalRoot = document.createElement("div");
124542
- document.getElementById(this.rootElementId).prepend(modalRoot);
124543
- return modalRoot;
124544
- }
124545
- openCreateMode(serviceId, databaseChangeStateEvent) {
124546
- const rootElement = this.getRootElement();
124547
- ReactDOM__default.render(/* @__PURE__ */ jsx(ThemeProvider$1, { theme, children: /* @__PURE__ */ jsx(
124548
- DatabaseWizard,
124549
- {
124550
- serviceId,
124551
- databaseChangeStateEvent,
124552
- mode: DatabaseWizardMode.Create,
124553
- services: this.services
124554
- }
124555
- ) }), rootElement);
124556
- }
124557
- openUpdateMode(serviceId, databaseAlias, databaseChangeStateEvent) {
124558
- const rootElement = this.getRootElement();
124559
- ReactDOM__default.render(/* @__PURE__ */ jsx(ThemeProvider$1, { theme, children: /* @__PURE__ */ jsx(
124560
- DatabaseWizard,
124561
- {
124562
- serviceId,
124563
- databaseChangeStateEvent,
124564
- mode: DatabaseWizardMode.Update,
124565
- services: this.services,
124566
- alias: databaseAlias
124567
- }
124568
- ) }), rootElement);
124569
- }
124570
- openConnectMode(serviceId, databaseChangeStateEvent) {
124571
- const rootElement = this.getRootElement();
124572
- ReactDOM__default.render(/* @__PURE__ */ jsx(ThemeProvider$1, { theme, children: /* @__PURE__ */ jsx(
124573
- DatabaseWizard,
124574
- {
124575
- serviceId,
124576
- databaseChangeStateEvent,
124577
- mode: DatabaseWizardMode.Add,
124578
- services: this.services
124579
- }
124580
- ) }), rootElement);
124581
- }
124582
- }
124583
- const $DatabaseMasterController = serviceName((s2) => s2.databaseMasterController);
124584
- class DatabaseMasterController {
124585
- constructor(requestService) {
124586
- this.requestService = requestService;
124587
- this.name = "DatabaseMaster";
124588
- this.meta = null;
124589
- this.baseUrl = "api/DatabaseMaster";
124590
- }
124591
- setState(serviceId, model) {
124592
- return this.requestService.post(`${this.baseUrl}/state?serviceId=${serviceId}`, model);
124593
- }
124594
- getState(serviceId, databaseAlias) {
124595
- return this.requestService.get(`${this.baseUrl}/state?serviceId=${serviceId}&databaseAlias=${databaseAlias}`);
124596
- }
124597
- deleteState(serviceId, databaseAlias) {
124598
- return this.requestService.delete(`${this.baseUrl}/state?serviceId=${serviceId}&databaseAlias=${databaseAlias}`);
124599
- }
124600
- }
124601
- const $DatabasesConfigurationController = serviceName((s2) => s2.databasesConfigurationController);
124602
- class DatabasesConfigurationController {
124603
- constructor(requestService) {
124604
- this.requestService = requestService;
124605
- this.name = "DatabasesConfiguration";
124606
- this.meta = null;
124607
- this.baseUrl = "api/DatabasesConfiguration";
124608
- }
124609
- all(serviceId) {
124610
- return this.requestService.get(`${this.baseUrl}/all?serviceId=${serviceId}`);
124611
- }
124612
- getDefault(serviceId) {
124613
- return this.requestService.get(`${this.baseUrl}/default?serviceId=${serviceId}`);
124614
- }
124615
- setDefault(serviceId, databaseAlias) {
124616
- return this.requestService.post(`${this.baseUrl}/default?serviceId=${serviceId}&defaultDatabaseAlias=${databaseAlias}`, {});
124617
- }
124618
- add(serviceId, databaseAlias) {
124619
- return this.requestService.post(`${this.baseUrl}/add?serviceId=${serviceId}&databaseAlias=${databaseAlias}`, {});
124620
- }
124621
- delete(serviceId, databaseAlias) {
124622
- return this.requestService.delete(`${this.baseUrl}?serviceId=${serviceId}&databaseAlias=${databaseAlias}`, {});
124623
- }
124624
- }
124625
- const $DatabasesController = serviceName((s2) => s2.databasesController);
124626
- class DatabasesController {
124627
- constructor(requestService) {
124628
- this.requestService = requestService;
124629
- this.name = "Databases";
124630
- this.meta = null;
124631
- this.baseUrl = "api/Databases";
124632
- }
124633
- create(serviceId, databaseAlias) {
124634
- return this.requestService.post(`${this.baseUrl}/create?serviceId=${serviceId}&databaseAlias=${databaseAlias}`, {});
124635
- }
124636
- update(serviceId, databaseAlias) {
124637
- return this.requestService.post(`${this.baseUrl}/update?serviceId=${serviceId}&databaseAlias=${databaseAlias}`, {});
124638
- }
124639
- status(serviceId, databaseAlias) {
124640
- return this.requestService.get(`${this.baseUrl}/status?serviceId=${serviceId}&databaseAlias=${databaseAlias}`);
124641
- }
124642
- stop(serviceId, databaseAlias) {
124643
- return this.requestService.post(`${this.baseUrl}/stop?serviceId=${serviceId}&databaseAlias=${databaseAlias}`, {});
124644
- }
124645
- databases(serviceId, serverParameters) {
124646
- return this.requestService.post(`${this.baseUrl}/databases?serviceId=${serviceId}`, { ...serverParameters });
124647
- }
124648
- checkSqlServerConnection(serviceId, serverParameters) {
124649
- return this.requestService.post(`${this.baseUrl}/CheckSqlServerConnection?serviceId=${serviceId}`, { ...serverParameters });
124650
- }
124651
- checkSqlDatabaseConnection(serviceId, serverParameters, databaseParameters) {
124652
- return this.requestService.post(
124653
- `${this.baseUrl}/CheckSqlDatabaseConnection?serviceId=${serviceId}`,
124654
- { server: serverParameters, database: databaseParameters }
124655
- );
124656
- }
124657
- checkSqlDatabaseConnectionFull(serviceId, serverParameters, databaseParameters) {
124658
- return this.requestService.post(
124659
- `${this.baseUrl}/CheckSqlDatabaseConnectionFull?serviceId=${serviceId}`,
124660
- { server: serverParameters, database: databaseParameters }
124661
- );
124662
- }
124663
- info(serviceId) {
124664
- return this.requestService.get(`${this.baseUrl}/info?serviceId=${serviceId}`);
124665
- }
124666
- libraries(serviceId, databaseAlias) {
124667
- return this.requestService.get(
124668
- `${this.baseUrl}/libraries?serviceId=${serviceId}&databaseAlias=${databaseAlias}`,
124669
- {},
124670
- { disableDialogsOnErrors: true }
124671
- );
124672
- }
124673
- solutions(serviceId, databaseAlias) {
124674
- return this.requestService.get(
124675
- `${this.baseUrl}/solutions?serviceId=${serviceId}&databaseAlias=${databaseAlias}`,
124676
- {},
124677
- { disableDialogsOnErrors: true }
124678
- );
124679
- }
124680
- installSolutions(serviceId, databaseAlias, solutions) {
124681
- return this.requestService.post(`${this.baseUrl}/installSolutions?serviceId=${serviceId}&databaseAlias=${databaseAlias}`, { solutions });
124682
- }
124683
- }
124684
- const $DatabaseWizard = serviceName((s2) => s2.databaseWizardService);
124685
121488
  const $RealtimeCommunication = serviceName((s2) => s2.realtimeCommunication);
124686
121489
  class HttpError extends Error {
124687
121490
  /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.
@@ -127738,8 +124541,14 @@ class ProcessTemplatesController {
127738
124541
  this.meta = null;
127739
124542
  this.baseUrl = "api/workflow/processTemplate";
127740
124543
  }
127741
- installProcessTemplates(serviceId, pageId, elementId, data) {
127742
- return this.requestService.post(`${this.baseUrl}?serviceId=${serviceId}&pageId=${pageId}&elementId=${elementId}`, data);
124544
+ installProcessTemplates(serviceId, data) {
124545
+ return this.requestService.post(`${this.baseUrl}?serviceId=${serviceId}`, data);
124546
+ }
124547
+ }
124548
+ const $RootElement = serviceName((s2) => s2.rootElement);
124549
+ class RootElementService {
124550
+ constructor(rootElementId) {
124551
+ this.rootElementId = rootElementId;
127743
124552
  }
127744
124553
  }
127745
124554
  class Application extends ServiceContainer {
@@ -127811,15 +124620,12 @@ class Application extends ServiceContainer {
127811
124620
  this.registerService($ServersController, new ServersController(this.requestService));
127812
124621
  this.registerService($SettingsNavigation, new SettingsNavigationService(this));
127813
124622
  this.registerService($FormControl, new FormControlService());
127814
- this.registerService($DatabaseMasterController, new DatabaseMasterController(this.requestService));
127815
- this.registerService($DatabasesController, new DatabasesController(this.requestService));
127816
- this.registerService($DatabasesConfigurationController, new DatabasesConfigurationController(this.requestService));
127817
- this.registerService($DatabaseWizard, new DatabaseWizardService(this, this.reactRootElementId));
127818
124623
  this.registerService($RealtimeCommunication, new RealtimeCommunicationService(this.applicationSettings));
127819
124624
  this.registerService($ConfigurationLocksController, new ConfigurationLocksController(this.requestService));
127820
124625
  this.registerService($ExtendedConfigurationController, new ExtendedConfigurationController(this.requestService));
127821
124626
  this.registerService($SessionsController, new SessionsController(this.requestService));
127822
124627
  this.registerService($ProcessTemplatesController, new ProcessTemplatesController(this.requestService));
124628
+ this.registerService($RootElement, new RootElementService(this.reactRootElementId));
127823
124629
  await this.registerLocalization();
127824
124630
  this.registerService($MessageWindow, new MessageWindowService({ resources: this.resources }));
127825
124631
  const about = await this.requestService.get("api/about");
@@ -127946,6 +124752,22 @@ function SectionContentWrapper(props) {
127946
124752
  }) })
127947
124753
  ] });
127948
124754
  }
124755
+ function SettingsPageButtonPanel(props) {
124756
+ const { buttons, ...rest } = props;
124757
+ return /* @__PURE__ */ jsx("div", { className: "settings-page__button-panel", ...rest, children: buttons.map(
124758
+ (buttonProps) => /* @__PURE__ */ jsx(
124759
+ Button$3,
124760
+ {
124761
+ onClick: buttonProps.onClick,
124762
+ variant: "contained",
124763
+ size: "small",
124764
+ color: "secondary",
124765
+ children: buttonProps.value
124766
+ },
124767
+ buttonProps.value?.toString()
124768
+ )
124769
+ ) });
124770
+ }
127949
124771
  export {
127950
124772
  $AboutSettings,
127951
124773
  $ApplicationSettings,
@@ -127959,6 +124781,7 @@ export {
127959
124781
  $LocalizationService,
127960
124782
  $Resources,
127961
124783
  $ResourcesManagement,
124784
+ $RootElement,
127962
124785
  $RouteContentRender,
127963
124786
  $SettingsNavigation,
127964
124787
  $TenantsService,
@@ -127998,10 +124821,10 @@ export {
127998
124821
  EditorName,
127999
124822
  EditorWrapper,
128000
124823
  ErrorBlock,
128001
- ErrorIcon$1 as ErrorIcon,
124824
+ ErrorIcon,
128002
124825
  ErrorMessage,
128003
124826
  ExpandButton$1 as ExpandButton,
128004
- ExpandMoreIcon$1 as ExpandMoreIcon,
124827
+ ExpandMoreIcon,
128005
124828
  ExtensionsService,
128006
124829
  FormControlService,
128007
124830
  GroupPanel,
@@ -128026,8 +124849,8 @@ export {
128026
124849
  PageTabPanel,
128027
124850
  PageTable,
128028
124851
  PageTitle,
128029
- ProcessOverlay,
128030
124852
  ResourcesManagement,
124853
+ RootElementService,
128031
124854
  RouteContentRenderService,
128032
124855
  SavePageStatus,
128033
124856
  SectionContentWrapper,