@verdaccio/ui-components 3.0.0-next-7.7 → 3.0.0-next-7.9
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/.eslintrc +1 -1
- package/CHANGELOG.md +14 -0
- package/build/AppTest/AppRoute.js +2 -2
- package/build/AppTest/pages/Front/index.js +1 -1
- package/build/AppTest/pages/Version/Version.js +2 -2
- package/build/AppTest/pages/Version/index.js +1 -1
- package/build/Theme/ResetStyles.js +1 -1
- package/build/Theme/StyleBaseline.js +1 -1
- package/build/Theme/ThemeProvider.js +2 -2
- package/build/Theme/index.js +2 -2
- package/build/Theme/theme.js +3 -3
- package/build/__mocks__/react-markdown.js +1 -1
- package/build/components/ActionBar/ActionBar.js +6 -4
- package/build/components/ActionBar/ActionBarAction.js +10 -9
- package/build/components/ActionBar/index.js +1 -1
- package/build/components/Author/Author.js +14 -43
- package/build/components/Author/index.js +1 -1
- package/build/components/Author/styles.js +1 -1
- package/build/components/CopyClipboard/CopyToClipBoard.js +1 -1
- package/build/components/CopyClipboard/index.js +1 -1
- package/build/components/CopyClipboard/utils.js +3 -12
- package/build/components/Dependencies/Dependencies.js +14 -15
- package/build/components/Dependencies/DependencyBlock.js +6 -5
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Deprecated/Deprecated.js +1 -1
- package/build/components/Deprecated/index.js +1 -1
- package/build/components/Developers/DeveloperType.js +12 -0
- package/build/components/Developers/Developers.js +22 -24
- package/build/components/Developers/Title.js +6 -10
- package/build/components/Developers/index.js +4 -4
- package/build/components/Distribution/Dist.js +2 -2
- package/build/components/Distribution/index.js +1 -1
- package/build/components/Distribution/styles.js +11 -24
- package/build/components/Engines/Engines.js +9 -3
- package/build/components/Engines/index.js +1 -1
- package/build/components/Engines/styles.js +7 -7
- package/build/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/build/components/ErrorBoundary/index.js +1 -1
- package/build/components/Forbidden/Forbidden.js +2 -2
- package/build/components/Forbidden/index.js +1 -1
- package/build/components/FundButton/FundButton.js +10 -11
- package/build/components/FundButton/index.js +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +4 -3
- package/build/components/HeaderInfoDialog/index.js +1 -1
- package/build/components/Heading/Heading.js +3 -3
- package/build/components/Heading/index.js +1 -1
- package/build/components/Help/Help.js +2 -2
- package/build/components/Help/index.js +1 -1
- package/build/components/Help/styles.js +1 -1
- package/build/components/Icons/DevsIcons/CommonJS.js +2 -13
- package/build/components/Icons/DevsIcons/ES6Module.js +3 -14
- package/build/components/Icons/DevsIcons/Git.js +2 -13
- package/build/components/Icons/DevsIcons/NodeJS.js +2 -13
- package/build/components/Icons/DevsIcons/TypeScript.js +2 -13
- package/build/components/Icons/Earth.js +2 -2
- package/build/components/Icons/FileBinary.js +13 -7
- package/build/components/Icons/Law.js +14 -8
- package/build/components/Icons/License.js +2 -2
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +2 -13
- package/build/components/Icons/Managers/Pnpm.js +2 -13
- package/build/components/Icons/Managers/Yarn.js +2 -13
- package/build/components/Icons/SvgIcon.js +2 -2
- package/build/components/Icons/Time.js +2 -2
- package/build/components/Icons/Version.js +2 -2
- package/build/components/Install/Install.js +28 -23
- package/build/components/Install/InstallListItem.js +20 -19
- package/build/components/Install/index.js +1 -1
- package/build/components/Keywords/KeywordListItems.js +34 -0
- package/build/components/Keywords/Keywords.js +39 -0
- package/build/components/Keywords/index.js +14 -0
- package/build/components/Label/Label.js +2 -2
- package/build/components/Label/index.js +1 -1
- package/build/components/Link/Link.js +5 -17
- package/build/components/Link/index.js +2 -2
- package/build/components/LinkExternal/LinkExternal.js +32 -0
- package/build/components/LinkExternal/index.js +14 -0
- package/build/components/Loading/Loading.js +1 -1
- package/build/components/Loading/Spinner/Spinner.js +1 -1
- package/build/components/Loading/Spinner/index.js +1 -1
- package/build/components/Loading/index.js +1 -1
- package/build/components/Loading/styles.js +4 -3
- package/build/components/LoginDialog/LoginDialog.js +14 -3
- package/build/components/LoginDialog/LoginDialogCloseButton.js +4 -3
- package/build/components/LoginDialog/LoginDialogForm.js +5 -17
- package/build/components/LoginDialog/LoginDialogFormError.js +5 -4
- package/build/components/LoginDialog/LoginDialogHeader.js +1 -1
- package/build/components/LoginDialog/index.js +1 -1
- package/build/components/Logo/Logo.js +14 -7
- package/build/components/Logo/index.js +1 -1
- package/build/components/MenuItem/MenuItem.js +3 -3
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/NoItems/NoItems.js +1 -1
- package/build/components/NoItems/index.js +1 -1
- package/build/components/NotFound/NotFound.js +2 -2
- package/build/components/NotFound/index.js +1 -1
- package/build/components/Package/Package.js +46 -37
- package/build/components/Package/index.js +1 -1
- package/build/components/Package/styles.js +47 -59
- package/build/components/PackageList/PackageList.js +1 -1
- package/build/components/PackageList/index.js +1 -1
- package/build/components/Person/Person.js +48 -0
- package/build/components/Person/PersonTooltip.js +22 -0
- package/build/components/Person/index.js +14 -0
- package/build/components/Person/utils.js +17 -0
- package/build/components/RawViewer/RawViewer.js +12 -6
- package/build/components/RawViewer/index.js +1 -1
- package/build/components/Readme/Readme.js +16 -7
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.spec.js +20 -1
- package/build/components/Readme/Readme.spec.js.map +1 -1
- package/build/components/Readme/index.js +1 -1
- package/build/components/Readme/utils.js +3 -6
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +1 -1
- package/build/components/RegistryInfoDialog/index.js +1 -1
- package/build/components/RegistryInfoDialog/styles.js +10 -11
- package/build/components/Repository/Repository.js +22 -34
- package/build/components/Repository/index.js +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.js +2 -2
- package/build/components/Search/AutoComplete/index.js +1 -1
- package/build/components/Search/AutoComplete/styles.js +5 -42
- package/build/components/Search/Search.js +9 -7
- package/build/components/Search/SearchItem.js +54 -41
- package/build/components/Search/index.js +1 -1
- package/build/components/Search/styles.js +1 -1
- package/build/components/Search/utils.js +23 -0
- package/build/components/SettingsMenu/SettingsMenu.js +36 -10
- package/build/components/SettingsMenu/index.js +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +17 -7
- package/build/components/SideBarTitle/index.js +1 -1
- package/build/components/SideBarTitle/utils.js +1 -1
- package/build/components/TextField/TextField.js +3 -3
- package/build/components/TextField/index.js +1 -1
- package/build/components/UpLinks/UpLinks.js +36 -7
- package/build/components/UpLinks/UplinkLink.js +22 -0
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.js +6 -5
- package/build/components/Versions/HistoryList.js +9 -6
- package/build/components/Versions/TagList.js +9 -5
- package/build/components/Versions/Versions.js +32 -9
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +29 -5
- package/build/layouts/Version/Version.js +1 -1
- package/build/layouts/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +3 -2
- package/build/providers/AppConfigurationProvider/index.js +1 -1
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +3 -2
- package/build/providers/PersistenceSettingProvider/index.js +1 -1
- package/build/providers/TranslatorProvider/TranslatorProvider.js +2 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +2 -2
- package/build/providers/TranslatorProvider/index.js +1 -1
- package/build/providers/VersionProvider/VersionProvider.js +2 -2
- package/build/providers/VersionProvider/index.js +1 -1
- package/build/sections/Detail/ContainerContent.js +2 -2
- package/build/sections/Detail/Detail.js +10 -6
- package/build/sections/Detail/ReadmeSection.js +1 -1
- package/build/sections/Detail/Tabs.js +5 -4
- package/build/sections/Detail/index.js +1 -1
- package/build/sections/Footer/Footer.js +38 -9
- package/build/sections/Footer/index.js +1 -1
- package/build/sections/Footer/styles.js +14 -11
- package/build/sections/Header/Header.js +2 -2
- package/build/sections/Header/HeaderGreetings.js +1 -1
- package/build/sections/Header/HeaderLeft.js +15 -18
- package/build/sections/Header/HeaderMenu.js +2 -2
- package/build/sections/Header/HeaderRight.js +14 -5
- package/build/sections/Header/HeaderSettingsDialog.js +4 -4
- package/build/sections/Header/HeaderToolTip.js +1 -1
- package/build/sections/Header/HeaderToolTipIcon.js +2 -2
- package/build/sections/Header/LanguageSwitch.js +4 -4
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +4 -4
- package/build/sections/Header/RegistryInfoContent/index.js +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.js +1 -1
- package/build/sections/Header/index.js +1 -1
- package/build/sections/Header/styles.js +44 -83
- package/build/sections/Home/Home.js +2 -2
- package/build/sections/Home/index.js +1 -1
- package/build/sections/SideBar/Sidebar.js +12 -17
- package/build/sections/SideBar/index.js +1 -1
- package/build/sections/index.js +1 -1
- package/build/src/Theme/ThemeProvider.test.d.ts +1 -0
- package/build/src/components/Author/Author.d.ts +0 -5
- package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +1 -0
- package/build/src/components/Dependencies/Dependencies.d.ts +0 -1
- package/build/src/components/Developers/DeveloperType.d.ts +4 -0
- package/build/src/components/Developers/Developers.d.ts +1 -4
- package/build/src/components/Developers/Title.d.ts +1 -4
- package/build/src/components/Developers/index.d.ts +2 -1
- package/build/src/components/Distribution/styles.d.ts +0 -1
- package/build/src/components/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
- package/build/src/components/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +1 -0
- package/build/src/components/Heading/Heading.test.d.ts +1 -0
- package/build/src/components/Icons/Icons.test.d.ts +1 -0
- package/build/src/components/Install/InstallListItem.d.ts +1 -1
- package/build/src/components/Keywords/KeywordListItems.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.d.ts +6 -0
- package/build/src/components/Keywords/Keywords.stories.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.test.d.ts +1 -0
- package/build/src/components/Keywords/index.d.ts +1 -0
- package/build/src/components/Link/Link.d.ts +0 -3
- package/build/src/components/Link/Link.test.d.ts +1 -0
- package/build/src/components/Link/index.d.ts +1 -1
- package/build/src/components/LinkExternal/LinkExternal.d.ts +3 -0
- package/build/src/components/LinkExternal/LinkExternal.test.d.ts +1 -0
- package/build/src/components/LinkExternal/index.d.ts +1 -0
- package/build/src/components/Logo/Logo.d.ts +1 -0
- package/build/src/components/Logo/Logo.stories.d.ts +5 -0
- package/build/src/components/Package/Package.d.ts +1 -1
- package/build/src/components/Package/styles.d.ts +0 -8
- package/build/src/components/Person/Person.d.ts +9 -0
- package/build/src/components/Person/Person.test.d.ts +1 -0
- package/build/src/components/Person/PersonTooltip.d.ts +6 -0
- package/build/src/components/Person/index.d.ts +1 -0
- package/build/src/components/Person/utils.d.ts +3 -0
- package/build/src/components/Readme/Readme.d.ts +0 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +0 -8
- package/build/src/components/Search/utils.d.ts +1 -0
- package/build/src/components/SettingsMenu/SettingsMenu.d.ts +2 -2
- package/build/src/components/SettingsMenu/SettingsMenu.test.d.ts +1 -0
- package/build/src/components/UpLinks/UplinkLink.d.ts +6 -0
- package/build/src/components/Versions/Versions.d.ts +1 -0
- package/build/src/index.d.ts +4 -1
- package/build/src/sections/Detail/Tabs.d.ts +1 -0
- package/build/src/sections/Header/styles.d.ts +0 -7
- package/build/src/store/models/routes.d.ts +8 -0
- package/build/src/store/models/utils.d.ts +1 -0
- package/build/src/types/packageMeta.d.ts +7 -5
- package/build/src/utils/routes.d.ts +1 -0
- package/build/src/utils/utils.d.ts +1 -0
- package/build/store/api.js +1 -1
- package/build/store/index.js +1 -1
- package/build/store/models/configuration.js +3 -2
- package/build/store/models/download.js +1 -1
- package/build/store/models/login.js +5 -3
- package/build/store/models/manifest.js +6 -4
- package/build/store/models/packages.js +5 -3
- package/build/store/models/routes.js +18 -0
- package/build/store/models/search.js +6 -4
- package/build/store/models/utils.js +10 -0
- package/build/store/storage.js +1 -1
- package/build/store/store.js +1 -1
- package/build/test/i18n-config.js +1 -1
- package/build/test/test-react-testing-library.js +1 -1
- package/build/utils/index.js +2 -2
- package/build/utils/loadable.js +1 -1
- package/build/utils/routes.js +1 -0
- package/build/utils/token.js +1 -1
- package/build/utils/url.js +1 -1
- package/build/utils/utils.js +21 -2
- package/package.json +8 -8
- package/src/AppTest/AppRoute.test.tsx +65 -0
- package/src/Theme/ThemeProvider.test.tsx +27 -0
- package/src/Theme/theme.ts +3 -3
- package/src/components/ActionBar/ActionBar.test.tsx +36 -15
- package/src/components/ActionBar/ActionBar.tsx +1 -1
- package/src/components/ActionBar/ActionBarAction.tsx +8 -5
- package/src/components/Author/Author.test.tsx +7 -1
- package/src/components/Author/Author.tsx +3 -41
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
- package/src/components/CopyClipboard/utils.ts +2 -13
- package/src/components/Dependencies/Dependencies.tsx +9 -9
- package/src/components/Dependencies/DependencyBlock.tsx +2 -1
- package/src/components/Developers/DeveloperType.tsx +4 -0
- package/src/components/Developers/Developers.test.tsx +37 -10
- package/src/components/Developers/Developers.tsx +13 -13
- package/src/components/Developers/Title.tsx +1 -5
- package/src/components/Developers/index.ts +2 -1
- package/src/components/Distribution/Dist.test.tsx +1 -1
- package/src/components/Distribution/Dist.tsx +2 -4
- package/src/components/Distribution/styles.ts +0 -6
- package/src/components/Engines/Engines.tsx +6 -2
- package/src/components/Engines/styles.ts +1 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +39 -0
- package/src/components/FundButton/FundButton.tsx +5 -5
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +51 -0
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.tsx +2 -2
- package/src/components/Heading/Heading.test.tsx +20 -0
- package/src/components/Icons/DevsIcons/CommonJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/ES6Module.tsx +2 -8
- package/src/components/Icons/DevsIcons/Git.tsx +1 -7
- package/src/components/Icons/DevsIcons/NodeJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/TypeScript.tsx +1 -7
- package/src/components/Icons/FileBinary.tsx +2 -1
- package/src/components/Icons/Icons.stories.tsx +21 -5
- package/src/components/Icons/Icons.test.tsx +70 -0
- package/src/components/Icons/Law.tsx +2 -1
- package/src/components/Icons/Managers/Npm.tsx +1 -7
- package/src/components/Icons/Managers/Pnpm.tsx +1 -7
- package/src/components/Icons/Managers/Yarn.tsx +1 -7
- package/src/components/Install/Install.test.tsx +54 -13
- package/src/components/Install/Install.tsx +12 -11
- package/src/components/Install/InstallListItem.tsx +12 -11
- package/src/components/Keywords/KeywordListItems.tsx +22 -0
- package/src/components/Keywords/Keywords.stories.tsx +19 -0
- package/src/components/Keywords/Keywords.test.tsx +57 -0
- package/src/components/Keywords/Keywords.tsx +35 -0
- package/src/components/Keywords/index.ts +1 -0
- package/src/components/Link/Link.test.tsx +25 -0
- package/src/components/Link/Link.tsx +4 -18
- package/src/components/Link/index.ts +1 -1
- package/src/components/LinkExternal/LinkExternal.test.tsx +18 -0
- package/src/components/LinkExternal/LinkExternal.tsx +22 -0
- package/src/components/LinkExternal/index.ts +1 -0
- package/src/components/Loading/Loading.test.tsx +8 -5
- package/src/components/Loading/styles.ts +1 -0
- package/src/components/LoginDialog/LoginDialog.test.tsx +1 -1
- package/src/components/LoginDialog/LoginDialog.tsx +10 -1
- package/src/components/LoginDialog/LoginDialogCloseButton.tsx +1 -0
- package/src/components/LoginDialog/LoginDialogForm.tsx +0 -2
- package/src/components/LoginDialog/LoginDialogFormError.tsx +1 -1
- package/src/components/Logo/Logo.stories.tsx +16 -0
- package/src/components/Logo/Logo.test.tsx +8 -1
- package/src/components/Logo/Logo.tsx +19 -3
- package/src/components/Package/Package.test.tsx +47 -14
- package/src/components/Package/Package.tsx +41 -44
- package/src/components/Package/styles.ts +7 -17
- package/src/components/PackageList/Packagelist.test.tsx +1 -0
- package/src/components/Person/Person.test.tsx +50 -0
- package/src/components/Person/Person.tsx +45 -0
- package/src/components/Person/PersonTooltip.tsx +26 -0
- package/src/components/Person/index.ts +1 -0
- package/src/components/Person/utils.ts +20 -0
- package/src/components/RawViewer/RawViewer.tsx +8 -4
- package/src/components/Readme/Readme.spec.tsx +17 -0
- package/src/components/Readme/Readme.tsx +10 -5
- package/src/components/Readme/utils.ts +2 -5
- package/src/components/RegistryInfoDialog/styles.ts +5 -4
- package/src/components/Repository/Repository.tsx +9 -14
- package/src/components/Search/AutoComplete/styles.ts +7 -0
- package/src/components/Search/Search.test.tsx +36 -9
- package/src/components/Search/Search.tsx +4 -2
- package/src/components/Search/SearchItem.tsx +19 -8
- package/src/components/Search/utils.ts +17 -0
- package/src/components/SettingsMenu/SettingsMenu.test.tsx +41 -0
- package/src/components/SettingsMenu/SettingsMenu.tsx +48 -10
- package/src/components/SideBarTitle/SideBarTitle.tsx +19 -3
- package/src/components/UpLinks/UpLinks.test.tsx +7 -0
- package/src/components/UpLinks/UpLinks.tsx +38 -15
- package/src/components/UpLinks/UplinkLink.tsx +20 -0
- package/src/components/UpLinks/styles.ts +1 -0
- package/src/components/Versions/HistoryList.tsx +9 -4
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +2 -0
- package/src/components/Versions/Versions.tsx +57 -32
- package/src/index.ts +4 -1
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +1 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +2 -0
- package/src/providers/VersionProvider/VersionProvider.test.tsx +3 -3
- package/src/sections/Detail/Detail.test.tsx +8 -1
- package/src/sections/Detail/Detail.tsx +11 -4
- package/src/sections/Detail/Tabs.tsx +5 -2
- package/src/sections/Footer/Footer.tsx +26 -12
- package/src/sections/Footer/styles.ts +4 -0
- package/src/sections/Header/Header.test.tsx +12 -10
- package/src/sections/Header/HeaderLeft.tsx +19 -11
- package/src/sections/Header/HeaderMenu.tsx +1 -1
- package/src/sections/Header/HeaderRight.tsx +14 -3
- package/src/sections/Header/HeaderSettingsDialog.tsx +1 -1
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
- package/src/sections/Header/styles.ts +4 -16
- package/src/sections/Home/Home.test.tsx +12 -4
- package/src/sections/SideBar/Sidebar.test.tsx +20 -13
- package/src/sections/SideBar/Sidebar.tsx +5 -9
- package/src/store/api.test.ts +16 -0
- package/src/store/models/configuration.ts +2 -1
- package/src/store/models/login.ts +10 -12
- package/src/store/models/manifest.ts +6 -5
- package/src/store/models/packages.ts +4 -5
- package/src/store/models/routes.ts +10 -0
- package/src/store/models/search.ts +4 -2
- package/src/store/models/utils.ts +3 -0
- package/src/types/packageMeta.ts +7 -5
- package/src/utils/routes.ts +1 -0
- package/src/utils/utils.test.ts +34 -0
- package/src/utils/utils.ts +20 -5
- package/tsconfig.json +1 -1
- package/build/components/Developers/styles.js +0 -65
- package/build/components/Distribution/utils.js +0 -25
- package/build/components/Distribution/utilts.spec.js +0 -18
- package/build/components/Package/Tag/Tag.js +0 -14
- package/build/components/Package/Tag/index.js +0 -14
- package/build/components/Package/Tag/styles.js +0 -24
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -36
- package/build/sections/Header/RegistryInfoDialog/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/styles.js +0 -46
- package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
- package/build/src/components/Developers/styles.d.ts +0 -11
- package/build/src/components/Distribution/utils.d.ts +0 -7
- package/build/src/components/Package/Tag/Tag.d.ts +0 -6
- package/build/src/components/Package/Tag/index.d.ts +0 -1
- package/build/src/components/Package/Tag/styles.d.ts +0 -5
- package/build/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.d.ts +0 -4
- package/build/src/sections/Header/RegistryInfoDialog/index.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoDialog/styles.d.ts +0 -13
- package/build/src/sections/Header/RegistryInfoDialog/types.d.ts +0 -7
- package/src/components/Developers/styles.ts +0 -31
- package/src/components/Distribution/utils.ts +0 -32
- package/src/components/Distribution/utilts.spec.ts +0 -17
- package/src/components/Package/Tag/Tag.test.tsx +0 -15
- package/src/components/Package/Tag/Tag.tsx +0 -11
- package/src/components/Package/Tag/index.ts +0 -1
- package/src/components/Package/Tag/styles.ts +0 -11
- package/src/components/Search/AutoComplete/styles.tsx +0 -42
- package/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +0 -31
- package/src/sections/Header/RegistryInfoDialog/index.ts +0 -1
- package/src/sections/Header/RegistryInfoDialog/styles.ts +0 -21
- package/src/sections/Header/RegistryInfoDialog/types.ts +0 -8
- /package/build/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/build/src/{components/Package/Tag/Tag.test.d.ts → AppTest/AppRoute.test.d.ts} +0 -0
- /package/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import Card from '@mui/material/Card';
|
|
3
|
+
import CardContent from '@mui/material/CardContent';
|
|
1
4
|
import List from '@mui/material/List';
|
|
2
5
|
import ListItem from '@mui/material/ListItem';
|
|
3
6
|
import React from 'react';
|
|
@@ -5,6 +8,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
8
|
|
|
6
9
|
import { utils } from '../../utils';
|
|
7
10
|
import NoItems from '../NoItems';
|
|
11
|
+
import UpLinkLink from './UplinkLink';
|
|
8
12
|
import { ListItemText, Spacer, StyledText } from './styles';
|
|
9
13
|
|
|
10
14
|
const UpLinks: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {
|
|
@@ -17,24 +21,43 @@ const UpLinks: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {
|
|
|
17
21
|
const { _uplinks: uplinks, latest } = packageMeta;
|
|
18
22
|
|
|
19
23
|
if (Object.keys(uplinks).length === 0) {
|
|
20
|
-
return
|
|
24
|
+
return (
|
|
25
|
+
<Card sx={{ mb: 2 }}>
|
|
26
|
+
<CardContent>
|
|
27
|
+
<NoItems data-testid="no-uplinks" text={t('uplinks.no-items', { name: latest.name })} />
|
|
28
|
+
</CardContent>
|
|
29
|
+
</Card>
|
|
30
|
+
);
|
|
21
31
|
}
|
|
22
32
|
|
|
23
33
|
return (
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
<Card sx={{ mb: 2 }}>
|
|
35
|
+
<CardContent>
|
|
36
|
+
<Box data-testid="uplinks" sx={{ m: 2 }}>
|
|
37
|
+
<StyledText variant="subtitle1">{t('uplinks.title')}</StyledText>
|
|
38
|
+
<List dense={true}>
|
|
39
|
+
{Object.keys(uplinks)
|
|
40
|
+
.reverse()
|
|
41
|
+
.map((name) => (
|
|
42
|
+
<ListItem
|
|
43
|
+
className="version-item"
|
|
44
|
+
data-testid={`uplink-${name}`}
|
|
45
|
+
key={name}
|
|
46
|
+
sx={{ pr: 0 }}
|
|
47
|
+
>
|
|
48
|
+
<ListItemText>
|
|
49
|
+
<UpLinkLink packageName={latest.name} uplinkName={name} />
|
|
50
|
+
</ListItemText>
|
|
51
|
+
<Spacer />
|
|
52
|
+
<ListItemText title={utils.formatDate(uplinks[name].fetched)}>
|
|
53
|
+
{utils.formatDateDistance(uplinks[name].fetched)}
|
|
54
|
+
</ListItemText>
|
|
55
|
+
</ListItem>
|
|
56
|
+
))}
|
|
57
|
+
</List>
|
|
58
|
+
</Box>
|
|
59
|
+
</CardContent>
|
|
60
|
+
</Card>
|
|
38
61
|
);
|
|
39
62
|
};
|
|
40
63
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { utils } from '../../utils';
|
|
4
|
+
import LinkExternal from '../LinkExternal';
|
|
5
|
+
|
|
6
|
+
const UpLinkLink: React.FC<{ packageName: string; uplinkName: string }> = ({
|
|
7
|
+
packageName,
|
|
8
|
+
uplinkName,
|
|
9
|
+
}) => {
|
|
10
|
+
const link = utils.getUplink(uplinkName, packageName);
|
|
11
|
+
return link ? (
|
|
12
|
+
<LinkExternal to={link} variant="outline">
|
|
13
|
+
{uplinkName}
|
|
14
|
+
</LinkExternal>
|
|
15
|
+
) : (
|
|
16
|
+
<>{uplinkName}</>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default UpLinkLink;
|
|
@@ -7,8 +7,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
7
7
|
|
|
8
8
|
import { useConfig } from '../../providers';
|
|
9
9
|
import { Time, Versions } from '../../types/packageMeta';
|
|
10
|
-
import { utils } from '../../utils';
|
|
11
|
-
import
|
|
10
|
+
import { Route, utils } from '../../utils';
|
|
11
|
+
import Link from '../Link';
|
|
12
12
|
import { ListItemText, Spacer } from './styles';
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
@@ -40,8 +40,13 @@ const VersionsHistoryList: React.FC<Props> = ({ versions, packageName, time }) =
|
|
|
40
40
|
{Object.keys(listVersions)
|
|
41
41
|
.reverse()
|
|
42
42
|
.map((version) => (
|
|
43
|
-
<ListItem
|
|
44
|
-
|
|
43
|
+
<ListItem
|
|
44
|
+
className="version-item"
|
|
45
|
+
data-testid={`version-${version}`}
|
|
46
|
+
key={version}
|
|
47
|
+
sx={{ pr: 0 }}
|
|
48
|
+
>
|
|
49
|
+
<Link to={`${Route.DETAIL}${packageName}/v/${version}`} variant="outline">
|
|
45
50
|
<ListItemText disableTypography={false} primary={version}></ListItemText>
|
|
46
51
|
</Link>
|
|
47
52
|
{typeof versions[version]?.deprecated === 'string' ? (
|
|
@@ -3,7 +3,8 @@ import ListItem from '@mui/material/ListItem';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
import { DistTags, Time } from '../../types/packageMeta';
|
|
6
|
-
import {
|
|
6
|
+
import { Route } from '../../utils';
|
|
7
|
+
import Link from '../Link';
|
|
7
8
|
import { ListItemText, Spacer } from './styles';
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
@@ -19,8 +20,8 @@ const VersionsTagList: React.FC<Props> = ({ tags, packageName, time }) => (
|
|
|
19
20
|
return time[tags[a]] < time[tags[b]] ? 1 : time[tags[a]] > time[tags[b]] ? -1 : 0;
|
|
20
21
|
})
|
|
21
22
|
.map((tag) => (
|
|
22
|
-
<ListItem className="version-item" data-testid={`tag-${tag}`} key={tag}>
|
|
23
|
-
<Link to={
|
|
23
|
+
<ListItem className="version-item" data-testid={`tag-${tag}`} key={tag} sx={{ pr: 0 }}>
|
|
24
|
+
<Link to={`${Route.DETAIL}${packageName}/v/${tags[tag]}`} variant="outline">
|
|
24
25
|
<ListItemText>{tag}</ListItemText>
|
|
25
26
|
</Link>
|
|
26
27
|
<Spacer />
|
|
@@ -45,6 +45,8 @@ describe('<Version /> component', () => {
|
|
|
45
45
|
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
|
|
46
46
|
fireEvent.change(screen.getByRole('textbox'), { target: { value: '2.3.0' } });
|
|
47
47
|
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(1);
|
|
48
|
+
fireEvent.change(screen.getByRole('textbox'), { target: { value: '' } });
|
|
49
|
+
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
|
|
48
50
|
});
|
|
49
51
|
|
|
50
52
|
test('should not render versions', () => {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
1
2
|
import Alert from '@mui/material/Alert';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import Card from '@mui/material/Card';
|
|
5
|
+
import CardContent from '@mui/material/CardContent';
|
|
2
6
|
import TextField from '@mui/material/TextField';
|
|
3
7
|
import Typography from '@mui/material/Typography';
|
|
4
8
|
import { useTheme } from '@mui/styles';
|
|
@@ -7,12 +11,18 @@ import React, { useState } from 'react';
|
|
|
7
11
|
import { useTranslation } from 'react-i18next';
|
|
8
12
|
import semver from 'semver';
|
|
9
13
|
|
|
14
|
+
import { Theme } from '../../Theme';
|
|
10
15
|
import { useConfig } from '../../providers';
|
|
11
16
|
import VersionsHistoryList from './HistoryList';
|
|
12
17
|
import VersionsTagList from './TagList';
|
|
13
18
|
|
|
14
19
|
export type Props = { packageMeta: any; packageName: string };
|
|
15
20
|
|
|
21
|
+
export const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
|
|
22
|
+
fontWeight: props.theme && props.theme.fontWeight.bold,
|
|
23
|
+
textTransform: 'capitalize',
|
|
24
|
+
}));
|
|
25
|
+
|
|
16
26
|
const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
|
|
17
27
|
const { t } = useTranslation();
|
|
18
28
|
const { configOptions } = useConfig();
|
|
@@ -46,38 +56,53 @@ const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
|
|
|
46
56
|
};
|
|
47
57
|
|
|
48
58
|
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
59
|
+
<Card sx={{ mb: 2 }}>
|
|
60
|
+
<CardContent>
|
|
61
|
+
<Box data-testid="versions" sx={{ m: 2 }}>
|
|
62
|
+
{hasDistTags ? (
|
|
63
|
+
<>
|
|
64
|
+
<StyledText variant="subtitle1">
|
|
65
|
+
{t('versions.current-tags')}
|
|
66
|
+
<span>{` (${Object.keys(distTags).length})`}</span>
|
|
67
|
+
</StyledText>
|
|
68
|
+
<VersionsTagList packageName={packageName} tags={distTags} time={time} />
|
|
69
|
+
</>
|
|
70
|
+
) : null}
|
|
71
|
+
<>
|
|
72
|
+
<StyledText variant="subtitle1">
|
|
73
|
+
{t('versions.version-history')}
|
|
74
|
+
<span>{` (${Object.keys(packageVersions).length})`}</span>
|
|
75
|
+
</StyledText>
|
|
76
|
+
<TextField
|
|
77
|
+
helperText={t('versions.search.placeholder')}
|
|
78
|
+
onChange={debounce((e) => {
|
|
79
|
+
filterVersions(e.target.value);
|
|
80
|
+
}, 200)}
|
|
81
|
+
size="small"
|
|
82
|
+
variant="standard"
|
|
83
|
+
width="50%"
|
|
84
|
+
/>
|
|
85
|
+
</>
|
|
86
|
+
{hasVersionHistory ? (
|
|
87
|
+
<>
|
|
88
|
+
{hideDeprecatedVersions === true && (
|
|
89
|
+
<Alert
|
|
90
|
+
severity="info"
|
|
91
|
+
sx={{ marginTop: theme.spacing(1), marginBottom: theme.spacing(1) }}
|
|
92
|
+
>
|
|
93
|
+
{t('versions.hide-deprecated')}
|
|
94
|
+
</Alert>
|
|
95
|
+
)}
|
|
96
|
+
<VersionsHistoryList
|
|
97
|
+
packageName={packageName}
|
|
98
|
+
time={time}
|
|
99
|
+
versions={packageVersions}
|
|
100
|
+
/>
|
|
101
|
+
</>
|
|
102
|
+
) : null}
|
|
103
|
+
</Box>
|
|
104
|
+
</CardContent>
|
|
105
|
+
</Card>
|
|
81
106
|
);
|
|
82
107
|
};
|
|
83
108
|
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as CopyClipboard, copyToClipBoardUtility } from './components/CopyClipboard';
|
|
2
2
|
export * from './components/CopyClipboard';
|
|
3
|
-
export { Link } from './components/Link';
|
|
4
3
|
export { default as ActionBar } from './components/ActionBar';
|
|
5
4
|
export { default as Author } from './components/Author';
|
|
6
5
|
export { default as Dependencies } from './components/Dependencies';
|
|
@@ -12,7 +11,11 @@ export { default as FundButton } from './components/FundButton';
|
|
|
12
11
|
export { default as Heading } from './components/Heading';
|
|
13
12
|
export * as Icons from './components/Icons';
|
|
14
13
|
export { default as Install } from './components/Install';
|
|
14
|
+
export { default as Keywords } from './components/Keywords';
|
|
15
|
+
export { default as Link } from './components/Link';
|
|
16
|
+
export { default as LinkExternal } from './components/LinkExternal';
|
|
15
17
|
export { default as RawViewer } from './components/RawViewer';
|
|
18
|
+
export { default as Person } from './components/Person';
|
|
16
19
|
export { default as Readme } from './components/Readme';
|
|
17
20
|
export { default as SideBarTitle } from './components/SideBarTitle';
|
|
18
21
|
export { default as UpLinks } from './components/UpLinks';
|
|
@@ -10,11 +10,13 @@ import React, {
|
|
|
10
10
|
import useLocalStorage from '../../hooks/useLocalStorage';
|
|
11
11
|
|
|
12
12
|
type PersistenceSettingsProps = {
|
|
13
|
+
isLatest?: boolean;
|
|
13
14
|
isGlobal?: boolean;
|
|
14
15
|
yarnModern: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const defaultValues: PersistenceSettingsProps = {
|
|
19
|
+
isLatest: false,
|
|
18
20
|
isGlobal: false,
|
|
19
21
|
yarnModern: false,
|
|
20
22
|
};
|
|
@@ -30,7 +30,7 @@ describe('<Header /> component with logged in state', () => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
test('should load data from the provider', async () => {
|
|
33
|
-
|
|
33
|
+
act(() =>
|
|
34
34
|
renderWithStore(
|
|
35
35
|
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
36
36
|
<Route path={Routes.PACKAGE}>
|
|
@@ -40,8 +40,8 @@ describe('<Header /> component with logged in state', () => {
|
|
|
40
40
|
</Route>
|
|
41
41
|
</MemoryRouter>,
|
|
42
42
|
store
|
|
43
|
-
)
|
|
44
|
-
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
45
|
await waitFor(() => screen.getByText('storybook'));
|
|
46
46
|
expect(screen.getByText('storybook')).toBeInTheDocument();
|
|
47
47
|
expect(screen.getByText('MIT')).toBeInTheDocument();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { render } from '../../test/test-react-testing-library';
|
|
3
|
+
import { render, screen } from '../../test/test-react-testing-library';
|
|
4
4
|
import DetailContainer from './Detail';
|
|
5
5
|
|
|
6
6
|
describe('DetailContainer', () => {
|
|
@@ -8,5 +8,12 @@ describe('DetailContainer', () => {
|
|
|
8
8
|
const { container } = render(<DetailContainer />);
|
|
9
9
|
expect(container.firstChild).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
test('renders without uplinks', () => {
|
|
13
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.showUplinks = false;
|
|
14
|
+
render(<DetailContainer />);
|
|
15
|
+
expect(screen.queryByTestId('uplinks-tab')).toBeFalsy();
|
|
16
|
+
});
|
|
17
|
+
|
|
11
18
|
test.todo('should test click on tabs');
|
|
12
19
|
});
|
|
@@ -2,7 +2,7 @@ import Box from '@mui/material/Box';
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import Deprecated from '../../components/Deprecated';
|
|
5
|
-
import { useVersion } from '../../providers';
|
|
5
|
+
import { useConfig, useVersion } from '../../providers';
|
|
6
6
|
import ContainerContent from './ContainerContent';
|
|
7
7
|
import Tabs from './Tabs';
|
|
8
8
|
|
|
@@ -14,7 +14,10 @@ export enum TabPosition {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const DetailContainer: React.FC = () => {
|
|
17
|
-
const
|
|
17
|
+
const { configOptions } = useConfig();
|
|
18
|
+
const tabs = configOptions.showUplinks
|
|
19
|
+
? Object.values(TabPosition)
|
|
20
|
+
: Object.values(TabPosition).filter((tab) => tab !== TabPosition.UPLINKS);
|
|
18
21
|
const [tabPosition, setTabPosition] = useState(0);
|
|
19
22
|
const { readMe, packageMeta } = useVersion();
|
|
20
23
|
|
|
@@ -23,8 +26,12 @@ const DetailContainer: React.FC = () => {
|
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
return (
|
|
26
|
-
<Box component="div" display="flex" flexDirection="column" padding={
|
|
27
|
-
<Tabs
|
|
29
|
+
<Box component="div" display="flex" flexDirection="column" padding={0}>
|
|
30
|
+
<Tabs
|
|
31
|
+
onChange={handleChange}
|
|
32
|
+
showUplinks={configOptions.showUplinks}
|
|
33
|
+
tabPosition={tabPosition}
|
|
34
|
+
/>
|
|
28
35
|
{packageMeta?.latest?.deprecated && <Deprecated message={packageMeta?.latest?.deprecated} />}
|
|
29
36
|
<ContainerContent readDescription={readMe} tabPosition={tabs[tabPosition]} />
|
|
30
37
|
</Box>
|
|
@@ -9,16 +9,19 @@ import { Theme } from '../../Theme';
|
|
|
9
9
|
interface Props {
|
|
10
10
|
onChange: (event: React.ChangeEvent<{}>, newValue: number) => void;
|
|
11
11
|
tabPosition: number;
|
|
12
|
+
showUplinks?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const DetailContainerTabs: React.FC<Props> = ({ tabPosition, onChange }) => {
|
|
15
|
+
const DetailContainerTabs: React.FC<Props> = ({ tabPosition, onChange, showUplinks }) => {
|
|
15
16
|
const { t } = useTranslation();
|
|
16
17
|
return (
|
|
17
18
|
<Tabs onChange={onChange} value={tabPosition} variant={'fullWidth'}>
|
|
18
19
|
<Tab data-testid={'readme-tab'} id={'readme-tab'} label={t('tab.readme')} />
|
|
19
20
|
<Tab data-testid={'dependencies-tab'} id={'dependencies-tab'} label={t('tab.dependencies')} />
|
|
20
21
|
<Tab data-testid={'versions-tab'} id={'versions-tab'} label={t('tab.versions')} />
|
|
21
|
-
|
|
22
|
+
{showUplinks && (
|
|
23
|
+
<Tab data-testid={'uplinks-tab'} id={'uplinks-tab'} label={t('tab.uplinks')} />
|
|
24
|
+
)}
|
|
22
25
|
</Tabs>
|
|
23
26
|
);
|
|
24
27
|
};
|
|
@@ -27,28 +27,34 @@ const Footer = () => {
|
|
|
27
27
|
<StyledEarth />
|
|
28
28
|
<Flags>
|
|
29
29
|
<Icon>
|
|
30
|
-
<FlagsIcon.ES />
|
|
30
|
+
<FlagsIcon.ES title={t('flag.spain')} />
|
|
31
31
|
</Icon>
|
|
32
32
|
<Icon>
|
|
33
|
-
<FlagsIcon.NI />
|
|
33
|
+
<FlagsIcon.NI title={t('flag.nicaragua')} />
|
|
34
34
|
</Icon>
|
|
35
35
|
<Icon>
|
|
36
|
-
<FlagsIcon.IN />
|
|
36
|
+
<FlagsIcon.IN title={t('flag.india')} />
|
|
37
37
|
</Icon>
|
|
38
38
|
<Icon>
|
|
39
|
-
<FlagsIcon.BR />
|
|
39
|
+
<FlagsIcon.BR title={t('flag.brazil')} />
|
|
40
40
|
</Icon>
|
|
41
41
|
<Icon>
|
|
42
|
-
<FlagsIcon.CN />
|
|
42
|
+
<FlagsIcon.CN title={t('flag.china')} />
|
|
43
43
|
</Icon>
|
|
44
44
|
<Icon>
|
|
45
|
-
<FlagsIcon.AU />
|
|
45
|
+
<FlagsIcon.AU title={t('flag.australia')} />
|
|
46
46
|
</Icon>
|
|
47
47
|
<Icon>
|
|
48
|
-
<FlagsIcon.DE />
|
|
48
|
+
<FlagsIcon.DE title={t('flag.germany')} />
|
|
49
49
|
</Icon>
|
|
50
50
|
<Icon>
|
|
51
|
-
<FlagsIcon.TW />
|
|
51
|
+
<FlagsIcon.TW title={t('flag.taiwan')} />
|
|
52
|
+
</Icon>
|
|
53
|
+
<Icon>
|
|
54
|
+
<FlagsIcon.AT title={t('flag.austria')} />
|
|
55
|
+
</Icon>
|
|
56
|
+
<Icon>
|
|
57
|
+
<FlagsIcon.CA title={t('flag.canada')} />
|
|
52
58
|
</Icon>
|
|
53
59
|
</Flags>
|
|
54
60
|
</ToolTip>
|
|
@@ -56,9 +62,13 @@ const Footer = () => {
|
|
|
56
62
|
<Right>
|
|
57
63
|
{configOptions?.version && (
|
|
58
64
|
<>
|
|
59
|
-
<
|
|
60
|
-
<Logo
|
|
61
|
-
|
|
65
|
+
<PoweredBy data-testid="version-footer">{t('footer.powered-by')}</PoweredBy>
|
|
66
|
+
<Logo
|
|
67
|
+
isDefault={true}
|
|
68
|
+
onClick={goToVerdaccioWebsite}
|
|
69
|
+
size="x-small"
|
|
70
|
+
title={configOptions.version}
|
|
71
|
+
/>
|
|
62
72
|
</>
|
|
63
73
|
)}
|
|
64
74
|
</Right>
|
|
@@ -69,13 +79,17 @@ const Footer = () => {
|
|
|
69
79
|
|
|
70
80
|
export default Footer;
|
|
71
81
|
|
|
82
|
+
const PoweredBy = styled('span')(() => ({
|
|
83
|
+
paddingRight: '5px',
|
|
84
|
+
}));
|
|
85
|
+
|
|
72
86
|
const StyledEarth = styled(Earth)<{ theme?: Theme }>(({ theme }) => ({
|
|
73
87
|
margin: theme.spacing(0, 1),
|
|
74
88
|
}));
|
|
75
89
|
|
|
76
90
|
const Flags = styled('span')<{ theme?: Theme }>(({ theme }) => ({
|
|
77
91
|
display: 'inline-grid',
|
|
78
|
-
gridTemplateColumns: 'repeat(
|
|
92
|
+
gridTemplateColumns: 'repeat(10, max-content)',
|
|
79
93
|
gridGap: theme.spacing(0, 1),
|
|
80
94
|
position: 'absolute',
|
|
81
95
|
background: theme?.palette.greyAthens,
|
|
@@ -14,6 +14,8 @@ export const Inner = styled('div')<{ theme?: Theme }>(({ theme }) => ({
|
|
|
14
14
|
display: 'flex',
|
|
15
15
|
alignItems: 'center',
|
|
16
16
|
justifyContent: 'flex-end',
|
|
17
|
+
paddingLeft: 16,
|
|
18
|
+
paddingRight: 16,
|
|
17
19
|
width: '100%',
|
|
18
20
|
[`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
|
|
19
21
|
minWidth: 400,
|
|
@@ -32,10 +34,12 @@ export const Left = styled('div')<{ theme?: Theme }>(({ theme }) => ({
|
|
|
32
34
|
[`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
|
|
33
35
|
display: 'flex',
|
|
34
36
|
},
|
|
37
|
+
marginLeft: 1,
|
|
35
38
|
}));
|
|
36
39
|
|
|
37
40
|
export const Right = styled(Left)({
|
|
38
41
|
display: 'flex',
|
|
42
|
+
marginRight: 1,
|
|
39
43
|
});
|
|
40
44
|
|
|
41
45
|
export const Love = styled('span')<{ theme?: Theme }>(({ theme }) => ({
|
|
@@ -39,7 +39,7 @@ describe('<Header /> component with logged in state', () => {
|
|
|
39
39
|
cleanup();
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
test('should load the component
|
|
42
|
+
test('should load the component in logged out state', () => {
|
|
43
43
|
renderWithStore(
|
|
44
44
|
<Router>
|
|
45
45
|
<Header />
|
|
@@ -59,7 +59,9 @@ describe('<Header /> component with logged in state', () => {
|
|
|
59
59
|
</Router>,
|
|
60
60
|
store
|
|
61
61
|
);
|
|
62
|
-
|
|
62
|
+
act(() => {
|
|
63
|
+
store.dispatch.login.logInUser({ username: 'store', token: '12345' });
|
|
64
|
+
});
|
|
63
65
|
|
|
64
66
|
await waitFor(() => {
|
|
65
67
|
expect(screen.getByTestId('logInDialogIcon')).toBeTruthy();
|
|
@@ -78,13 +80,13 @@ describe('<Header /> component with logged in state', () => {
|
|
|
78
80
|
const loginBtn = screen.getByTestId('header--button-login');
|
|
79
81
|
fireEvent.click(loginBtn);
|
|
80
82
|
|
|
81
|
-
const loginDialog = await waitFor(() => screen.
|
|
83
|
+
const loginDialog = await waitFor(() => screen.findByTestId('login--dialog'));
|
|
82
84
|
|
|
83
85
|
expect(loginDialog).toBeTruthy();
|
|
84
86
|
});
|
|
85
87
|
|
|
86
88
|
test('should login and logout the user', async () => {
|
|
87
|
-
const { getByText, getByTestId } = renderWithStore(
|
|
89
|
+
const { getByText, getByTestId, findByText, findByTestId } = renderWithStore(
|
|
88
90
|
<Router>
|
|
89
91
|
<Header />
|
|
90
92
|
</Router>,
|
|
@@ -104,14 +106,14 @@ describe('<Header /> component with logged in state', () => {
|
|
|
104
106
|
await act(async () => {
|
|
105
107
|
fireEvent.click(signInButton);
|
|
106
108
|
});
|
|
107
|
-
await waitFor(() =>
|
|
109
|
+
await waitFor(() => findByTestId('logInDialogIcon'));
|
|
108
110
|
const headerMenuAccountCircle = getByTestId('logInDialogIcon');
|
|
109
111
|
fireEvent.click(headerMenuAccountCircle);
|
|
110
112
|
|
|
111
113
|
// // wait for button Logout's appearance and return the element
|
|
112
|
-
const logoutBtn = await waitFor(() =>
|
|
114
|
+
const logoutBtn = await waitFor(() => findByText('button.logout'));
|
|
113
115
|
fireEvent.click(logoutBtn);
|
|
114
|
-
await waitFor(() =>
|
|
116
|
+
await waitFor(() => findByText('button.login'));
|
|
115
117
|
expect(getByText('button.login')).toBeTruthy();
|
|
116
118
|
});
|
|
117
119
|
|
|
@@ -169,12 +171,12 @@ describe('<Header /> component with logged in state', () => {
|
|
|
169
171
|
expect(infoBtn).toBeInTheDocument();
|
|
170
172
|
fireEvent.click(infoBtn);
|
|
171
173
|
// wait for registrationInfo modal appearance and return the element
|
|
172
|
-
const registrationInfoModal = await waitFor(() => screen.
|
|
174
|
+
const registrationInfoModal = await waitFor(() => screen.findByTestId('registryInfo--dialog'));
|
|
173
175
|
expect(registrationInfoModal).toBeTruthy();
|
|
174
176
|
});
|
|
175
177
|
|
|
176
178
|
test('should close the registrationInfo modal when clicking on the button close', async () => {
|
|
177
|
-
const { getByTestId,
|
|
179
|
+
const { getByTestId, findByText, queryByTestId } = renderWithStore(
|
|
178
180
|
<Router>
|
|
179
181
|
<Header HeaderInfoDialog={CustomInfoDialog} />
|
|
180
182
|
</Router>,
|
|
@@ -185,7 +187,7 @@ describe('<Header /> component with logged in state', () => {
|
|
|
185
187
|
fireEvent.click(infoBtn);
|
|
186
188
|
|
|
187
189
|
// wait for Close's button of registrationInfo modal appearance and return the element
|
|
188
|
-
const closeBtn = await waitFor(() =>
|
|
190
|
+
const closeBtn = await waitFor(() => findByText('button.close'));
|
|
189
191
|
fireEvent.click(closeBtn);
|
|
190
192
|
|
|
191
193
|
const hasRegistrationInfoModalBeenRemoved = await waitForElementToBeRemoved(() =>
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Toolbar from '@mui/material/Toolbar';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Link } from 'react-router-dom';
|
|
3
|
+
import { Link as RouterLink } from 'react-router-dom';
|
|
4
4
|
|
|
5
5
|
import { Logo, Search } from '../../';
|
|
6
|
-
import {
|
|
6
|
+
import { SearchWrapper } from './styles';
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
9
|
showSearch?: boolean;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const StyledLink = styled(Link)({
|
|
13
|
-
marginRight: '1em',
|
|
14
|
-
});
|
|
15
|
-
|
|
16
12
|
const HeaderLeft: React.FC<Props> = ({ showSearch }) => (
|
|
17
|
-
<
|
|
18
|
-
|
|
13
|
+
<Toolbar
|
|
14
|
+
sx={{
|
|
15
|
+
display: 'flex',
|
|
16
|
+
padding: 0,
|
|
17
|
+
marginLeft: 1,
|
|
18
|
+
flex: 1,
|
|
19
|
+
'@media (min-width: 600px)': {
|
|
20
|
+
padding: 0,
|
|
21
|
+
marginLeft: 1,
|
|
22
|
+
marginRight: '20px',
|
|
23
|
+
},
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<RouterLink to={'/'}>
|
|
19
27
|
<Logo />
|
|
20
|
-
</
|
|
28
|
+
</RouterLink>
|
|
21
29
|
{showSearch && (
|
|
22
30
|
<SearchWrapper data-testid="search-container">
|
|
23
31
|
<Search />
|
|
24
32
|
</SearchWrapper>
|
|
25
33
|
)}
|
|
26
|
-
</
|
|
34
|
+
</Toolbar>
|
|
27
35
|
);
|
|
28
36
|
|
|
29
37
|
export default HeaderLeft;
|