@verdaccio/ui-components 4.0.0-next-8.12 → 4.0.0-next-8.13
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/README.md +23 -49
- package/build/AppTest/AppRoute.d.ts +1 -3
- package/build/AppTest/AppRoute.js +13 -40
- package/build/AppTest/AppRoute.js.map +1 -1
- package/build/Theme/ResetStyles.js +42 -32
- package/build/Theme/ResetStyles.js.map +1 -1
- package/build/Theme/StyleBaseline.js +15 -6
- package/build/Theme/StyleBaseline.js.map +1 -1
- package/build/Theme/ThemeProvider.js +38 -22
- package/build/Theme/ThemeProvider.js.map +1 -1
- package/build/Theme/colors.d.ts +11 -0
- package/build/Theme/colors.js +19 -1
- package/build/Theme/colors.js.map +1 -1
- package/build/Theme/index.d.ts +2 -1
- package/build/Theme/index.js +57 -5
- package/build/Theme/index.js.map +1 -1
- package/build/Theme/modes.d.ts +3 -0
- package/build/Theme/modes.js +40 -0
- package/build/Theme/modes.js.map +1 -0
- package/build/Theme/theme.d.ts +5 -149
- package/build/Theme/theme.js +16 -95
- package/build/Theme/theme.js.map +1 -1
- package/build/Theme/tokens.d.ts +57 -0
- package/build/Theme/tokens.js +35 -0
- package/build/Theme/tokens.js.map +1 -0
- package/build/api/use-data-mutation.d.ts +19 -0
- package/build/api/use-data-mutation.js +99 -0
- package/build/api/use-data-mutation.js.map +1 -0
- package/build/api/use-data.d.ts +3 -0
- package/build/api/use-data.js +36 -0
- package/build/api/use-data.js.map +1 -0
- package/build/components/ActionBar/ActionBar.js +49 -30
- package/build/components/ActionBar/ActionBar.js.map +1 -1
- package/build/components/ActionBar/ActionBarAction.js +72 -57
- package/build/components/ActionBar/ActionBarAction.js.map +1 -1
- package/build/components/ActionBar/index.js +13 -1
- package/build/components/ActionBar/index.js.map +1 -1
- package/build/components/AppRoute/AppRoute.d.ts +3 -0
- package/build/components/AppRoute/AppRoute.js +89 -0
- package/build/components/AppRoute/AppRoute.js.map +1 -0
- package/build/components/Author/Author.d.ts +1 -1
- package/build/components/Author/Author.js +25 -22
- package/build/components/Author/Author.js.map +1 -1
- package/build/components/Author/index.js +13 -1
- package/build/components/Author/index.js.map +1 -1
- package/build/components/Author/styles.js +18 -9
- package/build/components/Author/styles.js.map +1 -1
- package/build/components/CopyClipboard/CopyToClipBoard.js +31 -28
- package/build/components/CopyClipboard/CopyToClipBoard.js.map +1 -1
- package/build/components/CopyClipboard/index.js +20 -2
- package/build/components/CopyClipboard/index.js.map +1 -1
- package/build/components/CopyClipboard/utils.d.ts +1 -1
- package/build/components/CopyClipboard/utils.js +12 -4
- package/build/components/CopyClipboard/utils.js.map +1 -1
- package/build/components/Dependencies/Dependencies.js +52 -42
- package/build/components/Dependencies/Dependencies.js.map +1 -1
- package/build/components/Dependencies/DependencyBlock.d.ts +2 -2
- package/build/components/Dependencies/DependencyBlock.js +65 -49
- package/build/components/Dependencies/DependencyBlock.js.map +1 -1
- package/build/components/Dependencies/index.js +13 -1
- package/build/components/Dependencies/index.js.map +1 -1
- package/build/components/Dependencies/types.d.ts +1 -1
- package/build/components/Dependencies/types.js +5 -1
- package/build/components/Dependencies/types.js.map +1 -1
- package/build/components/Dependencies/utits.js +7 -1
- package/build/components/Dependencies/utits.js.map +1 -1
- package/build/components/Deprecated/Deprecated.js +13 -8
- package/build/components/Deprecated/Deprecated.js.map +1 -1
- package/build/components/Deprecated/index.js +13 -1
- package/build/components/Deprecated/index.js.map +1 -1
- package/build/components/Developers/DeveloperType.js +7 -1
- package/build/components/Developers/DeveloperType.js.map +1 -1
- package/build/components/Developers/Developers.d.ts +1 -1
- package/build/components/Developers/Developers.js +62 -39
- package/build/components/Developers/Developers.js.map +1 -1
- package/build/components/Developers/Title.js +25 -23
- package/build/components/Developers/Title.js.map +1 -1
- package/build/components/Developers/get-unique-developer-values.d.ts +1 -1
- package/build/components/Developers/get-unique-developer-values.js +18 -2
- package/build/components/Developers/get-unique-developer-values.js.map +1 -1
- package/build/components/Developers/index.js +20 -2
- package/build/components/Developers/index.js.map +1 -1
- package/build/components/Distribution/Dist.d.ts +2 -2
- package/build/components/Distribution/Dist.js +31 -30
- package/build/components/Distribution/Dist.js.map +1 -1
- package/build/components/Distribution/index.js +13 -1
- package/build/components/Distribution/index.js.map +1 -1
- package/build/components/Distribution/styles.js +22 -13
- package/build/components/Distribution/styles.js.map +1 -1
- package/build/components/Engines/Engines.d.ts +1 -1
- package/build/components/Engines/Engines.js +37 -36
- package/build/components/Engines/Engines.js.map +1 -1
- package/build/components/Engines/index.js +13 -1
- package/build/components/Engines/index.js.map +1 -1
- package/build/components/Engines/styles.js +19 -10
- package/build/components/Engines/styles.js.map +1 -1
- package/build/components/ErrorBoundary/ErrorBoundary.d.ts +11 -9
- package/build/components/ErrorBoundary/ErrorBoundary.js +63 -28
- package/build/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/build/components/ErrorBoundary/index.js +13 -1
- package/build/components/ErrorBoundary/index.js.map +1 -1
- package/build/components/Forbidden/Forbidden.d.ts +3 -2
- package/build/components/Forbidden/Forbidden.js +55 -52
- package/build/components/Forbidden/Forbidden.js.map +1 -1
- package/build/components/Forbidden/index.js +13 -1
- package/build/components/Forbidden/index.js.map +1 -1
- package/build/components/FundButton/FundButton.js +33 -34
- package/build/components/FundButton/FundButton.js.map +1 -1
- package/build/components/FundButton/index.js +13 -1
- package/build/components/FundButton/index.js.map +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +45 -32
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js.map +1 -1
- package/build/components/HeaderInfoDialog/index.js +13 -1
- package/build/components/HeaderInfoDialog/index.js.map +1 -1
- package/build/components/Heading/Heading.d.ts +5 -2
- package/build/components/Heading/Heading.js +17 -11
- package/build/components/Heading/Heading.js.map +1 -1
- package/build/components/Heading/index.js +13 -1
- package/build/components/Heading/index.js.map +1 -1
- package/build/components/Help/Help.js +32 -26
- package/build/components/Help/Help.js.map +1 -1
- package/build/components/Help/index.js +13 -1
- package/build/components/Help/index.js.map +1 -1
- package/build/components/Help/styles.js +10 -3
- package/build/components/Help/styles.js.map +1 -1
- package/build/components/Icons/DevsIcons/CommonJS.js +10 -3
- package/build/components/Icons/DevsIcons/CommonJS.js.map +1 -1
- package/build/components/Icons/DevsIcons/ES6Module.js +10 -3
- package/build/components/Icons/DevsIcons/ES6Module.js.map +1 -1
- package/build/components/Icons/DevsIcons/Git.js +10 -3
- package/build/components/Icons/DevsIcons/Git.js.map +1 -1
- package/build/components/Icons/DevsIcons/NodeJS.js +10 -3
- package/build/components/Icons/DevsIcons/NodeJS.js.map +1 -1
- package/build/components/Icons/DevsIcons/TypeScript.js +10 -3
- package/build/components/Icons/DevsIcons/TypeScript.js.map +1 -1
- package/build/components/Icons/DevsIcons/index.js +40 -5
- package/build/components/Icons/DevsIcons/index.js.map +1 -1
- package/build/components/Icons/Earth.d.ts +5 -5
- package/build/components/Icons/Earth.js +25 -14
- package/build/components/Icons/Earth.js.map +1 -1
- package/build/components/Icons/FileBinary.d.ts +5 -5
- package/build/components/Icons/FileBinary.js +23 -16
- package/build/components/Icons/FileBinary.js.map +1 -1
- package/build/components/Icons/Law.d.ts +5 -5
- package/build/components/Icons/Law.js +24 -17
- package/build/components/Icons/Law.js.map +1 -1
- package/build/components/Icons/License.d.ts +7 -5
- package/build/components/Icons/License.js +19 -8
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +10 -3
- package/build/components/Icons/Managers/Npm.js.map +1 -1
- package/build/components/Icons/Managers/Pnpm.js +10 -3
- package/build/components/Icons/Managers/Pnpm.js.map +1 -1
- package/build/components/Icons/Managers/Yarn.js +10 -3
- package/build/components/Icons/Managers/Yarn.js.map +1 -1
- package/build/components/Icons/Managers/index.js +26 -3
- package/build/components/Icons/Managers/index.js.map +1 -1
- package/build/components/Icons/SvgIcon.d.ts +8 -2
- package/build/components/Icons/SvgIcon.js +26 -22
- package/build/components/Icons/SvgIcon.js.map +1 -1
- package/build/components/Icons/Time.d.ts +5 -5
- package/build/components/Icons/Time.js +20 -9
- package/build/components/Icons/Time.js.map +1 -1
- package/build/components/Icons/Version.d.ts +5 -5
- package/build/components/Icons/Version.js +18 -7
- package/build/components/Icons/Version.js.map +1 -1
- package/build/components/Icons/index.js +79 -8
- package/build/components/Icons/index.js.map +1 -1
- package/build/components/Install/Install.d.ts +2 -2
- package/build/components/Install/Install.js +41 -33
- package/build/components/Install/Install.js.map +1 -1
- package/build/components/Install/InstallListItem.js +48 -43
- package/build/components/Install/InstallListItem.js.map +1 -1
- package/build/components/Install/index.js +13 -1
- package/build/components/Install/index.js.map +1 -1
- package/build/components/Keywords/KeywordListItems.js +25 -17
- package/build/components/Keywords/KeywordListItems.js.map +1 -1
- package/build/components/Keywords/Keywords.d.ts +1 -1
- package/build/components/Keywords/Keywords.js +22 -18
- package/build/components/Keywords/Keywords.js.map +1 -1
- package/build/components/Keywords/index.js +13 -1
- package/build/components/Keywords/index.js.map +1 -1
- package/build/components/Label/Label.d.ts +1 -1
- package/build/components/Label/Label.js +25 -17
- package/build/components/Label/Label.js.map +1 -1
- package/build/components/Label/index.js +13 -1
- package/build/components/Label/index.js.map +1 -1
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.js +26 -19
- package/build/components/Link/Link.js.map +1 -1
- package/build/components/Link/index.js +13 -1
- package/build/components/Link/index.js.map +1 -1
- package/build/components/LinkExternal/LinkExternal.d.ts +1 -1
- package/build/components/LinkExternal/LinkExternal.js +28 -24
- package/build/components/LinkExternal/LinkExternal.js.map +1 -1
- package/build/components/LinkExternal/index.js +13 -1
- package/build/components/LinkExternal/index.js.map +1 -1
- package/build/components/Loading/Loading.js +21 -12
- package/build/components/Loading/Loading.js.map +1 -1
- package/build/components/Loading/Spinner/Spinner.js +31 -26
- package/build/components/Loading/Spinner/Spinner.js.map +1 -1
- package/build/components/Loading/Spinner/index.js +13 -1
- package/build/components/Loading/Spinner/index.js.map +1 -1
- package/build/components/Loading/index.js +13 -1
- package/build/components/Loading/index.js.map +1 -1
- package/build/components/Loading/styles.d.ts +1 -2
- package/build/components/Loading/styles.js +14 -9
- package/build/components/Loading/styles.js.map +1 -1
- package/build/components/LoginDialog/LoginDialog.js +29 -77
- package/build/components/LoginDialog/LoginDialog.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.js +24 -22
- package/build/components/LoginDialog/LoginDialogCloseButton.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogForm.d.ts +2 -11
- package/build/components/LoginDialog/LoginDialogForm.js +25 -111
- package/build/components/LoginDialog/LoginDialogForm.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogFormError.d.ts +1 -6
- package/build/components/LoginDialog/LoginDialogFormError.js +31 -26
- package/build/components/LoginDialog/LoginDialogFormError.js.map +1 -1
- package/build/components/LoginDialog/index.js +13 -1
- package/build/components/LoginDialog/index.js.map +1 -1
- package/build/components/LoginForm/Login.d.ts +15 -0
- package/build/components/LoginForm/Login.js +87 -0
- package/build/components/LoginForm/Login.js.map +1 -0
- package/build/components/LoginForm/PasswordField.d.ts +9 -0
- package/build/components/LoginForm/PasswordField.js +51 -0
- package/build/components/LoginForm/PasswordField.js.map +1 -0
- package/build/components/LoginForm/UsernameField.d.ts +9 -0
- package/build/components/LoginForm/UsernameField.js +49 -0
- package/build/components/LoginForm/UsernameField.js.map +1 -0
- package/build/components/LoginForm/styles.d.ts +6 -0
- package/build/components/LoginForm/styles.js +60 -0
- package/build/components/LoginForm/styles.js.map +1 -0
- package/build/components/LoginForm/useLoginForm.d.ts +78 -0
- package/build/components/LoginForm/useLoginForm.js +66 -0
- package/build/components/LoginForm/useLoginForm.js.map +1 -0
- package/build/components/Logo/Logo.js +34 -29
- package/build/components/Logo/Logo.js.map +1 -1
- package/build/components/Logo/index.js +13 -1
- package/build/components/Logo/index.js.map +1 -1
- package/build/components/MenuItem/MenuItem.d.ts +4 -2
- package/build/components/MenuItem/MenuItem.js +24 -11
- package/build/components/MenuItem/MenuItem.js.map +1 -1
- package/build/components/MenuItem/index.js +13 -1
- package/build/components/MenuItem/index.js.map +1 -1
- package/build/components/NoItems/NoItems.js +15 -10
- package/build/components/NoItems/NoItems.js.map +1 -1
- package/build/components/NoItems/index.js +13 -1
- package/build/components/NoItems/index.js.map +1 -1
- package/build/components/NotFound/NotFound.js +37 -32
- package/build/components/NotFound/NotFound.js.map +1 -1
- package/build/components/NotFound/index.js +13 -1
- package/build/components/NotFound/index.js.map +1 -1
- package/build/components/Package/Package.d.ts +2 -1
- package/build/components/Package/Package.js +187 -155
- package/build/components/Package/Package.js.map +1 -1
- package/build/components/Package/index.js +13 -1
- package/build/components/Package/index.js.map +1 -1
- package/build/components/Package/styles.d.ts +2 -3
- package/build/components/Package/styles.js +73 -72
- package/build/components/Package/styles.js.map +1 -1
- package/build/components/PackageList/PackageList.d.ts +2 -1
- package/build/components/PackageList/PackageList.js +55 -59
- package/build/components/PackageList/PackageList.js.map +1 -1
- package/build/components/PackageList/index.js +13 -1
- package/build/components/PackageList/index.js.map +1 -1
- package/build/components/Person/Person.d.ts +1 -1
- package/build/components/Person/Person.js +28 -22
- package/build/components/Person/Person.js.map +1 -1
- package/build/components/Person/PersonTooltip.d.ts +1 -1
- package/build/components/Person/PersonTooltip.js +18 -13
- package/build/components/Person/PersonTooltip.js.map +1 -1
- package/build/components/Person/index.js +13 -1
- package/build/components/Person/index.js.map +1 -1
- package/build/components/Person/utils.d.ts +1 -1
- package/build/components/Person/utils.js +14 -6
- package/build/components/Person/utils.js.map +1 -1
- package/build/components/RawViewer/RawViewer.js +38 -34
- package/build/components/RawViewer/RawViewer.js.map +1 -1
- package/build/components/RawViewer/index.js +13 -1
- package/build/components/RawViewer/index.js.map +1 -1
- package/build/components/Readme/Readme.d.ts +1 -1
- package/build/components/Readme/Readme.js +26 -22
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/index.js +13 -1
- package/build/components/Readme/index.js.map +1 -1
- package/build/components/Readme/types.js +5 -1
- package/build/components/Readme/utils.js +15 -8
- package/build/components/Readme/utils.js.map +1 -1
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.d.ts +1 -1
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +25 -19
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js.map +1 -1
- package/build/components/RegistryInfoDialog/index.js +13 -1
- package/build/components/RegistryInfoDialog/index.js.map +1 -1
- package/build/components/RegistryInfoDialog/styles.d.ts +1 -2
- package/build/components/RegistryInfoDialog/styles.js +26 -24
- package/build/components/RegistryInfoDialog/styles.js.map +1 -1
- package/build/components/RegistryInfoDialog/types.d.ts +1 -1
- package/build/components/RegistryInfoDialog/types.js +5 -1
- package/build/components/RegistryInfoDialog/types.js.map +1 -1
- package/build/components/Repository/Repository.js +47 -42
- package/build/components/Repository/Repository.js.map +1 -1
- package/build/components/Repository/index.js +13 -1
- package/build/components/Repository/index.js.map +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.d.ts +5 -4
- package/build/components/Search/AutoComplete/AutoComplete.js +44 -26
- package/build/components/Search/AutoComplete/AutoComplete.js.map +1 -1
- package/build/components/Search/AutoComplete/index.js +13 -1
- package/build/components/Search/AutoComplete/index.js.map +1 -1
- package/build/components/Search/AutoComplete/styles.d.ts +0 -1
- package/build/components/Search/AutoComplete/styles.js +9 -2
- package/build/components/Search/AutoComplete/styles.js.map +1 -1
- package/build/components/Search/Search.d.ts +2 -5
- package/build/components/Search/Search.js +133 -123
- package/build/components/Search/Search.js.map +1 -1
- package/build/components/Search/SearchItem.d.ts +1 -1
- package/build/components/Search/SearchItem.js +92 -97
- package/build/components/Search/SearchItem.js.map +1 -1
- package/build/components/Search/index.js +13 -1
- package/build/components/Search/index.js.map +1 -1
- package/build/components/Search/styles.d.ts +5 -4
- package/build/components/Search/styles.js +46 -33
- package/build/components/Search/styles.js.map +1 -1
- package/build/components/Search/utils.js +7 -1
- package/build/components/Search/utils.js.map +1 -1
- package/build/components/SettingsMenu/SettingsMenu.js +60 -52
- package/build/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/build/components/SettingsMenu/index.js +13 -1
- package/build/components/SettingsMenu/index.js.map +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +52 -52
- package/build/components/SideBarTitle/SideBarTitle.js.map +1 -1
- package/build/components/SideBarTitle/index.js +13 -1
- package/build/components/SideBarTitle/index.js.map +1 -1
- package/build/components/SideBarTitle/utils.js +15 -6
- package/build/components/SideBarTitle/utils.js.map +1 -1
- package/build/components/UnAuthorized/UnAuthorized.d.ts +3 -0
- package/build/components/UnAuthorized/UnAuthorized.js +75 -0
- package/build/components/UnAuthorized/UnAuthorized.js.map +1 -0
- package/build/components/UnAuthorized/index.d.ts +1 -0
- package/build/components/UnAuthorized/index.js +14 -0
- package/build/components/UnAuthorized/index.js.map +1 -0
- package/build/components/UpLinks/UpLinks.js +46 -42
- package/build/components/UpLinks/UpLinks.js.map +1 -1
- package/build/components/UpLinks/UplinkLink.js +17 -12
- package/build/components/UpLinks/UplinkLink.js.map +1 -1
- package/build/components/UpLinks/index.js +13 -1
- package/build/components/UpLinks/index.js.map +1 -1
- package/build/components/UpLinks/styles.d.ts +1 -2
- package/build/components/UpLinks/styles.js +26 -20
- package/build/components/UpLinks/styles.js.map +1 -1
- package/build/components/Versions/HistoryList.d.ts +1 -1
- package/build/components/Versions/HistoryList.js +44 -37
- package/build/components/Versions/HistoryList.js.map +1 -1
- package/build/components/Versions/TagList.d.ts +1 -1
- package/build/components/Versions/TagList.js +33 -26
- package/build/components/Versions/TagList.js.map +1 -1
- package/build/components/Versions/Versions.js +67 -50
- package/build/components/Versions/Versions.js.map +1 -1
- package/build/components/Versions/index.js +13 -1
- package/build/components/Versions/index.js.map +1 -1
- package/build/components/Versions/styles.d.ts +1 -2
- package/build/components/Versions/styles.js +19 -15
- package/build/components/Versions/styles.js.map +1 -1
- package/build/components/Versions/types.d.ts +1 -1
- package/build/components/Versions/types.js +5 -1
- package/build/components/Versions/types.js.map +1 -1
- package/build/configuration.d.ts +2 -0
- package/build/configuration.js +23 -0
- package/build/configuration.js.map +1 -0
- package/build/hooks/index.js +20 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useLocalStorage.js +31 -18
- package/build/hooks/useLocalStorage.js.map +1 -1
- package/build/hooks/useOnClickOutside.d.ts +1 -1
- package/build/hooks/useOnClickOutside.js +10 -5
- package/build/hooks/useOnClickOutside.js.map +1 -1
- package/build/index.d.ts +6 -14
- package/build/index.js +481 -66
- package/build/index.js.map +1 -1
- package/build/layouts/Security/Dialog.js +16 -11
- package/build/layouts/Security/Dialog.js.map +1 -1
- package/build/layouts/Version/Version.js +16 -9
- package/build/layouts/Version/Version.js.map +1 -1
- package/build/layouts/Version/index.js +13 -1
- package/build/layouts/Version/index.js.map +1 -1
- package/build/pages/Front/Home.d.ts +2 -0
- package/build/pages/Front/Home.js +9 -0
- package/build/pages/Front/Home.js.map +1 -0
- package/build/pages/Front/index.js +14 -0
- package/build/pages/Front/index.js.map +1 -0
- package/build/pages/Security/AddUser.d.ts +2 -0
- package/build/pages/Security/AddUser.js +9 -0
- package/build/pages/Security/AddUser.js.map +1 -0
- package/build/pages/Security/ChangePassword.d.ts +2 -0
- package/build/pages/Security/ChangePassword.js +9 -0
- package/build/pages/Security/ChangePassword.js.map +1 -0
- package/build/pages/Security/Login.d.ts +2 -0
- package/build/pages/Security/Login.js +9 -0
- package/build/pages/Security/Login.js.map +1 -0
- package/build/pages/Security/Success.d.ts +2 -0
- package/build/pages/Security/Success.js +9 -0
- package/build/pages/Security/Success.js.map +1 -0
- package/build/pages/Security/index.js +35 -0
- package/build/pages/Security/index.js.map +1 -0
- package/build/pages/Version/Version.js +32 -0
- package/build/pages/Version/Version.js.map +1 -0
- package/build/pages/Version/index.js +14 -0
- package/build/pages/Version/index.js.map +1 -0
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.d.ts +8 -6
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +67 -46
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js.map +1 -1
- package/build/providers/AppConfigurationProvider/index.d.ts +1 -1
- package/build/providers/AppConfigurationProvider/index.js +18 -1
- package/build/providers/AppConfigurationProvider/index.js.map +1 -1
- package/build/providers/AuthProvider/AuthProvider.d.ts +18 -0
- package/build/providers/AuthProvider/AuthProvider.js +102 -0
- package/build/providers/AuthProvider/AuthProvider.js.map +1 -0
- package/build/providers/AuthProvider/index.d.ts +1 -0
- package/build/providers/AuthProvider/index.js +17 -0
- package/build/providers/AuthProvider/index.js.map +1 -0
- package/build/providers/AuthProvider/types.d.ts +15 -0
- package/build/providers/AuthProvider/types.js +6 -0
- package/build/providers/AuthProvider/types.js.map +1 -0
- package/build/providers/AuthProvider/utils.d.ts +3 -0
- package/build/providers/AuthProvider/utils.js +27 -0
- package/build/providers/AuthProvider/utils.js.map +1 -0
- package/build/providers/DownloadProvider/DownloadProvider.d.ts +13 -0
- package/build/providers/DownloadProvider/DownloadProvider.js +73 -0
- package/build/providers/DownloadProvider/DownloadProvider.js.map +1 -0
- package/build/providers/DownloadProvider/index.d.ts +1 -0
- package/build/providers/DownloadProvider/index.js +19 -0
- package/build/providers/DownloadProvider/index.js.map +1 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.d.ts +26 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.js +33 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.js.map +1 -0
- package/build/providers/ManifestsProvider/README.md +22 -0
- package/build/providers/ManifestsProvider/index.d.ts +1 -0
- package/build/providers/ManifestsProvider/index.js +21 -0
- package/build/providers/ManifestsProvider/index.js.map +1 -0
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.d.ts +3 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +39 -17
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js.map +1 -1
- package/build/providers/PersistenceSettingProvider/index.d.ts +1 -1
- package/build/providers/PersistenceSettingProvider/index.js +18 -1
- package/build/providers/PersistenceSettingProvider/index.js.map +1 -1
- package/build/providers/SearchProvider/SearchProvider.d.ts +19 -0
- package/build/providers/SearchProvider/SearchProvider.js +97 -0
- package/build/providers/SearchProvider/SearchProvider.js.map +1 -0
- package/build/providers/SearchProvider/index.d.ts +1 -0
- package/build/providers/SearchProvider/index.js +25 -0
- package/build/providers/SearchProvider/index.js.map +1 -0
- package/build/providers/TranslatorProvider/TranslatorProvider.d.ts +3 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.js +52 -25
- package/build/providers/TranslatorProvider/TranslatorProvider.js.map +1 -1
- package/build/providers/TranslatorProvider/index.js +20 -1
- package/build/providers/TranslatorProvider/index.js.map +1 -1
- package/build/providers/VersionProvider/VersionProvider.d.ts +13 -31
- package/build/providers/VersionProvider/VersionProvider.js +55 -69
- package/build/providers/VersionProvider/VersionProvider.js.map +1 -1
- package/build/providers/VersionProvider/index.js +20 -1
- package/build/providers/VersionProvider/index.js.map +1 -1
- package/build/providers/index.d.ts +5 -0
- package/build/providers/index.js +93 -3
- package/build/providers/index.js.map +1 -1
- package/build/routes/SecurityRoutes.d.ts +3 -0
- package/build/routes/SecurityRoutes.js +36 -0
- package/build/routes/SecurityRoutes.js.map +1 -0
- package/build/sections/Detail/ContainerContent.js +40 -22
- package/build/sections/Detail/ContainerContent.js.map +1 -1
- package/build/sections/Detail/Detail.js +42 -23
- package/build/sections/Detail/Detail.js.map +1 -1
- package/build/sections/Detail/ReadmeSection.js +13 -8
- package/build/sections/Detail/ReadmeSection.js.map +1 -1
- package/build/sections/Detail/Tabs.js +29 -23
- package/build/sections/Detail/Tabs.js.map +1 -1
- package/build/sections/Detail/index.js +13 -1
- package/build/sections/Detail/index.js.map +1 -1
- package/build/sections/Footer/Footer.js +62 -61
- package/build/sections/Footer/Footer.js.map +1 -1
- package/build/sections/Footer/index.js +13 -1
- package/build/sections/Footer/index.js.map +1 -1
- package/build/sections/Footer/styles.d.ts +1 -2
- package/build/sections/Footer/styles.js +47 -47
- package/build/sections/Footer/styles.js.map +1 -1
- package/build/sections/Header/Header.js +106 -65
- package/build/sections/Header/Header.js.map +1 -1
- package/build/sections/Header/HeaderGreetings.js +17 -13
- package/build/sections/Header/HeaderGreetings.js.map +1 -1
- package/build/sections/Header/HeaderLeft.js +19 -14
- package/build/sections/Header/HeaderLeft.js.map +1 -1
- package/build/sections/Header/HeaderMenu.d.ts +2 -1
- package/build/sections/Header/HeaderMenu.js +29 -24
- package/build/sections/Header/HeaderMenu.js.map +1 -1
- package/build/sections/Header/HeaderRight.js +61 -44
- package/build/sections/Header/HeaderRight.js.map +1 -1
- package/build/sections/Header/HeaderSettingsDialog.js +58 -53
- package/build/sections/Header/HeaderSettingsDialog.js.map +1 -1
- package/build/sections/Header/HeaderToolTip.d.ts +1 -1
- package/build/sections/Header/HeaderToolTip.js +14 -9
- package/build/sections/Header/HeaderToolTip.js.map +1 -1
- package/build/sections/Header/HeaderToolTipIcon.d.ts +4 -1
- package/build/sections/Header/HeaderToolTipIcon.js +30 -26
- package/build/sections/Header/HeaderToolTipIcon.js.map +1 -1
- package/build/sections/Header/LanguageSwitch.js +64 -56
- package/build/sections/Header/LanguageSwitch.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +2 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +77 -74
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/index.js +13 -1
- package/build/sections/Header/RegistryInfoContent/index.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.d.ts +1 -2
- package/build/sections/Header/RegistryInfoContent/styles.js +20 -13
- package/build/sections/Header/RegistryInfoContent/styles.js.map +1 -1
- package/build/sections/Header/index.js +13 -1
- package/build/sections/Header/index.js.map +1 -1
- package/build/sections/Header/styles.d.ts +1 -2
- package/build/sections/Header/styles.js +60 -50
- package/build/sections/Header/styles.js.map +1 -1
- package/build/sections/Home/Home.js +19 -19
- package/build/sections/Home/Home.js.map +1 -1
- package/build/sections/Home/index.js +13 -1
- package/build/sections/Home/index.js.map +1 -1
- package/build/sections/Security/AddUser.js +146 -85
- package/build/sections/Security/AddUser.js.map +1 -1
- package/build/sections/Security/ChangePassword.js +150 -95
- package/build/sections/Security/ChangePassword.js.map +1 -1
- package/build/sections/Security/Login.js +126 -87
- package/build/sections/Security/Login.js.map +1 -1
- package/build/sections/Security/Success.js +25 -19
- package/build/sections/Security/Success.js.map +1 -1
- package/build/sections/Security/index.js +34 -4
- package/build/sections/Security/index.js.map +1 -1
- package/build/sections/Security/styles.js +15 -15
- package/build/sections/Security/styles.js.map +1 -1
- package/build/sections/Security/utils.js +16 -8
- package/build/sections/Security/utils.js.map +1 -1
- package/build/sections/SideBar/Sidebar.js +49 -40
- package/build/sections/SideBar/Sidebar.js.map +1 -1
- package/build/sections/SideBar/index.js +13 -1
- package/build/sections/SideBar/index.js.map +1 -1
- package/build/sections/index.js +20 -2
- package/build/sections/index.js.map +1 -1
- package/build/store/api.d.ts +1 -1
- package/build/store/api.js +89 -48
- package/build/store/api.js.map +1 -1
- package/build/store/index.d.ts +0 -6
- package/build/store/index.js +13 -2
- package/build/store/index.js.map +1 -1
- package/build/store/{models/routes.d.ts → routes.d.ts} +4 -0
- package/build/store/{models/routes.js → routes.js} +11 -1
- package/build/store/routes.js.map +1 -0
- package/build/store/storage.d.ts +6 -0
- package/build/store/storage.js +28 -4
- package/build/store/storage.js.map +1 -1
- package/build/store/utils.js +14 -0
- package/build/store/utils.js.map +1 -0
- package/build/test/i18n-config.js +12 -4
- package/build/test/i18n-config.js.map +1 -1
- package/build/test/test-react-testing-library.d.ts +19 -4
- package/build/test/test-react-testing-library.js +140 -28
- package/build/test/test-react-testing-library.js.map +1 -1
- package/build/types/external-modules.d.js +2 -0
- package/build/types/external-modules.d.js.map +1 -0
- package/build/types/index.d.ts +1 -1
- package/build/types/index.js +5 -1
- package/build/types/index.js.map +1 -1
- package/build/types/packageMeta.d.ts +1 -6
- package/build/types/packageMeta.js +5 -1
- package/build/types/packageMeta.js.map +1 -1
- package/build/utils/cli-utils.d.ts +1 -1
- package/build/utils/cli-utils.js +30 -18
- package/build/utils/cli-utils.js.map +1 -1
- package/build/utils/index.js +74 -8
- package/build/utils/index.js.map +1 -1
- package/build/utils/loadable.js +15 -7
- package/build/utils/loadable.js.map +1 -1
- package/build/utils/routes.d.ts +11 -3
- package/build/utils/routes.js +20 -4
- package/build/utils/routes.js.map +1 -1
- package/build/utils/schemas.d.ts +34 -0
- package/build/utils/schemas.js +30 -0
- package/build/utils/schemas.js.map +1 -0
- package/build/utils/token-generate.js +17 -6
- package/build/utils/token-generate.js.map +1 -1
- package/build/utils/token.js +23 -9
- package/build/utils/token.js.map +1 -1
- package/build/utils/url.js +20 -10
- package/build/utils/url.js.map +1 -1
- package/build/utils/utils.d.ts +2 -2
- package/build/utils/utils.js +48 -29
- package/build/utils/utils.js.map +1 -1
- package/package.json +28 -29
- package/build/AppTest/pages/Front/Home.d.ts +0 -2
- package/build/AppTest/pages/Front/Home.js +0 -3
- package/build/AppTest/pages/Front/Home.js.map +0 -1
- package/build/AppTest/pages/Front/index.js +0 -2
- package/build/AppTest/pages/Front/index.js.map +0 -1
- package/build/AppTest/pages/Security/AddUser.d.ts +0 -2
- package/build/AppTest/pages/Security/AddUser.js +0 -3
- package/build/AppTest/pages/Security/AddUser.js.map +0 -1
- package/build/AppTest/pages/Security/ChangePassword.d.ts +0 -2
- package/build/AppTest/pages/Security/ChangePassword.js +0 -3
- package/build/AppTest/pages/Security/ChangePassword.js.map +0 -1
- package/build/AppTest/pages/Security/Login.d.ts +0 -2
- package/build/AppTest/pages/Security/Login.js +0 -3
- package/build/AppTest/pages/Security/Login.js.map +0 -1
- package/build/AppTest/pages/Security/Success.d.ts +0 -2
- package/build/AppTest/pages/Security/Success.js +0 -3
- package/build/AppTest/pages/Security/Success.js.map +0 -1
- package/build/AppTest/pages/Security/index.js +0 -5
- package/build/AppTest/pages/Security/index.js.map +0 -1
- package/build/AppTest/pages/Version/Version.js +0 -27
- package/build/AppTest/pages/Version/Version.js.map +0 -1
- package/build/AppTest/pages/Version/index.js +0 -2
- package/build/AppTest/pages/Version/index.js.map +0 -1
- package/build/components/LoginDialog/LoginDialogHeader.d.ts +0 -6
- package/build/components/LoginDialog/LoginDialogHeader.js +0 -59
- package/build/components/LoginDialog/LoginDialogHeader.js.map +0 -1
- package/build/components/TextField/TextField.d.ts +0 -3
- package/build/components/TextField/TextField.js +0 -30
- package/build/components/TextField/TextField.js.map +0 -1
- package/build/components/TextField/index.d.ts +0 -1
- package/build/components/TextField/index.js +0 -2
- package/build/components/TextField/index.js.map +0 -1
- package/build/sections/Security/LoginError.d.ts +0 -7
- package/build/sections/Security/LoginError.js +0 -38
- package/build/sections/Security/LoginError.js.map +0 -1
- package/build/store/models/add-user.d.ts +0 -45
- package/build/store/models/add-user.js +0 -103
- package/build/store/models/add-user.js.map +0 -1
- package/build/store/models/change-password.d.ts +0 -44
- package/build/store/models/change-password.js +0 -118
- package/build/store/models/change-password.js.map +0 -1
- package/build/store/models/configuration.d.ts +0 -24
- package/build/store/models/configuration.js +0 -46
- package/build/store/models/configuration.js.map +0 -1
- package/build/store/models/download.d.ts +0 -16
- package/build/store/models/download.js +0 -38
- package/build/store/models/download.js.map +0 -1
- package/build/store/models/index.d.ts +0 -22
- package/build/store/models/index.js +0 -21
- package/build/store/models/index.js.map +0 -1
- package/build/store/models/login-v1.d.ts +0 -44
- package/build/store/models/login-v1.js +0 -111
- package/build/store/models/login-v1.js.map +0 -1
- package/build/store/models/login.d.ts +0 -69
- package/build/store/models/login.js +0 -102
- package/build/store/models/login.js.map +0 -1
- package/build/store/models/manifest.d.ts +0 -54
- package/build/store/models/manifest.js +0 -117
- package/build/store/models/manifest.js.map +0 -1
- package/build/store/models/packages.d.ts +0 -28
- package/build/store/models/packages.js +0 -47
- package/build/store/models/packages.js.map +0 -1
- package/build/store/models/routes.js.map +0 -1
- package/build/store/models/search.d.ts +0 -42
- package/build/store/models/search.js +0 -92
- package/build/store/models/search.js.map +0 -1
- package/build/store/models/utils.js +0 -7
- package/build/store/models/utils.js.map +0 -1
- package/build/store/store.d.ts +0 -9
- package/build/store/store.js +0 -8
- package/build/store/store.js.map +0 -1
- /package/build/{AppTest/pages → pages}/Front/index.d.ts +0 -0
- /package/build/{AppTest/pages → pages}/Security/index.d.ts +0 -0
- /package/build/{AppTest/pages → pages}/Version/Version.d.ts +0 -0
- /package/build/{AppTest/pages → pages}/Version/index.d.ts +0 -0
- /package/build/store/{models/utils.d.ts → utils.d.ts} +0 -0
|
@@ -1,120 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _yup = require("@hookform/resolvers/yup");
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _reactHookForm = require("react-hook-form");
|
|
12
|
+
var _reactI18next = require("react-i18next");
|
|
13
|
+
var _reactRouter = require("react-router");
|
|
14
|
+
var _useDataMutation2 = require("../../api/use-data-mutation");
|
|
15
|
+
var _LoginDialogFormError = _interopRequireDefault(require("../../components/LoginDialog/LoginDialogFormError"));
|
|
16
|
+
var _PasswordField = _interopRequireDefault(require("../../components/LoginForm/PasswordField"));
|
|
17
|
+
var _UsernameField = _interopRequireDefault(require("../../components/LoginForm/UsernameField"));
|
|
18
|
+
var _configuration = require("../../configuration");
|
|
19
|
+
var _Dialog = _interopRequireDefault(require("../../layouts/Security/Dialog"));
|
|
20
|
+
var _utils = require("../../providers/AuthProvider/utils");
|
|
21
|
+
var _utils2 = require("../../store/utils");
|
|
22
|
+
var _utils3 = require("../../utils");
|
|
23
|
+
var _schemas = require("../../utils/schemas");
|
|
24
|
+
var _Success = require("./Success");
|
|
25
|
+
var _styles = require("./styles");
|
|
26
|
+
var _utils4 = require("./utils");
|
|
27
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
29
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
30
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
31
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
1
32
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
2
33
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
var AddUser = function AddUser() {
|
|
35
|
+
var _configuration$flags;
|
|
36
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
37
|
+
t = _useTranslation.t;
|
|
38
|
+
var location = (0, _reactRouter.useLocation)();
|
|
39
|
+
var navigate = (0, _reactRouter.useNavigate)();
|
|
40
|
+
var configuration = (0, _configuration.getConfiguration)();
|
|
41
|
+
var basePath = (0, _utils2.stripTrailingSlash)(configuration.base);
|
|
42
|
+
var _getSecurityUrlParams = (0, _utils4.getSecurityUrlParams)(location),
|
|
43
|
+
next = _getSecurityUrlParams.next,
|
|
44
|
+
user = _getSecurityUrlParams.user;
|
|
45
|
+
var loginLink = _utils3.Route.LOGIN + (next ? "?next=".concat(encodeURIComponent(next)) : '');
|
|
46
|
+
var createUserEnabled = configuration === null || configuration === void 0 || (_configuration$flags = configuration.flags) === null || _configuration$flags === void 0 ? void 0 : _configuration$flags.createUser;
|
|
47
|
+
var form = (0, _reactHookForm.useForm)({
|
|
48
|
+
mode: 'onChange',
|
|
49
|
+
defaultValues: {
|
|
50
|
+
username: typeof user === 'string' ? user : '',
|
|
51
|
+
password: '',
|
|
52
|
+
email: ''
|
|
53
|
+
},
|
|
54
|
+
resolver: (0, _yup.yupResolver)(_schemas.addUserSchema)
|
|
55
|
+
});
|
|
56
|
+
var setError = form.setError,
|
|
57
|
+
handleSubmit = form.handleSubmit,
|
|
58
|
+
register = form.register,
|
|
59
|
+
watch = form.watch,
|
|
60
|
+
_form$formState = form.formState,
|
|
61
|
+
isValid = _form$formState.isValid,
|
|
62
|
+
errors = _form$formState.errors;
|
|
63
|
+
var username = watch('username');
|
|
64
|
+
var addUserLink = "".concat(_utils3.Route.ADD_USER, ":").concat(encodeURIComponent(username));
|
|
65
|
+
var _useDataMutation = (0, _useDataMutation2.useDataMutation)(basePath, addUserLink, 'PUT'),
|
|
66
|
+
trigger = _useDataMutation.trigger;
|
|
67
|
+
var handleAddUser = (0, _react.useCallback)(/*#__PURE__*/function () {
|
|
68
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(body) {
|
|
69
|
+
var _t;
|
|
70
|
+
return _regenerator().w(function (_context) {
|
|
71
|
+
while (1) switch (_context.p = _context.n) {
|
|
72
|
+
case 0:
|
|
73
|
+
_context.p = 0;
|
|
74
|
+
_context.n = 1;
|
|
75
|
+
return trigger(body);
|
|
76
|
+
case 1:
|
|
77
|
+
_context.n = 3;
|
|
78
|
+
break;
|
|
79
|
+
case 2:
|
|
80
|
+
_context.p = 2;
|
|
81
|
+
_t = _context.v;
|
|
82
|
+
throw (0, _utils.normalizeAuthError)(_t);
|
|
83
|
+
case 3:
|
|
84
|
+
return _context.a(2);
|
|
85
|
+
}
|
|
86
|
+
}, _callee, null, [[0, 2]]);
|
|
87
|
+
}));
|
|
88
|
+
return function (_x) {
|
|
56
89
|
return _ref.apply(this, arguments);
|
|
57
90
|
};
|
|
58
|
-
}();
|
|
59
|
-
|
|
91
|
+
}(), [trigger]);
|
|
92
|
+
var onSubmit = (0, _react.useCallback)(/*#__PURE__*/function () {
|
|
93
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(data) {
|
|
94
|
+
var _t2;
|
|
95
|
+
return _regenerator().w(function (_context2) {
|
|
96
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
97
|
+
case 0:
|
|
98
|
+
_context2.p = 0;
|
|
99
|
+
_context2.n = 1;
|
|
100
|
+
return handleAddUser({
|
|
101
|
+
name: data.username,
|
|
102
|
+
password: data.password,
|
|
103
|
+
email: data.email
|
|
104
|
+
});
|
|
105
|
+
case 1:
|
|
106
|
+
navigate("".concat(_utils3.Route.SUCCESS, "?messageType=").concat(_Success.MessageType.AddUser));
|
|
107
|
+
_context2.n = 3;
|
|
108
|
+
break;
|
|
109
|
+
case 2:
|
|
110
|
+
_context2.p = 2;
|
|
111
|
+
_t2 = _context2.v;
|
|
112
|
+
setError('root', {
|
|
113
|
+
type: 'server',
|
|
114
|
+
// TODO: add translation key
|
|
115
|
+
message: 'Failed to create user'
|
|
116
|
+
});
|
|
117
|
+
case 3:
|
|
118
|
+
return _context2.a(2);
|
|
119
|
+
}
|
|
120
|
+
}, _callee2, null, [[0, 2]]);
|
|
121
|
+
}));
|
|
122
|
+
return function (_x2) {
|
|
123
|
+
return _ref2.apply(this, arguments);
|
|
124
|
+
};
|
|
125
|
+
}(), [handleAddUser, setError, navigate]);
|
|
126
|
+
(0, _react.useEffect)(function () {
|
|
127
|
+
if (!createUserEnabled) {
|
|
128
|
+
navigate('/');
|
|
129
|
+
}
|
|
130
|
+
}, [createUserEnabled, navigate]);
|
|
131
|
+
return createUserEnabled ? /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_styles.SecurityContainer, null, /*#__PURE__*/_react["default"].createElement(_styles.SecurityForm, {
|
|
60
132
|
component: "form",
|
|
61
|
-
onSubmit: handleSubmit
|
|
62
|
-
}, /*#__PURE__*/
|
|
133
|
+
onSubmit: handleSubmit(onSubmit)
|
|
134
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
|
|
63
135
|
align: "center",
|
|
64
136
|
component: "h1",
|
|
65
137
|
gutterBottom: true,
|
|
66
138
|
variant: "h4"
|
|
67
|
-
}, t('security.addUser.title')), /*#__PURE__*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}), /*#__PURE__*/React.createElement(SecurityTextField, {
|
|
75
|
-
error: !!addUserStore.error,
|
|
76
|
-
inputRef: passwordRef,
|
|
77
|
-
label: t('security.addUser.password'),
|
|
78
|
-
onChange: e => setPassword(e.target.value),
|
|
79
|
-
required: true,
|
|
80
|
-
type: "password",
|
|
81
|
-
value: password
|
|
82
|
-
}), /*#__PURE__*/React.createElement(SecurityTextField, {
|
|
83
|
-
error: !!addUserStore.error,
|
|
139
|
+
}, t('security.addUser.title')), /*#__PURE__*/_react["default"].createElement(_UsernameField["default"], {
|
|
140
|
+
errors: errors,
|
|
141
|
+
register: register
|
|
142
|
+
}), /*#__PURE__*/_react["default"].createElement(_PasswordField["default"], {
|
|
143
|
+
errors: errors,
|
|
144
|
+
register: register
|
|
145
|
+
}), /*#__PURE__*/_react["default"].createElement(_styles.SecurityTextField, _extends({
|
|
84
146
|
label: t('security.addUser.email'),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
value: email
|
|
88
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
147
|
+
type: "email"
|
|
148
|
+
}, register('email'))), /*#__PURE__*/_react["default"].createElement(_material.Typography, {
|
|
89
149
|
color: "text.secondary",
|
|
90
150
|
paragraph: true,
|
|
91
151
|
sx: {
|
|
92
152
|
fontSize: 12
|
|
93
153
|
},
|
|
94
154
|
variant: "body2"
|
|
95
|
-
}, t('security.addUser.emailDescription')),
|
|
96
|
-
error:
|
|
97
|
-
}), /*#__PURE__*/
|
|
155
|
+
}, t('security.addUser.emailDescription')), errors.root && /*#__PURE__*/_react["default"].createElement(_LoginDialogFormError["default"], {
|
|
156
|
+
error: errors.root
|
|
157
|
+
}), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
98
158
|
color: "primary",
|
|
159
|
+
disabled: !isValid,
|
|
99
160
|
fullWidth: true,
|
|
100
161
|
sx: {
|
|
101
162
|
mt: 2
|
|
102
163
|
},
|
|
103
164
|
type: "submit",
|
|
104
165
|
variant: "contained"
|
|
105
|
-
}, t('security.addUser.submit')), /*#__PURE__*/
|
|
166
|
+
}, t('security.addUser.submit')), /*#__PURE__*/_react["default"].createElement(_material.Typography, {
|
|
106
167
|
align: "center",
|
|
107
168
|
sx: {
|
|
108
169
|
mt: 2,
|
|
109
170
|
fontSize: 12
|
|
110
171
|
},
|
|
111
172
|
variant: "body2"
|
|
112
|
-
}, t('security.addUser.alreadyUserQuestion'), /*#__PURE__*/
|
|
173
|
+
}, t('security.addUser.alreadyUserQuestion'), /*#__PURE__*/_react["default"].createElement(_material.Link, {
|
|
113
174
|
href: loginLink,
|
|
114
175
|
sx: {
|
|
115
176
|
ml: 1
|
|
116
177
|
}
|
|
117
|
-
}, t('security.addUser.login'))))));
|
|
178
|
+
}, t('security.addUser.login')))))) : null;
|
|
118
179
|
};
|
|
119
|
-
|
|
180
|
+
var _default = exports["default"] = AddUser;
|
|
120
181
|
//# sourceMappingURL=AddUser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddUser.js","names":["Button","Link","Typography","React","useEffect","useRef","useTranslation","useDispatch","useSelector","useLocation","SecurityLayout","Route","LoginError","MessageType","SecurityContainer","SecurityForm","SecurityTextField","getSecurityUrlParams","validateCredentials","AddUser","t","dispatch","addUserStore","state","addUser","usernameRef","passwordRef","location","next","user","loginLink","LOGIN","username","setUsername","useState","password","setPassword","email","setEmail","_passwordRef$current","current","focus","_usernameRef$current","handleSubmit","_ref","_asyncToGenerator","e","preventDefault","clearError","addError","register","messageType","_x","apply","arguments","createElement","component","onSubmit","align","gutterBottom","variant","error","inputRef","label","onChange","target","value","required","type","color","paragraph","sx","fontSize","fullWidth","mt","href","ml"],"sources":["../../../src/sections/Security/AddUser.tsx"],"sourcesContent":["import { Button, Link, Typography } from '@mui/material';\nimport React, { useEffect, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useLocation } from 'react-router-dom';\n\nimport SecurityLayout from '../../layouts/Security/Dialog';\nimport { Dispatch, RootState } from '../../store';\nimport { Route } from '../../utils';\nimport LoginError from './LoginError';\nimport { MessageType } from './Success';\nimport { SecurityContainer, SecurityForm, SecurityTextField } from './styles';\nimport { getSecurityUrlParams, validateCredentials } from './utils';\n\nconst AddUser: React.FC = () => {\n const { t } = useTranslation();\n const dispatch = useDispatch<Dispatch>();\n const addUserStore = useSelector((state: RootState) => state.addUser);\n const usernameRef = useRef<HTMLInputElement>(null);\n const passwordRef = useRef<HTMLInputElement>(null);\n\n const location = useLocation();\n const { next, user } = getSecurityUrlParams(location);\n const loginLink = Route.LOGIN + (next ? '?next=' + next : '');\n\n const [username, setUsername] = React.useState(user);\n const [password, setPassword] = React.useState('');\n const [email, setEmail] = React.useState('');\n\n useEffect(() => {\n if (username) {\n passwordRef.current?.focus();\n } else {\n usernameRef.current?.focus();\n }\n }, [username]);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n dispatch.addUser.clearError();\n\n if (!validateCredentials(username, password, t, dispatch.addUser.addError)) {\n return;\n }\n\n await dispatch.addUser.register({\n username: username,\n password,\n email,\n next,\n messageType: MessageType.AddUser,\n });\n };\n\n return (\n <SecurityLayout>\n <SecurityContainer>\n <SecurityForm component=\"form\" onSubmit={handleSubmit}>\n <Typography align=\"center\" component=\"h1\" gutterBottom={true} variant=\"h4\">\n {t('security.addUser.title')}\n </Typography>\n <SecurityTextField\n error={!!addUserStore.error}\n inputRef={usernameRef}\n label={t('security.addUser.username')}\n onChange={(e) => setUsername(e.target.value)}\n required={true}\n value={username}\n />\n <SecurityTextField\n error={!!addUserStore.error}\n inputRef={passwordRef}\n label={t('security.addUser.password')}\n onChange={(e) => setPassword(e.target.value)}\n required={true}\n type=\"password\"\n value={password}\n />\n <SecurityTextField\n error={!!addUserStore.error}\n label={t('security.addUser.email')}\n onChange={(e) => setEmail(e.target.value)}\n type=\"email\"\n value={email}\n />\n <Typography color=\"text.secondary\" paragraph={true} sx={{ fontSize: 12 }} variant=\"body2\">\n {t('security.addUser.emailDescription')}\n </Typography>\n {addUserStore.error && <LoginError error={addUserStore.error} />}\n <Button color=\"primary\" fullWidth={true} sx={{ mt: 2 }} type=\"submit\" variant=\"contained\">\n {t('security.addUser.submit')}\n </Button>\n <Typography align=\"center\" sx={{ mt: 2, fontSize: 12 }} variant=\"body2\">\n {t('security.addUser.alreadyUserQuestion')}\n <Link href={loginLink} sx={{ ml: 1 }}>\n {t('security.addUser.login')}\n </Link>\n </Typography>\n </SecurityForm>\n </SecurityContainer>\n </SecurityLayout>\n );\n};\n\nexport default AddUser;\n"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AACxD,OAAOC,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,iBAAiB,EAAEC,YAAY,EAAEC,iBAAiB,QAAQ,UAAU;AAC7E,SAASC,oBAAoB,EAAEC,mBAAmB,QAAQ,SAAS;AAEnE,IAAMC,OAAiB,GAAGA,CAAA,KAAM;EAC9B,IAAM;IAAEC;EAAE,CAAC,GAAGd,cAAc,CAAC,CAAC;EAC9B,IAAMe,QAAQ,GAAGd,WAAW,CAAW,CAAC;EACxC,IAAMe,YAAY,GAAGd,WAAW,CAAEe,KAAgB,IAAKA,KAAK,CAACC,OAAO,CAAC;EACrE,IAAMC,WAAW,GAAGpB,MAAM,CAAmB,IAAI,CAAC;EAClD,IAAMqB,WAAW,GAAGrB,MAAM,CAAmB,IAAI,CAAC;EAElD,IAAMsB,QAAQ,GAAGlB,WAAW,CAAC,CAAC;EAC9B,IAAM;IAAEmB,IAAI;IAAEC;EAAK,CAAC,GAAGZ,oBAAoB,CAACU,QAAQ,CAAC;EACrD,IAAMG,SAAS,GAAGnB,KAAK,CAACoB,KAAK,IAAIH,IAAI,GAAG,QAAQ,GAAGA,IAAI,GAAG,EAAE,CAAC;EAE7D,IAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAG9B,KAA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;IAC1CE,IAAI,EAAC,OAAO;IACZF,KAAK,EAAE7B;EAAM,CACd,CAAC,eACFlC,KAAA,CAAAoD,aAAA,CAACrD,UAAU;IAACmE,KAAK,EAAC,gBAAgB;IAACC,SAAS,EAAE,IAAK;IAACC,EAAE,EAAE;MAAEC,QAAQ,EAAE;IAAG,CAAE;IAACZ,OAAO,EAAC;EAAO,GACtFxC,CAAC,CAAC,mCAAmC,CAC5B,CAAC,EACZE,YAAY,CAACuC,KAAK,iBAAI1D,KAAA,CAAAoD,aAAA,CAAC3C,UAAU;IAACiD,KAAK,EAAEvC,YAAY,CAACuC;EAAM,CAAE,CAAC,eAChE1D,KAAA,CAAAoD,aAAA,CAACvD,MAAM;IAACqE,KAAK,EAAC,SAAS;IAACI,SAAS,EAAE,IAAK;IAACF,EAAE,EAAE;MAAEG,EAAE,EAAE;IAAE,CAAE;IAACN,IAAI,EAAC,QAAQ;IAACR,OAAO,EAAC;EAAW,GACtFxC,CAAC,CAAC,yBAAyB,CACtB,CAAC,eACTjB,KAAA,CAAAoD,aAAA,CAACrD,UAAU;IAACwD,KAAK,EAAC,QAAQ;IAACa,EAAE,EAAE;MAAEG,EAAE,EAAE,CAAC;MAAEF,QAAQ,EAAE;IAAG,CAAE;IAACZ,OAAO,EAAC;EAAO,GACpExC,CAAC,CAAC,sCAAsC,CAAC,eAC1CjB,KAAA,CAAAoD,aAAA,CAACtD,IAAI;IAAC0E,IAAI,EAAE7C,SAAU;IAACyC,EAAE,EAAE;MAAEK,EAAE,EAAE;IAAE;EAAE,GAClCxD,CAAC,CAAC,wBAAwB,CACvB,CACI,CACA,CACG,CACL,CAAC;AAErB,CAAC;AAED,eAAeD,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"AddUser.js","names":["_yup","require","_material","_react","_interopRequireWildcard","_reactHookForm","_reactI18next","_reactRouter","_useDataMutation2","_LoginDialogFormError","_interopRequireDefault","_PasswordField","_UsernameField","_configuration","_Dialog","_utils","_utils2","_utils3","_schemas","_Success","_styles","_utils4","e","__esModule","t","WeakMap","r","n","o","i","f","__proto__","_typeof","has","get","set","_t3","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_regenerator","Symbol","iterator","toStringTag","c","prototype","Generator","u","create","_regeneratorDefine2","p","y","G","v","a","d","l","TypeError","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","displayName","w","m","_regeneratorDefine","_invoke","enumerable","configurable","writable","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","_next","_throw","AddUser","_configuration$flags","_useTranslation","useTranslation","location","useLocation","navigate","useNavigate","configuration","getConfiguration","basePath","stripTrailingSlash","base","_getSecurityUrlParams","getSecurityUrlParams","next","user","loginLink","Route","LOGIN","concat","encodeURIComponent","createUserEnabled","flags","createUser","form","useForm","mode","defaultValues","username","password","email","resolver","yupResolver","addUserSchema","setError","handleSubmit","register","watch","_form$formState","formState","isValid","errors","addUserLink","ADD_USER","_useDataMutation","useDataMutation","trigger","handleAddUser","useCallback","_ref","_callee","body","_t","_context","normalizeAuthError","_x","onSubmit","_ref2","_callee2","data","_t2","_context2","name","SUCCESS","MessageType","type","message","_x2","useEffect","createElement","SecurityContainer","SecurityForm","component","Typography","align","gutterBottom","variant","SecurityTextField","label","color","paragraph","sx","fontSize","root","error","Button","disabled","fullWidth","mt","Link","href","ml","_default","exports"],"sources":["../../../src/sections/Security/AddUser.tsx"],"sourcesContent":["import { yupResolver } from '@hookform/resolvers/yup';\nimport { Button, Link, Typography } from '@mui/material';\nimport React, { useCallback, useEffect } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { useLocation, useNavigate } from 'react-router';\n\nimport { useDataMutation } from '../../api/use-data-mutation';\nimport LoginDialogFormError from '../../components/LoginDialog/LoginDialogFormError';\nimport PasswordField from '../../components/LoginForm/PasswordField';\nimport UsernameField from '../../components/LoginForm/UsernameField';\nimport { getConfiguration } from '../../configuration';\nimport SecurityLayout from '../../layouts/Security/Dialog';\nimport { normalizeAuthError } from '../../providers/AuthProvider/utils';\nimport { stripTrailingSlash } from '../../store/utils';\nimport { Route } from '../../utils';\nimport type { AddUserFormValues } from '../../utils/schemas';\nimport { addUserSchema } from '../../utils/schemas';\nimport { MessageType } from './Success';\nimport { SecurityContainer, SecurityForm, SecurityTextField } from './styles';\nimport { getSecurityUrlParams } from './utils';\n\ntype AddUserBody = {\n name: string;\n password: string;\n email?: string;\n};\n\nconst AddUser: React.FC = () => {\n const { t } = useTranslation();\n const location = useLocation();\n const navigate = useNavigate();\n const configuration = getConfiguration();\n const basePath = stripTrailingSlash(configuration.base);\n const { next, user } = getSecurityUrlParams(location);\n const loginLink = Route.LOGIN + (next ? `?next=${encodeURIComponent(next)}` : '');\n const createUserEnabled = configuration?.flags?.createUser;\n const form = useForm<AddUserFormValues>({\n mode: 'onChange',\n defaultValues: {\n username: typeof user === 'string' ? user : '',\n password: '',\n email: '',\n },\n resolver: yupResolver(addUserSchema),\n });\n\n const {\n setError,\n handleSubmit,\n register,\n watch,\n formState: { isValid, errors },\n } = form;\n\n const username = watch('username');\n\n const addUserLink = `${Route.ADD_USER}:${encodeURIComponent(username)}`;\n\n const { trigger } = useDataMutation<{ ok: string; token: string }>(basePath, addUserLink, 'PUT');\n\n const handleAddUser = useCallback(\n async (body: AddUserBody) => {\n try {\n await trigger(body);\n } catch (err) {\n throw normalizeAuthError(err);\n }\n },\n [trigger]\n );\n\n const onSubmit = useCallback(\n async (data: AddUserFormValues) => {\n try {\n await handleAddUser({\n name: data.username,\n password: data.password,\n email: data.email,\n });\n navigate(`${Route.SUCCESS}?messageType=${MessageType.AddUser}`);\n } catch {\n setError('root', {\n type: 'server',\n // TODO: add translation key\n message: 'Failed to create user',\n });\n }\n },\n [handleAddUser, setError, navigate]\n );\n\n useEffect(() => {\n if (!createUserEnabled) {\n navigate('/');\n }\n }, [createUserEnabled, navigate]);\n\n return createUserEnabled ? (\n <SecurityLayout>\n <SecurityContainer>\n <SecurityForm component=\"form\" onSubmit={handleSubmit(onSubmit)}>\n <Typography align=\"center\" component=\"h1\" gutterBottom={true} variant=\"h4\">\n {t('security.addUser.title')}\n </Typography>\n <UsernameField errors={errors} register={register} />\n <PasswordField errors={errors} register={register} />\n\n <SecurityTextField\n label={t('security.addUser.email')}\n type=\"email\"\n {...register('email')}\n />\n\n <Typography color=\"text.secondary\" paragraph={true} sx={{ fontSize: 12 }} variant=\"body2\">\n {t('security.addUser.emailDescription')}\n </Typography>\n {errors.root && <LoginDialogFormError error={errors.root} />}\n <Button\n color=\"primary\"\n disabled={!isValid}\n fullWidth={true}\n sx={{ mt: 2 }}\n type=\"submit\"\n variant=\"contained\"\n >\n {t('security.addUser.submit')}\n </Button>\n <Typography align=\"center\" sx={{ mt: 2, fontSize: 12 }} variant=\"body2\">\n {t('security.addUser.alreadyUserQuestion')}\n <Link href={loginLink} sx={{ ml: 1 }}>\n {t('security.addUser.login')}\n </Link>\n </Typography>\n </SecurityForm>\n </SecurityContainer>\n </SecurityLayout>\n ) : null;\n};\n\nexport default AddUser;\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAEA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,cAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,cAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,OAAA,GAAAf,OAAA;AACA,IAA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KAAK,EAAC,SAAS;IACfO,QAAQ,EAAE,CAAC9C,OAAQ;IACnB+C,SAAS,EAAE,IAAK;IAChBN,EAAE,EAAE;MAAEO,EAAE,EAAE;IAAE,CAAE;IACdvB,IAAI,EAAC,QAAQ;IACbW,OAAO,EAAC;EAAW,GAElB5I,CAAC,CAAC,yBAAyB,CACtB,CAAC,eACTrB,MAAA,YAAA0J,aAAA,CAAC3J,SAAA,CAAA+J,UAAU;IAACC,KAAK,EAAC,QAAQ;IAACO,EAAE,EAAE;MAAEO,EAAE,EAAE,CAAC;MAAEN,QAAQ,EAAE;IAAG,CAAE;IAACN,OAAO,EAAC;EAAO,GACpE5I,CAAC,CAAC,sCAAsC,CAAC,eAC1CrB,MAAA,YAAA0J,aAAA,CAAC3J,SAAA,CAAA+K,IAAI;IAACC,IAAI,EAAE1E,SAAU;IAACiE,EAAE,EAAE;MAAEU,EAAE,EAAE;IAAE;EAAE,GAClC3J,CAAC,CAAC,wBAAwB,CACvB,CACI,CACA,CACG,CACL,CAAC,GACf,IAAI;AACV,CAAC;AAAC,IAAA4J,QAAA,GAAAC,OAAA,cAEa9F,OAAO","ignoreList":[]}
|
|
@@ -1,116 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _yup = require("@hookform/resolvers/yup");
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _reactHookForm = require("react-hook-form");
|
|
12
|
+
var _reactI18next = require("react-i18next");
|
|
13
|
+
var _reactRouter = require("react-router");
|
|
14
|
+
var _useDataMutation2 = require("../../api/use-data-mutation");
|
|
15
|
+
var _LoginDialogFormError = _interopRequireDefault(require("../../components/LoginDialog/LoginDialogFormError"));
|
|
16
|
+
var _configuration = require("../../configuration");
|
|
17
|
+
var _Dialog = _interopRequireDefault(require("../../layouts/Security/Dialog"));
|
|
18
|
+
var _utils = require("../../providers/AuthProvider/utils");
|
|
19
|
+
var _utils2 = require("../../store/utils");
|
|
20
|
+
var _utils3 = require("../../utils");
|
|
21
|
+
var _routes = require("../../utils/routes");
|
|
22
|
+
var _schemas = require("../../utils/schemas");
|
|
23
|
+
var _Success = require("./Success");
|
|
24
|
+
var _styles = require("./styles");
|
|
25
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
26
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
27
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
28
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
29
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
1
30
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
2
31
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
description: t('security.error.password-mismatch')
|
|
52
|
-
});
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
yield dispatch.changePassword.updatePassword({
|
|
56
|
-
username,
|
|
57
|
-
oldPassword,
|
|
58
|
-
newPassword,
|
|
59
|
-
messageType: MessageType.ChangePassword
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
return function handleSubmit(_x) {
|
|
32
|
+
var ChangePassword = function ChangePassword() {
|
|
33
|
+
var _configuration$flags, _errors$username, _errors$oldPassword, _errors$newPassword, _errors$confirmPasswo;
|
|
34
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
35
|
+
t = _useTranslation.t;
|
|
36
|
+
var navigate = (0, _reactRouter.useNavigate)();
|
|
37
|
+
var configuration = (0, _configuration.getConfiguration)();
|
|
38
|
+
var basePath = (0, _utils2.stripTrailingSlash)(configuration.base);
|
|
39
|
+
var changePasswordEnabled = configuration === null || configuration === void 0 || (_configuration$flags = configuration.flags) === null || _configuration$flags === void 0 ? void 0 : _configuration$flags.changePassword;
|
|
40
|
+
var form = (0, _reactHookForm.useForm)({
|
|
41
|
+
mode: 'onChange',
|
|
42
|
+
defaultValues: {
|
|
43
|
+
username: '',
|
|
44
|
+
oldPassword: '',
|
|
45
|
+
newPassword: '',
|
|
46
|
+
confirmPassword: ''
|
|
47
|
+
},
|
|
48
|
+
resolver: (0, _yup.yupResolver)(_schemas.changePasswordSchema)
|
|
49
|
+
});
|
|
50
|
+
var setError = form.setError,
|
|
51
|
+
handleSubmit = form.handleSubmit,
|
|
52
|
+
register = form.register,
|
|
53
|
+
_form$formState = form.formState,
|
|
54
|
+
isValid = _form$formState.isValid,
|
|
55
|
+
errors = _form$formState.errors;
|
|
56
|
+
var _useDataMutation = (0, _useDataMutation2.useDataMutation)(basePath, _routes.APIRoute.RESET_PASSWORD, 'PUT'),
|
|
57
|
+
trigger = _useDataMutation.trigger;
|
|
58
|
+
var handleChangePassword = (0, _react.useCallback)(/*#__PURE__*/function () {
|
|
59
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(body) {
|
|
60
|
+
var _t;
|
|
61
|
+
return _regenerator().w(function (_context) {
|
|
62
|
+
while (1) switch (_context.p = _context.n) {
|
|
63
|
+
case 0:
|
|
64
|
+
_context.p = 0;
|
|
65
|
+
_context.n = 1;
|
|
66
|
+
return trigger(body);
|
|
67
|
+
case 1:
|
|
68
|
+
_context.n = 3;
|
|
69
|
+
break;
|
|
70
|
+
case 2:
|
|
71
|
+
_context.p = 2;
|
|
72
|
+
_t = _context.v;
|
|
73
|
+
throw (0, _utils.normalizeAuthError)(_t);
|
|
74
|
+
case 3:
|
|
75
|
+
return _context.a(2);
|
|
76
|
+
}
|
|
77
|
+
}, _callee, null, [[0, 2]]);
|
|
78
|
+
}));
|
|
79
|
+
return function (_x) {
|
|
63
80
|
return _ref.apply(this, arguments);
|
|
64
81
|
};
|
|
65
|
-
}();
|
|
66
|
-
|
|
82
|
+
}(), [trigger]);
|
|
83
|
+
var onSubmit = (0, _react.useCallback)(/*#__PURE__*/function () {
|
|
84
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(data) {
|
|
85
|
+
var _t2;
|
|
86
|
+
return _regenerator().w(function (_context2) {
|
|
87
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
88
|
+
case 0:
|
|
89
|
+
_context2.p = 0;
|
|
90
|
+
_context2.n = 1;
|
|
91
|
+
return handleChangePassword({
|
|
92
|
+
password: {
|
|
93
|
+
old: data.oldPassword,
|
|
94
|
+
"new": data.newPassword
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
case 1:
|
|
98
|
+
navigate("".concat(_utils3.Route.SUCCESS, "?messageType=").concat(_Success.MessageType.ChangePassword));
|
|
99
|
+
_context2.n = 3;
|
|
100
|
+
break;
|
|
101
|
+
case 2:
|
|
102
|
+
_context2.p = 2;
|
|
103
|
+
_t2 = _context2.v;
|
|
104
|
+
setError('root', {
|
|
105
|
+
type: 'server',
|
|
106
|
+
message: 'Failed to change password'
|
|
107
|
+
});
|
|
108
|
+
case 3:
|
|
109
|
+
return _context2.a(2);
|
|
110
|
+
}
|
|
111
|
+
}, _callee2, null, [[0, 2]]);
|
|
112
|
+
}));
|
|
113
|
+
return function (_x2) {
|
|
114
|
+
return _ref2.apply(this, arguments);
|
|
115
|
+
};
|
|
116
|
+
}(), [handleChangePassword, setError, navigate]);
|
|
117
|
+
(0, _react.useEffect)(function () {
|
|
118
|
+
if (!changePasswordEnabled) {
|
|
119
|
+
navigate('/');
|
|
120
|
+
}
|
|
121
|
+
}, [changePasswordEnabled, navigate]);
|
|
122
|
+
return changePasswordEnabled ? /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_styles.SecurityContainer, null, /*#__PURE__*/_react["default"].createElement(_styles.SecurityForm, {
|
|
67
123
|
component: "form",
|
|
68
|
-
onSubmit: handleSubmit
|
|
69
|
-
}, /*#__PURE__*/
|
|
124
|
+
onSubmit: handleSubmit(onSubmit)
|
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
|
|
70
126
|
align: "center",
|
|
71
127
|
component: "h1",
|
|
72
128
|
gutterBottom: true,
|
|
73
129
|
variant: "h4"
|
|
74
|
-
}, t('security.changePassword.title')), /*#__PURE__*/
|
|
75
|
-
error: !!
|
|
76
|
-
|
|
77
|
-
label: t('security.changePassword.username')
|
|
78
|
-
|
|
79
|
-
required: true
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
onChange: e => setOldPassword(e.target.value),
|
|
130
|
+
}, t('security.changePassword.title')), /*#__PURE__*/_react["default"].createElement(_styles.SecurityTextField, _extends({
|
|
131
|
+
error: !!errors.username,
|
|
132
|
+
helperText: (_errors$username = errors.username) === null || _errors$username === void 0 ? void 0 : _errors$username.message,
|
|
133
|
+
label: t('security.changePassword.username')
|
|
134
|
+
}, register('username'), {
|
|
135
|
+
required: true
|
|
136
|
+
})), /*#__PURE__*/_react["default"].createElement(_styles.SecurityTextField, _extends({
|
|
137
|
+
error: !!errors.oldPassword,
|
|
138
|
+
helperText: (_errors$oldPassword = errors.oldPassword) === null || _errors$oldPassword === void 0 ? void 0 : _errors$oldPassword.message,
|
|
139
|
+
label: t('security.changePassword.oldPassword')
|
|
140
|
+
}, register('oldPassword'), {
|
|
86
141
|
required: true,
|
|
87
|
-
type: "password"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
label: t('security.changePassword.newPassword')
|
|
92
|
-
|
|
142
|
+
type: "password"
|
|
143
|
+
})), /*#__PURE__*/_react["default"].createElement(_styles.SecurityTextField, _extends({
|
|
144
|
+
error: !!errors.newPassword,
|
|
145
|
+
helperText: (_errors$newPassword = errors.newPassword) === null || _errors$newPassword === void 0 ? void 0 : _errors$newPassword.message,
|
|
146
|
+
label: t('security.changePassword.newPassword')
|
|
147
|
+
}, register('newPassword'), {
|
|
93
148
|
required: true,
|
|
94
|
-
type: "password"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
label: t('security.changePassword.confirmPassword')
|
|
99
|
-
|
|
149
|
+
type: "password"
|
|
150
|
+
})), /*#__PURE__*/_react["default"].createElement(_styles.SecurityTextField, _extends({
|
|
151
|
+
error: !!errors.confirmPassword,
|
|
152
|
+
helperText: (_errors$confirmPasswo = errors.confirmPassword) === null || _errors$confirmPasswo === void 0 ? void 0 : _errors$confirmPasswo.message,
|
|
153
|
+
label: t('security.changePassword.confirmPassword')
|
|
154
|
+
}, register('confirmPassword'), {
|
|
100
155
|
required: true,
|
|
101
|
-
type: "password"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
156
|
+
type: "password"
|
|
157
|
+
})), errors.root && /*#__PURE__*/_react["default"].createElement(_LoginDialogFormError["default"], {
|
|
158
|
+
error: errors.root
|
|
159
|
+
}), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
106
160
|
color: "primary",
|
|
161
|
+
disabled: !isValid,
|
|
107
162
|
fullWidth: true,
|
|
108
163
|
sx: {
|
|
109
164
|
mt: 2
|
|
110
165
|
},
|
|
111
166
|
type: "submit",
|
|
112
167
|
variant: "contained"
|
|
113
|
-
}, t('security.changePassword.submit')))));
|
|
168
|
+
}, t('security.changePassword.submit'))))) : null;
|
|
114
169
|
};
|
|
115
|
-
|
|
170
|
+
var _default = exports["default"] = ChangePassword;
|
|
116
171
|
//# sourceMappingURL=ChangePassword.js.map
|