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

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