@topconsultnpm/sdkui-react 6.19.0-hotfix0 → 6.19.0-hotfix1
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.
|
@@ -3,6 +3,8 @@ import { TMEndpointsType } from './TMLoginForm';
|
|
|
3
3
|
export interface LoginData {
|
|
4
4
|
endpoint: TMEndpointsType;
|
|
5
5
|
dcmtArchive: ArchiveDescriptor;
|
|
6
|
+
manualArchiveID?: string;
|
|
7
|
+
hasArchives?: boolean;
|
|
6
8
|
authenticationMode: AuthenticationModes;
|
|
7
9
|
username?: string;
|
|
8
10
|
password?: string;
|
|
@@ -27,8 +27,13 @@ export class LoginValidator {
|
|
|
27
27
|
if (!data.endpoint?.Description?.trim()) {
|
|
28
28
|
addError("endpoint", SDKUI_Localizator.RequiredField);
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
31
|
-
|
|
30
|
+
if (data.hasArchives) {
|
|
31
|
+
if (!data.dcmtArchive?.description?.trim()) {
|
|
32
|
+
addError("dcmtArchive", SDKUI_Localizator.RequiredField);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (!data.manualArchiveID?.trim()) {
|
|
36
|
+
addError("manualArchiveID", SDKUI_Localizator.RequiredField);
|
|
32
37
|
}
|
|
33
38
|
if (!data.authenticationMode || data.authenticationMode === AuthenticationModes.None) {
|
|
34
39
|
addError("authenticationMode", SDKUI_Localizator.RequiredField);
|
|
@@ -111,6 +111,7 @@ const TMLoginForm = (props) => {
|
|
|
111
111
|
const [showCultureIDs, setShowCultureIDs] = useState(false);
|
|
112
112
|
const [dcmtArchives, setDcmtArchives] = useState([]);
|
|
113
113
|
const [dcmtArchive, setDcmtArchive] = useState();
|
|
114
|
+
const [manualArchiveID, setManualArchiveID] = useState('');
|
|
114
115
|
const [authMode, setAuthMode] = useState(AuthenticationModes.TopMedia);
|
|
115
116
|
const [username, setUsername] = useState('SysAdmin');
|
|
116
117
|
const [password, setPassword] = useState('');
|
|
@@ -131,6 +132,8 @@ const TMLoginForm = (props) => {
|
|
|
131
132
|
authenticationMode: authMode,
|
|
132
133
|
cultureID: props.cultureID ?? CultureIDs.It_IT,
|
|
133
134
|
dcmtArchive: dcmtArchive,
|
|
135
|
+
manualArchiveID: manualArchiveID,
|
|
136
|
+
hasArchives: dcmtArchives.length > 0,
|
|
134
137
|
endpoint: endpoint,
|
|
135
138
|
authDomain: authDomain,
|
|
136
139
|
authDomainOnBehalfOf: authDomain,
|
|
@@ -142,7 +145,7 @@ const TMLoginForm = (props) => {
|
|
|
142
145
|
username: username,
|
|
143
146
|
usernameOnBehalfOf: usernameOnBehalf
|
|
144
147
|
};
|
|
145
|
-
}, [authMode, props.cultureID, dcmtArchive, endpoint, authDomain, otpCode, password, passwordOnBehalf, saveLoginName, saveLoginEnable, username, usernameOnBehalf]);
|
|
148
|
+
}, [authMode, props.cultureID, dcmtArchive, manualArchiveID, dcmtArchives.length, endpoint, authDomain, otpCode, password, passwordOnBehalf, saveLoginName, saveLoginEnable, username, usernameOnBehalf]);
|
|
146
149
|
const inputRefs = useMemo(() => {
|
|
147
150
|
switch (authMode) {
|
|
148
151
|
case AuthenticationModes.TopMedia:
|
|
@@ -302,7 +305,7 @@ const TMLoginForm = (props) => {
|
|
|
302
305
|
}, []);
|
|
303
306
|
const disableContinueBtn = useMemo(() => {
|
|
304
307
|
switch (loginStep) {
|
|
305
|
-
case 1: return fieldValidations('endpoint').length > 0 || fieldValidations('dcmtArchive').length > 0;
|
|
308
|
+
case 1: return fieldValidations('endpoint').length > 0 || fieldValidations('dcmtArchive').length > 0 || fieldValidations('manualArchiveID').length > 0;
|
|
306
309
|
case 2: return fieldValidations('authenticationMode').length > 0 || fieldValidations('username').length > 0 || fieldValidations('password').length > 0;
|
|
307
310
|
default: return false;
|
|
308
311
|
}
|
|
@@ -321,8 +324,13 @@ const TMLoginForm = (props) => {
|
|
|
321
324
|
return tmSession;
|
|
322
325
|
}, [endpoint, username, dcmtArchive]);
|
|
323
326
|
const nextStepHandler = async () => {
|
|
324
|
-
if (!endpoint || !dcmtArchive)
|
|
327
|
+
if (!endpoint || (!dcmtArchive && !manualArchiveID))
|
|
325
328
|
return;
|
|
329
|
+
if (loginStep === 1 && !dcmtArchive && manualArchiveID) {
|
|
330
|
+
const isValid = await validateManualArchiveAsync();
|
|
331
|
+
if (!isValid)
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
326
334
|
if (loginStep === 1) {
|
|
327
335
|
setLoginStep(2);
|
|
328
336
|
}
|
|
@@ -349,6 +357,23 @@ const TMLoginForm = (props) => {
|
|
|
349
357
|
return;
|
|
350
358
|
setLoginStep(prev => prev - 1);
|
|
351
359
|
}, [loginStep]);
|
|
360
|
+
const validateManualArchiveAsync = async () => {
|
|
361
|
+
if (!tmSession || !manualArchiveID)
|
|
362
|
+
return false;
|
|
363
|
+
try {
|
|
364
|
+
TMSpinner.show({ description: '' });
|
|
365
|
+
const archiveEngine = tmSession.NewArchiveEngine();
|
|
366
|
+
await archiveEngine.RetrieveAsync(manualArchiveID);
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
catch (e) {
|
|
370
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
finally {
|
|
374
|
+
TMSpinner.hide();
|
|
375
|
+
}
|
|
376
|
+
};
|
|
352
377
|
const getArchivesAsync = async () => {
|
|
353
378
|
if (!tmSession)
|
|
354
379
|
return;
|
|
@@ -392,7 +417,7 @@ const TMLoginForm = (props) => {
|
|
|
392
417
|
const sdInput = {
|
|
393
418
|
authenticationMode: authMode,
|
|
394
419
|
appModuleID: props.appModule,
|
|
395
|
-
archiveID: dcmtArchive?.id,
|
|
420
|
+
archiveID: dcmtArchive?.id ?? (dcmtArchives.length === 0 && manualArchiveID ? manualArchiveID : undefined),
|
|
396
421
|
description: dcmtArchive?.description,
|
|
397
422
|
userName: username,
|
|
398
423
|
password: password,
|
|
@@ -594,7 +619,7 @@ const TMLoginForm = (props) => {
|
|
|
594
619
|
}
|
|
595
620
|
}, [SDK_Globals.appModule]);
|
|
596
621
|
return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, "$isConnector": props.isConnector ?? false, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + welcomeAppNameHeader + ' ' + 'v.' + SDK_Globals.appVersion }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsx(StyledOverlay, { "$isMobile": isMobile, children: _jsx(StyledCustomLogo, { style: { backgroundImage: `url(${showDefaultLogo ? 'logo-default.svg' : 'logo-custom.svg'})` } }) }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [((((getDeviceType() === 'desktop' || isDesktop || isTablet) && windowHeight !== WindowHeight.SMALL)) && !isMobile) && _jsxs(StyledLogoContainer, { "$isMobile": isMobile, children: [_jsx(StyledWelcomeText, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') }), _jsx(StyledLogo, { children: _jsx("img", { src: six, alt: "six", height: 50 }) }), _jsx(StyledWelcomeText, { children: welcomeAppName })] }), _jsxs(StyledToolbarContainer, { children: [_jsx(StyledLanguageChooser, { onClick: () => setShowCultureIDs(true), children: _jsx(TMTooltip, { content: SDKUI_Localizator.CultureID, children: _jsx("img", { src: getCultureIDImg(), alt: "Lang", width: 25, height: 25 }) }) }), loginStep !== 3 && _jsx(TMButton, { btnStyle: "icon", onClick: () => setShowRapidAccess(true), icon: _jsx(IconFastAccess, { fontSize: 20 }), caption: LOGINLocalizator.QuickAccess }), showPasswordOperations && _jsx(TMButton, { disabled: disablePasswordOperations, btnStyle: "icon", onClick: () => setShowChangePassword(true), icon: _jsx(IconPasswordOutline, { fontSize: 19 }), caption: SDKUI_Localizator.ChangePassword })] }), _jsxs(StyledFormContainer, { "$isMobile": isMobile, "$windowHeight": windowHeight, children: [loginStep === 1 &&
|
|
597
|
-
_jsxs(StyledStepContainer, { "$deviceType": deviceType, children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), _jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })] }), loginStep === 2 &&
|
|
622
|
+
_jsxs(StyledStepContainer, { "$deviceType": deviceType, children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), dcmtArchives.length > 0 ? (_jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })) : (_jsx(TextBox, { type: "text", icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, value: manualArchiveID, onValueChanged: (value) => setManualArchiveID(value), validationItems: fieldValidations('manualArchiveID'), disabled: !endpoint, placeHolder: 'Inserisci archivio' }))] }), loginStep === 2 &&
|
|
598
623
|
_jsxs(_Fragment, { children: [_jsxs(StyledSummaryContainer, { style: {
|
|
599
624
|
display: 'flex',
|
|
600
625
|
justifyContent: 'center',
|
|
@@ -604,7 +629,7 @@ const TMLoginForm = (props) => {
|
|
|
604
629
|
marginBottom: windowHeight === WindowHeight.SMALL ? '30px' : '25px',
|
|
605
630
|
width: '100%',
|
|
606
631
|
minHeight: '15px'
|
|
607
|
-
}, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: endpoint?.Description ?? '', children: _jsx("p", { children: endpoint?.Description && endpoint.Description.length > 20 ? endpoint.Description.substring(0, 20) + '...' : endpoint?.Description }) })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: dcmtArchive
|
|
632
|
+
}, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: endpoint?.Description ?? '', children: _jsx("p", { children: endpoint?.Description && endpoint.Description.length > 20 ? endpoint.Description.substring(0, 20) + '...' : endpoint?.Description }) })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: dcmtArchive ? (dcmtArchive.description ?? '') : manualArchiveID, children: _jsx(StyledArchiveText, { children: dcmtArchive ? (dcmtArchive.description ?? '') : manualArchiveID }) })] })] }), _jsxs(StyledStepContainer, { "$windowHeight": windowHeight, "$deviceType": deviceType, children: [_jsx(SelectBox, { value: authMode, options: authModeOptions, onValueChanged: (value) => setAuthMode(value), validationItems: fieldValidations('authenticationMode'), icon: _jsx(IconLogin, {}), label: SDKUI_Localizator.AuthMode }), _jsxs(StyledCredentialWrapper, { children: [authMode === AuthenticationModes.WindowsThroughTopMedia && _jsx(TextBox, { ref: authDomainRef, value: authDomain, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), authMode !== AuthenticationModes.MSAzure && _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameRef, secondaryRef: passwordRef, usernameValidator: fieldValidations('username'), passwordValidator: fieldValidations('password'), authMode: authMode, username: username, password: password, onUsernameChanged: (un) => setUsername(un), onPasswordChanged: (ps) => setPassword(ps) }), authMode === AuthenticationModes.TopMediaOnBehalfOf &&
|
|
608
633
|
_jsxs(StyledCredentialWrapper, { children: [_jsx(TextBox, { value: authDomain, ref: authDomainRef, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameOnBehalfOfRef, secondaryRef: passwordOnBehalfOfRRef, usernameValidator: fieldValidations('usernameOnBehalfOf'), passwordValidator: fieldValidations('passwordOnBehalfOf'), authMode: AuthenticationModes.TopMediaOnBehalfOf, username: usernameOnBehalf, password: passwordOnBehalf, onUsernameChanged: (un) => setUsernameOnBehalf(un), onPasswordChanged: (ps) => setPasswordOnBehalf(ps) })] })] }), authMode !== AuthenticationModes.TopMediaWithMFA &&
|
|
609
634
|
_jsx(RapidAccessContainer, { isSaveEnable: saveLoginEnable, name: saveLoginName, nameValidationItems: fieldValidations('rapidAccessName'), onEnableSaveChange: () => setSaveLoginEnable(!saveLoginEnable), onNameChange: (name) => setSaveLoginName(name) })] })] }), loginStep === 3 &&
|
|
610
635
|
_jsxs(StyledStepThreeContainer, { "$isMobile": isMobile, children: [_jsx(OTPReader, { isMobile: isMobile, digits: otpCode, onChange: handleDigitChange, onFullChange: handleFullChange, text: _jsxs("div", { children: [" ", LOGINLocalizator.EnterOtpInstructions, " "] }), header: '', additionalButtons: [
|
|
@@ -703,6 +728,7 @@ const StyledLogo = styled.div ` display: flex; gap: 5px; align-items: center; `;
|
|
|
703
728
|
const StyledFormContainer = styled.div ` display: flex; flex-direction: column; padding: ${props => getPadding(props.$windowHeight, props.$isMobile)} ; align-items: center; justify-content: center; gap: 10px; width: 100%; height: fit-content; max-height: calc(100% - 100px); margin-top : ${props => !props.$isMobile && props.$windowHeight === WindowHeight.MEDIUM ? '70px' : '0'} ; `;
|
|
704
729
|
const StyledButtonContainer = styled.div ` display: flex; align-items: center; justify-content: center; padding: ${props => props.$windowHeight !== WindowHeight.SMALL ? '10px' : '0'}; width: 100%; margin-top: ${props => props.$windowHeight !== WindowHeight.SMALL ? '10px' : '0'}; `;
|
|
705
730
|
const StyledDescription = styled.div ` display: flex; align-items: center; gap: 2px; `;
|
|
731
|
+
const StyledArchiveText = styled.p ` max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; `;
|
|
706
732
|
const StyledRapidLoginSave = styled.div ` display: flex; flex-direction: column; width: 100%; gap: 2px; `;
|
|
707
733
|
const StyledForgetPassword = styled.div ` position: absolute; bottom: ${props => props.$isMobile ? '15px' : '25px'}; left: 50%; transform: translateX(-50%); font-size: 0.8rem; `;
|
|
708
734
|
const StyledBackButton = styled.div ` position: absolute; top: 20px; left: 20px; `;
|
package/lib/helper/helpers.js
CHANGED
|
@@ -659,7 +659,13 @@ export const renderHighlightedText = (text, searchText, isSelected) => {
|
|
|
659
659
|
return text.split(regex).map((part, index) => regex.test(part) ? (_jsx("span", { style: { backgroundColor: isSelected ? '#6c9023' : 'yellow' }, children: part }, index)) : (part));
|
|
660
660
|
};
|
|
661
661
|
export function versionAndBuildtypeInfo(module) {
|
|
662
|
-
|
|
662
|
+
switch (module) {
|
|
663
|
+
case moduleTypes.SDK:
|
|
664
|
+
case moduleTypes.SDKUI:
|
|
665
|
+
return moduleVersion(module).replace("-hotfix", "+hotfix");
|
|
666
|
+
default:
|
|
667
|
+
return moduleVersion(module);
|
|
668
|
+
}
|
|
663
669
|
}
|
|
664
670
|
export const getListMaxItems = (deviceType) => { return deviceType === DeviceType.MOBILE ? 8 : 12; };
|
|
665
671
|
export const svgToString = (icon) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.19.0-
|
|
3
|
+
"version": "6.19.0-hotfix1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"lib"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@topconsultnpm/sdk-ts": "6.19.0
|
|
42
|
+
"@topconsultnpm/sdk-ts": "6.19.0",
|
|
43
43
|
"buffer": "^6.0.3",
|
|
44
44
|
"devextreme": "25.1.7",
|
|
45
45
|
"devextreme-react": "25.1.7",
|