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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -494,6 +494,8 @@ export declare class DashboardConfigurationService implements IDashboardConfigur
494
494
  removeDashboardConfiguration(dashboardId: string): Promise<void>;
495
495
  }
496
496
 
497
+ export declare function DatabaseSelectionModal(props: IDatabaseSelectionModalProps): JSX.Element;
498
+
497
499
  export declare function DatabaseSettingsCard(props: IDatabaseSettingsCardProps): JSX.Element;
498
500
 
499
501
  export declare type DatabaseSettingsCardSize = "sm" | "md";
@@ -587,6 +589,11 @@ declare type EffectCallbackAsync = () => (Promise<void> | (() => Promise<void |
587
589
 
588
590
  export declare const EMAIL_CONNECTION_SETTINGS_LAYOUT = "ea883b59-bb95-446e-879b-97874ac4d82b";
589
591
 
592
+ export declare enum EngineType {
593
+ MsSQL = 0,
594
+ PgSQL = 1
595
+ }
596
+
590
597
  export declare const ERROR_ROW_CLASS_NAME = "page-table__row-error";
591
598
 
592
599
  export declare function ErrorBlock({ text, close }: IErrorBlockProps): JSX.Element;
@@ -1205,6 +1212,16 @@ declare enum IDatabaseMasterState {
1205
1212
  SolutionProcessFinished = 4
1206
1213
  }
1207
1214
 
1215
+ export declare interface IDatabaseModel {
1216
+ baseName: string;
1217
+ sqlServerName: string;
1218
+ serverType: EngineType;
1219
+ usesFileService: boolean;
1220
+ hash: string;
1221
+ serverNames: string[];
1222
+ error?: string;
1223
+ }
1224
+
1208
1225
  declare interface IDatabaseParameters {
1209
1226
  alias: string;
1210
1227
  databaseName: string;
@@ -1235,6 +1252,14 @@ declare interface IDatabasesController extends Service {
1235
1252
  installSolutions(serviceId: string, databaseAlias: string, solutions: string[]): Promise<void>;
1236
1253
  }
1237
1254
 
1255
+ export declare interface IDatabaseSelectionModalProps {
1256
+ open: boolean;
1257
+ databases: IDatabaseModel[];
1258
+ onCancel: () => void;
1259
+ onApply: (selected: IDatabaseModel[]) => void;
1260
+ resources: IResourcesMap_2;
1261
+ }
1262
+
1238
1263
  export declare interface IDatabaseSettingsCardProps {
1239
1264
  title: string;
1240
1265
  label: string;
package/index.js CHANGED
@@ -59033,6 +59033,12 @@ const CheckIcon$1 = createSvgIcon(/* @__PURE__ */ jsx("path", {
59033
59033
  const Clear = createSvgIcon(/* @__PURE__ */ jsx("path", {
59034
59034
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
59035
59035
  }));
59036
+ const Close = createSvgIcon(/* @__PURE__ */ jsx("path", {
59037
+ d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
59038
+ }));
59039
+ const ComputerRounded = createSvgIcon(/* @__PURE__ */ jsx("path", {
59040
+ d: "M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H1c-.55 0-1 .45-1 1s.45 1 1 1h22c.55 0 1-.45 1-1s-.45-1-1-1zM5 6h14c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1"
59041
+ }));
59036
59042
  const DeleteIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
59037
59043
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
59038
59044
  }));
@@ -127916,6 +127922,121 @@ function SectionContentWrapper(props) {
127916
127922
  }) })
127917
127923
  ] });
127918
127924
  }
