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

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