@docsvision/management-console 6.2.0-beta.13 → 6.2.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1471,6 +1471,10 @@ declare interface IHelpIconButtonProps {
1471
1471
  transformOrigin?: PopoverOrigin;
1472
1472
  }
1473
1473
 
1474
+ declare interface IInfoBanner {
1475
+ text: string;
1476
+ }
1477
+
1474
1478
  export declare interface IInformationIconProps {
1475
1479
  className?: string;
1476
1480
  color?: string;
@@ -1700,6 +1704,8 @@ declare enum IncomingMessageState {
1700
1704
  Paused = 4
1701
1705
  }
1702
1706
 
1707
+ export declare function InfoBanner({ text }: IInfoBanner): JSX.Element;
1708
+
1703
1709
  export declare function InformationIcon(props: IInformationIconProps): JSX.Element;
1704
1710
 
1705
1711
  declare interface INumberComponentProps extends Omit<OutlinedTextFieldProps, "variant" | "value" | "onChange" | "type" | "defaultValue"> {
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, InputAdornment as InputAdornment$3, Stack, 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, Dialog as Dialog$2, DialogTitle, DialogContent as DialogContent$2, DialogActions as DialogActions$2 } from "@mui/material";
4
+ import { Accordion as Accordion$1, AccordionSummary, AccordionDetails, Typography as Typography$3, Button as Button$3, Box, CircularProgress as CircularProgress$3, Tooltip as Tooltip$2, Breadcrumbs, IconButton as IconButton$3, Popover as Popover$4, SvgIcon as SvgIcon$3, TableCell as TableCell$2, Grid as Grid$1, Paper as Paper$3, Chip as Chip$1, MenuItem as MenuItem$2, List as List$4, ListItemButton, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, ListItem as ListItem$1, Input as Input$3, TextField as TextField$3, InputAdornment as InputAdornment$3, Stack, 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, FormControl as FormControl$3, capitalize as capitalize$2, ThemeProvider as ThemeProvider$1, 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";
@@ -58970,6 +58970,11 @@ function getTextContent$1(content, className) {
58970
58970
  }
58971
58971
  return /* @__PURE__ */ jsx("ul", { className: classNames("text-message__list", className), children: content.map((m2) => /* @__PURE__ */ jsx("li", { children: m2 }, m2)) });
58972
58972
  }
58973
+ function InfoBanner({ text }) {
58974
+ if (text) {
58975
+ return /* @__PURE__ */ jsx("div", { className: "info-banner", "data-testid": "info-banner", children: /* @__PURE__ */ jsx(Typography$3, { variant: "subtitle2", color: "inherit", children: text }) });
58976
+ }
58977
+ }
58973
58978
  const KeyboardArrowRightIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
58974
58979
  d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
58975
58980
  }));
@@ -83735,12 +83740,22 @@ function DropdownWithEllipsis(props) {
83735
83740
  const { options, value, label, handleChange, dataTestId, field, className, noOptionsText } = props;
83736
83741
  const anchorRef = useRef(null);
83737
83742
  const [menuWidth, setMenuWidth] = useState(void 0);
83743
+ const [isOpen, setIsOpen] = useState(false);
83738
83744
  useLayoutEffect(() => {
83739
83745
  setMenuWidth(anchorRef.current?.offsetWidth);
83740
83746
  }, []);
83747
+ const handleKeyDown2 = (event) => {
83748
+ if (options.length === 0 && event.key === "Tab") {
83749
+ setIsOpen(false);
83750
+ return;
83751
+ }
83752
+ };
83741
83753
  const selectProps = {
83742
83754
  ...commonMuiProps.select,
83743
83755
  variant: "outlined",
83756
+ open: isOpen,
83757
+ onOpen: () => setIsOpen(true),
83758
+ onClose: () => setIsOpen(false),
83744
83759
  MenuProps: {
83745
83760
  keepMounted: true,
83746
83761
  ...commonMuiProps.select.MenuProps,
@@ -83759,6 +83774,7 @@ function DropdownWithEllipsis(props) {
83759
83774
  ref: anchorRef,
83760
83775
  onChange: (event) => handleChange(event.target.value),
83761
83776
  className,
83777
+ onKeyDown: handleKeyDown2,
83762
83778
  variant: "outlined",
83763
83779
  size: "small",
83764
83780
  slotProps: { select: selectProps },
@@ -83941,6 +83957,227 @@ function AdvancedSettings(props) {
83941
83957
  };
83942
83958
  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 }) });
83943
83959
  }
