@verdaccio/ui-components 3.0.0-next.2 → 4.0.0-next-8.0
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 +85 -0
- package/build/AppTest/AppRoute.js +34 -0
- package/build/AppTest/pages/Front/Home.js +9 -0
- package/build/AppTest/pages/Front/index.js +14 -0
- package/build/AppTest/pages/Version/Version.js +34 -0
- package/build/AppTest/pages/Version/index.js +14 -0
- package/build/Theme/ResetStyles.js +2 -3
- package/build/Theme/StyleBaseline.js +2 -3
- package/build/Theme/ThemeProvider.js +3 -3
- package/build/Theme/colors.js +1 -2
- package/build/Theme/index.js +3 -3
- package/build/Theme/theme.js +17 -7
- package/build/__mocks__/react-markdown.js +1 -1
- package/build/components/ActionBar/ActionBar.js +8 -7
- package/build/components/ActionBar/ActionBarAction.js +13 -14
- package/build/components/ActionBar/index.js +1 -1
- package/build/components/Author/Author.js +15 -45
- package/build/components/Author/index.js +1 -1
- package/build/components/Author/styles.js +3 -5
- package/build/components/CopyClipboard/CopyToClipBoard.js +2 -3
- package/build/components/CopyClipboard/index.js +1 -1
- package/build/components/CopyClipboard/utils.js +3 -12
- package/build/components/Dependencies/Dependencies.js +31 -58
- package/build/components/Dependencies/DependencyBlock.js +102 -0
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Dependencies/utits.js +10 -0
- package/build/components/Deprecated/Deprecated.js +2 -3
- package/build/components/Deprecated/index.js +1 -1
- package/build/components/Developers/DeveloperType.js +12 -0
- package/build/components/Developers/Developers.js +26 -32
- package/build/components/Developers/Title.js +7 -13
- package/build/components/Developers/get-unique-developer-values.js +1 -2
- package/build/components/Developers/index.js +4 -4
- package/build/components/Distribution/Dist.js +3 -4
- package/build/components/Distribution/index.js +1 -1
- package/build/components/Distribution/styles.js +14 -31
- package/build/components/Engines/Engines.js +10 -5
- package/build/components/Engines/index.js +1 -1
- package/build/components/Engines/styles.js +9 -11
- package/build/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/build/components/ErrorBoundary/index.js +1 -1
- package/build/components/Forbidden/Forbidden.js +75 -0
- package/build/components/Forbidden/index.js +14 -0
- package/build/components/FundButton/FundButton.js +11 -13
- package/build/components/FundButton/index.js +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +5 -5
- package/build/components/HeaderInfoDialog/index.js +1 -1
- package/build/components/Heading/Heading.js +5 -6
- package/build/components/Heading/index.js +1 -1
- package/build/components/Help/Help.js +4 -5
- package/build/components/Help/index.js +1 -1
- package/build/components/Help/styles.js +2 -3
- 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 +3 -4
- package/build/components/Icons/FileBinary.js +14 -9
- package/build/components/Icons/Law.js +15 -10
- package/build/components/Icons/License.js +3 -4
- 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 +3 -4
- package/build/components/Icons/Time.js +3 -4
- package/build/components/Icons/Version.js +3 -4
- package/build/components/Install/Install.js +30 -26
- package/build/components/Install/InstallListItem.js +22 -23
- 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 +3 -4
- package/build/components/Label/index.js +1 -1
- package/build/components/Link/Link.js +5 -19
- 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 +2 -3
- package/build/components/Loading/Spinner/Spinner.js +2 -3
- package/build/components/Loading/Spinner/index.js +1 -1
- package/build/components/Loading/index.js +1 -1
- package/build/components/Loading/styles.js +6 -7
- package/build/components/LoginDialog/LoginDialog.js +16 -6
- package/build/components/LoginDialog/LoginDialogCloseButton.js +5 -5
- package/build/components/LoginDialog/LoginDialogForm.js +7 -20
- package/build/components/LoginDialog/LoginDialogFormError.js +7 -7
- package/build/components/LoginDialog/LoginDialogHeader.js +2 -3
- package/build/components/LoginDialog/index.js +1 -1
- package/build/components/Logo/Logo.js +15 -9
- package/build/components/Logo/index.js +1 -1
- package/build/components/MenuItem/MenuItem.js +5 -6
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/NoItems/NoItems.js +2 -3
- package/build/components/NoItems/index.js +1 -1
- package/build/components/NotFound/NotFound.js +20 -19
- package/build/components/NotFound/index.js +1 -1
- package/build/components/Package/Package.js +48 -40
- package/build/components/Package/index.js +2 -2
- package/build/components/Package/styles.js +59 -84
- package/build/components/PackageList/PackageList.js +2 -3
- 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 +13 -8
- package/build/components/RawViewer/index.js +1 -1
- package/build/components/Readme/Readme.js +46 -11
- 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/{github-markdown-dark.css → github-markdown.css} +266 -83
- package/build/components/Readme/index.js +1 -1
- package/build/components/Readme/utils.js +14 -17
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +2 -3
- package/build/components/RegistryInfoDialog/index.js +1 -1
- package/build/components/RegistryInfoDialog/styles.js +13 -17
- package/build/components/Repository/Repository.js +23 -36
- package/build/components/Repository/index.js +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.js +4 -5
- package/build/components/Search/AutoComplete/index.js +1 -1
- package/build/components/Search/AutoComplete/styles.js +6 -45
- package/build/components/Search/Search.js +11 -10
- package/build/components/Search/SearchItem.js +56 -45
- package/build/components/Search/index.js +1 -1
- package/build/components/Search/styles.js +3 -5
- package/build/components/Search/utils.js +23 -0
- package/build/components/SettingsMenu/SettingsMenu.js +36 -11
- package/build/components/SettingsMenu/index.js +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +104 -0
- package/build/components/SideBarTitle/index.js +14 -0
- package/build/components/{SideBarTittle → SideBarTitle}/utils.js +2 -3
- package/build/components/TextField/TextField.js +5 -6
- package/build/components/TextField/index.js +1 -1
- package/build/components/UpLinks/UpLinks.js +37 -9
- package/build/components/UpLinks/UplinkLink.js +22 -0
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.js +9 -11
- package/build/components/Versions/HistoryList.js +32 -26
- package/build/components/Versions/TagList.js +10 -7
- package/build/components/Versions/Versions.js +69 -16
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.js +3 -5
- package/build/hooks/index.js +1 -1
- package/build/hooks/useLocalStorage.js +1 -2
- package/build/hooks/useOnClickOutside.js +1 -2
- package/build/index.js +40 -8
- package/build/layouts/Version/Version.js +2 -3
- package/build/layouts/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +5 -5
- package/build/providers/AppConfigurationProvider/index.js +2 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +5 -5
- package/build/providers/PersistenceSettingProvider/index.js +2 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.js +4 -5
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +3 -3
- package/build/providers/TranslatorProvider/index.js +2 -2
- package/build/providers/VersionProvider/VersionProvider.js +5 -7
- package/build/providers/VersionProvider/index.js +2 -2
- package/build/sections/Detail/ContainerContent.js +5 -7
- package/build/sections/Detail/Detail.js +13 -11
- package/build/sections/Detail/ReadmeSection.js +2 -3
- package/build/sections/Detail/Tabs.js +6 -8
- package/build/sections/Detail/index.js +1 -1
- package/build/sections/Footer/Footer.js +39 -11
- package/build/sections/Footer/index.js +1 -1
- package/build/sections/Footer/styles.js +19 -21
- package/build/sections/Header/Header.js +4 -5
- package/build/sections/Header/HeaderGreetings.js +2 -3
- package/build/sections/Header/HeaderLeft.js +16 -20
- package/build/sections/Header/HeaderMenu.js +3 -4
- package/build/sections/Header/HeaderRight.js +16 -8
- package/build/sections/Header/HeaderSettingsDialog.js +6 -10
- package/build/sections/Header/HeaderToolTip.js +2 -3
- package/build/sections/Header/HeaderToolTipIcon.js +4 -5
- package/build/sections/Header/LanguageSwitch.js +10 -13
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +14 -24
- package/build/sections/Header/RegistryInfoContent/index.js +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.js +3 -5
- package/build/sections/Header/index.js +1 -1
- package/build/sections/Header/styles.js +54 -106
- package/build/sections/Home/Home.js +4 -5
- package/build/sections/Home/index.js +1 -1
- package/build/sections/SideBar/Sidebar.js +23 -30
- package/build/sections/SideBar/index.js +1 -1
- package/build/sections/index.js +1 -1
- package/build/src/AppTest/App.stories.d.ts +8 -0
- package/build/src/AppTest/AppRoute.d.ts +3 -0
- package/build/src/AppTest/pages/Front/Home.d.ts +2 -0
- package/build/src/AppTest/pages/Front/index.d.ts +1 -0
- package/build/src/AppTest/pages/Version/Version.d.ts +3 -0
- package/build/src/AppTest/pages/Version/index.d.ts +1 -0
- 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/DependencyBlock.d.ts +16 -0
- package/build/src/components/Dependencies/DependencyBlock.test.d.ts +1 -0
- package/build/src/components/Dependencies/utits.d.ts +3 -0
- 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/Forbidden/Forbidden.d.ts +3 -0
- package/build/src/components/Forbidden/Forbidden.test.d.ts +1 -0
- package/build/src/components/Forbidden/index.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/Loading/styles.d.ts +2 -2
- 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 +7 -15
- 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 +1 -1
- package/build/src/components/RegistryInfoDialog/styles.d.ts +1 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +1 -9
- package/build/src/components/Search/SearchItem.d.ts +1 -1
- 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/SideBarTitle/index.d.ts +1 -0
- package/build/src/components/UpLinks/UplinkLink.d.ts +6 -0
- package/build/src/components/UpLinks/styles.d.ts +2 -2
- package/build/src/components/Versions/Versions.d.ts +1 -0
- package/build/src/components/Versions/styles.d.ts +2 -2
- package/build/src/index.d.ts +6 -2
- package/build/src/sections/Detail/Detail.stories.d.ts +1 -0
- package/build/src/sections/Detail/Tabs.d.ts +1 -0
- package/build/src/sections/Footer/styles.d.ts +5 -5
- package/build/src/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +3 -3
- package/build/src/sections/Header/RegistryInfoContent/styles.d.ts +2 -2
- package/build/src/sections/Header/styles.d.ts +4 -11
- package/build/src/sections/Home/Home.test.d.ts +1 -0
- package/build/src/store/models/manifest.d.ts +11 -0
- 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/__partials__/packageMeta.d.ts +0 -1
- package/build/src/utils/routes.d.ts +1 -0
- package/build/src/utils/utils.d.ts +1 -0
- package/build/store/api.js +14 -9
- package/build/store/index.js +1 -1
- package/build/store/models/configuration.js +4 -4
- package/build/store/models/download.js +2 -3
- package/build/store/models/index.js +1 -2
- package/build/store/models/login.js +7 -7
- package/build/store/models/manifest.js +27 -8
- package/build/store/models/packages.js +6 -5
- package/build/store/models/routes.js +18 -0
- package/build/store/models/search.js +7 -6
- package/build/store/models/utils.js +10 -0
- package/build/store/storage.js +2 -3
- package/build/store/store.js +2 -3
- package/build/test/i18n-config.js +2 -3
- package/build/test/test-react-testing-library.js +1 -1
- package/build/utils/__partials__/packageMeta.js +1 -3
- package/build/utils/index.js +3 -3
- package/build/utils/loadable.js +2 -2
- package/build/utils/routes.js +2 -2
- package/build/utils/token.js +1 -1
- package/build/utils/url.js +1 -1
- package/build/utils/utils.js +22 -4
- package/package.json +33 -32
- package/src/AppTest/App.stories.tsx +32 -0
- package/src/AppTest/AppRoute.test.tsx +65 -0
- package/src/AppTest/AppRoute.tsx +42 -0
- package/src/AppTest/pages/Front/Home.ts +3 -0
- package/src/AppTest/pages/Front/index.ts +1 -0
- package/src/AppTest/pages/Version/Version.tsx +28 -0
- package/src/AppTest/pages/Version/index.ts +1 -0
- package/src/Theme/ThemeProvider.test.tsx +27 -0
- package/src/Theme/theme.ts +12 -5
- 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.stories.tsx +11 -11
- package/src/components/Dependencies/Dependencies.test.tsx +1 -11
- package/src/components/Dependencies/Dependencies.tsx +30 -69
- package/src/components/Dependencies/DependencyBlock.test.tsx +46 -0
- package/src/components/Dependencies/DependencyBlock.tsx +83 -0
- package/src/components/Dependencies/utits.ts +3 -0
- 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/Forbidden/Forbidden.test.tsx +38 -0
- package/src/components/Forbidden/Forbidden.tsx +56 -0
- package/src/components/Forbidden/index.ts +1 -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/Help/Help.test.tsx +10 -3
- 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 +15 -13
- 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 -4
- 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/NotFound/NotFound.tsx +6 -5
- package/src/components/NotFound/Notfound.test.tsx +6 -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 +34 -7
- package/src/components/Readme/{github-markdown-dark.css → github-markdown.css} +266 -83
- package/src/components/Readme/utils.ts +15 -14
- package/src/components/RegistryInfoDialog/styles.ts +5 -4
- package/src/components/Repository/Repository.tsx +10 -17
- package/src/components/Search/AutoComplete/AutoComplete.tsx +1 -1
- package/src/components/Search/AutoComplete/styles.ts +7 -0
- package/src/components/Search/Search.test.tsx +38 -11
- 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/{SideBarTittle/SideBarTittle.tsx → SideBarTitle/SideBarTitle.tsx} +19 -3
- package/src/components/SideBarTitle/index.ts +1 -0
- 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 +11 -6
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +26 -8
- package/src/components/Versions/Versions.tsx +81 -28
- package/src/index.ts +6 -2
- 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.stories.tsx +10 -0
- package/src/sections/Detail/Detail.test.tsx +8 -1
- package/src/sections/Detail/Detail.tsx +11 -4
- package/src/sections/Detail/Tabs.tsx +6 -9
- 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 +2 -3
- package/src/sections/Header/LanguageSwitch.tsx +10 -7
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.tsx +2 -7
- package/src/sections/Header/styles.ts +4 -16
- package/src/sections/Home/Home.test.tsx +37 -0
- package/src/sections/Home/Home.tsx +0 -1
- package/src/sections/SideBar/Sidebar.test.tsx +52 -84
- package/src/sections/SideBar/Sidebar.tsx +11 -26
- package/src/store/api.test.ts +19 -2
- package/src/store/api.ts +13 -6
- package/src/store/models/configuration.ts +2 -1
- package/src/store/models/login.ts +10 -12
- package/src/store/models/manifest.ts +25 -6
- 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/__partials__/packageMeta.ts +0 -1
- 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/Dependencies/styles.js +0 -68
- package/build/components/Developers/styles.js +0 -69
- 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 -15
- package/build/components/Package/Tag/index.js +0 -14
- package/build/components/Package/Tag/styles.js +0 -25
- package/build/components/Readme/ReadmeDark.js +0 -46
- package/build/components/Readme/ReadmeLight.js +0 -46
- package/build/components/Readme/github-markdown-light.css +0 -1014
- package/build/components/SideBarTittle/SideBarTittle.js +0 -95
- package/build/components/SideBarTittle/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -37
- package/build/sections/Header/RegistryInfoDialog/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/styles.js +0 -49
- package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
- package/build/src/components/Dependencies/styles.d.ts +0 -8
- 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/components/Readme/ReadmeDark.d.ts +0 -5
- package/build/src/components/Readme/ReadmeLight.d.ts +0 -5
- package/build/src/components/SideBarTittle/index.d.ts +0 -1
- 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/Dependencies/styles.ts +0 -26
- 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/Readme/ReadmeDark.tsx +0 -32
- package/src/components/Readme/ReadmeLight.tsx +0 -32
- package/src/components/Readme/github-markdown-light.css +0 -1014
- package/src/components/Search/AutoComplete/styles.tsx +0 -42
- package/src/components/SideBarTittle/index.ts +0 -1
- 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/build/src/components/{SideBarTittle/SideBarTittle.d.ts → SideBarTitle/SideBarTitle.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle/SideBarTittle.stories.d.ts → SideBarTitle/SideBarTitle.stories.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle → SideBarTitle}/utils.d.ts +0 -0
- /package/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/src/components/{SideBarTittle/SideBarTittle.stories.tsx → SideBarTitle/SideBarTitle.stories.tsx} +0 -0
- /package/src/components/{SideBarTittle → SideBarTitle}/utils.ts +0 -0
|
@@ -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,11 +40,16 @@ 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
|
-
{typeof versions[version]
|
|
52
|
+
{typeof versions[version]?.deprecated === 'string' ? (
|
|
48
53
|
<Chip
|
|
49
54
|
color="warning"
|
|
50
55
|
data-testid="deprecated-badge"
|
|
@@ -55,7 +60,7 @@ const VersionsHistoryList: React.FC<Props> = ({ versions, packageName, time }) =
|
|
|
55
60
|
/>
|
|
56
61
|
) : null}
|
|
57
62
|
<Spacer />
|
|
58
|
-
<ListItemText title={utils.formatDate(time[version])}>
|
|
63
|
+
<ListItemText data-testid={`version-list-text`} title={utils.formatDate(time[version])}>
|
|
59
64
|
{time[version]
|
|
60
65
|
? utils.formatDateDistance(time[version])
|
|
61
66
|
: t('versions.not-available')}
|
|
@@ -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 />
|
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { fireEvent, render, screen } from '../../test/test-react-testing-library';
|
|
6
6
|
import Versions, { Props } from './Versions';
|
|
7
7
|
import data from './__partials__/data.json';
|
|
8
8
|
import dataDeprecated from './__partials__/deprecated-versions.json';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const VersionsComponent: React.FC<Props> = (props) => (
|
|
11
11
|
<MemoryRouter>
|
|
12
12
|
<Versions {...props} />
|
|
13
13
|
</MemoryRouter>
|
|
14
14
|
);
|
|
15
15
|
|
|
16
|
+
jest.mock('lodash/debounce', () =>
|
|
17
|
+
jest.fn((fn) => {
|
|
18
|
+
fn.cancel = jest.fn();
|
|
19
|
+
return fn;
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
16
23
|
describe('<Version /> component', () => {
|
|
17
24
|
afterEach(() => {
|
|
18
|
-
|
|
25
|
+
jest.clearAllMocks();
|
|
19
26
|
});
|
|
20
27
|
|
|
21
28
|
test('should render versions', () => {
|
|
22
|
-
const { getByText } = render(<
|
|
29
|
+
const { getByText } = render(<VersionsComponent packageMeta={data} packageName={'foo'} />);
|
|
23
30
|
|
|
24
31
|
expect(getByText('versions.version-history')).toBeTruthy();
|
|
25
32
|
expect(getByText('versions.current-tags')).toBeTruthy();
|
|
@@ -31,17 +38,28 @@ describe('<Version /> component', () => {
|
|
|
31
38
|
expect(screen.queryByTestId('deprecated-badge')).toBeInTheDocument();
|
|
32
39
|
});
|
|
33
40
|
|
|
41
|
+
test('should filter by version', () => {
|
|
42
|
+
render(<VersionsComponent packageMeta={data} packageName={'foo'} />);
|
|
43
|
+
expect(screen.getByText('versions.version-history')).toBeTruthy();
|
|
44
|
+
expect(screen.getByText('versions.current-tags')).toBeTruthy();
|
|
45
|
+
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
|
|
46
|
+
fireEvent.change(screen.getByRole('textbox'), { target: { value: '2.3.0' } });
|
|
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);
|
|
50
|
+
});
|
|
51
|
+
|
|
34
52
|
test('should not render versions', () => {
|
|
35
|
-
|
|
53
|
+
render(<VersionsComponent packageMeta={{}} packageName={'foo'} />);
|
|
36
54
|
|
|
37
|
-
expect(queryByText('versions.version-history')).toBeFalsy();
|
|
38
|
-
expect(queryByText('versions.current-tags')).toBeFalsy();
|
|
55
|
+
expect(screen.queryByText('versions.version-history')).toBeFalsy();
|
|
56
|
+
expect(screen.queryByText('versions.current-tags')).toBeFalsy();
|
|
39
57
|
});
|
|
40
58
|
|
|
41
59
|
test('should render versions deprecated settings', () => {
|
|
42
60
|
window.__VERDACCIO_BASENAME_UI_OPTIONS.hideDeprecatedVersions = true;
|
|
43
61
|
const { getByText } = render(
|
|
44
|
-
<
|
|
62
|
+
<VersionsComponent packageMeta={dataDeprecated} packageName={'foo'} />
|
|
45
63
|
);
|
|
46
64
|
expect(getByText('versions.hide-deprecated')).toBeTruthy();
|
|
47
65
|
|
|
@@ -1,55 +1,108 @@
|
|
|
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';
|
|
6
|
+
import TextField from '@mui/material/TextField';
|
|
2
7
|
import Typography from '@mui/material/Typography';
|
|
3
8
|
import { useTheme } from '@mui/styles';
|
|
4
|
-
import
|
|
9
|
+
import debounce from 'lodash/debounce';
|
|
10
|
+
import React, { useState } from 'react';
|
|
5
11
|
import { useTranslation } from 'react-i18next';
|
|
12
|
+
import semver from 'semver';
|
|
6
13
|
|
|
14
|
+
import { Theme } from '../../Theme';
|
|
7
15
|
import { useConfig } from '../../providers';
|
|
8
16
|
import VersionsHistoryList from './HistoryList';
|
|
9
17
|
import VersionsTagList from './TagList';
|
|
10
18
|
|
|
11
19
|
export type Props = { packageMeta: any; packageName: string };
|
|
12
20
|
|
|
21
|
+
export const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
|
|
22
|
+
fontWeight: props.theme && props.theme.fontWeight.bold,
|
|
23
|
+
textTransform: 'capitalize',
|
|
24
|
+
}));
|
|
25
|
+
|
|
13
26
|
const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
|
|
14
27
|
const { t } = useTranslation();
|
|
15
28
|
const { configOptions } = useConfig();
|
|
16
29
|
const theme = useTheme();
|
|
30
|
+
const { versions = {}, time = {}, ['dist-tags']: distTags = {} } = packageMeta;
|
|
17
31
|
|
|
18
|
-
|
|
32
|
+
const [packageVersions, setPackageVersions] = useState(versions);
|
|
33
|
+
if (!packageMeta || Object.keys(packageMeta).length === 0) {
|
|
19
34
|
return null;
|
|
20
35
|
}
|
|
36
|
+
const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
|
|
37
|
+
const hasDistTags = distTags && Object.keys(distTags).length > 0 && packageName;
|
|
38
|
+
const hasVersionHistory =
|
|
39
|
+
packageVersions && Object.keys(packageVersions).length > 0 && packageName;
|
|
21
40
|
|
|
22
|
-
const
|
|
41
|
+
const filterVersions = (textSearch) => {
|
|
42
|
+
const filteredVersions = Object.keys(versions).reduce((acc, version) => {
|
|
43
|
+
if (textSearch !== '') {
|
|
44
|
+
if (typeof versions[version] !== 'undefined') {
|
|
45
|
+
if (semver.satisfies(version, textSearch, { includePrerelease: true, loose: true })) {
|
|
46
|
+
acc[version] = versions[version];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
acc[version] = versions[version];
|
|
51
|
+
}
|
|
52
|
+
return acc;
|
|
53
|
+
}, {});
|
|
23
54
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
|
|
55
|
+
setPackageVersions(filteredVersions);
|
|
56
|
+
};
|
|
27
57
|
|
|
28
58
|
return (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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}
|
|
39
71
|
<>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
/>
|
|
49
85
|
</>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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>
|
|
53
106
|
);
|
|
54
107
|
};
|
|
55
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,9 +11,13 @@ 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
|
-
export { default as SideBarTitle } from './components/
|
|
20
|
+
export { default as SideBarTitle } from './components/SideBarTitle';
|
|
18
21
|
export { default as UpLinks } from './components/UpLinks';
|
|
19
22
|
export { default as Versions } from './components/Versions';
|
|
20
23
|
export { default as TextField } from './components/TextField';
|
|
@@ -22,6 +25,7 @@ export { default as Label } from './components/Label';
|
|
|
22
25
|
export { default as Logo } from './components/Logo';
|
|
23
26
|
export { default as MenuItem } from './components/MenuItem';
|
|
24
27
|
export { default as NotFound } from './components/NotFound';
|
|
28
|
+
export { default as Forbidden } from './components/Forbidden';
|
|
25
29
|
export { default as LoginDialog } from './components/LoginDialog';
|
|
26
30
|
export { default as Search } from './components/Search';
|
|
27
31
|
export { default as HeaderInfoDialog } from './components/HeaderInfoDialog';
|
|
@@ -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();
|
|
@@ -27,3 +27,13 @@ export const DetailJquery: any = () => (
|
|
|
27
27
|
</Route>
|
|
28
28
|
</MemoryRouter>
|
|
29
29
|
);
|
|
30
|
+
|
|
31
|
+
export const DetailForbidden: any = () => (
|
|
32
|
+
<MemoryRouter initialEntries={[`/-/web/detail/JSONStream`]}>
|
|
33
|
+
<Route exact={true} path="/-/web/detail/:package">
|
|
34
|
+
<VersionProvider>
|
|
35
|
+
<Detail />
|
|
36
|
+
</VersionProvider>
|
|
37
|
+
</Route>
|
|
38
|
+
</MemoryRouter>
|
|
39
|
+
);
|
|
@@ -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,22 +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
|
-
<Tabs
|
|
18
|
-
color={'primary'}
|
|
19
|
-
indicatorColor={'primary'}
|
|
20
|
-
onChange={onChange}
|
|
21
|
-
value={tabPosition}
|
|
22
|
-
variant={'fullWidth'}
|
|
23
|
-
>
|
|
18
|
+
<Tabs onChange={onChange} value={tabPosition} variant={'fullWidth'}>
|
|
24
19
|
<Tab data-testid={'readme-tab'} id={'readme-tab'} label={t('tab.readme')} />
|
|
25
20
|
<Tab data-testid={'dependencies-tab'} id={'dependencies-tab'} label={t('tab.dependencies')} />
|
|
26
21
|
<Tab data-testid={'versions-tab'} id={'versions-tab'} label={t('tab.versions')} />
|
|
27
|
-
|
|
22
|
+
{showUplinks && (
|
|
23
|
+
<Tab data-testid={'uplinks-tab'} id={'uplinks-tab'} label={t('tab.uplinks')} />
|
|
24
|
+
)}
|
|
28
25
|
</Tabs>
|
|
29
26
|
);
|
|
30
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(() =>
|