@topconsultnpm/sdkui-react-beta 6.5.51
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/lib/assets/6.png +0 -0
- package/lib/assets/ImageLibrary/arrow_001.png +0 -0
- package/lib/assets/ImageLibrary/arrow_002.png +0 -0
- package/lib/assets/ImageLibrary/arrow_003.png +0 -0
- package/lib/assets/ImageLibrary/arrow_004.png +0 -0
- package/lib/assets/ImageLibrary/arrow_005.png +0 -0
- package/lib/assets/ImageLibrary/arrow_006.png +0 -0
- package/lib/assets/ImageLibrary/arrow_007.png +0 -0
- package/lib/assets/ImageLibrary/arrow_008.png +0 -0
- package/lib/assets/ImageLibrary/arrow_009.png +0 -0
- package/lib/assets/ImageLibrary/arrow_010.png +0 -0
- package/lib/assets/ImageLibrary/arrow_011.png +0 -0
- package/lib/assets/ImageLibrary/arrow_012.png +0 -0
- package/lib/assets/ImageLibrary/book_001.png +0 -0
- package/lib/assets/ImageLibrary/book_002.png +0 -0
- package/lib/assets/ImageLibrary/book_003.png +0 -0
- package/lib/assets/ImageLibrary/book_004.png +0 -0
- package/lib/assets/ImageLibrary/book_005.png +0 -0
- package/lib/assets/ImageLibrary/book_006.png +0 -0
- package/lib/assets/ImageLibrary/book_007.png +0 -0
- package/lib/assets/ImageLibrary/clock_001.png +0 -0
- package/lib/assets/ImageLibrary/clock_002.png +0 -0
- package/lib/assets/ImageLibrary/clock_003.png +0 -0
- package/lib/assets/ImageLibrary/cube_001.png +0 -0
- package/lib/assets/ImageLibrary/cube_002.png +0 -0
- package/lib/assets/ImageLibrary/cube_003.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_001.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_002.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_003.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_004.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_005.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_006.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_007.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_008.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_001.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_002.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_003.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_004.png +0 -0
- package/lib/assets/ImageLibrary/fld_001.png +0 -0
- package/lib/assets/ImageLibrary/fld_002.png +0 -0
- package/lib/assets/ImageLibrary/fld_003.png +0 -0
- package/lib/assets/ImageLibrary/fld_004.png +0 -0
- package/lib/assets/ImageLibrary/fld_005.png +0 -0
- package/lib/assets/ImageLibrary/fld_006.png +0 -0
- package/lib/assets/ImageLibrary/fld_007.png +0 -0
- package/lib/assets/ImageLibrary/fld_008.png +0 -0
- package/lib/assets/ImageLibrary/fld_009.png +0 -0
- package/lib/assets/ImageLibrary/fld_010.png +0 -0
- package/lib/assets/ImageLibrary/fld_011.png +0 -0
- package/lib/assets/ImageLibrary/fld_012.png +0 -0
- package/lib/assets/ImageLibrary/fld_013.png +0 -0
- package/lib/assets/ImageLibrary/fld_014.png +0 -0
- package/lib/assets/ImageLibrary/fld_015.png +0 -0
- package/lib/assets/ImageLibrary/fld_016.png +0 -0
- package/lib/assets/ImageLibrary/fld_017.png +0 -0
- package/lib/assets/ImageLibrary/fld_018.png +0 -0
- package/lib/assets/ImageLibrary/fld_019.png +0 -0
- package/lib/assets/ImageLibrary/fld_020.png +0 -0
- package/lib/assets/ImageLibrary/fld_021.png +0 -0
- package/lib/assets/ImageLibrary/fld_022.png +0 -0
- package/lib/assets/ImageLibrary/fld_023.png +0 -0
- package/lib/assets/ImageLibrary/fld_024.png +0 -0
- package/lib/assets/ImageLibrary/fld_025.png +0 -0
- package/lib/assets/ImageLibrary/fld_026.png +0 -0
- package/lib/assets/ImageLibrary/fld_027.png +0 -0
- package/lib/assets/ImageLibrary/fld_028.png +0 -0
- package/lib/assets/ImageLibrary/fld_029.png +0 -0
- package/lib/assets/ImageLibrary/fld_030.png +0 -0
- package/lib/assets/ImageLibrary/fld_031.png +0 -0
- package/lib/assets/ImageLibrary/fld_032.png +0 -0
- package/lib/assets/ImageLibrary/fld_033.png +0 -0
- package/lib/assets/ImageLibrary/gen_001.png +0 -0
- package/lib/assets/ImageLibrary/gen_002.png +0 -0
- package/lib/assets/ImageLibrary/gen_003.png +0 -0
- package/lib/assets/ImageLibrary/gen_004.png +0 -0
- package/lib/assets/ImageLibrary/gen_005.png +0 -0
- package/lib/assets/ImageLibrary/gen_006.png +0 -0
- package/lib/assets/ImageLibrary/gen_007.png +0 -0
- package/lib/assets/ImageLibrary/gen_008.png +0 -0
- package/lib/assets/ImageLibrary/gen_009.png +0 -0
- package/lib/assets/ImageLibrary/gen_010.png +0 -0
- package/lib/assets/ImageLibrary/gen_011.png +0 -0
- package/lib/assets/ImageLibrary/gen_012.png +0 -0
- package/lib/assets/ImageLibrary/gen_013.png +0 -0
- package/lib/assets/ImageLibrary/gen_014.png +0 -0
- package/lib/assets/ImageLibrary/gen_015.png +0 -0
- package/lib/assets/ImageLibrary/gen_016.png +0 -0
- package/lib/assets/ImageLibrary/gen_017.png +0 -0
- package/lib/assets/ImageLibrary/gen_018.png +0 -0
- package/lib/assets/ImageLibrary/gen_019.png +0 -0
- package/lib/assets/ImageLibrary/gen_020.png +0 -0
- package/lib/assets/ImageLibrary/gen_021.png +0 -0
- package/lib/assets/ImageLibrary/gen_022.png +0 -0
- package/lib/assets/ImageLibrary/gen_023.png +0 -0
- package/lib/assets/ImageLibrary/gen_024.png +0 -0
- package/lib/assets/ImageLibrary/gen_025.png +0 -0
- package/lib/assets/ImageLibrary/gen_026.png +0 -0
- package/lib/assets/ImageLibrary/gen_027.png +0 -0
- package/lib/assets/ImageLibrary/gen_028.png +0 -0
- package/lib/assets/ImageLibrary/gen_029.png +0 -0
- package/lib/assets/ImageLibrary/gen_030.png +0 -0
- package/lib/assets/ImageLibrary/gen_031.png +0 -0
- package/lib/assets/ImageLibrary/gen_032.png +0 -0
- package/lib/assets/ImageLibrary/gen_033.png +0 -0
- package/lib/assets/ImageLibrary/gen_034.png +0 -0
- package/lib/assets/ImageLibrary/gen_035.png +0 -0
- package/lib/assets/ImageLibrary/gen_036.png +0 -0
- package/lib/assets/ImageLibrary/gen_037.png +0 -0
- package/lib/assets/ImageLibrary/gen_038.png +0 -0
- package/lib/assets/ImageLibrary/gen_039.png +0 -0
- package/lib/assets/ImageLibrary/gen_040.png +0 -0
- package/lib/assets/ImageLibrary/gen_041.png +0 -0
- package/lib/assets/ImageLibrary/gen_042.png +0 -0
- package/lib/assets/ImageLibrary/gen_043.png +0 -0
- package/lib/assets/ImageLibrary/gen_044.png +0 -0
- package/lib/assets/ImageLibrary/gen_045.png +0 -0
- package/lib/assets/ImageLibrary/gen_046.png +0 -0
- package/lib/assets/ImageLibrary/gen_047.png +0 -0
- package/lib/assets/ImageLibrary/gen_048.png +0 -0
- package/lib/assets/ImageLibrary/gen_049.png +0 -0
- package/lib/assets/ImageLibrary/gen_050.png +0 -0
- package/lib/assets/ImageLibrary/gen_051.png +0 -0
- package/lib/assets/ImageLibrary/gen_052.png +0 -0
- package/lib/assets/ImageLibrary/hand_001.png +0 -0
- package/lib/assets/ImageLibrary/hand_002.png +0 -0
- package/lib/assets/ImageLibrary/hand_003.png +0 -0
- package/lib/assets/ImageLibrary/hand_004.png +0 -0
- package/lib/assets/ImageLibrary/hand_005.png +0 -0
- package/lib/assets/ImageLibrary/hand_006.png +0 -0
- package/lib/assets/ImageLibrary/law_001.png +0 -0
- package/lib/assets/ImageLibrary/law_002.png +0 -0
- package/lib/assets/ImageLibrary/law_003.png +0 -0
- package/lib/assets/ImageLibrary/lock_001.png +0 -0
- package/lib/assets/ImageLibrary/lock_002.png +0 -0
- package/lib/assets/ImageLibrary/lock_003.png +0 -0
- package/lib/assets/ImageLibrary/mail_001.png +0 -0
- package/lib/assets/ImageLibrary/mail_002.png +0 -0
- package/lib/assets/ImageLibrary/mail_003.png +0 -0
- package/lib/assets/ImageLibrary/mail_004.png +0 -0
- package/lib/assets/ImageLibrary/mail_005.png +0 -0
- package/lib/assets/ImageLibrary/mail_006.png +0 -0
- package/lib/assets/ImageLibrary/mail_007.png +0 -0
- package/lib/assets/ImageLibrary/mail_008.png +0 -0
- package/lib/assets/ImageLibrary/mail_009.png +0 -0
- package/lib/assets/ImageLibrary/mail_010.png +0 -0
- package/lib/assets/ImageLibrary/mail_011.png +0 -0
- package/lib/assets/ImageLibrary/mail_012.png +0 -0
- package/lib/assets/ImageLibrary/mail_013.png +0 -0
- package/lib/assets/ImageLibrary/mail_014.png +0 -0
- package/lib/assets/ImageLibrary/mail_015.png +0 -0
- package/lib/assets/ImageLibrary/net_001.png +0 -0
- package/lib/assets/ImageLibrary/net_002.png +0 -0
- package/lib/assets/ImageLibrary/net_003.png +0 -0
- package/lib/assets/ImageLibrary/net_004.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_001.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_002.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_003.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_004.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_005.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_006.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_007.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_008.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_009.png +0 -0
- package/lib/assets/ImageLibrary/note_001.png +0 -0
- package/lib/assets/ImageLibrary/note_002.png +0 -0
- package/lib/assets/ImageLibrary/note_003.png +0 -0
- package/lib/assets/ImageLibrary/note_004.png +0 -0
- package/lib/assets/ImageLibrary/note_005.png +0 -0
- package/lib/assets/ImageLibrary/note_006.png +0 -0
- package/lib/assets/ImageLibrary/note_007.png +0 -0
- package/lib/assets/ImageLibrary/note_008.png +0 -0
- package/lib/assets/ImageLibrary/note_009.png +0 -0
- package/lib/assets/ImageLibrary/note_010.png +0 -0
- package/lib/assets/ImageLibrary/note_011.png +0 -0
- package/lib/assets/ImageLibrary/note_012.png +0 -0
- package/lib/assets/ImageLibrary/note_013.png +0 -0
- package/lib/assets/ImageLibrary/note_014.png +0 -0
- package/lib/assets/ImageLibrary/note_015.png +0 -0
- package/lib/assets/ImageLibrary/note_016.png +0 -0
- package/lib/assets/ImageLibrary/run_001.png +0 -0
- package/lib/assets/ImageLibrary/run_002.png +0 -0
- package/lib/assets/ImageLibrary/run_003.png +0 -0
- package/lib/assets/ImageLibrary/sem_001.png +0 -0
- package/lib/assets/ImageLibrary/sem_002.png +0 -0
- package/lib/assets/ImageLibrary/sem_003.png +0 -0
- package/lib/assets/ImageLibrary/sem_004.png +0 -0
- package/lib/assets/ImageLibrary/sem_005.png +0 -0
- package/lib/assets/ImageLibrary/star_001.png +0 -0
- package/lib/assets/ImageLibrary/star_002.png +0 -0
- package/lib/assets/ImageLibrary/star_003.png +0 -0
- package/lib/assets/ImageLibrary/star_004.png +0 -0
- package/lib/assets/ImageLibrary/star_005.png +0 -0
- package/lib/assets/ImageLibrary/star_006.png +0 -0
- package/lib/assets/ImageLibrary/state_001.png +0 -0
- package/lib/assets/ImageLibrary/state_002.png +0 -0
- package/lib/assets/ImageLibrary/state_003.png +0 -0
- package/lib/assets/ImageLibrary/state_004.png +0 -0
- package/lib/assets/ImageLibrary/state_005.png +0 -0
- package/lib/assets/ImageLibrary/study_001.png +0 -0
- package/lib/assets/ImageLibrary/study_002.png +0 -0
- package/lib/assets/ImageLibrary/user_001.png +0 -0
- package/lib/assets/ImageLibrary/user_002.png +0 -0
- package/lib/assets/ImageLibrary/user_003.png +0 -0
- package/lib/assets/ImageLibrary/user_004.png +0 -0
- package/lib/assets/ImageLibrary/user_005.png +0 -0
- package/lib/assets/ImageLibrary/user_006.png +0 -0
- package/lib/assets/ImageLibrary/user_007.png +0 -0
- package/lib/assets/ImageLibrary/user_008.png +0 -0
- package/lib/assets/ImageLibrary/user_009.png +0 -0
- package/lib/assets/ImageLibrary/user_010.png +0 -0
- package/lib/assets/ImageLibrary/user_011.png +0 -0
- package/lib/assets/ImageLibrary/user_012.png +0 -0
- package/lib/assets/ImageLibrary/user_013.png +0 -0
- package/lib/assets/ImageLibrary/user_014.png +0 -0
- package/lib/assets/ImageLibrary/user_015.png +0 -0
- package/lib/assets/ImageLibrary/user_016.png +0 -0
- package/lib/assets/ImageLibrary/user_017.png +0 -0
- package/lib/assets/ImageLibrary/user_018.png +0 -0
- package/lib/assets/ImageLibrary/user_019.png +0 -0
- package/lib/assets/ImageLibrary/user_020.png +0 -0
- package/lib/assets/ImageLibrary/user_021.png +0 -0
- package/lib/assets/ImageLibrary/user_022.png +0 -0
- package/lib/assets/ImageLibrary/user_023.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_001.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_002.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_003.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_004.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_005.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_006.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_007.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_008.png +0 -0
- package/lib/assets/Metadata/DataList_32.png +0 -0
- package/lib/assets/Metadata/DynamicDataList_32.png +0 -0
- package/lib/assets/Metadata/MetadataComputed_32.png +0 -0
- package/lib/assets/Metadata/MetadataDateTime_16.png +0 -0
- package/lib/assets/Metadata/MetadataNumeric_16.png +0 -0
- package/lib/assets/Metadata/MetadataSpecial_32.png +0 -0
- package/lib/assets/Metadata/MetadataText_16.png +0 -0
- package/lib/assets/Metadata/Metadata_32.png +0 -0
- package/lib/assets/Metadata/Numerator_32.png +0 -0
- package/lib/assets/Metadata/UserLevel_Member_32.png +0 -0
- package/lib/assets/Orchestrator6.png +0 -0
- package/lib/assets/TopMediaOrchestrator6.svg +93 -0
- package/lib/assets/Toppy-generico.png +0 -0
- package/lib/assets/background-login.png +0 -0
- package/lib/assets/d.png +0 -0
- package/lib/assets/doc.jpg +0 -0
- package/lib/assets/icomoon.eot +0 -0
- package/lib/assets/icomoon.svg +97 -0
- package/lib/assets/icomoon.ttf +0 -0
- package/lib/assets/icomoon.woff +0 -0
- package/lib/assets/loading.png +0 -0
- package/lib/assets/login-bg.png +0 -0
- package/lib/assets/logo-TopConsult-footer.png +0 -0
- package/lib/assets/logo.svg +79 -0
- package/lib/assets/multipleSelectionManager.jpg +0 -0
- package/lib/assets/s.png +0 -0
- package/lib/components/base/Styled.d.ts +28 -0
- package/lib/components/base/Styled.js +117 -0
- package/lib/components/base/TMAlert.d.ts +20 -0
- package/lib/components/base/TMAlert.js +75 -0
- package/lib/components/base/TMButton.d.ts +17 -0
- package/lib/components/base/TMButton.js +163 -0
- package/lib/components/base/TMClosableList.d.ts +10 -0
- package/lib/components/base/TMClosableList.js +69 -0
- package/lib/components/base/TMContextMenu.d.ts +26 -0
- package/lib/components/base/TMContextMenu.js +56 -0
- package/lib/components/base/TMDropDown.d.ts +11 -0
- package/lib/components/base/TMDropDown.js +64 -0
- package/lib/components/base/TMDropDownMenu.d.ts +17 -0
- package/lib/components/base/TMDropDownMenu.js +39 -0
- package/lib/components/base/TMEditorBase.d.ts +31 -0
- package/lib/components/base/TMEditorBase.js +1 -0
- package/lib/components/base/TMLayout.d.ts +51 -0
- package/lib/components/base/TMLayout.js +152 -0
- package/lib/components/base/TMList.d.ts +9 -0
- package/lib/components/base/TMList.js +46 -0
- package/lib/components/base/TMListView.d.ts +24 -0
- package/lib/components/base/TMListView.js +321 -0
- package/lib/components/base/TMModal.d.ts +14 -0
- package/lib/components/base/TMModal.js +48 -0
- package/lib/components/base/TMPopUp.d.ts +26 -0
- package/lib/components/base/TMPopUp.js +136 -0
- package/lib/components/base/TMProgressBar.d.ts +11 -0
- package/lib/components/base/TMProgressBar.js +32 -0
- package/lib/components/base/TMSpinner.d.ts +13 -0
- package/lib/components/base/TMSpinner.js +23 -0
- package/lib/components/base/TMTab.d.ts +20 -0
- package/lib/components/base/TMTab.js +42 -0
- package/lib/components/base/TMToggleButton.d.ts +10 -0
- package/lib/components/base/TMToggleButton.js +58 -0
- package/lib/components/base/TMTooltip.d.ts +9 -0
- package/lib/components/base/TMTooltip.js +19 -0
- package/lib/components/base/TMVilViewer.d.ts +5 -0
- package/lib/components/base/TMVilViewer.js +22 -0
- package/lib/components/choosers/TMDataListItemChooser.d.ts +19 -0
- package/lib/components/choosers/TMDataListItemChooser.js +37 -0
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +25 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +46 -0
- package/lib/components/choosers/TMMetadataChooser.d.ts +41 -0
- package/lib/components/choosers/TMMetadataChooser.js +118 -0
- package/lib/components/choosers/TMUserChooser.d.ts +26 -0
- package/lib/components/choosers/TMUserChooser.js +82 -0
- package/lib/components/editors/TMCheckBox.d.ts +9 -0
- package/lib/components/editors/TMCheckBox.js +90 -0
- package/lib/components/editors/TMDateBox.d.ts +12 -0
- package/lib/components/editors/TMDateBox.js +78 -0
- package/lib/components/editors/TMDropDown.d.ts +10 -0
- package/lib/components/editors/TMDropDown.js +38 -0
- package/lib/components/editors/TMEditorStyled.d.ts +30 -0
- package/lib/components/editors/TMEditorStyled.js +75 -0
- package/lib/components/editors/TMRadioButton.d.ts +10 -0
- package/lib/components/editors/TMRadioButton.js +57 -0
- package/lib/components/editors/TMSummary.d.ts +18 -0
- package/lib/components/editors/TMSummary.js +62 -0
- package/lib/components/editors/TMTextBox.d.ts +20 -0
- package/lib/components/editors/TMTextBox.js +116 -0
- package/lib/components/filesystem/ProgressBar.d.ts +7 -0
- package/lib/components/filesystem/ProgressBar.js +25 -0
- package/lib/components/forms/TMApplyForm.d.ts +4 -0
- package/lib/components/forms/TMApplyForm.js +102 -0
- package/lib/components/forms/TMChooserForm.d.ts +3 -0
- package/lib/components/forms/TMChooserForm.js +56 -0
- package/lib/components/forms/TMLoginForm.d.ts +32 -0
- package/lib/components/forms/TMLoginForm.js +986 -0
- package/lib/components/forms/TMSaveForm.d.ts +4 -0
- package/lib/components/forms/TMSaveForm.js +107 -0
- package/lib/components/grids/TMValidationItemsList.d.ts +6 -0
- package/lib/components/grids/TMValidationItemsList.js +82 -0
- package/lib/components/index.d.ts +44 -0
- package/lib/components/index.js +59 -0
- package/lib/components/pages/TMPage.d.ts +39 -0
- package/lib/components/pages/TMPage.js +194 -0
- package/lib/components/query/TMQueryEditor.d.ts +27 -0
- package/lib/components/query/TMQueryEditor.js +1044 -0
- package/lib/components/query/TMQueryResult.d.ts +8 -0
- package/lib/components/query/TMQueryResult.js +47 -0
- package/lib/components/settings/SettingsAppearance.d.ts +2 -0
- package/lib/components/settings/SettingsAppearance.js +44 -0
- package/lib/components/sidebar/TMHeader.d.ts +31 -0
- package/lib/components/sidebar/TMHeader.js +228 -0
- package/lib/components/sidebar/TMSidebar.d.ts +17 -0
- package/lib/components/sidebar/TMSidebar.js +24 -0
- package/lib/components/sidebar/TMSidebarItem.d.ts +12 -0
- package/lib/components/sidebar/TMSidebarItem.js +27 -0
- package/lib/components/splitter/TMSplitterLayout.d.ts +17 -0
- package/lib/components/splitter/TMSplitterLayout.js +215 -0
- package/lib/components/viewers/TMDataListItemViewer.d.ts +9 -0
- package/lib/components/viewers/TMDataListItemViewer.js +27 -0
- package/lib/components/viewers/TMMidViewer.d.ts +26 -0
- package/lib/components/viewers/TMMidViewer.js +110 -0
- package/lib/components/viewers/TMTidViewer.d.ts +21 -0
- package/lib/components/viewers/TMTidViewer.js +398 -0
- package/lib/css/tm-sdkui.css +1 -0
- package/lib/helper/Enum_Localizator.d.ts +8 -0
- package/lib/helper/Enum_Localizator.js +125 -0
- package/lib/helper/Globalization.d.ts +14 -0
- package/lib/helper/Globalization.js +80 -0
- package/lib/helper/SDKUI_Globals.d.ts +11 -0
- package/lib/helper/SDKUI_Globals.js +8 -0
- package/lib/helper/SDKUI_Localizator.d.ts +222 -0
- package/lib/helper/SDKUI_Localizator.js +2143 -0
- package/lib/helper/TMIcons.d.ts +171 -0
- package/lib/helper/TMIcons.js +507 -0
- package/lib/helper/TMImageLibrary.d.ts +3 -0
- package/lib/helper/TMImageLibrary.js +466 -0
- package/lib/helper/helpers.d.ts +25 -0
- package/lib/helper/helpers.js +250 -0
- package/lib/helper/index.d.ts +8 -0
- package/lib/helper/index.js +8 -0
- package/lib/helper/queryHelper.d.ts +8 -0
- package/lib/helper/queryHelper.js +32 -0
- package/lib/hooks/useForm.d.ts +18 -0
- package/lib/hooks/useForm.js +111 -0
- package/lib/hooks/useOutsideClick.d.ts +2 -0
- package/lib/hooks/useOutsideClick.js +38 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.js +1 -0
- package/lib/services/platform_services.d.ts +17 -0
- package/lib/services/platform_services.js +334 -0
- package/lib/ts/index.d.ts +1 -0
- package/lib/ts/index.js +1 -0
- package/lib/ts/types.d.ts +152 -0
- package/lib/ts/types.js +17 -0
- package/lib/utils/theme.d.ts +58 -0
- package/lib/utils/theme.js +57 -0
- package/package.json +38 -0
|
@@ -0,0 +1,986 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { AppModules, AuthenticationModes, CultureIDs, ChangePswDescriptor, SDK_Localizator, SessionDescriptor, TopMediaServer, ValidationItem, ResultTypes, SDK_Globals } from "@topconsultnpm/sdk-ts-beta";
|
|
4
|
+
import deMessages from "devextreme/localization/messages/de.json";
|
|
5
|
+
import enMessages from "devextreme/localization/messages/en.json";
|
|
6
|
+
import esMessages from "devextreme/localization/messages/es.json";
|
|
7
|
+
import frMessages from "devextreme/localization/messages/fr.json";
|
|
8
|
+
import itMessages from "devextreme/localization/messages/it.json";
|
|
9
|
+
import ptMessages from "devextreme/localization/messages/pt.json";
|
|
10
|
+
import { locale as dxlocale, loadMessages } from "devextreme/localization";
|
|
11
|
+
import backgroundLogin from '../../assets/login-bg.png';
|
|
12
|
+
import logo from '../../assets/TopMediaOrchestrator6.svg';
|
|
13
|
+
import six from '../../assets/6.png';
|
|
14
|
+
import { IconAccessPoint, IconArchive, IconLanguage, IconLogin, IconMail, IconPassword, IconSearch, IconUser, IconWeb, IconWifi, SDKUI_Localizator, calcResponsiveDirection, calcResponsiveSizes, useWindowWidth, IconArrowLeft, SDKUI_Globals } from "../../helper";
|
|
15
|
+
// import { TMColors } from "@topconsultnpm/sdkui-react-beta/lib/utils/theme";
|
|
16
|
+
// import TMLayoutContainer, { TMCard, TMLayoutItem } from "../Layout/TMLayout";
|
|
17
|
+
import styled from "styled-components";
|
|
18
|
+
import { DataGrid } from "devextreme-react";
|
|
19
|
+
import { Column, Selection } from "devextreme-react/cjs/data-grid";
|
|
20
|
+
import { ScrollBar } from "devextreme-react/cjs/chart";
|
|
21
|
+
import TMLayoutContainer, { TMCard, TMLayoutItem } from "../base/TMLayout";
|
|
22
|
+
import { TMColors } from "../../utils/theme";
|
|
23
|
+
import TMSpinner from "../base/TMSpinner";
|
|
24
|
+
import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager } from "../base/TMPopUp";
|
|
25
|
+
import TMTextBox from "../editors/TMTextBox";
|
|
26
|
+
import TMButton from "../base/TMButton";
|
|
27
|
+
import TMSummary from "../editors/TMSummary";
|
|
28
|
+
import TMDropDown from "../editors/TMDropDown";
|
|
29
|
+
export const onChangeLanguage = (cultureID) => {
|
|
30
|
+
//localizzazione devexpress
|
|
31
|
+
switch (cultureID) {
|
|
32
|
+
case CultureIDs.De_DE:
|
|
33
|
+
dxlocale("de");
|
|
34
|
+
break;
|
|
35
|
+
case CultureIDs.Es_ES:
|
|
36
|
+
dxlocale("es");
|
|
37
|
+
break;
|
|
38
|
+
case CultureIDs.Fr_FR:
|
|
39
|
+
dxlocale("fr");
|
|
40
|
+
break;
|
|
41
|
+
case CultureIDs.It_IT:
|
|
42
|
+
dxlocale("it");
|
|
43
|
+
break;
|
|
44
|
+
case CultureIDs.Pt_PT:
|
|
45
|
+
dxlocale("pt");
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
dxlocale("en");
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
SDKUI_Localizator.setLanguage(cultureID);
|
|
52
|
+
SDK_Localizator.setLanguage(cultureID);
|
|
53
|
+
};
|
|
54
|
+
export const useCultureID = ({ cultureID = CultureIDs.It_IT }) => {
|
|
55
|
+
const [currentCultureID, setCurrentCultureID] = useState(cultureID);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
onChangeLanguage(cultureID);
|
|
58
|
+
setCurrentCultureID(cultureID);
|
|
59
|
+
}, [cultureID]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
loadMessages(deMessages);
|
|
62
|
+
loadMessages(enMessages);
|
|
63
|
+
loadMessages(esMessages);
|
|
64
|
+
loadMessages(frMessages);
|
|
65
|
+
loadMessages(itMessages);
|
|
66
|
+
loadMessages(ptMessages);
|
|
67
|
+
}, []);
|
|
68
|
+
return (currentCultureID);
|
|
69
|
+
};
|
|
70
|
+
const StyledLoginContainer = styled.div ` position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 3px 3px 10px #00000024; width: ${props => props.$responsiveWidth ? props.$responsiveWidth : '51%'}; height: ${props => props.$responsiveHeight ? props.$responsiveHeight : '71%'}; border-radius: 10px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; background: #FFFFFF 0% 0% no-repeat padding-box; overflow: hidden; `;
|
|
71
|
+
const StyledContainer = styled.div ` width: 100%; overflow: auto; height: 100%; position: absolute; `;
|
|
72
|
+
const StyledHeaderText = styled.p ` padding-top: 25px; padding-bottom: 15px; font-size: 1.4rem; font-weight: bolder; color: ${TMColors.primary}; `;
|
|
73
|
+
const StyledOTPContainer = styled.div ` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; margin-top: 30px; color: ${TMColors.primary}; `;
|
|
74
|
+
const StyledOTPInputContainer = styled.div ` display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px; `;
|
|
75
|
+
const StyledOTPInput = styled.input ` width: 40px; height: 40px; border-radius: 5px; border: 1px solid; border-color: ${TMColors.primary}; padding-left: 15px; &::-webkit-inner-spin-button, ::-webkit-outer-spin-button{ -webkit-appearance: none; margin: 0; } `;
|
|
76
|
+
const StyledOTPWaitPanel = styled.div ` width: 265px; margin-top: 30px; color: ${TMColors.primary}; font-size: 0.65rem; display: flex; flex-direction: column; `;
|
|
77
|
+
const StyledOTPLabel = styled.p ` width: 265px; text-align: left; display :flex; justify-content: space-between; align-items: center; `;
|
|
78
|
+
const StyledLogoContainer = styled.div ` position: relative; width: ${props => props.$width}; height: ${props => props.$height}; top: ${props => props.$top}; background: transparent linear-gradient(90deg, #FFFFFF00 0%, #FFFFFFCF 25%, #FFFFFFE8 51%, #FFFFFFCF 75%, #FFFFFF00 100%) 0% 0% no-repeat padding-box; box-shadow: 0px 3px 10px #00000029; opacity: 1; `;
|
|
79
|
+
export const cultureIDsDataSource = [{ value: CultureIDs.It_IT, display: "Italiano" }, { value: CultureIDs.Fr_FR, display: "Française" }, { value: CultureIDs.Pt_PT, display: "Português" }, { value: CultureIDs.En_US, display: "English" }, { value: CultureIDs.Es_ES, display: "Español" }, { value: CultureIDs.De_DE, display: "Deutsch" },];
|
|
80
|
+
const TMLoginForm = (props) => {
|
|
81
|
+
// const [currentCultureID, setCurrentCultureID] = useState<CultureIDs>(CultureIDs.It_IT);
|
|
82
|
+
const [endpoints, setEndpoints] = useState();
|
|
83
|
+
const [selectedEndpoint, setSelectedEndPoint] = useState();
|
|
84
|
+
const [selectedArchive, setSelectedArchive] = useState();
|
|
85
|
+
const [endpoint, setEndpoint] = useState();
|
|
86
|
+
const [tmServer, setTmServer] = useState();
|
|
87
|
+
const [tmSession, setTmSession] = useState();
|
|
88
|
+
const [archives, setArchives] = useState();
|
|
89
|
+
const [archive, setArchive] = useState();
|
|
90
|
+
const [archiveID, setArchiveID] = useState('');
|
|
91
|
+
const [authMode, setAuthMode] = useState(AuthenticationModes.TopMedia);
|
|
92
|
+
const [username, setUsername] = useState('');
|
|
93
|
+
const [password, setPassword] = useState('');
|
|
94
|
+
const [onBehalfUsername, setOnBeHalfUsername] = useState('');
|
|
95
|
+
const [onBeHalfPassword, setOnBeHalfPassword] = useState('');
|
|
96
|
+
const [domain, setDomain] = useState('');
|
|
97
|
+
const [domainAlternative, setDomainArternative] = useState('');
|
|
98
|
+
const [loginValidationItems, setLoginValidationItems] = useState([]);
|
|
99
|
+
const [recoveryPasswordValidationItems, setrecoveryPasswordValidationItems] = useState([]);
|
|
100
|
+
const [togglePages, setTogglePages] = useState({ change: false, recovery: false, endpoint: false, archive: false });
|
|
101
|
+
const [recoveryPasswordState, setRecoveryPasswordState] = useState({ confermPassword: '', email: '', newPassword: '', otp: '', step: 0 });
|
|
102
|
+
const [wait, setWait] = useState(60);
|
|
103
|
+
const otp1Ref = useRef(null);
|
|
104
|
+
const otp2Ref = useRef(null);
|
|
105
|
+
const otp3Ref = useRef(null);
|
|
106
|
+
const otp4Ref = useRef(null);
|
|
107
|
+
const otp5Ref = useRef(null);
|
|
108
|
+
const otp6Ref = useRef(null);
|
|
109
|
+
const [otpValues, setOtpValues] = useState(['', '', '', '', '', '']);
|
|
110
|
+
const [otpHasFilled, setOtpHasFilled] = useState([false, false, false, false, false, false]);
|
|
111
|
+
const size = useWindowWidth();
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
let interval;
|
|
114
|
+
if (recoveryPasswordState.step === 2 && wait > 0) {
|
|
115
|
+
interval = setInterval(() => { setWait(prev => prev - 1); }, 1000);
|
|
116
|
+
}
|
|
117
|
+
return () => clearInterval(interval);
|
|
118
|
+
}, [recoveryPasswordState.step, wait]);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
let arr = [...otpValues];
|
|
121
|
+
for (let i = 0; i < otpValues.length; i++) {
|
|
122
|
+
if (otpValues[i].length > 1) {
|
|
123
|
+
arr[i] = otpValues[i][0];
|
|
124
|
+
let a = '';
|
|
125
|
+
for (let j = 1; j < otpValues[i].length; j++) {
|
|
126
|
+
a += otpValues[i][j];
|
|
127
|
+
}
|
|
128
|
+
arr[i + 1] = a;
|
|
129
|
+
setOtpValues(arr);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, [otpValues]);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
setEndpoints(props.endpoints);
|
|
135
|
+
if (props.sdInput) {
|
|
136
|
+
if (props.sdInput.userName)
|
|
137
|
+
setUsername(props.sdInput.userName);
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
const loginWidthEnterKey = (e) => { if (loginValidationItems.length === 0) {
|
|
142
|
+
if (e.key === 'Enter')
|
|
143
|
+
login();
|
|
144
|
+
} };
|
|
145
|
+
window.addEventListener('keyup', loginWidthEnterKey);
|
|
146
|
+
return () => window.removeEventListener('keyup', loginWidthEnterKey);
|
|
147
|
+
}, [loginValidationItems]);
|
|
148
|
+
// useEffect(() => { setEndpoint(props.endpoints[0]) }, [endpoints])
|
|
149
|
+
useEffect(() => { setEndpoint(props.endpoints.find(ep => ep.isDefault)); }, [endpoints]);
|
|
150
|
+
useEffect(() => { setTmServer(new TopMediaServer(endpoint?.URL)); }, [endpoint]);
|
|
151
|
+
useEffect(() => { setTmSession(tmServer?.NewSession()); }, [tmServer]);
|
|
152
|
+
useEffect(() => { getArchivesAsync().then((result) => { setArchives(result); }); }, [tmSession]);
|
|
153
|
+
useEffect(() => { setArchive(archives && archives.find(a => a.isDefault == 1)); }, [archives]);
|
|
154
|
+
useEffect(() => { if (archive && archive.id) {
|
|
155
|
+
setArchiveID(archive.id);
|
|
156
|
+
}
|
|
157
|
+
else
|
|
158
|
+
setArchiveID(''); }, [archive]);
|
|
159
|
+
useEffect(() => { loginValidator(); }, [username, password, domain, endpoint, archive, archives, domainAlternative, archiveID, props.cultureID, authMode, onBehalfUsername, onBeHalfPassword]);
|
|
160
|
+
useEffect(() => { recoveryPasswordValidator(); }, [recoveryPasswordState.confermPassword, recoveryPasswordState.email, recoveryPasswordState.newPassword, recoveryPasswordState.otp, recoveryPasswordState.step]);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
let arr = [...otpHasFilled];
|
|
163
|
+
if (otpValues[0].length > 0) {
|
|
164
|
+
arr[0] = true;
|
|
165
|
+
setOtpHasFilled(arr);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
arr[0] = false;
|
|
169
|
+
setOtpHasFilled(arr);
|
|
170
|
+
}
|
|
171
|
+
if (otpValues[1].length > 0) {
|
|
172
|
+
arr[1] = true;
|
|
173
|
+
setOtpHasFilled(arr);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
arr[1] = false;
|
|
177
|
+
setOtpHasFilled(arr);
|
|
178
|
+
}
|
|
179
|
+
if (otpValues[2].length > 0) {
|
|
180
|
+
arr[2] = true;
|
|
181
|
+
setOtpHasFilled(arr);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
arr[2] = false;
|
|
185
|
+
setOtpHasFilled(arr);
|
|
186
|
+
}
|
|
187
|
+
if (otpValues[3].length > 0) {
|
|
188
|
+
arr[3] = true;
|
|
189
|
+
setOtpHasFilled(arr);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
arr[3] = false;
|
|
193
|
+
setOtpHasFilled(arr);
|
|
194
|
+
}
|
|
195
|
+
if (otpValues[4].length > 0) {
|
|
196
|
+
arr[4] = true;
|
|
197
|
+
setOtpHasFilled(arr);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
arr[4] = false;
|
|
201
|
+
setOtpHasFilled(arr);
|
|
202
|
+
}
|
|
203
|
+
if (otpValues[5].length > 0) {
|
|
204
|
+
arr[5] = true;
|
|
205
|
+
setOtpHasFilled(arr);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
arr[5] = false;
|
|
209
|
+
setOtpHasFilled(arr);
|
|
210
|
+
}
|
|
211
|
+
}, [otpValues]);
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
if (otpHasFilled[0]) {
|
|
214
|
+
otp1Ref.current?.blur();
|
|
215
|
+
otp2Ref.current?.focus();
|
|
216
|
+
}
|
|
217
|
+
if (otpHasFilled[1]) {
|
|
218
|
+
otp2Ref.current?.blur();
|
|
219
|
+
otp3Ref.current?.focus();
|
|
220
|
+
}
|
|
221
|
+
if (otpHasFilled[2]) {
|
|
222
|
+
otp3Ref.current?.blur();
|
|
223
|
+
otp4Ref.current?.focus();
|
|
224
|
+
}
|
|
225
|
+
if (otpHasFilled[3]) {
|
|
226
|
+
otp4Ref.current?.blur();
|
|
227
|
+
otp5Ref.current?.focus();
|
|
228
|
+
}
|
|
229
|
+
if (otpHasFilled[4]) {
|
|
230
|
+
otp5Ref.current?.blur();
|
|
231
|
+
otp6Ref.current?.focus();
|
|
232
|
+
}
|
|
233
|
+
if (otpHasFilled[5]) {
|
|
234
|
+
otp6Ref.current?.blur();
|
|
235
|
+
}
|
|
236
|
+
if (otpHasFilled[0] && otpHasFilled[1] && otpHasFilled[2] && otpHasFilled[3] && otpHasFilled[4] && otpHasFilled[5]) {
|
|
237
|
+
setRecoveryPasswordState({ ...recoveryPasswordState, otp: otpValues[0] + otpValues[1] + otpValues[2] + otpValues[3] + otpValues[4] + otpValues[5] });
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
setRecoveryPasswordState({ ...recoveryPasswordState, otp: '' });
|
|
241
|
+
}
|
|
242
|
+
}, [otpHasFilled]);
|
|
243
|
+
const loginValidator = () => {
|
|
244
|
+
let arr = [...loginValidationItems];
|
|
245
|
+
arr = [];
|
|
246
|
+
if (!endpoint || endpoint?.URL.length === 0) {
|
|
247
|
+
if (!arr.find(item => item.PropertyName === 'endpoint')) {
|
|
248
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'endpoint', SDK_Localizator.RequiredField));
|
|
249
|
+
}
|
|
250
|
+
;
|
|
251
|
+
setLoginValidationItems(arr);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
{
|
|
255
|
+
arr = arr.filter(item => item.PropertyName !== 'endpoint');
|
|
256
|
+
}
|
|
257
|
+
;
|
|
258
|
+
setLoginValidationItems(arr);
|
|
259
|
+
}
|
|
260
|
+
if (!archive && archiveID.length === 0) {
|
|
261
|
+
if (!arr.find(item => item.PropertyName === 'archive')) {
|
|
262
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'archive', SDK_Localizator.RequiredField));
|
|
263
|
+
}
|
|
264
|
+
;
|
|
265
|
+
setLoginValidationItems(arr);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
{
|
|
269
|
+
arr = arr.filter(item => item.PropertyName !== 'archive');
|
|
270
|
+
}
|
|
271
|
+
;
|
|
272
|
+
setLoginValidationItems(arr);
|
|
273
|
+
}
|
|
274
|
+
if (!authMode) {
|
|
275
|
+
if (!arr.find(item => item.PropertyName === 'authMode')) {
|
|
276
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'authMode', SDK_Localizator.RequiredField));
|
|
277
|
+
}
|
|
278
|
+
;
|
|
279
|
+
setLoginValidationItems(arr);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
{
|
|
283
|
+
arr = arr.filter(item => item.PropertyName !== 'authMode');
|
|
284
|
+
}
|
|
285
|
+
;
|
|
286
|
+
setLoginValidationItems(arr);
|
|
287
|
+
}
|
|
288
|
+
if (!props.cultureID) {
|
|
289
|
+
if (!arr.find(item => item.PropertyName === 'cultureId')) {
|
|
290
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'cultureId', SDK_Localizator.RequiredField));
|
|
291
|
+
}
|
|
292
|
+
;
|
|
293
|
+
setLoginValidationItems(arr);
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
{
|
|
297
|
+
arr = arr.filter(item => item.PropertyName !== 'cultureId');
|
|
298
|
+
}
|
|
299
|
+
;
|
|
300
|
+
setLoginValidationItems(arr);
|
|
301
|
+
}
|
|
302
|
+
if (username.length === 0) {
|
|
303
|
+
if (!arr.find(item => item.PropertyName === 'username')) {
|
|
304
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'username', SDK_Localizator.RequiredField));
|
|
305
|
+
}
|
|
306
|
+
;
|
|
307
|
+
setLoginValidationItems(arr);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
{
|
|
311
|
+
arr = arr.filter(item => item.PropertyName !== 'username');
|
|
312
|
+
}
|
|
313
|
+
;
|
|
314
|
+
setLoginValidationItems(arr);
|
|
315
|
+
}
|
|
316
|
+
if (password.length === 0) {
|
|
317
|
+
if (!arr.find(item => item.PropertyName === 'password')) {
|
|
318
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'password', SDK_Localizator.RequiredField));
|
|
319
|
+
}
|
|
320
|
+
;
|
|
321
|
+
setLoginValidationItems(arr);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
{
|
|
325
|
+
arr = arr.filter(item => item.PropertyName !== 'password');
|
|
326
|
+
}
|
|
327
|
+
;
|
|
328
|
+
setLoginValidationItems(arr);
|
|
329
|
+
}
|
|
330
|
+
switch (authMode) {
|
|
331
|
+
case AuthenticationModes.TopMedia:
|
|
332
|
+
arr.filter(item => item.PropertyName !== 'domain' && item.PropertyName !== 'domain_alt' && item.PropertyName !== 'onBeHalfUsername' && item.PropertyName !== 'onBeHalfPassword');
|
|
333
|
+
break;
|
|
334
|
+
case AuthenticationModes.WindowsThroughTopMedia:
|
|
335
|
+
arr.filter(item => item.PropertyName !== 'onBeHalfUsername' && item.PropertyName !== 'onBeHalfPassword' && item.PropertyName !== 'domain');
|
|
336
|
+
if (domainAlternative.length === 0) {
|
|
337
|
+
if (!arr.find(item => item.PropertyName === 'domain_alt')) {
|
|
338
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'domain_alt', SDK_Localizator.RequiredField));
|
|
339
|
+
}
|
|
340
|
+
;
|
|
341
|
+
setLoginValidationItems(arr);
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
{
|
|
345
|
+
arr = arr.filter(item => item.PropertyName !== 'domain_alt');
|
|
346
|
+
}
|
|
347
|
+
;
|
|
348
|
+
setLoginValidationItems(arr);
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
case AuthenticationModes.TopMediaOnBehalfOf:
|
|
352
|
+
arr.filter(item => item.PropertyName !== 'domain_alt');
|
|
353
|
+
if (domain.length === 0) {
|
|
354
|
+
if (!arr.find(item => item.PropertyName === 'domain')) {
|
|
355
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'domain', SDK_Localizator.RequiredField));
|
|
356
|
+
}
|
|
357
|
+
;
|
|
358
|
+
setLoginValidationItems(arr);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
{
|
|
362
|
+
arr = arr.filter(item => item.PropertyName !== 'domain');
|
|
363
|
+
}
|
|
364
|
+
;
|
|
365
|
+
setLoginValidationItems(arr);
|
|
366
|
+
}
|
|
367
|
+
if (onBehalfUsername.length === 0) {
|
|
368
|
+
if (!arr.find(item => item.PropertyName === 'onBeHalfUsername')) {
|
|
369
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'onBeHalfUsername', SDK_Localizator.RequiredField));
|
|
370
|
+
}
|
|
371
|
+
;
|
|
372
|
+
setLoginValidationItems(arr);
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
{
|
|
376
|
+
arr = arr.filter(item => item.PropertyName !== 'onBeHalfUsername');
|
|
377
|
+
}
|
|
378
|
+
;
|
|
379
|
+
setLoginValidationItems(arr);
|
|
380
|
+
}
|
|
381
|
+
if (onBeHalfPassword.length === 0) {
|
|
382
|
+
if (!arr.find(item => item.PropertyName === 'onBeHalfPassword')) {
|
|
383
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'onBeHalfPassword', SDK_Localizator.RequiredField));
|
|
384
|
+
}
|
|
385
|
+
;
|
|
386
|
+
setLoginValidationItems(arr);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
{
|
|
390
|
+
arr = arr.filter(item => item.PropertyName !== 'onBeHalfPassword');
|
|
391
|
+
}
|
|
392
|
+
;
|
|
393
|
+
setLoginValidationItems(arr);
|
|
394
|
+
}
|
|
395
|
+
//
|
|
396
|
+
break;
|
|
397
|
+
case AuthenticationModes.MSAzure:
|
|
398
|
+
arr = arr.filter(item => item.PropertyName !== 'username' && item.PropertyName !== 'password' && item.PropertyName !== 'domain' && item.PropertyName !== 'domain_alt' && item.PropertyName !== 'onBeHalfUsername' && item.PropertyName !== 'onBeHalfPassword');
|
|
399
|
+
setLoginValidationItems(arr);
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
const recoveryPasswordValidator = () => {
|
|
404
|
+
let arr = [...recoveryPasswordValidationItems];
|
|
405
|
+
let char_upperCase = new RegExp(/([A-Z])/g);
|
|
406
|
+
let char_lowerCase = new RegExp(/([a-z])/g);
|
|
407
|
+
let char_number = new RegExp(/([0-9])/g);
|
|
408
|
+
let char_symbol = new RegExp(/[!@?#\$%\^\&*\)\(+=._-]/g);
|
|
409
|
+
// let email_validation = new RegExp(/^[-\.]+@([\w-]+\.)+[\w-]{2,4}$/g)
|
|
410
|
+
let email_validation = new RegExp(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g);
|
|
411
|
+
switch (recoveryPasswordState.step) {
|
|
412
|
+
case 1:
|
|
413
|
+
// if (recoveryPasswordState.email?.length === 0) { if (!arr.find(item => item.PropertyName === 'recoveryPass_email')) { arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_email', SDK_Localizator.RequiredField)) }; setrecoveryPasswordValidationItems(arr); } else { { arr = arr.filter(item => item.PropertyName !== 'recoveryPass_email') }; setrecoveryPasswordValidationItems(arr); }
|
|
414
|
+
if (recoveryPasswordState.email?.length === 0) {
|
|
415
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_email')) {
|
|
416
|
+
arr.unshift(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_email', SDK_Localizator.RequiredField));
|
|
417
|
+
}
|
|
418
|
+
;
|
|
419
|
+
setrecoveryPasswordValidationItems(arr);
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
{
|
|
423
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_email');
|
|
424
|
+
}
|
|
425
|
+
;
|
|
426
|
+
setrecoveryPasswordValidationItems(arr);
|
|
427
|
+
}
|
|
428
|
+
if (!recoveryPasswordState.email?.match(email_validation)) {
|
|
429
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_notEmail')) {
|
|
430
|
+
arr.push(new ValidationItem(ResultTypes.WARNING, 'recoveryPass_notEmail', SDKUI_Localizator.EmailIsNotValid));
|
|
431
|
+
}
|
|
432
|
+
;
|
|
433
|
+
setrecoveryPasswordValidationItems(arr);
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
{
|
|
437
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_notEmail');
|
|
438
|
+
}
|
|
439
|
+
;
|
|
440
|
+
setrecoveryPasswordValidationItems(arr);
|
|
441
|
+
}
|
|
442
|
+
break;
|
|
443
|
+
case 2:
|
|
444
|
+
if (recoveryPasswordState.otp?.length === 0) {
|
|
445
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_otp')) {
|
|
446
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_otp', SDK_Localizator.RequiredField));
|
|
447
|
+
}
|
|
448
|
+
;
|
|
449
|
+
setrecoveryPasswordValidationItems(arr);
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
{
|
|
453
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_otp');
|
|
454
|
+
}
|
|
455
|
+
;
|
|
456
|
+
setrecoveryPasswordValidationItems(arr);
|
|
457
|
+
}
|
|
458
|
+
break;
|
|
459
|
+
case 3:
|
|
460
|
+
if (recoveryPasswordState.newPassword?.length === 0) {
|
|
461
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_new')) {
|
|
462
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_new', SDK_Localizator.RequiredField));
|
|
463
|
+
}
|
|
464
|
+
;
|
|
465
|
+
setrecoveryPasswordValidationItems(arr);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
{
|
|
469
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_new');
|
|
470
|
+
}
|
|
471
|
+
;
|
|
472
|
+
setrecoveryPasswordValidationItems(arr);
|
|
473
|
+
}
|
|
474
|
+
if (recoveryPasswordState.confermPassword?.length === 0) {
|
|
475
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_confirm')) {
|
|
476
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_confirm', SDK_Localizator.RequiredField));
|
|
477
|
+
}
|
|
478
|
+
;
|
|
479
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_notConfirmed');
|
|
480
|
+
setrecoveryPasswordValidationItems(arr);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
{
|
|
484
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_confirm');
|
|
485
|
+
}
|
|
486
|
+
;
|
|
487
|
+
setrecoveryPasswordValidationItems(arr);
|
|
488
|
+
}
|
|
489
|
+
if (recoveryPasswordState.newPassword.length > 0 && recoveryPasswordState.confermPassword.length > 0 && recoveryPasswordState.newPassword !== recoveryPasswordState.confermPassword) {
|
|
490
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_notConfirmed')) {
|
|
491
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_notConfirmed', SDKUI_Localizator.PasswordConfirmError));
|
|
492
|
+
}
|
|
493
|
+
;
|
|
494
|
+
setrecoveryPasswordValidationItems(arr);
|
|
495
|
+
}
|
|
496
|
+
else if (recoveryPasswordState.newPassword.length > 0 && recoveryPasswordState.confermPassword.length > 0 && recoveryPasswordState.newPassword === recoveryPasswordState.confermPassword) {
|
|
497
|
+
{
|
|
498
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_notConfirmed');
|
|
499
|
+
}
|
|
500
|
+
;
|
|
501
|
+
setrecoveryPasswordValidationItems(arr);
|
|
502
|
+
}
|
|
503
|
+
if (recoveryPasswordState.newPassword.length > 0 && recoveryPasswordState.newPassword?.toLowerCase() === username.toLowerCase()) {
|
|
504
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_equalUsername')) {
|
|
505
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_equalUsername', SDKUI_Localizator.PasswordEqualsUsernameError));
|
|
506
|
+
}
|
|
507
|
+
;
|
|
508
|
+
setrecoveryPasswordValidationItems(arr);
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
{
|
|
512
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_equalUsername');
|
|
513
|
+
}
|
|
514
|
+
;
|
|
515
|
+
setrecoveryPasswordValidationItems(arr);
|
|
516
|
+
}
|
|
517
|
+
if (recoveryPasswordState.newPassword.length > 0 && recoveryPasswordState.newPassword?.toLowerCase().includes(username.toLowerCase())) {
|
|
518
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_containUsername')) {
|
|
519
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_containUsername', SDKUI_Localizator.PasswordEqualsUsernameError));
|
|
520
|
+
}
|
|
521
|
+
;
|
|
522
|
+
setrecoveryPasswordValidationItems(arr);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
{
|
|
526
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_containUsername');
|
|
527
|
+
}
|
|
528
|
+
;
|
|
529
|
+
setrecoveryPasswordValidationItems(arr);
|
|
530
|
+
}
|
|
531
|
+
if (!char_symbol.test(recoveryPasswordState.newPassword)) {
|
|
532
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_hasNotSymbol')) {
|
|
533
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_hasNotSymbol', SDKUI_Localizator.PasswordSymbolError));
|
|
534
|
+
}
|
|
535
|
+
;
|
|
536
|
+
setrecoveryPasswordValidationItems(arr);
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
{
|
|
540
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_hasNotSymbol');
|
|
541
|
+
}
|
|
542
|
+
;
|
|
543
|
+
setrecoveryPasswordValidationItems(arr);
|
|
544
|
+
}
|
|
545
|
+
if (!char_number.test(recoveryPasswordState.newPassword)) {
|
|
546
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_hasNotNumber')) {
|
|
547
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_hasNotNumber', SDKUI_Localizator.PasswordNumberError));
|
|
548
|
+
}
|
|
549
|
+
;
|
|
550
|
+
setrecoveryPasswordValidationItems(arr);
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
{
|
|
554
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_hasNotNumber');
|
|
555
|
+
}
|
|
556
|
+
;
|
|
557
|
+
setrecoveryPasswordValidationItems(arr);
|
|
558
|
+
}
|
|
559
|
+
if (!char_lowerCase.test(recoveryPasswordState.newPassword)) {
|
|
560
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_hasNotLower')) {
|
|
561
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_hasNotLower', SDKUI_Localizator.PasswordLowercaseError));
|
|
562
|
+
}
|
|
563
|
+
;
|
|
564
|
+
setrecoveryPasswordValidationItems(arr);
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
{
|
|
568
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_hasNotLower');
|
|
569
|
+
}
|
|
570
|
+
;
|
|
571
|
+
setrecoveryPasswordValidationItems(arr);
|
|
572
|
+
}
|
|
573
|
+
if (!char_upperCase.test(recoveryPasswordState.newPassword)) {
|
|
574
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_hasNotUpper')) {
|
|
575
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_hasNotUpper', SDKUI_Localizator.PasswordUppercaseError));
|
|
576
|
+
}
|
|
577
|
+
;
|
|
578
|
+
setrecoveryPasswordValidationItems(arr);
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
{
|
|
582
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_hasNotUpper');
|
|
583
|
+
}
|
|
584
|
+
;
|
|
585
|
+
setrecoveryPasswordValidationItems(arr);
|
|
586
|
+
}
|
|
587
|
+
if (recoveryPasswordState.newPassword.length < 10 || recoveryPasswordState.newPassword.length > 128) {
|
|
588
|
+
if (!arr.find(item => item.PropertyName === 'recoveryPass_length')) {
|
|
589
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'recoveryPass_length', SDKUI_Localizator.PasswordLengthError));
|
|
590
|
+
}
|
|
591
|
+
;
|
|
592
|
+
setrecoveryPasswordValidationItems(arr);
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
{
|
|
596
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_length');
|
|
597
|
+
}
|
|
598
|
+
;
|
|
599
|
+
setrecoveryPasswordValidationItems(arr);
|
|
600
|
+
}
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
async function login() {
|
|
605
|
+
TMSpinner.show({ description: '' });
|
|
606
|
+
try {
|
|
607
|
+
const sdInput = {
|
|
608
|
+
authenticationMode: authMode,
|
|
609
|
+
appModuleID: props.appModule,
|
|
610
|
+
archiveID: archiveID,
|
|
611
|
+
userName: username,
|
|
612
|
+
password: password,
|
|
613
|
+
cultureID: props.cultureID,
|
|
614
|
+
domain: domainAlternative,
|
|
615
|
+
onBehalfOf: {
|
|
616
|
+
domain: domain,
|
|
617
|
+
userName: onBehalfUsername,
|
|
618
|
+
password: onBeHalfPassword
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
let tmServer = new TopMediaServer(endpoint?.URL);
|
|
622
|
+
let tmSession = tmServer.NewSession();
|
|
623
|
+
await tmSession.LoginAsync(sdInput);
|
|
624
|
+
props.onLogged(tmSession);
|
|
625
|
+
}
|
|
626
|
+
catch (e) {
|
|
627
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
628
|
+
}
|
|
629
|
+
TMSpinner.hide();
|
|
630
|
+
}
|
|
631
|
+
async function getArchivesAsync() {
|
|
632
|
+
try {
|
|
633
|
+
TMSpinner.show({ description: '' });
|
|
634
|
+
return tmSession?.TopMediaServer.BaseAddress && await tmSession?.NewArchiveEngine().RetrieveAllAsync();
|
|
635
|
+
}
|
|
636
|
+
catch (e) {
|
|
637
|
+
return TMExceptionBoxManager.show({ exception: e });
|
|
638
|
+
}
|
|
639
|
+
finally {
|
|
640
|
+
TMSpinner.hide();
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
async function pingAsync(endpoint) {
|
|
644
|
+
const server = new TopMediaServer(endpoint.URL);
|
|
645
|
+
// server.NewSession()
|
|
646
|
+
try {
|
|
647
|
+
TMSpinner.show();
|
|
648
|
+
TMMessageBoxManager.show({ title: 'Ping', message: (await server?.PingAsync())?.toString(), buttons: [ButtonNames.OK] });
|
|
649
|
+
}
|
|
650
|
+
catch (e) {
|
|
651
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
652
|
+
}
|
|
653
|
+
finally {
|
|
654
|
+
TMSpinner.hide();
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
const isPasswordChangeEnable = () => {
|
|
658
|
+
if (endpoint && (archive || archiveID.length > 0) && authMode === AuthenticationModes.TopMedia && username.length > 0) {
|
|
659
|
+
return true;
|
|
660
|
+
}
|
|
661
|
+
else
|
|
662
|
+
return false;
|
|
663
|
+
};
|
|
664
|
+
const showRecoveryPassword = () => { setRecoveryPasswordState({ ...recoveryPasswordState, step: 1 }); setTogglePages({ change: false, recovery: true, archive: false, endpoint: false }); };
|
|
665
|
+
const showEndpoints = () => { setTogglePages({ change: false, recovery: false, archive: false, endpoint: true }); };
|
|
666
|
+
const showArchives = () => { setTogglePages({ change: false, recovery: false, archive: true, endpoint: false }); };
|
|
667
|
+
const backToLogin = () => { setTogglePages({ change: false, recovery: false, archive: false, endpoint: false }); setOtpValues(['', '', '', '', '', '']); };
|
|
668
|
+
const isLoginPage = () => { if ((!togglePages.change && !togglePages.recovery && !togglePages.endpoint && !togglePages.archive))
|
|
669
|
+
return true;
|
|
670
|
+
else
|
|
671
|
+
return false; };
|
|
672
|
+
const getChangePswTmSession = () => {
|
|
673
|
+
let tmServer = new TopMediaServer(endpoint?.URL);
|
|
674
|
+
let tmSession = tmServer.NewSession();
|
|
675
|
+
let sd = new SessionDescriptor();
|
|
676
|
+
sd.userName = username;
|
|
677
|
+
sd.accessToken = "CHANGEPSWTOKEN";
|
|
678
|
+
sd.archiveID = archiveID;
|
|
679
|
+
tmSession.SessionDescr = sd;
|
|
680
|
+
return tmSession;
|
|
681
|
+
};
|
|
682
|
+
const recoveryPasswordOnClickManager = async () => {
|
|
683
|
+
let cpd = new ChangePswDescriptor();
|
|
684
|
+
switch (recoveryPasswordState.step) {
|
|
685
|
+
case 1:
|
|
686
|
+
cpd.archiveID = archiveID;
|
|
687
|
+
cpd.userName = username;
|
|
688
|
+
cpd.eMail = recoveryPasswordState.email;
|
|
689
|
+
cpd.cultureID = props.cultureID;
|
|
690
|
+
try {
|
|
691
|
+
TMSpinner.show();
|
|
692
|
+
await getChangePswTmSession().NewUserEngine().RecoveryPasswordAsync(cpd);
|
|
693
|
+
setRecoveryPasswordState({ ...recoveryPasswordState, step: 2 });
|
|
694
|
+
}
|
|
695
|
+
catch (e) {
|
|
696
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
697
|
+
}
|
|
698
|
+
finally {
|
|
699
|
+
TMSpinner.hide();
|
|
700
|
+
}
|
|
701
|
+
break;
|
|
702
|
+
case 2:
|
|
703
|
+
cpd.archiveID = archiveID;
|
|
704
|
+
cpd.userName = username;
|
|
705
|
+
cpd.eMail = recoveryPasswordState.email;
|
|
706
|
+
cpd.cultureID = props.cultureID;
|
|
707
|
+
cpd.otp = Number(recoveryPasswordState.otp); // OTP ricevuto per mail
|
|
708
|
+
cpd.newPassword = 'password_123!';
|
|
709
|
+
cpd.onlyCheckOTP = 1;
|
|
710
|
+
try {
|
|
711
|
+
TMSpinner.show();
|
|
712
|
+
await getChangePswTmSession().NewUserEngine().ChangePasswordAsync(cpd);
|
|
713
|
+
setRecoveryPasswordState({ ...recoveryPasswordState, step: 3 });
|
|
714
|
+
}
|
|
715
|
+
catch (e) {
|
|
716
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
717
|
+
}
|
|
718
|
+
finally {
|
|
719
|
+
TMSpinner.hide();
|
|
720
|
+
}
|
|
721
|
+
break;
|
|
722
|
+
case 3:
|
|
723
|
+
cpd.archiveID = archiveID;
|
|
724
|
+
cpd.userName = username;
|
|
725
|
+
cpd.eMail = recoveryPasswordState.email;
|
|
726
|
+
cpd.cultureID = props.cultureID;
|
|
727
|
+
cpd.otp = Number(recoveryPasswordState.otp);
|
|
728
|
+
cpd.onlyCheckOTP = 0;
|
|
729
|
+
cpd.newPassword = recoveryPasswordState.newPassword;
|
|
730
|
+
try {
|
|
731
|
+
TMSpinner.show();
|
|
732
|
+
await getChangePswTmSession().NewUserEngine().ChangePasswordAsync(cpd);
|
|
733
|
+
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], onButtonClick: (e) => e === ButtonNames.OK && backToLogin(), message: SDKUI_Localizator.PasswordChangedSuccessfully });
|
|
734
|
+
}
|
|
735
|
+
catch (e) {
|
|
736
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
737
|
+
}
|
|
738
|
+
finally {
|
|
739
|
+
TMSpinner.hide();
|
|
740
|
+
}
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
const recoveryPasswordBackClick = () => {
|
|
745
|
+
switch (recoveryPasswordState.step) {
|
|
746
|
+
case 1:
|
|
747
|
+
case 2:
|
|
748
|
+
backToLogin();
|
|
749
|
+
setRecoveryPasswordState({ confermPassword: '', email: '', newPassword: '', otp: '', step: 0 });
|
|
750
|
+
setrecoveryPasswordValidationItems([]);
|
|
751
|
+
break;
|
|
752
|
+
case 3:
|
|
753
|
+
let arr = [...recoveryPasswordValidationItems];
|
|
754
|
+
arr = arr.filter(item => item.PropertyName === 'recoveryPass_email' || item.PropertyName === 'recoveryPass_notEmail' || item.PropertyName === 'recoveryPass_otp');
|
|
755
|
+
setrecoveryPasswordValidationItems(arr);
|
|
756
|
+
setRecoveryPasswordState({ ...recoveryPasswordState, step: 2, otp: '' });
|
|
757
|
+
setOtpValues(['', '', '', '', '', '']);
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
return (_jsx(StyledLoginContainer, { "$responsiveHeight": calcResponsiveSizes(size, '75%', '96%', '98%'), "$responsiveWidth": calcResponsiveSizes(size, '55%', '95%', '95%'), children: _jsxs(TMLayoutContainer, { direction: calcResponsiveDirection(size, "horizontal", "vertical", "vertical"), children: [_jsx(TMLayoutItem, { width: calcResponsiveSizes(size, "40%", "100%", "100%"), height: calcResponsiveSizes(size, '100%', '20%', '20%'), children: _jsx("div", { style: { width: '100%', height: '100%', backgroundImage: `url(${backgroundLogin})`, backgroundRepeat: 'no-repeat', backgroundSize: 'cover', backgroundPosition: 'center', borderRadius: '10px' }, children: _jsx(StyledLogoContainer, { "$width": "100%", "$height": calcResponsiveSizes(size, '21%', '50%', '50%'), "$top": '20%', children: SDK_Globals.appModule === AppModules.ORCHESTRATOR ? _jsx("div", { style: { width: '60%', height: '50%', backgroundImage: `url(${logo})`, backgroundRepeat: 'no-repeat', backgroundSize: 'contain', position: 'absolute', backgroundPosition: 'center', top: '50%', left: '50%', transform: 'translate(-50%, -50%)' } }) :
|
|
761
|
+
_jsx("div", { style: { display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'center', fontWeight: 'bolder', color: TMColors.secondary, fontStyle: 'italic' }, children: _jsxs("div", { style: { display: 'flex', alignItems: 'flex-end', gap: 10 }, children: [_jsx("img", { src: six, height: 40, alt: "" }), _jsx("div", { children: SDK_Globals.appModule })] }) }) }) }) }), _jsxs(TMLayoutItem, { width: calcResponsiveSizes(size, "60%", "100%", "100%"), height: calcResponsiveSizes(size, '100%', '80%', '80%'), children: [togglePages.recovery &&
|
|
762
|
+
_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ForgetPassword }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: "max-content", children: _jsxs("div", { style: { width: '100%', height: '5px', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginTop: '20px' }, children: [_jsx("div", { style: { transform: 'translateX(-1px)', width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: TMColors.primary, zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "1" }), _jsx("div", { style: { width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: recoveryPasswordState.step > 1 ? TMColors.primary : 'rgb(180,180,180)', zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "2" }), _jsx("div", { style: { transform: 'translateX(1px)', width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: recoveryPasswordState.step > 2 ? TMColors.primary : 'rgb(180,180,180)', zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "3" }), _jsx("div", { style: { width: '100%', height: '5px', backgroundColor: 'rgb(180,180,180)', position: 'absolute' } }), _jsx("div", { style: { width: recoveryPasswordState.step === 1 ? '0%' : recoveryPasswordState.step === 2 ? '50%' : '100%', transition: '500ms ease', height: '5px', backgroundColor: TMColors.primary, position: 'absolute' } })] }) }), recoveryPasswordState.step === 1 && _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "email", elementStyle: { marginTop: '30px' }, label: SDKUI_Localizator.InsertYourEmail, icon: _jsx(IconMail, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, email: e.target.value }), value: recoveryPasswordState.email, validationItems: recoveryPasswordState.email?.length === 0 ? recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_email') : recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_notEmail') }) }), recoveryPasswordState.step === 2 && _jsx(TMLayoutItem, { children: _jsxs(StyledOTPContainer, { children: [_jsxs(StyledOTPLabel, { children: [" ", SDKUI_Localizator.InsertOTP, " ", otpHasFilled.find(input => input === true) && _jsx("strong", { style: { cursor: 'pointer' }, onClick: () => setOtpValues(['', '', '', '', '', '']), children: SDKUI_Localizator.ClearOTP }), " "] }), _jsxs(StyledOTPInputContainer, { children: [_jsx(StyledOTPInput, { ref: otp1Ref, type: "number", max: 9, min: 0, value: otpValues[0], onChange: (e) => { let arr = [...otpValues]; arr[0] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp2Ref, type: "number", max: 9, min: 0, value: otpValues[1], onChange: (e) => { let arr = [...otpValues]; arr[1] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp3Ref, type: "number", max: 9, min: 0, value: otpValues[2], onChange: (e) => { let arr = [...otpValues]; arr[2] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp4Ref, type: "number", max: 9, min: 0, value: otpValues[3], onChange: (e) => { let arr = [...otpValues]; arr[3] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp5Ref, type: "number", max: 9, min: 0, value: otpValues[4], onChange: (e) => { let arr = [...otpValues]; arr[4] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp6Ref, type: "number", max: 9, min: 0, value: otpValues[5], onChange: (e) => { let arr = [...otpValues]; arr[5] = e.target.value; setOtpValues(arr); } })] }), _jsxs(StyledOTPWaitPanel, { children: [_jsxs("em", { children: [" ", SDKUI_Localizator.OTPSent, " ", _jsx("strong", { children: recoveryPasswordState.email }), ". ", SDKUI_Localizator.OTPNewRequest, " ", _jsx("strong", { children: wait }), " ", SDKUI_Localizator.Seconds] }), ".", wait === 0 && _jsx(TMButton, { caption: SDKUI_Localizator.NewOTP, showTooltip: false, onClick: () => setWait(60) })] })] }) }), recoveryPasswordState.step === 3 && _jsxs(_Fragment, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.NewPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, newPassword: e.target.value }), value: recoveryPasswordState.newPassword, validationItems: recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_new' || item.PropertyName === 'recoveryPass_equalUsername' || item.PropertyName === 'recoveryPass_containUsername') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.ConfirmPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, confermPassword: e.target.value }), value: recoveryPasswordState.confermPassword, validationItems: recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_confirm' || item.PropertyName === 'recoveryPass_notConfirmed') }) })] })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", width: "fit-content", children: _jsx("p", { onClick: () => { recoveryPasswordBackClick(); }, tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && recoveryPasswordBackClick(), style: { userSelect: 'none', cursor: 'pointer', color: TMColors.primary, fontSize: '1rem' }, children: (recoveryPasswordState.step === 1 || recoveryPasswordState.step === 3) ? SDKUI_Localizator.Back : SDKUI_Localizator.Cancel }) }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", disabled: recoveryPasswordValidationItems.filter(vil => vil.ResultType === ResultTypes.ERROR).length > 0, caption: recoveryPasswordState.step < 3 ? SDKUI_Localizator.Next : SDKUI_Localizator.Save, onClick: () => recoveryPasswordOnClickManager(), showTooltip: false }) }) })] }) }), togglePages.change && _jsx(TMChangePassword, { tmSession: getChangePswTmSession(), username: username, enable: isPasswordChangeEnable(), onClose: () => backToLogin() }), togglePages.endpoint && _jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.Endpoint }) }), _jsx(TMLayoutItem, { height: "fit-content", maxHeight: "70%", children: _jsx("div", { style: { height: '100%', padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(DataGrid, { height: '100%', elementAttr: { class: 'dx-custom-row' }, dataSource: endpoints, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, keyExpr: "URL", showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onSelectionChanged: (e) => setSelectedEndPoint(e.selectedRowsData[0]), onRowDblClick: () => { setEndpoint(selectedEndpoint); backToLogin(); setSelectedEndPoint(undefined); }, children: [_jsx(Selection, { mode: "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(ScrollBar, { width: 3 }), _jsx(Column, { dataField: "Description", caption: SDKUI_Localizator.Description, allowSorting: false }), _jsx(Column, { dataField: "URL", caption: 'URL', allowSorting: false }), _jsx(Column, { dataField: "isDefault", caption: 'Default', dataType: "boolean", allowSorting: false })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '10px 0', gap: 10 }, children: [_jsx(TMButton, { caption: SDKUI_Localizator.Back, btnStyle: "icon", height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "0.8rem", onClick: backToLogin, icon: _jsx(IconArrowLeft, {}) }), _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", disabled: !selectedEndpoint, caption: SDKUI_Localizator.Select, onClick: () => { setEndpoint(selectedEndpoint); backToLogin(); setSelectedEndPoint(undefined); }, showTooltip: false }), _jsx(TMButton, { caption: 'Ping', btnStyle: "icon", height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "0.8rem", disabled: !selectedEndpoint, onClick: () => pingAsync(selectedEndpoint), icon: _jsx(IconWifi, {}) })] }) })] }) }), togglePages.archive && _jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ArchiveID }) }), _jsx(TMLayoutItem, { height: "fit-content", maxHeight: "70%", children: _jsx("div", { style: { height: '100%', padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(DataGrid, { height: '100%', dataSource: archives, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, keyExpr: "id", showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onSelectionChanged: (e) => setSelectedArchive(e.selectedRowsData[0]), onRowDblClick: () => { setArchive(selectedArchive); backToLogin(); setSelectedArchive(undefined); }, children: [_jsx(Selection, { mode: "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Column, { dataField: "id", caption: 'ID', allowSorting: false }), _jsx(Column, { dataField: "description", caption: SDKUI_Localizator.Description, allowSorting: false }), _jsx(Column, { dataField: "isDefault", caption: 'Default', dataType: "boolean", allowSorting: false })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0', gap: 10 }, children: [_jsx(TMButton, { caption: SDKUI_Localizator.Back, btnStyle: "icon", height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "0.8rem", onClick: backToLogin, icon: _jsx(IconArrowLeft, {}) }), _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", disabled: !selectedArchive, caption: SDKUI_Localizator.Select, onClick: () => { setArchive(selectedArchive); backToLogin(); setSelectedArchive(undefined); }, showTooltip: false })] }) })] }) }), (isLoginPage()) &&
|
|
763
|
+
_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: "Login" }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsxs(TMLayoutItem, { children: [_jsx(TMSummary, { label: SDKUI_Localizator.Endpoint, icon: _jsx(IconAccessPoint, {}), onClearClick: () => setEndpoint(undefined), iconEditButton: _jsx(IconSearch, {}), template: _jsx("div", { children: endpoint?.Description }), customBtn: _jsx(IconWifi, { color: "gray" }), onCustumBtnClick: () => pingAsync(endpoint), validationItems: loginValidationItems.filter(item => item.PropertyName === 'endpoint'), onEditorClick: showEndpoints }), archives && archives.length > 0 ?
|
|
764
|
+
_jsx(TMSummary, { label: SDKUI_Localizator.ArchiveID, onClearClick: () => setArchive(undefined), iconEditButton: _jsx(IconSearch, {}), icon: _jsx(IconArchive, {}), template: _jsx("div", { children: archive ? archive.description : null }), validationItems: loginValidationItems.filter(item => item.PropertyName === 'archive'), onEditorClick: showArchives }) :
|
|
765
|
+
_jsx(TMTextBox, { label: SDKUI_Localizator.ArchiveID, icon: _jsx(IconArchive, {}), onValueChanged: (e) => setArchiveID(e.target.value), value: archiveID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'archive') }), _jsx(TMDropDown, { dataSource: [{ display: 'TopMedia', value: AuthenticationModes.TopMedia }, { display: SDKUI_Localizator.AuthMode_OnBehalfOf, value: AuthenticationModes.TopMediaOnBehalfOf }, { display: 'MSAzure', value: AuthenticationModes.MSAzure }, { display: SDKUI_Localizator.AuthMode_WindowsViaTopMedia, value: AuthenticationModes.WindowsThroughTopMedia }], label: SDKUI_Localizator.AuthMode, value: authMode, icon: _jsx(IconLogin, {}), onValueChanged: (e) => { setAuthMode(e.target.value); }, validationItems: loginValidationItems.filter(item => item.PropertyName === 'authMode') })] }), (authMode === AuthenticationModes.TopMedia || authMode === AuthenticationModes.WindowsThroughTopMedia) && _jsx(TMLayoutItem, { children: authMode === AuthenticationModes.WindowsThroughTopMedia ?
|
|
766
|
+
_jsxs(_Fragment, { children: [_jsx(TMTextBox, { label: SDKUI_Localizator.Domain, icon: _jsx(IconWeb, {}), value: domainAlternative, onValueChanged: (e) => setDomainArternative(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'domain_alt') }), _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'username'), label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: username, onValueChanged: (e) => setUsername(e.target.value) }), _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'password'), type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: password, onValueChanged: (e) => setPassword(e.target.value) })] })
|
|
767
|
+
:
|
|
768
|
+
_jsxs(_Fragment, { children: [_jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'username'), label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: username, onValueChanged: (e) => setUsername(e.target.value) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'password'), type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: password, onValueChanged: (e) => setPassword(e.target.value) }) })] }) }), authMode === AuthenticationModes.TopMediaOnBehalfOf && _jsx(TMLayoutItem, { children: _jsxs(TMLayoutContainer, { direction: "horizontal", children: [_jsx(TMLayoutItem, { children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'username'), label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: username, onValueChanged: (e) => setUsername(e.target.value) }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'password'), type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: password, onValueChanged: (e) => setPassword(e.target.value) }) })] }) }), _jsx(TMLayoutItem, { children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { label: SDKUI_Localizator.Domain, icon: _jsx(IconWeb, {}), value: domain, onValueChanged: (e) => setDomain(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'domain') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: onBehalfUsername, onValueChanged: (e) => setOnBeHalfUsername(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'onBeHalfUsername') }) })] }) })] }) }), authMode !== AuthenticationModes.TopMediaOnBehalfOf ? _jsx(TMLayoutItem, { children: _jsx(TMDropDown, { dataSource: cultureIDsDataSource, icon: _jsx(IconLanguage, {}), label: SDKUI_Localizator.CultureID, onValueChanged: (e) => props.onChangeLanguage && props.onChangeLanguage(e.target.value), value: props.cultureID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'cultureId') }) }) :
|
|
769
|
+
_jsxs(TMLayoutContainer, { direction: "horizontal", children: [_jsx(TMLayoutItem, { children: _jsx(TMDropDown, { dataSource: cultureIDsDataSource, icon: _jsx(IconLanguage, {}), label: SDKUI_Localizator.CultureID, onValueChanged: (e) => props.onChangeLanguage && props.onChangeLanguage(e.target.value), value: props.cultureID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'cultureId') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: onBeHalfPassword, onValueChanged: (e) => setOnBeHalfPassword(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'onBeHalfPassword') }) })] })] }) }) }) }), authMode === AuthenticationModes.TopMedia && _jsxs(TMLayoutItem, { height: "fit-content", width: "fit-content", children: [_jsx("p", { onClick: () => isPasswordChangeEnable() && setTogglePages({ recovery: false, change: true, archive: false, endpoint: false }), tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && setTogglePages({ recovery: false, change: true, archive: false, endpoint: false }), style: { userSelect: 'none', cursor: isPasswordChangeEnable() ? 'pointer' : 'default', color: isPasswordChangeEnable() ? TMColors.primary : 'rgb(180,180,180)', textAlign: 'center', fontSize: '0.9rem' }, children: SDKUI_Localizator.ChangePassword }), _jsx("p", { tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && showRecoveryPassword(), onClick: () => isPasswordChangeEnable() && showRecoveryPassword(), style: { userSelect: 'none', marginTop: '10px', cursor: isPasswordChangeEnable() ? 'pointer' : 'default', color: isPasswordChangeEnable() ? TMColors.primary : 'rgb(180,180,180)', fontSize: '0.9rem' }, children: SDKUI_Localizator.ForgetPassword })] }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '250px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1.1rem", caption: "Login", disabled: loginValidationItems.length > 0, onClick: login, showTooltip: false }) }) })] }) })] })] }) }));
|
|
770
|
+
};
|
|
771
|
+
const TMPasswordManager = ({ validationItems = [], operation = 'change' }) => {
|
|
772
|
+
const passwordStrength = () => {
|
|
773
|
+
let arr = [...validationItems];
|
|
774
|
+
if (operation === 'change') {
|
|
775
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_old' && item.PropertyName !== 'changePass_new' && item.PropertyName !== 'changePass_confirm' && item.PropertyName !== 'changePass_notConfirmed' && item.PropertyName !== 'changePass_equalUsername' && item.PropertyName !== 'changePass_containUsername');
|
|
776
|
+
}
|
|
777
|
+
if (operation === 'recovery') {
|
|
778
|
+
arr = arr.filter(item => item.PropertyName !== 'recoveryPass_email' && item.PropertyName !== 'recoveryPass_otp' && item.PropertyName !== 'recoveryPass_new' && item.PropertyName !== 'recoveryPass_confirm' && item.PropertyName !== 'recoveryPass_notConfirmed' && item.PropertyName !== 'recoveryPass_equalUsername' && item.PropertyName !== 'recoveryPass_containUsername');
|
|
779
|
+
}
|
|
780
|
+
if (arr.length > 4)
|
|
781
|
+
return { width: '20%', color: TMColors.error };
|
|
782
|
+
if (arr.length <= 4 && arr.length > 2)
|
|
783
|
+
return { width: '40%', color: TMColors.tertiary };
|
|
784
|
+
if (arr.length === 2)
|
|
785
|
+
return { width: '60%', color: TMColors.warning };
|
|
786
|
+
if (arr.length === 1)
|
|
787
|
+
return { width: '80%', color: TMColors.warning };
|
|
788
|
+
if (arr.length === 0)
|
|
789
|
+
return { width: '100%', color: TMColors.success };
|
|
790
|
+
return { width: '', color: '' };
|
|
791
|
+
};
|
|
792
|
+
return (_jsxs(TMLayoutItem, { height: "60%", children: [_jsx("div", { style: { width: 'calc(100% - 70px)', height: '5px', backgroundColor: 'white', margin: '0px 0px 10px 45px', borderRadius: '2px', overflow: 'hidden' }, children: _jsx("div", { style: { width: passwordStrength().width, height: '100%', backgroundColor: passwordStrength().color, transition: 'ease 300ms' } }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 2, padding: '0 45px 10px 45px' }, children: [_jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_length`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_length`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordLengthError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotLower`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotLower`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordLowercaseError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotUpper`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotUpper`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordUppercaseError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotNumber`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotNumber`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordNumberError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotSymbol`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsxs("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotSymbol`) ? 'red' : 'green' }, children: [SDKUI_Localizator.PasswordSymbolError, " "] }) })] })] })] }));
|
|
793
|
+
};
|
|
794
|
+
export const TMChangePassword = ({ tmSession, username, onClose, enable, hasBack = true }) => {
|
|
795
|
+
const [changePasswordState, setChangePasswordState] = useState({ confermPassword: '', newPassword: '', oldPassword: '' });
|
|
796
|
+
const [changePasswordValidationItems, setChangePasswordValidationItems] = useState([]);
|
|
797
|
+
useEffect(() => { changePasswordValidator(); }, [changePasswordState.oldPassword, changePasswordState.newPassword, changePasswordState.confermPassword, username]);
|
|
798
|
+
const size = useWindowWidth();
|
|
799
|
+
const changePasswordValidator = () => {
|
|
800
|
+
let arr = [...changePasswordValidationItems];
|
|
801
|
+
let char_upperCase = new RegExp(/([A-Z])/g);
|
|
802
|
+
let char_lowerCase = new RegExp(/([a-z])/g);
|
|
803
|
+
let char_number = new RegExp(/([0-9])/g);
|
|
804
|
+
let char_symbol = new RegExp(/[!@?#\$%\^\&*\)\(+=._-]/g);
|
|
805
|
+
if (changePasswordState.oldPassword?.length === 0) {
|
|
806
|
+
if (!arr.find(item => item.PropertyName === 'changePass_old')) {
|
|
807
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_old', SDK_Localizator.RequiredField));
|
|
808
|
+
}
|
|
809
|
+
;
|
|
810
|
+
setChangePasswordValidationItems(arr);
|
|
811
|
+
}
|
|
812
|
+
else {
|
|
813
|
+
{
|
|
814
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_old');
|
|
815
|
+
}
|
|
816
|
+
;
|
|
817
|
+
setChangePasswordValidationItems(arr);
|
|
818
|
+
}
|
|
819
|
+
if (changePasswordState.newPassword?.length === 0) {
|
|
820
|
+
if (!arr.find(item => item.PropertyName === 'changePass_new')) {
|
|
821
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_new', SDK_Localizator.RequiredField));
|
|
822
|
+
}
|
|
823
|
+
;
|
|
824
|
+
setChangePasswordValidationItems(arr);
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
{
|
|
828
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_new');
|
|
829
|
+
}
|
|
830
|
+
;
|
|
831
|
+
setChangePasswordValidationItems(arr);
|
|
832
|
+
}
|
|
833
|
+
if (changePasswordState.confermPassword?.length === 0) {
|
|
834
|
+
if (!arr.find(item => item.PropertyName === 'changePass_confirm')) {
|
|
835
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_confirm', SDK_Localizator.RequiredField));
|
|
836
|
+
}
|
|
837
|
+
;
|
|
838
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_notConfirmed');
|
|
839
|
+
setChangePasswordValidationItems(arr);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
{
|
|
843
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_confirm');
|
|
844
|
+
}
|
|
845
|
+
;
|
|
846
|
+
setChangePasswordValidationItems(arr);
|
|
847
|
+
}
|
|
848
|
+
if (changePasswordState.newPassword.length > 0 && changePasswordState.confermPassword.length > 0 && changePasswordState.newPassword !== changePasswordState.confermPassword) {
|
|
849
|
+
if (!arr.find(item => item.PropertyName === 'changePass_notConfirmed')) {
|
|
850
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_notConfirmed', SDKUI_Localizator.PasswordConfirmError));
|
|
851
|
+
}
|
|
852
|
+
;
|
|
853
|
+
setChangePasswordValidationItems(arr);
|
|
854
|
+
}
|
|
855
|
+
else if (changePasswordState.newPassword.length > 0 && changePasswordState.confermPassword.length > 0 && changePasswordState.newPassword === changePasswordState.confermPassword) {
|
|
856
|
+
{
|
|
857
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_notConfirmed');
|
|
858
|
+
}
|
|
859
|
+
;
|
|
860
|
+
setChangePasswordValidationItems(arr);
|
|
861
|
+
}
|
|
862
|
+
if (changePasswordState.newPassword.length > 0 && changePasswordState.newPassword?.toLowerCase() === username.toLowerCase()) {
|
|
863
|
+
if (!arr.find(item => item.PropertyName === 'changePass_equalUsername')) {
|
|
864
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_equalUsername', SDKUI_Localizator.PasswordEqualsUsernameError));
|
|
865
|
+
}
|
|
866
|
+
;
|
|
867
|
+
setChangePasswordValidationItems(arr);
|
|
868
|
+
}
|
|
869
|
+
else {
|
|
870
|
+
{
|
|
871
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_equalUsername');
|
|
872
|
+
}
|
|
873
|
+
;
|
|
874
|
+
setChangePasswordValidationItems(arr);
|
|
875
|
+
}
|
|
876
|
+
if (changePasswordState.newPassword.length > 0 && changePasswordState.newPassword?.toLowerCase().includes(username.toLowerCase())) {
|
|
877
|
+
if (!arr.find(item => item.PropertyName === 'changePass_containUsername')) {
|
|
878
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_containUsername', SDKUI_Localizator.PasswordContainsUsernameError));
|
|
879
|
+
}
|
|
880
|
+
;
|
|
881
|
+
setChangePasswordValidationItems(arr);
|
|
882
|
+
}
|
|
883
|
+
else {
|
|
884
|
+
{
|
|
885
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_containUsername');
|
|
886
|
+
}
|
|
887
|
+
;
|
|
888
|
+
setChangePasswordValidationItems(arr);
|
|
889
|
+
}
|
|
890
|
+
if (!char_symbol.test(changePasswordState.newPassword)) {
|
|
891
|
+
if (!arr.find(item => item.PropertyName === 'changePass_hasNotSymbol')) {
|
|
892
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_hasNotSymbol', SDKUI_Localizator.PasswordSymbolError));
|
|
893
|
+
}
|
|
894
|
+
;
|
|
895
|
+
setChangePasswordValidationItems(arr);
|
|
896
|
+
}
|
|
897
|
+
else {
|
|
898
|
+
{
|
|
899
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_hasNotSymbol');
|
|
900
|
+
}
|
|
901
|
+
;
|
|
902
|
+
setChangePasswordValidationItems(arr);
|
|
903
|
+
}
|
|
904
|
+
if (!char_number.test(changePasswordState.newPassword)) {
|
|
905
|
+
if (!arr.find(item => item.PropertyName === 'changePass_hasNotNumber')) {
|
|
906
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_hasNotNumber', SDKUI_Localizator.PasswordNumberError));
|
|
907
|
+
}
|
|
908
|
+
;
|
|
909
|
+
setChangePasswordValidationItems(arr);
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
{
|
|
913
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_hasNotNumber');
|
|
914
|
+
}
|
|
915
|
+
;
|
|
916
|
+
setChangePasswordValidationItems(arr);
|
|
917
|
+
}
|
|
918
|
+
if (!char_lowerCase.test(changePasswordState.newPassword)) {
|
|
919
|
+
if (!arr.find(item => item.PropertyName === 'changePass_hasNotLower')) {
|
|
920
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_hasNotLower', SDKUI_Localizator.PasswordLowercaseError));
|
|
921
|
+
}
|
|
922
|
+
;
|
|
923
|
+
setChangePasswordValidationItems(arr);
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
{
|
|
927
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_hasNotLower');
|
|
928
|
+
}
|
|
929
|
+
;
|
|
930
|
+
setChangePasswordValidationItems(arr);
|
|
931
|
+
}
|
|
932
|
+
if (!char_upperCase.test(changePasswordState.newPassword)) {
|
|
933
|
+
if (!arr.find(item => item.PropertyName === 'changePass_hasNotUpper')) {
|
|
934
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_hasNotUpper', SDKUI_Localizator.PasswordUppercaseError));
|
|
935
|
+
}
|
|
936
|
+
;
|
|
937
|
+
setChangePasswordValidationItems(arr);
|
|
938
|
+
}
|
|
939
|
+
else {
|
|
940
|
+
{
|
|
941
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_hasNotUpper');
|
|
942
|
+
}
|
|
943
|
+
;
|
|
944
|
+
setChangePasswordValidationItems(arr);
|
|
945
|
+
}
|
|
946
|
+
if (changePasswordState.newPassword.length < 10 || changePasswordState.newPassword.length > 128) {
|
|
947
|
+
if (!arr.find(item => item.PropertyName === 'changePass_length')) {
|
|
948
|
+
arr.push(new ValidationItem(ResultTypes.ERROR, 'changePass_length', SDKUI_Localizator.PasswordLengthError));
|
|
949
|
+
}
|
|
950
|
+
;
|
|
951
|
+
setChangePasswordValidationItems(arr);
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
{
|
|
955
|
+
arr = arr.filter(item => item.PropertyName !== 'changePass_length');
|
|
956
|
+
}
|
|
957
|
+
;
|
|
958
|
+
setChangePasswordValidationItems(arr);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
// const goBack = (button: ButtonNames) => { if (button !== ButtonNames.OK) return; onClose && onClose(); setChangePasswordState({ confermPassword: '', newPassword: '', oldPassword: '' }); }
|
|
962
|
+
const goBackToLogin = (button) => { if (button !== ButtonNames.OK)
|
|
963
|
+
return; back(); };
|
|
964
|
+
const changePasswordAsync = async () => {
|
|
965
|
+
let cpd = new ChangePswDescriptor();
|
|
966
|
+
cpd.archiveID = tmSession?.SessionDescr?.archiveID;
|
|
967
|
+
cpd.userName = username;
|
|
968
|
+
cpd.oldPassword = changePasswordState.oldPassword;
|
|
969
|
+
cpd.newPassword = changePasswordState.newPassword;
|
|
970
|
+
cpd.cultureID = CultureIDs.It_IT;
|
|
971
|
+
try {
|
|
972
|
+
TMSpinner.show();
|
|
973
|
+
await tmSession?.NewUserEngine().ChangePasswordAsync(cpd);
|
|
974
|
+
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], onButtonClick: goBackToLogin, message: SDKUI_Localizator.PasswordChangedSuccessfully });
|
|
975
|
+
}
|
|
976
|
+
catch (e) {
|
|
977
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
978
|
+
}
|
|
979
|
+
finally {
|
|
980
|
+
TMSpinner.hide();
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
const back = () => { onClose && onClose(); setChangePasswordState({ confermPassword: '', newPassword: '', oldPassword: '' }); };
|
|
984
|
+
return (_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ChangePassword }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.OldPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setChangePasswordState({ ...changePasswordState, oldPassword: e.target.value }), value: changePasswordState.oldPassword, validationItems: changePasswordValidationItems.filter(item => item.PropertyName === 'changePass_old') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.NewPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setChangePasswordState({ ...changePasswordState, newPassword: e.target.value }), value: changePasswordState.newPassword, validationItems: changePasswordValidationItems.filter(item => item.PropertyName === 'changePass_new' || item.PropertyName === 'changePass_equalUsername' || item.PropertyName === 'changePass_containUsername') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.ConfirmPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setChangePasswordState({ ...changePasswordState, confermPassword: e.target.value }), value: changePasswordState.confermPassword, validationItems: changePasswordValidationItems.filter(item => item.PropertyName === 'changePass_confirm' || item.PropertyName === 'changePass_notConfirmed') }) })] }) }) }) }), _jsx(TMPasswordManager, { operation: "change", validationItems: changePasswordValidationItems }), hasBack && _jsx(TMLayoutItem, { height: "fit-content", width: "fit-content", children: _jsx("p", { onClick: back, tabIndex: enable ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && back(), style: { userSelect: 'none', cursor: enable ? 'pointer' : 'default', color: enable ? TMColors.primary : 'rgb(180,180,180)', fontSize: '1rem' }, children: SDKUI_Localizator.Back }) }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", caption: SDKUI_Localizator.Save, disabled: changePasswordValidationItems.length > 0, onClick: () => { changePasswordAsync(); }, showTooltip: false }) }) })] }) }));
|
|
985
|
+
};
|
|
986
|
+
export default TMLoginForm;
|