127925
+ var EngineType = /* @__PURE__ */ ((EngineType2) => {
127926
+ EngineType2[EngineType2["MsSQL"] = 0] = "MsSQL";
127927
+ EngineType2[EngineType2["PgSQL"] = 1] = "PgSQL";
127928
+ return EngineType2;
127929
+ })(EngineType || {});
127930
+ function renderColumn(values2, iconComponent) {
127931
+ const Icon2 = iconComponent;
127932
+ return values2.map((value, index) => /* @__PURE__ */ jsxs("div", { className: "database-selection-modal__value", children: [
127933
+ /* @__PURE__ */ jsx(Icon2, { fontSize: "small", color: "secondary" }),
127934
+ /* @__PURE__ */ jsx(CellTextContent, { content: value, multiline: true })
127935
+ ] }, `${value}-${index}`));
127936
+ }
127937
+ function DatabaseSelectionModal(props) {
127938
+ const { open, databases, onCancel, onApply, resources } = props;
127939
+ const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
127940
+ useEffect(() => {
127941
+ if (open) {
127942
+ setSelectedIds(/* @__PURE__ */ new Set());
127943
+ }
127944
+ }, [open]);
127945
+ const handleToggle = (id) => {
127946
+ setSelectedIds((prev) => {
127947
+ const next = new Set(prev);
127948
+ if (next.has(id)) {
127949
+ next.delete(id);
127950
+ } else {
127951
+ next.add(id);
127952
+ }
127953
+ return next;
127954
+ });
127955
+ };
127956
+ const handleApply = () => {
127957
+ const selectedItems = databases.filter((database) => selectedIds.has(database.hash));
127958
+ onApply(selectedItems);
127959
+ };
127960
+ const handleKeyDown2 = (event, databaseHash) => {
127961
+ if (event.key === "Enter") {
127962
+ handleToggle(databaseHash);
127963
+ }
127964
+ };
127965
+ const hasDatabases = databases.length > 0;
127966
+ const isApplyDisabled = !hasDatabases || !selectedIds.size;
127967
+ const columns = [resources.Alias, resources.ApplicationServer, resources.SqlServer, ""];
127968
+ return /* @__PURE__ */ jsxs(
127969
+ Dialog$2,
127970
+ {
127971
+ open,
127972
+ onClose: onCancel,
127973
+ fullWidth: true,
127974
+ maxWidth: "md",
127975
+ scroll: "paper",
127976
+ className: "database-selection-modal__dialog",
127977
+ slotProps: { paper: { className: "database-selection-modal__paper" } },
127978
+ children: [
127979
+ /* @__PURE__ */ jsxs(DialogTitle, { variant: "h6", className: "database-selection-modal__title", children: [
127980
+ resources.ConnectDatabase,
127981
+ /* @__PURE__ */ jsx(IconButton$3, { onClick: onCancel, children: /* @__PURE__ */ jsx(Close, {}) })
127982
+ ] }),
127983
+ /* @__PURE__ */ jsxs(DialogContent$2, { className: "database-selection-modal__content", children: [
127984
+ /* @__PURE__ */ jsx(Typography$3, { variant: "body1", className: "database-selection-modal__description", children: resources.SelectDatabasesToConnect }),
127985
+ !hasDatabases ? /* @__PURE__ */ jsx(Typography$3, { variant: "body2", className: "database-selection-modal__empty", children: resources.NoDatabasesAvailableForConnection }) : /* @__PURE__ */ jsx("div", { className: "database-selection-modal__table-wrapper", children: /* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(Table$1, { size: "small", children: [
127986
+ /* @__PURE__ */ jsx(TableHead, { children: columns.map((column) => /* @__PURE__ */ jsx(TableCell$2, { children: column }, column)) }),
127987
+ /* @__PURE__ */ jsx(TableBody$1, { children: databases.map((database) => {
127988
+ const hasError = !!database.error;
127989
+ const isSelected = selectedIds.has(database.hash);
127990
+ const handleRowClick = hasError ? void 0 : () => handleToggle(database.hash);
127991
+ return /* @__PURE__ */ jsx(
127992
+ LightTooltip,
127993
+ {
127994
+ title: database.error ?? "",
127995
+ arrow: true,
127996
+ placement: "top",
127997
+ disableHoverListener: !hasError,
127998
+ disableFocusListener: !hasError,
127999
+ disableTouchListener: !hasError,
128000
+ children: /* @__PURE__ */ jsxs(
128001
+ TableRow$1,
128002
+ {
128003
+ hover: !hasError,
128004
+ onClick: handleRowClick,
128005
+ className: classNames(
128006
+ "database-selection-modal__row",
128007
+ { "database-selection-modal__row_error": hasError }
128008
+ ),
128009
+ children: [
128010
+ /* @__PURE__ */ jsx(TableCell$2, { className: "database-selection-modal__cell", width: "30%", children: renderColumn([database.baseName], StorageRounded) }),
128011
+ /* @__PURE__ */ jsx(TableCell$2, { className: "database-selection-modal__cell", width: "30%", children: renderColumn(database.serverNames, ComputerRounded) }),
128012
+ /* @__PURE__ */ jsx(CellWithFixedWidth, { content: database.sqlServerName, maxWidth: "30%" }),
128013
+ /* @__PURE__ */ jsx(TableCell$2, { className: "database-selection-modal__cell", width: "10%", children: /* @__PURE__ */ jsx(
128014
+ Checkbox$1,
128015
+ {
128016
+ checked: isSelected,
128017
+ onChange: () => handleToggle(database.hash),
128018
+ onClick: (event) => event.stopPropagation(),
128019
+ onKeyDown: (event) => handleKeyDown2(event, database.hash),
128020
+ disabled: hasError
128021
+ }
128022
+ ) })
128023
+ ]
128024
+ }
128025
+ )
128026
+ },
128027
+ database.hash
128028
+ );
128029
+ }) })
128030
+ ] }) }) })
128031
+ ] }),
128032
+ /* @__PURE__ */ jsxs(DialogActions$2, { className: "database-selection-modal__actions", children: [
128033
+ /* @__PURE__ */ jsx(Button$3, { onClick: onCancel, color: "primary", children: resources.DialogButton_Cancel }),
128034
+ /* @__PURE__ */ jsx(Button$3, { onClick: handleApply, color: "primary", variant: "contained", disabled: isApplyDisabled, children: resources.DialogButton_Accept })
128035
+ ] })
128036
+ ]
128037
+ }
128038
+ );
128039
+ }
127919
128040
  export {
127920
128041
  $AboutSettings,
127921
128042
  $ApplicationSettings,
@@ -127949,6 +128070,7 @@ export {
127949
128070
  DEFAULT_PAGE_SIZE,
127950
128071
  DOCSVISION_CONNECTION_SETTINGS_LAYOUT,
127951
128072
  DashboardConfigurationService,
128073
+ DatabaseSelectionModal,
127952
128074
  DatabaseSettingsCard,
127953
128075
  DateRangeCalendarIcon,
127954
128076
  DateRangeContainer,
@@ -127967,6 +128089,7 @@ export {
127967
128089
  EditorInnerWrapper,
127968
128090
  EditorName,
127969
128091
  EditorWrapper,
128092
+ EngineType,
127970
128093
  ErrorBlock,
127971
128094
  ErrorIcon$1 as ErrorIcon,
127972
128095
  ErrorMessage,