83960
+ var LogBackupStrategyType = /* @__PURE__ */ ((LogBackupStrategyType2) => {
83961
+ LogBackupStrategyType2[LogBackupStrategyType2["Period"] = 0] = "Period";
83962
+ LogBackupStrategyType2[LogBackupStrategyType2["Quantity"] = 1] = "Quantity";
83963
+ LogBackupStrategyType2[LogBackupStrategyType2["Disabled"] = 2] = "Disabled";
83964
+ return LogBackupStrategyType2;
83965
+ })(LogBackupStrategyType || {});
83966
+ LogBackupStrategyType.Period;
83967
+ const LOG_BACKUP_STRATEGY_PERIOD_IN_DAYS_DEFAULT = 7;
83968
+ const LOG_BACKUP_STRATEGY_QUANTITY_IN_MESSAGES_DEFAULT = 3e3;
83969
+ const LOG_BACKUP_STRATEGY_BACKUP_FOLDER_DEFAULT = "";
83970
+ const LOG_BACKUP_STRATEGY_VALUE_DEFAULT = {
83971
+ strategyType: LogBackupStrategyType,
83972
+ periodInDays: LOG_BACKUP_STRATEGY_PERIOD_IN_DAYS_DEFAULT,
83973
+ quantityInMessages: LOG_BACKUP_STRATEGY_QUANTITY_IN_MESSAGES_DEFAULT,
83974
+ backupFolder: LOG_BACKUP_STRATEGY_BACKUP_FOLDER_DEFAULT
83975
+ };
83976
+ const LOG_BACKUP_STRATEGY_NUMBER_INPUT_WIDTH = 160;
83977
+ const LOG_BACKUP_STRATEGY_PERIOD_MIN_VALUE = 1;
83978
+ const LOG_BACKUP_STRATEGY_PERIOD_MAX_VALUE = 2147483647;
83979
+ const LOG_BACKUP_STRATEGY_MESSAGES_MIN_VALUE = 0;
83980
+ const LOG_BACKUP_STRATEGY_MESSAGES_MAX_VALUE = 2147483647;
83981
+ function getLogBackupStrategyOptions(services) {
83982
+ const resources = services.resources;
83983
+ const { numberGroupSeparator, numberDecimalSeparator } = services.applicationSettings.culture;
83984
+ return [
83985
+ {
83986
+ name: "LogBackupStrategy_Period",
83987
+ type: LogBackupStrategyType.Period,
83988
+ label: resources.LogBackupStrategy_PeriodStrategy,
83989
+ controls: [
83990
+ {
83991
+ name: "period-in-days",
83992
+ instance: NumberComponent,
83993
+ getProperties: (field) => ({
83994
+ name: "periodInDays",
83995
+ numberGroupSeparator,
83996
+ numberDecimalSeparator,
83997
+ sx: {
83998
+ minWidth: LOG_BACKUP_STRATEGY_NUMBER_INPUT_WIDTH,
83999
+ maxWidth: LOG_BACKUP_STRATEGY_NUMBER_INPUT_WIDTH
84000
+ },
84001
+ slotProps: {
84002
+ htmlInput: {
84003
+ className: "log-backup-strategy-folder__number_text-center"
84004
+ }
84005
+ },
84006
+ value: field.value.periodInDays,
84007
+ allowDecimals: false,
84008
+ minValue: LOG_BACKUP_STRATEGY_PERIOD_MIN_VALUE,
84009
+ maxValue: LOG_BACKUP_STRATEGY_PERIOD_MAX_VALUE,
84010
+ onChange: (value) => field.onChange({ ...field.value, periodInDays: value }),
84011
+ onBlur: (ev) => {
84012
+ if (ev.target.value === "") {
84013
+ field.onChange({ ...field.value, periodInDays: LOG_BACKUP_STRATEGY_PERIOD_MIN_VALUE });
84014
+ }
84015
+ }
84016
+ })
84017
+ }
84018
+ ]
84019
+ },
84020
+ {
84021
+ name: "LogBackupStrategy_Quantity",
84022
+ type: LogBackupStrategyType.Quantity,
84023
+ label: resources.LogBackupStrategy_QuantityStrategy,
84024
+ controls: [
84025
+ {
84026
+ name: "quantity-in-messages",
84027
+ instance: NumberComponent,
84028
+ getProperties: (field) => ({
84029
+ name: "quantityInMessages",
84030
+ numberGroupSeparator,
84031
+ numberDecimalSeparator,
84032
+ sx: {
84033
+ minWidth: LOG_BACKUP_STRATEGY_NUMBER_INPUT_WIDTH,
84034
+ maxWidth: LOG_BACKUP_STRATEGY_NUMBER_INPUT_WIDTH
84035
+ },
84036
+ slotProps: {
84037
+ htmlInput: {
84038
+ className: "log-backup-strategy-folder__number_text-center"
84039
+ }
84040
+ },
84041
+ value: field.value.quantityInMessages,
84042
+ allowDecimals: false,
84043
+ minValue: LOG_BACKUP_STRATEGY_MESSAGES_MIN_VALUE,
84044
+ maxValue: LOG_BACKUP_STRATEGY_MESSAGES_MAX_VALUE,
84045
+ onChange: (value) => field.onChange({ ...field.value, quantityInMessages: value }),
84046
+ onBlur: (ev) => {
84047
+ if (ev.target.value === "") {
84048
+ field.onChange({ ...field.value, quantityInMessages: LOG_BACKUP_STRATEGY_MESSAGES_MIN_VALUE });
84049
+ }
84050
+ }
84051
+ })
84052
+ }
84053
+ ]
84054
+ },
84055
+ {
84056
+ name: "LogBackupStrategy_Disabled",
84057
+ type: LogBackupStrategyType.Disabled,
84058
+ label: resources.LogBackupStrategy_DisabledStrategy
84059
+ }
84060
+ ];
84061
+ }
84062
+ class LogBackupStrategyLogic extends ComponentLogic {
84063
+ constructor() {
84064
+ super(...arguments);
84065
+ this.domain = y("LogBackupStrategyLogic");
84066
+ this.componentDidMount = c$1("componentDidMount");
84067
+ this.$options = this.domain.createStore([], { name: "$options" });
84068
+ }
84069
+ initOptions() {
84070
+ v({
84071
+ clock: this.componentDidMount,
84072
+ fn: () => getLogBackupStrategyOptions(this.options.services),
84073
+ target: this.$options
84074
+ });
84075
+ }
84076
+ init() {
84077
+ this.initOptions();
84078
+ }
84079
+ }
84080
+ function convertLabelToNode(label, controls, field, services) {
84081
+ return replaceControls(
84082
+ label,
84083
+ controls,
84084
+ field
84085
+ );
84086
+ }
84087
+ function replaceControls(label, controlsDescriptions, field) {
84088
+ const controls = label.matchAll(/\[.+?\]/g);
84089
+ let index = 0;
84090
+ const nodes = [];
84091
+ for (const control of controls) {
84092
+ const controlSubstr = control[0];
84093
+ const controlSubstrIndex = control.index;
84094
+ const text = label.slice(index, controlSubstrIndex);
84095
+ nodes.push(/* @__PURE__ */ jsx("span", { children: text }));
84096
+ const controlDescriptionIndex = controlSubstr.replaceAll(/[\[\]]/g, "");
84097
+ const controlName = controlsDescriptions[controlDescriptionIndex].name;
84098
+ const ControlComponent = controlsDescriptions[controlDescriptionIndex].instance;
84099
+ const controlProperties = controlsDescriptions[controlDescriptionIndex].getProperties(field);
84100
+ nodes.push(
84101
+ /* @__PURE__ */ jsx(
84102
+ "div",
84103
+ {
84104
+ className: `log-backup-strategy__option_control-wrapper ${controlName}`,
84105
+ "data-testid": `log-backup-strategy-option-control-wrapper-${controlName}`,
84106
+ onClick: (ev) => ev.preventDefault(),
84107
+ children: /* @__PURE__ */ jsx(ControlComponent, { ...controlProperties })
84108
+ }
84109
+ )
84110
+ );
84111
+ index = index + text.length + controlSubstr.length;
84112
+ }
84113
+ nodes.push(/* @__PURE__ */ jsx("span", { children: label.slice(index) }));
84114
+ return /* @__PURE__ */ jsx("div", { className: "log-backup-strategy__option_label", children: nodes });
84115
+ }
84116
+ function LogBackupStrategyOption(props) {
84117
+ const { name, type: type2, label, services, controls = [], field, fieldName } = props;
84118
+ const key = `${fieldName}_${props.type}`;
84119
+ return /* @__PURE__ */ jsx("div", { "data-testid": "log-backup-strategy_option-wrapper", children: /* @__PURE__ */ jsx(
84120
+ FormControlLabel$1,
84121
+ {
84122
+ label: convertLabelToNode(label, controls, field),
84123
+ control: /* @__PURE__ */ createElement(
84124
+ Radio,
84125
+ {
84126
+ ...field,
84127
+ key,
84128
+ id: key,
84129
+ name,
84130
+ color: "primary",
84131
+ onChange: (ev) => field.onChange({ ...field.value, strategyType: Number(ev.target.value) }),
84132
+ value: type2,
84133
+ checked: field.value.strategyType === type2,
84134
+ "data-testid": `log-backup-strategy_option_${type2}`
84135
+ }
84136
+ )
84137
+ },
84138
+ `${key}_label}`
84139
+ ) });
84140
+ }
84141
+ function LogBackupStrategy(props) {
84142
+ const { id: fieldName, value } = props;
84143
+ const services = useContext(ServicesContext);
84144
+ const logic = useLogic({ ...props, services }, LogBackupStrategyLogic);
84145
+ const options = e(logic.$options);
84146
+ const { resetField, control } = useCustomFormContext();
84147
+ const { field, fieldState } = useController({
84148
+ name: props.id,
84149
+ control,
84150
+ defaultValue: { ...LOG_BACKUP_STRATEGY_VALUE_DEFAULT, ...props.value || {} }
84151
+ });
84152
+ useEffect(() => {
84153
+ logic.componentDidMount();
84154
+ }, [logic]);
84155
+ return /* @__PURE__ */ jsx(EditorContainer, { resetValue: () => {
84156
+ resetField(props.id);
84157
+ }, isChanged: fieldState.isDirty, ...props, children: /* @__PURE__ */ jsxs(FormControl$3, { size: "small", children: [
84158
+ /* @__PURE__ */ jsx(RadioGroup, { children: options.map((option) => /* @__PURE__ */ jsx(LogBackupStrategyOption, { ...option, field, fieldName, services }, `${fieldName}_${option.type}`)) }),
84159
+ /* @__PURE__ */ jsx(
84160
+ EditorInnerWrapper,
84161
+ {
84162
+ label: services.resources.LogBackupStrategy_Title,
84163
+ description: services.resources.LogBackupStrategy_Description,
84164
+ children: /* @__PURE__ */ jsx(
84165
+ TextField$3,
84166
+ {
84167
+ variant: "outlined",
84168
+ size: "small",
84169
+ className: "log-backup-strategy-folder__input",
84170
+ value: field.value.backupFolder,
84171
+ fullWidth: true,
84172
+ required: field.value.strategyType,
84173
+ onChange: (e2) => field.onChange({ ...field.value, backupFolder: e2.target.value || "" }),
84174
+ slotProps: { htmlInput: { "data-testid": "log-backup-strategy-folder" } }
84175
+ }
84176
+ )
84177
+ }
84178
+ )
84179
+ ] }) });
84180
+ }
83944
84181
  var TableLocationType = /* @__PURE__ */ ((TableLocationType2) => {
83945
84182
  TableLocationType2[TableLocationType2["UseDefaultOrCurrent"] = 0] = "UseDefaultOrCurrent";
83946
84183
  TableLocationType2[TableLocationType2["UseOwnDatabase"] = 1] = "UseOwnDatabase";
@@ -85584,6 +85821,7 @@ function registerEditors() {
85584
85821
  editorFactory.register("LdapCatalogs", LdapCatalogs);
85585
85822
  editorFactory.register("ReadonlyEditor", ReadonlyEditor);
85586
85823
  editorFactory.register("AdvancedSettings", AdvancedSettings);
85824
+ editorFactory.register("LogBackupStrategy", LogBackupStrategy);
85587
85825
  editorFactory.register("DatabaseGenerationSettings", DatabaseGenerationSettings);
85588
85826
  }
85589
85827
  serviceName(function(s2) {
@@ -87394,6 +87632,11 @@ function Toolbar$1() {
87394
87632
  return await services.localizationService.getResources();
87395
87633
  };
87396
87634
  const changeLocale = async () => {
87635
+ const { resources, formControl } = services;
87636
+ if (formControl.isDirty) {
87637
+ const canProceed = window.confirm(resources.UnsavedChangesConfirmation);
87638
+ if (!canProceed) return;
87639
+ }
87397
87640
  disableLocaleButton(true);
87398
87641
  let index;
87399
87642
  if (localeIndexInAvailableLocales + 1 < applicationSettings.availableLocales.length) {
@@ -125861,6 +126104,7 @@ export {
125861
126104
  GroupPanel,
125862
126105
  HandPointRightIcon,
125863
126106
  HelpIconButton,
126107
+ InfoBanner,
125864
126108
  InformationIcon,
125865
126109
  KEYCODE_ESCAPE,
125866
126110
  LayoutService,