@docsvision/management-console 6.2.2 → 6.2.3
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 +3 -4
- package/index.js +130 -59
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1821,6 +1821,8 @@ declare interface IMetaInformation_2 {
|
|
|
1821
1821
|
|
|
1822
1822
|
export declare interface INavigationMenuProps {
|
|
1823
1823
|
menuItems: IMenuItem_2[];
|
|
1824
|
+
activeMenuId?: string;
|
|
1825
|
+
onMenuClick: (menuId: string) => void;
|
|
1824
1826
|
}
|
|
1825
1827
|
|
|
1826
1828
|
declare interface INavigationMenuService {
|
|
@@ -2021,7 +2023,7 @@ export declare interface IPopupNotificationButton {
|
|
|
2021
2023
|
text: string;
|
|
2022
2024
|
className?: string;
|
|
2023
2025
|
dataTestId?: string;
|
|
2024
|
-
onClick: () => void;
|
|
2026
|
+
onClick: (notification: PopupNotification) => void;
|
|
2025
2027
|
}
|
|
2026
2028
|
|
|
2027
2029
|
export declare interface IPopupNotificationCallbacks {
|
|
@@ -2875,14 +2877,11 @@ export declare const setDashboardPosition: (settings: IWidgetSettings_2, positio
|
|
|
2875
2877
|
export declare class SettingsNavigationService implements ISettingsNavigationService {
|
|
2876
2878
|
private readonly application;
|
|
2877
2879
|
private readonly serviceNamesCache;
|
|
2878
|
-
private readonly serversNamesCache;
|
|
2879
2880
|
constructor(application: IApplication);
|
|
2880
2881
|
ensureServiceName(serviceId?: string): Promise<void>;
|
|
2881
2882
|
private rememberServiceName;
|
|
2882
2883
|
private getCachedServiceName;
|
|
2883
2884
|
private resolveServiceName;
|
|
2884
|
-
private rememberServerName;
|
|
2885
|
-
private getCachedServerName;
|
|
2886
2885
|
convertPathToUrl(str: string, ...args: any[]): string;
|
|
2887
2886
|
getServerPageUrl(serverId: string): string;
|
|
2888
2887
|
getSettingsPageUrl(serverId: string, serviceId: string, layoutId: string, serviceName: string): string;
|
package/index.js
CHANGED
|
@@ -61464,10 +61464,9 @@ function ListPanel(props) {
|
|
|
61464
61464
|
] });
|
|
61465
61465
|
}
|
|
61466
61466
|
function NavigationMenu(props) {
|
|
61467
|
-
const { menuItems } = props;
|
|
61468
|
-
const [selectedMenuItem, setSelectedMenuItem] = useState();
|
|
61467
|
+
const { menuItems, activeMenuId, onMenuClick } = props;
|
|
61469
61468
|
const onClick = (menuItem) => {
|
|
61470
|
-
|
|
61469
|
+
onMenuClick(menuItem.id);
|
|
61471
61470
|
menuItem.refElement?.current.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
|
|
61472
61471
|
};
|
|
61473
61472
|
return /* @__PURE__ */ jsx("div", { className: "navigation-menu", children: menuItems?.map((menuItem) => {
|
|
@@ -61475,7 +61474,7 @@ function NavigationMenu(props) {
|
|
|
61475
61474
|
"div",
|
|
61476
61475
|
{
|
|
61477
61476
|
onClick: () => onClick(menuItem),
|
|
61478
|
-
className: classNames("navigation-menu-item", classIf(
|
|
61477
|
+
className: classNames("navigation-menu-item", classIf(activeMenuId === menuItem.id, "selected")),
|
|
61479
61478
|
children: /* @__PURE__ */ jsx("div", { children: menuItem.name })
|
|
61480
61479
|
},
|
|
61481
61480
|
`menu-item_${menuItem.id}`
|
|
@@ -62573,7 +62572,10 @@ function NumberComponent(props) {
|
|
|
62573
62572
|
}
|
|
62574
62573
|
function handleBlur(event) {
|
|
62575
62574
|
if (valueRef.current) {
|
|
62576
|
-
|
|
62575
|
+
const clampedValue = clampValue(valueRef.current);
|
|
62576
|
+
if (clampedValue !== valueRef.current.toString()) {
|
|
62577
|
+
onChange(clampValue(valueRef.current));
|
|
62578
|
+
}
|
|
62577
62579
|
}
|
|
62578
62580
|
onBlur?.(event);
|
|
62579
62581
|
}
|
|
@@ -66944,9 +66946,9 @@ class WorkerPanelLogic extends ComponentLogic {
|
|
|
66944
66946
|
} finally {
|
|
66945
66947
|
this.setLoading(false);
|
|
66946
66948
|
}
|
|
66949
|
+
this.openDialog(false);
|
|
66947
66950
|
this.setDataNewProcess({ ...WORKER_PROCESS_EMPTY_DATA });
|
|
66948
66951
|
this.setProcessUnchanged(newProcess.id);
|
|
66949
|
-
this.openDialog(false);
|
|
66950
66952
|
return newProcess;
|
|
66951
66953
|
});
|
|
66952
66954
|
this.openDialog.watch((opened) => {
|
|
@@ -69320,11 +69322,12 @@ const _PopupNotification = class _PopupNotification {
|
|
|
69320
69322
|
e2.stopPropagation();
|
|
69321
69323
|
toast.dismiss(toastId);
|
|
69322
69324
|
};
|
|
69323
|
-
|
|
69324
|
-
|
|
69325
|
+
const handleButtonClick = (btn) => () => btn.onClick(this);
|
|
69326
|
+
return /* @__PURE__ */ jsxs("div", { className: classes2, onMouseEnter: this.callbacks.onHover, onClick: handleLayoutClick, children: [
|
|
69327
|
+
this.closeWith.includes("button") && /* @__PURE__ */ jsx("div", { className: "noty_close_button", onClick: handleCloseButtonClick, children: "×" }),
|
|
69325
69328
|
/* @__PURE__ */ jsx("div", { className: "noty_body", children: this.text }),
|
|
69326
|
-
|
|
69327
|
-
this.showProgress() && /* @__PURE__ */ jsx("div", { className: "noty_progressbar", style: { animationDuration: `${this.timeout}ms` } }
|
|
69329
|
+
this.options.buttons?.length ? /* @__PURE__ */ jsx("div", { className: "noty_buttons", children: this.options.buttons.map((btn, idx) => /* @__PURE__ */ jsx("button", { className: classNames("noty_btn", btn.className), "data-testid": btn.dataTestId, onClick: handleButtonClick(btn), children: btn.text }, idx)) }) : null,
|
|
69330
|
+
this.showProgress() && /* @__PURE__ */ jsx("div", { className: "noty_progressbar", style: { animationDuration: `${this.timeout}ms` } })
|
|
69328
69331
|
] });
|
|
69329
69332
|
};
|
|
69330
69333
|
const mergedOptions = {
|
|
@@ -69373,7 +69376,6 @@ const _PopupNotification = class _PopupNotification {
|
|
|
69373
69376
|
return `noty_layout__${this.options.layout}`;
|
|
69374
69377
|
}
|
|
69375
69378
|
show() {
|
|
69376
|
-
if (this.toastId) return;
|
|
69377
69379
|
this.callbacks.beforeShow?.();
|
|
69378
69380
|
if (this.options.killer) {
|
|
69379
69381
|
toast.dismiss();
|
|
@@ -69387,12 +69389,10 @@ const _PopupNotification = class _PopupNotification {
|
|
|
69387
69389
|
onDismiss: () => {
|
|
69388
69390
|
this.callbacks.onClose?.();
|
|
69389
69391
|
this.callbacks.afterClose?.();
|
|
69390
|
-
this.toastId = void 0;
|
|
69391
69392
|
},
|
|
69392
69393
|
onAutoClose: () => {
|
|
69393
69394
|
this.callbacks.onClose?.();
|
|
69394
69395
|
this.callbacks.afterClose?.();
|
|
69395
|
-
this.toastId = void 0;
|
|
69396
69396
|
}
|
|
69397
69397
|
});
|
|
69398
69398
|
this.callbacks.onShow?.();
|
|
@@ -69465,13 +69465,21 @@ class SettingsPageLogic extends ComponentLogic {
|
|
|
69465
69465
|
super(...arguments);
|
|
69466
69466
|
this.domain = y$1("SettingsPageLogic");
|
|
69467
69467
|
this.submitFx = this.domain.effect("onSubmit");
|
|
69468
|
-
this
|
|
69468
|
+
this.$loadPageRequestId = this.domain.store(0, { name: "$loadPageRequestId" });
|
|
69469
|
+
this.loadPage = this.domain.event("loadPage");
|
|
69470
|
+
this.loadPageFx = this.domain.effect("loadPageFx");
|
|
69471
|
+
this.validLoadPageFxDone = w$2({
|
|
69472
|
+
clock: this.loadPageFx.done,
|
|
69473
|
+
filter: ({ params }) => params.requestId === this.$loadPageRequestId.getState()
|
|
69474
|
+
});
|
|
69469
69475
|
this.$pageData = this.domain.store(null, { name: "pageData" });
|
|
69470
|
-
this.setPageData = this.domain.event("setPageData");
|
|
69471
69476
|
this.$pageDataList = this.domain.store(null, { name: "pageDataList" });
|
|
69472
|
-
this.setPageDataList = this.domain.event("setPageDataList");
|
|
69473
69477
|
this.$scrollRestored = this.domain.store(!window.sessionStorage.getItem(SESSION_STORAGE_SCROLL_KEY), { name: "$scrollRestored" });
|
|
69474
69478
|
this.$scrollElement = this.domain.store(null, { name: "$scrollElement" });
|
|
69479
|
+
this.$activeMenuId = this.domain.store(null, { name: "$activeMenuId" });
|
|
69480
|
+
this.activeMenuChanged = this.domain.event("activeMenuChanged");
|
|
69481
|
+
this.menuSelected = this.domain.event("menuSelected");
|
|
69482
|
+
this.activeMenuChangedFx = this.domain.effect("activeMenuChangedFx");
|
|
69475
69483
|
this.settedScrollElement = this.domain.event("setScrollElement");
|
|
69476
69484
|
this.saveScrollPositionRequested = this.domain.event("setScrollElement");
|
|
69477
69485
|
this.saveScrollPositionFx = this.domain.effect("saveScrollPosition");
|
|
@@ -69498,14 +69506,6 @@ class SettingsPageLogic extends ComponentLogic {
|
|
|
69498
69506
|
cleanUpLeaveHook();
|
|
69499
69507
|
});
|
|
69500
69508
|
});
|
|
69501
|
-
v$2({
|
|
69502
|
-
clock: this.setPageData,
|
|
69503
|
-
target: this.$pageData
|
|
69504
|
-
});
|
|
69505
|
-
v$2({
|
|
69506
|
-
clock: this.setPageDataList,
|
|
69507
|
-
target: this.$pageDataList
|
|
69508
|
-
});
|
|
69509
69509
|
this.submitFx.use(async (params) => {
|
|
69510
69510
|
const savePageResponse = await layoutService.saveLayout(params.layoutId, params.serviceId, params.data, params.itemId, params.timestamp);
|
|
69511
69511
|
if (savePageResponse.status === SavePageStatus.Error) {
|
|
@@ -69528,15 +69528,42 @@ class SettingsPageLogic extends ComponentLogic {
|
|
|
69528
69528
|
fn: (pageData, { timestamp }) => ({ ...pageData, meta: { ...pageData.meta, timestamp } }),
|
|
69529
69529
|
target: this.$pageData
|
|
69530
69530
|
});
|
|
69531
|
-
|
|
69532
|
-
|
|
69533
|
-
this
|
|
69534
|
-
|
|
69535
|
-
|
|
69536
|
-
|
|
69537
|
-
|
|
69538
|
-
|
|
69539
|
-
|
|
69531
|
+
v$2({
|
|
69532
|
+
clock: this.loadPage,
|
|
69533
|
+
source: this.$loadPageRequestId,
|
|
69534
|
+
fn: (requestId) => requestId + 1,
|
|
69535
|
+
target: this.$loadPageRequestId
|
|
69536
|
+
});
|
|
69537
|
+
v$2({
|
|
69538
|
+
clock: this.loadPage,
|
|
69539
|
+
source: this.$loadPageRequestId,
|
|
69540
|
+
fn: (requestId, params) => ({ ...params, requestId }),
|
|
69541
|
+
target: this.loadPageFx
|
|
69542
|
+
});
|
|
69543
|
+
this.loadPageFx.use(async (params) => {
|
|
69544
|
+
return await layoutService.getLayout(params.url, params.serviceId, params.itemId);
|
|
69545
|
+
});
|
|
69546
|
+
v$2({
|
|
69547
|
+
clock: this.validLoadPageFxDone,
|
|
69548
|
+
fn: ({ result }) => result,
|
|
69549
|
+
target: this.$pageData
|
|
69550
|
+
});
|
|
69551
|
+
v$2({
|
|
69552
|
+
clock: this.validLoadPageFxDone,
|
|
69553
|
+
fn: ({ result }) => {
|
|
69554
|
+
const elements = [];
|
|
69555
|
+
result.elements.length && this.getElementsInList(elements, result.elements);
|
|
69556
|
+
return elements;
|
|
69557
|
+
},
|
|
69558
|
+
target: this.$pageDataList
|
|
69559
|
+
});
|
|
69560
|
+
v$2({
|
|
69561
|
+
clock: this.validLoadPageFxDone,
|
|
69562
|
+
fn: ({ result }) => {
|
|
69563
|
+
const { readOnly, readonlyReasonMsg } = result.meta;
|
|
69564
|
+
if (readOnly) {
|
|
69565
|
+
services.messageWindow.showInfo(readonlyReasonMsg || resources.ReadOnlyReasonMessage);
|
|
69566
|
+
}
|
|
69540
69567
|
}
|
|
69541
69568
|
});
|
|
69542
69569
|
v$2({
|
|
@@ -69571,6 +69598,40 @@ class SettingsPageLogic extends ComponentLogic {
|
|
|
69571
69598
|
filter: ({ scrollElement, restored, pageData }) => Boolean(scrollElement) && !restored && Boolean(pageData),
|
|
69572
69599
|
target: this.restoreScrollPositionFx
|
|
69573
69600
|
});
|
|
69601
|
+
this.activeMenuChangedFx.use((scrollElement) => {
|
|
69602
|
+
const HEADER_OFFSET = 127;
|
|
69603
|
+
const clamp2 = (value) => Math.max(0, value);
|
|
69604
|
+
const isBetween2 = (value, floor, ceil) => value >= floor && value <= ceil;
|
|
69605
|
+
const menuItems = services.navigationMenu.$menuItems.getState();
|
|
69606
|
+
if (scrollElement) {
|
|
69607
|
+
const scroll = scrollElement.scrollTop;
|
|
69608
|
+
const position = menuItems?.map((menuItem) => {
|
|
69609
|
+
const element = menuItem.refElement?.current;
|
|
69610
|
+
if (!element) {
|
|
69611
|
+
return { id: menuItem.id, top: -1, bottom: -1 };
|
|
69612
|
+
}
|
|
69613
|
+
const rect = element.getBoundingClientRect();
|
|
69614
|
+
const top2 = clamp2(rect.top + scroll - HEADER_OFFSET);
|
|
69615
|
+
const bottom2 = clamp2(rect.bottom + scroll - HEADER_OFFSET);
|
|
69616
|
+
return { id: menuItem.id, top: top2, bottom: bottom2 };
|
|
69617
|
+
}).find(({ top: top2, bottom: bottom2 }) => isBetween2(scroll, top2, bottom2));
|
|
69618
|
+
return position?.id;
|
|
69619
|
+
}
|
|
69620
|
+
return "";
|
|
69621
|
+
});
|
|
69622
|
+
v$2({
|
|
69623
|
+
clock: this.menuSelected,
|
|
69624
|
+
target: this.$activeMenuId
|
|
69625
|
+
});
|
|
69626
|
+
v$2({
|
|
69627
|
+
clock: this.activeMenuChanged,
|
|
69628
|
+
source: this.$scrollElement,
|
|
69629
|
+
target: this.activeMenuChangedFx
|
|
69630
|
+
});
|
|
69631
|
+
v$2({
|
|
69632
|
+
clock: this.activeMenuChangedFx.doneData,
|
|
69633
|
+
target: this.$activeMenuId
|
|
69634
|
+
});
|
|
69574
69635
|
v$2({
|
|
69575
69636
|
clock: this.restoreScrollPositionFx.done,
|
|
69576
69637
|
fn: () => true,
|
|
@@ -69592,12 +69653,14 @@ function SettingsPage(props) {
|
|
|
69592
69653
|
const { resources } = services;
|
|
69593
69654
|
const logic = useLogic(props, SettingsPageLogic);
|
|
69594
69655
|
const pageData = e(logic.$pageData);
|
|
69656
|
+
const activeMenuId = e(logic.$activeMenuId);
|
|
69595
69657
|
const methods = useForm({ mode: "onTouched" });
|
|
69596
69658
|
const menuItems = e(services.navigationMenu.$menuItems);
|
|
69597
69659
|
const clearMenuItems = c(services.navigationMenu.clearMenuItems);
|
|
69598
69660
|
const isSubmitButtonLoading = e(logic.submitFx.pending);
|
|
69599
|
-
const isPageLoading = e(logic.
|
|
69661
|
+
const isPageLoading = e(logic.loadPageFx.pending);
|
|
69600
69662
|
const formRef = useRef(null);
|
|
69663
|
+
const scrollElementRef = useRef(null);
|
|
69601
69664
|
const breadcrumbsItems = services.settingsNavigation.getBreadcrumbsItems();
|
|
69602
69665
|
const readOnly = pageData?.meta.readOnly || false;
|
|
69603
69666
|
const {
|
|
@@ -69624,6 +69687,20 @@ function SettingsPage(props) {
|
|
|
69624
69687
|
window.addEventListener("pagehide", onPageHide);
|
|
69625
69688
|
return () => window.removeEventListener("pagehide", onPageHide);
|
|
69626
69689
|
}, [logic]);
|
|
69690
|
+
useLayoutEffect(() => {
|
|
69691
|
+
const onScrollChanged = () => logic.activeMenuChanged();
|
|
69692
|
+
onScrollChanged();
|
|
69693
|
+
window.addEventListener("resize", onScrollChanged);
|
|
69694
|
+
if (scrollElementRef.current) {
|
|
69695
|
+
scrollElementRef.current.addEventListener("scroll", onScrollChanged);
|
|
69696
|
+
}
|
|
69697
|
+
return () => {
|
|
69698
|
+
window.removeEventListener("scroll", onScrollChanged);
|
|
69699
|
+
if (scrollElementRef.current) {
|
|
69700
|
+
scrollElementRef.current.removeEventListener("scroll", onScrollChanged);
|
|
69701
|
+
}
|
|
69702
|
+
};
|
|
69703
|
+
}, [scrollElementRef.current]);
|
|
69627
69704
|
const onSubmit = async (props2) => {
|
|
69628
69705
|
const { confirm: confirm2 = true, ...data } = props2;
|
|
69629
69706
|
const dirtyFields2 = methods.formState.dirtyFields;
|
|
@@ -69663,6 +69740,13 @@ function SettingsPage(props) {
|
|
|
69663
69740
|
reset(defaultValues);
|
|
69664
69741
|
services.formControl.canceled();
|
|
69665
69742
|
};
|
|
69743
|
+
const onMenuClick = (menuId) => {
|
|
69744
|
+
logic.menuSelected(menuId);
|
|
69745
|
+
};
|
|
69746
|
+
const onScrollElementSet = (el2) => {
|
|
69747
|
+
scrollElementRef.current = el2;
|
|
69748
|
+
logic.settedScrollElement(el2);
|
|
69749
|
+
};
|
|
69666
69750
|
const hasDirtyFields = !!Object.keys(dirtyFields).length;
|
|
69667
69751
|
return /* @__PURE__ */ jsxs("div", { className: "settings-page__container", children: [
|
|
69668
69752
|
/* @__PURE__ */ jsxs("div", { className: "settings-page__header", children: [
|
|
@@ -69685,12 +69769,12 @@ function SettingsPage(props) {
|
|
|
69685
69769
|
] })
|
|
69686
69770
|
] }),
|
|
69687
69771
|
/* @__PURE__ */ jsx("div", { className: "settings-page__wrapper", children: /* @__PURE__ */ jsxs("div", { className: "settings-page__content-container", children: [
|
|
69688
|
-
/* @__PURE__ */ jsx(NavigationMenu, { menuItems }),
|
|
69772
|
+
/* @__PURE__ */ jsx(NavigationMenu, { menuItems, activeMenuId, onMenuClick }),
|
|
69689
69773
|
/* @__PURE__ */ jsx("div", { className: "settings-page__scroll-container", children: /* @__PURE__ */ jsx(
|
|
69690
69774
|
"div",
|
|
69691
69775
|
{
|
|
69692
69776
|
className: classNames("setting-page__scroll-element", classIf(readOnly, "setting-page__readonly-layout")),
|
|
69693
|
-
ref:
|
|
69777
|
+
ref: onScrollElementSet,
|
|
69694
69778
|
children: /* @__PURE__ */ jsx(CustomFormProvider, { ...methods, children: /* @__PURE__ */ jsx("form", { className: "settings-page", ref: formRef, children: pageData?.elements?.map((data) => {
|
|
69695
69779
|
const Component2 = data.error ? ErrorEditor : editorFactory.get(data.editorType);
|
|
69696
69780
|
return /* @__PURE__ */ jsx(Component2, { ...data, services, formMethods: methods }, data.id);
|
|
@@ -70569,8 +70653,9 @@ function ImportSettingsDialog(props) {
|
|
|
70569
70653
|
const peers = e(logic.$peers);
|
|
70570
70654
|
const onSubmitClick = async () => {
|
|
70571
70655
|
if (selectedPeer.lastUpdated) {
|
|
70572
|
-
const
|
|
70573
|
-
const
|
|
70656
|
+
const cultureName = services.applicationSettings.culture.name;
|
|
70657
|
+
const dateFormat = cultureName === "ru-RU" ? DATE_TIME_FORMAT_RUS : DATE_TIME_FORMAT_ENG;
|
|
70658
|
+
const dateStr = hooks(selectedPeer.lastUpdated).locale(cultureName).format(dateFormat);
|
|
70574
70659
|
await services.messageWindow.showConfirmation(
|
|
70575
70660
|
formatString$1(resources.ImportSettingsConfirmationWithDateMessage, dateStr),
|
|
70576
70661
|
{
|
|
@@ -70879,10 +70964,6 @@ function ServersRouteComponent({ services }) {
|
|
|
70879
70964
|
const routeServices = useLocalServiceContainer(ServicesContext, (s2) => s2.isPageService);
|
|
70880
70965
|
return /* @__PURE__ */ jsx(ServicesContext.Provider, { value: routeServices, children: /* @__PURE__ */ jsx(ServersPage, { services }) });
|
|
70881
70966
|
}
|
|
70882
|
-
function ServerPageRouteComponent({ services }) {
|
|
70883
|
-
const routeServices = useLocalServiceContainer(ServicesContext, (s2) => s2.isPageService);
|
|
70884
|
-
return /* @__PURE__ */ jsx(ServicesContext.Provider, { value: routeServices, children: /* @__PURE__ */ jsx(ServersPage, { services }) });
|
|
70885
|
-
}
|
|
70886
70967
|
const serversRouteHandler = async (application) => {
|
|
70887
70968
|
return /* @__PURE__ */ jsx(ServersRouteComponent, { services: application });
|
|
70888
70969
|
};
|
|
@@ -70890,12 +70971,9 @@ const serversRoute = {
|
|
|
70890
70971
|
path: SERVERS_ROUTE_PATH,
|
|
70891
70972
|
handler: serversRouteHandler
|
|
70892
70973
|
};
|
|
70893
|
-
const serverPageRouteHandler = async (application) => {
|
|
70894
|
-
return /* @__PURE__ */ jsx(ServerPageRouteComponent, { services: application });
|
|
70895
|
-
};
|
|
70896
70974
|
const serverPageRoute = {
|
|
70897
70975
|
path: SERVER_PAGE_ROUTE_PATH,
|
|
70898
|
-
handler:
|
|
70976
|
+
handler: serversRouteHandler
|
|
70899
70977
|
};
|
|
70900
70978
|
const $ServersController = serviceName((s2) => s2.serverController);
|
|
70901
70979
|
class ServersController {
|
|
@@ -70925,7 +71003,6 @@ class SettingsNavigationService {
|
|
|
70925
71003
|
constructor(application) {
|
|
70926
71004
|
this.application = application;
|
|
70927
71005
|
this.serviceNamesCache = /* @__PURE__ */ new Map();
|
|
70928
|
-
this.serversNamesCache = /* @__PURE__ */ new Map();
|
|
70929
71006
|
this.goToConfigurationPage = () => {
|
|
70930
71007
|
const { params, data } = this.application.routingService.getLastRouteResolvedParams() || {};
|
|
70931
71008
|
const { serverId, serviceId, layoutId } = data;
|
|
@@ -70942,7 +71019,6 @@ class SettingsNavigationService {
|
|
|
70942
71019
|
const service = await this.application.serverController.getServiceInfo(serviceId);
|
|
70943
71020
|
if (!service) return;
|
|
70944
71021
|
this.rememberServiceName(service.serviceId, service.serviceName);
|
|
70945
|
-
this.rememberServerName(service.serviceId, service.serverName);
|
|
70946
71022
|
} catch {
|
|
70947
71023
|
}
|
|
70948
71024
|
}
|
|
@@ -70957,13 +71033,6 @@ class SettingsNavigationService {
|
|
|
70957
71033
|
if (!serviceId) return fallback;
|
|
70958
71034
|
return this.getCachedServiceName(serviceId) ?? fallback;
|
|
70959
71035
|
}
|
|
70960
|
-
rememberServerName(serviceId, serverName) {
|
|
70961
|
-
if (!serviceId || !serverName) return;
|
|
70962
|
-
this.serversNamesCache.set(serviceId, serverName);
|
|
70963
|
-
}
|
|
70964
|
-
getCachedServerName(serviceId) {
|
|
70965
|
-
return this.serversNamesCache.get(serviceId);
|
|
70966
|
-
}
|
|
70967
71036
|
convertPathToUrl(str, ...args) {
|
|
70968
71037
|
const matches = str.match(/(:\w+)/g);
|
|
70969
71038
|
if (!matches) return str;
|
|
@@ -70999,9 +71068,8 @@ class SettingsNavigationService {
|
|
|
70999
71068
|
const { serviceName: serviceName2, itemName, extendedLayoutId } = params;
|
|
71000
71069
|
const breadcrumbsItems = [];
|
|
71001
71070
|
if (data.serverId) {
|
|
71002
|
-
const serverName = this.getCachedServerName(data.serviceId) ?? data.serverId;
|
|
71003
71071
|
breadcrumbsItems.push({
|
|
71004
|
-
label: `${this.application.resources.Server}: ${
|
|
71072
|
+
label: `${this.application.resources.Server}: ${data.serverId.toUpperCase()}`,
|
|
71005
71073
|
path: this.getServerPageUrl(serverId)
|
|
71006
71074
|
});
|
|
71007
71075
|
}
|
|
@@ -108273,7 +108341,7 @@ class EmailServerConnectionSettingsView {
|
|
|
108273
108341
|
}
|
|
108274
108342
|
function EmailServerConnectionSettings(options) {
|
|
108275
108343
|
const view = useView(options, EmailServerConnectionSettingsView);
|
|
108276
|
-
const { data, onDataChanged, mode, services, validation, validationFieldsProvider } = options;
|
|
108344
|
+
const { data, onDataChanged, mode, services, validation, validationFieldsProvider, isCurrentlyEditedSetting } = options;
|
|
108277
108345
|
const testIdPrefix = mode === EditMode.Create ? "new-email-server" : "email-server";
|
|
108278
108346
|
if (!data) {
|
|
108279
108347
|
return null;
|
|
@@ -108281,9 +108349,10 @@ function EmailServerConnectionSettings(options) {
|
|
|
108281
108349
|
const { resources } = services;
|
|
108282
108350
|
const [serverType, setServerType] = useState(data.serverType);
|
|
108283
108351
|
useEffect(() => {
|
|
108352
|
+
if (mode === EditMode.Edit && !isCurrentlyEditedSetting) return;
|
|
108284
108353
|
setServerType(data.serverType);
|
|
108285
108354
|
updateServerTypeValidationFields(data.serverType);
|
|
108286
|
-
}, [data.serverType]);
|
|
108355
|
+
}, [data.serverType, mode, isCurrentlyEditedSetting]);
|
|
108287
108356
|
const labelPlacement = mode === EditMode.Create ? LabelPlacement.Top : LabelPlacement.Left;
|
|
108288
108357
|
const getEmailServer = (type, data2) => {
|
|
108289
108358
|
switch (type) {
|
|
@@ -108841,6 +108910,7 @@ function ConnectionPanel(props) {
|
|
|
108841
108910
|
const $changedConnections = e(logic.$changedConnections);
|
|
108842
108911
|
const $loading = e(logic.$loading);
|
|
108843
108912
|
const $customValidationModel = e(logic.$customValidationModel);
|
|
108913
|
+
const activeSettingsId = e(logic.$activeId);
|
|
108844
108914
|
const dataTestIdPrefix = props.connectionType === ConnectionTypes.EmailServer ? "email-server" : "settings-panel";
|
|
108845
108915
|
const dataTestIdDefault = `${dataTestIdPrefix}__checkbox-default`;
|
|
108846
108916
|
const dataTestIdAddButton = `${dataTestIdPrefix}__add-button`;
|
|
@@ -108931,6 +109001,7 @@ function ConnectionPanel(props) {
|
|
|
108931
109001
|
onDataChanged: logic.updateSettings,
|
|
108932
109002
|
services: props.services,
|
|
108933
109003
|
validation: $changedValidationModel,
|
|
109004
|
+
isCurrentlyEditedSetting: connection.id === activeSettingsId,
|
|
108934
109005
|
customValidationProvider: {
|
|
108935
109006
|
model: $customValidationModel,
|
|
108936
109007
|
set: logic.changeCustomValidationModel,
|