@verdaccio/ui-components 3.0.0-next.1 → 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 +108 -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 +13 -8
- package/build/components/ActionBar/ActionBarAction.js +26 -19
- package/build/components/ActionBar/index.js +1 -1
- package/build/components/Author/Author.js +12 -34
- package/build/components/Author/index.js +1 -1
- package/build/components/Author/styles.js +10 -28
- package/build/components/CopyClipboard/CopyToClipBoard.js +13 -13
- 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 +13 -22
- 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 +17 -12
- 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 +36 -29
- package/build/components/Install/InstallListItem.js +35 -48
- 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 +56 -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 -9
- package/build/components/RawViewer/index.js +1 -1
- package/build/components/Readme/Readme.js +41 -21
- 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.css +1198 -0
- 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 +49 -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 +52 -18
- package/build/components/Versions/TagList.js +10 -7
- package/build/components/Versions/Versions.js +82 -15
- package/build/components/Versions/__partials__/data.json +1 -0
- package/build/components/Versions/__partials__/deprecated-versions.json +175 -0
- 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 +6 -5
- package/build/providers/AppConfigurationProvider/index.js +2 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +7 -6
- 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/__mocks__/react-markdown.d.ts +2 -2
- package/build/src/components/Author/Author.d.ts +0 -5
- package/build/src/components/Author/styles.d.ts +0 -4
- package/build/src/components/CopyClipboard/CopyToClipBoard.d.ts +1 -1
- 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/Deprecated/Deprecated.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/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.d.ts +1 -1
- package/build/src/components/Heading/Heading.test.d.ts +1 -0
- package/build/src/components/Icons/DevsIcons/CommonJS.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/ES6Module.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/Git.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/NodeJS.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/TypeScript.d.ts +2 -2
- package/build/src/components/Icons/Earth.d.ts +2 -2
- package/build/src/components/Icons/FileBinary.d.ts +2 -2
- package/build/src/components/Icons/Icons.test.d.ts +1 -0
- package/build/src/components/Icons/Law.d.ts +2 -2
- package/build/src/components/Icons/License.d.ts +2 -2
- package/build/src/components/Icons/Managers/Npm.d.ts +2 -2
- package/build/src/components/Icons/Managers/Pnpm.d.ts +2 -2
- package/build/src/components/Icons/Managers/Yarn.d.ts +2 -2
- package/build/src/components/Icons/SvgIcon.d.ts +1 -1
- package/build/src/components/Icons/Time.d.ts +2 -2
- package/build/src/components/Icons/Version.d.ts +2 -2
- package/build/src/components/Install/InstallListItem.d.ts +2 -0
- 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 +1 -4
- 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/LoginDialog/LoginDialog.stories.d.ts +2 -2
- package/build/src/components/LoginDialog/LoginDialogForm.d.ts +1 -1
- package/build/src/components/LoginDialog/LoginDialogFormError.d.ts +1 -1
- 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/MenuItem/MenuItem.d.ts +1 -1
- 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 -2
- 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/Search.stories.d.ts +2 -2
- package/build/src/components/Search/SearchItem.d.ts +1 -1
- package/build/src/components/Search/styles.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/TextField/TextField.d.ts +1 -1
- 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/HistoryList.d.ts +1 -0
- 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/Footer.d.ts +2 -2
- package/build/src/sections/Footer/styles.d.ts +5 -5
- package/build/src/sections/Header/LanguageSwitch.d.ts +2 -2
- 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 +8 -5
- package/build/src/utils/__partials__/packageMeta.d.ts +0 -1
- package/build/src/utils/loadable.d.ts +2 -2
- 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 -4
- 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 +34 -31
- 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.stories.tsx +1 -1
- package/src/components/ActionBar/ActionBar.test.tsx +44 -16
- package/src/components/ActionBar/ActionBar.tsx +17 -13
- package/src/components/ActionBar/ActionBarAction.tsx +22 -14
- package/src/components/Author/Author.test.tsx +7 -1
- package/src/components/Author/Author.tsx +4 -33
- package/src/components/Author/styles.ts +0 -6
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
- package/src/components/CopyClipboard/CopyToClipBoard.tsx +4 -3
- 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/Deprecated/Deprecated.tsx +6 -19
- 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 +10 -6
- 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 +74 -41
- package/src/components/Install/Install.tsx +27 -15
- package/src/components/Install/InstallListItem.tsx +49 -31
- 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 +51 -45
- 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 +9 -10
- package/src/components/Readme/Readme.spec.tsx +17 -0
- package/src/components/Readme/Readme.tsx +28 -12
- package/src/components/Readme/github-markdown.css +1198 -0
- 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 +64 -7
- package/src/components/{SideBarTittle/SideBarTittle.tsx → SideBarTitle/SideBarTitle.tsx} +20 -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 +39 -6
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +40 -7
- package/src/components/Versions/Versions.tsx +88 -19
- package/src/components/Versions/__partials__/data.json +1 -0
- package/src/components/Versions/__partials__/deprecated-versions.json +175 -0
- package/src/index.ts +6 -2
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +2 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +4 -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/download.ts +0 -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 +8 -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/SideBarTittle/SideBarTittle.js +0 -94
- 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/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/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,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import AppRoute from './AppRoute';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'App/Main',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ApplicationStoryBook: any = () => (
|
|
11
|
+
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
12
|
+
<AppRoute />
|
|
13
|
+
</MemoryRouter>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const ApplicationjQuery: any = () => (
|
|
17
|
+
<MemoryRouter initialEntries={[`/-/web/detail/jquery`]}>
|
|
18
|
+
<AppRoute />
|
|
19
|
+
</MemoryRouter>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const ApplicationForbidden: any = () => (
|
|
23
|
+
<MemoryRouter initialEntries={[`/-/web/detail/JSONStream`]}>
|
|
24
|
+
<AppRoute />
|
|
25
|
+
</MemoryRouter>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const ApplicationNotFound: any = () => (
|
|
29
|
+
<MemoryRouter initialEntries={[`/-/web/detail/kleur`]}>
|
|
30
|
+
<AppRoute />
|
|
31
|
+
</MemoryRouter>
|
|
32
|
+
);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import { store } from '../';
|
|
5
|
+
import { act, renderWithStore, screen, waitFor } from '../test/test-react-testing-library';
|
|
6
|
+
import AppRoute from './AppRoute';
|
|
7
|
+
|
|
8
|
+
// force the windows to expand to display items
|
|
9
|
+
// https://github.com/bvaughn/react-virtualized/issues/493#issuecomment-640084107
|
|
10
|
+
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(600);
|
|
11
|
+
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(600);
|
|
12
|
+
|
|
13
|
+
function appTest(path: string) {
|
|
14
|
+
renderWithStore(
|
|
15
|
+
<MemoryRouter initialEntries={[path]}>
|
|
16
|
+
<AppRoute />
|
|
17
|
+
</MemoryRouter>,
|
|
18
|
+
store
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// See jest/server-handlers.ts for test routes
|
|
23
|
+
describe('AppRoute', () => {
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
jest.clearAllMocks();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('renders Front component for ROOT path', async () => {
|
|
29
|
+
act(() => appTest('/'));
|
|
30
|
+
await waitFor(() => expect(screen.getByTestId('loading')).toBeInTheDocument());
|
|
31
|
+
await waitFor(() => expect(screen.getAllByTestId('package-item-list')).toHaveLength(5));
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('renders VersionPage component for PACKAGE path', async () => {
|
|
35
|
+
act(() => appTest('/-/web/detail/jquery'));
|
|
36
|
+
await waitFor(() => screen.getByTestId('readme-tab'));
|
|
37
|
+
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('renders VersionPage component for PACKAGE VERSION path', async () => {
|
|
41
|
+
act(() => appTest('/-/web/detail/jquery/v/3.6.3'));
|
|
42
|
+
await waitFor(() => screen.getByTestId('readme-tab'));
|
|
43
|
+
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('renders Forbidden component for not allowed PACKAGE', async () => {
|
|
47
|
+
act(() => appTest('/-/web/detail/JSONstream'));
|
|
48
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('renders NotFound component for missing PACKAGE', async () => {
|
|
52
|
+
act(() => appTest('/-/web/detail/kleur'));
|
|
53
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('renders NotFound component for non-existing PACKAGE VERSION', async () => {
|
|
57
|
+
act(() => appTest('/-/web/detail/jquery/v/0.9.9'));
|
|
58
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('renders NotFound component for non-matching path', async () => {
|
|
62
|
+
act(() => appTest('/oiccadrev'));
|
|
63
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Route as ReactRouterDomRoute, Switch } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import { NotFound, Route, VersionProvider, loadable } from '../index';
|
|
5
|
+
|
|
6
|
+
const VersionPage = loadable(() => import(/* webpackChunkName: "Version" */ './pages/Version'));
|
|
7
|
+
const Front = loadable(() => import(/* webpackChunkName: "Home" */ './pages/Front'));
|
|
8
|
+
|
|
9
|
+
const AppRoute: React.FC = () => {
|
|
10
|
+
return (
|
|
11
|
+
<Switch>
|
|
12
|
+
<ReactRouterDomRoute exact={true} path={Route.ROOT}>
|
|
13
|
+
<Front />
|
|
14
|
+
</ReactRouterDomRoute>
|
|
15
|
+
<ReactRouterDomRoute exact={true} path={Route.PACKAGE}>
|
|
16
|
+
<VersionProvider>
|
|
17
|
+
<VersionPage />
|
|
18
|
+
</VersionProvider>
|
|
19
|
+
</ReactRouterDomRoute>
|
|
20
|
+
<ReactRouterDomRoute exact={true} path={Route.PACKAGE_VERSION}>
|
|
21
|
+
<VersionProvider>
|
|
22
|
+
<VersionPage />
|
|
23
|
+
</VersionProvider>
|
|
24
|
+
</ReactRouterDomRoute>
|
|
25
|
+
<ReactRouterDomRoute exact={true} path={Route.SCOPE_PACKAGE_VERSION}>
|
|
26
|
+
<VersionProvider>
|
|
27
|
+
<VersionPage />
|
|
28
|
+
</VersionProvider>
|
|
29
|
+
</ReactRouterDomRoute>
|
|
30
|
+
<ReactRouterDomRoute exact={true} path={Route.SCOPE_PACKAGE}>
|
|
31
|
+
<VersionProvider>
|
|
32
|
+
<VersionPage />
|
|
33
|
+
</VersionProvider>
|
|
34
|
+
</ReactRouterDomRoute>
|
|
35
|
+
<ReactRouterDomRoute>
|
|
36
|
+
<NotFound />
|
|
37
|
+
</ReactRouterDomRoute>
|
|
38
|
+
</Switch>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default AppRoute;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Home';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
|
|
4
|
+
import Forbidden from '../../../components/Forbidden';
|
|
5
|
+
import { Loading, NotFound, RootState, VersionLayout } from '../../../index';
|
|
6
|
+
|
|
7
|
+
const Version: React.FC = () => {
|
|
8
|
+
const manifestStore = useSelector((state: RootState) => state.manifest);
|
|
9
|
+
const isLoading = useSelector((state: RootState) => state?.loading?.models.manifest);
|
|
10
|
+
|
|
11
|
+
if (isLoading) {
|
|
12
|
+
return <Loading />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// @ts-expect-error
|
|
16
|
+
if (manifestStore.forbidden) {
|
|
17
|
+
return <Forbidden />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// @ts-expect-error
|
|
21
|
+
if (manifestStore.hasNotBeenFound) {
|
|
22
|
+
return <NotFound />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return <VersionLayout />;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Version;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Version';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
AppConfigurationProvider,
|
|
6
|
+
PersistenceSettingProvider,
|
|
7
|
+
StyleBaseline,
|
|
8
|
+
ThemeProvider,
|
|
9
|
+
} from '../';
|
|
10
|
+
|
|
11
|
+
const AppContainer = () => (
|
|
12
|
+
<AppConfigurationProvider>
|
|
13
|
+
<ThemeProvider>
|
|
14
|
+
<StyleBaseline />
|
|
15
|
+
<PersistenceSettingProvider>
|
|
16
|
+
<div>{'Theme'}</div>
|
|
17
|
+
</PersistenceSettingProvider>
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
</AppConfigurationProvider>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
describe('ThemeProvider', () => {
|
|
23
|
+
test('should render with theme', async () => {
|
|
24
|
+
render(<AppContainer />);
|
|
25
|
+
await screen.findByText('Theme');
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/Theme/theme.ts
CHANGED
|
@@ -6,11 +6,11 @@ const colors = {
|
|
|
6
6
|
black: '#000',
|
|
7
7
|
white: '#fff',
|
|
8
8
|
red: '#d32f2f',
|
|
9
|
-
orange: '#
|
|
9
|
+
orange: '#cd4000',
|
|
10
10
|
greySuperLight: '#f5f5f5',
|
|
11
11
|
greyLight: '#d3d3d3',
|
|
12
12
|
greyLight2: '#908ba1',
|
|
13
|
-
greyLight3: '#
|
|
13
|
+
greyLight3: '#f3f4f2',
|
|
14
14
|
greyDark: '#a9a9a9',
|
|
15
15
|
greyDark2: '#586069',
|
|
16
16
|
greyChateau: '#95989a',
|
|
@@ -25,7 +25,7 @@ const colors = {
|
|
|
25
25
|
nobel02: '#9f9f9f',
|
|
26
26
|
primary: PRIMARY_COLOR,
|
|
27
27
|
secondary: '#20232a',
|
|
28
|
-
background: '#
|
|
28
|
+
background: '#f4f4f4',
|
|
29
29
|
dodgerBlue: '#1ba1f2',
|
|
30
30
|
cyanBlue: '#253341',
|
|
31
31
|
};
|
|
@@ -36,9 +36,9 @@ const themeModes = {
|
|
|
36
36
|
},
|
|
37
37
|
dark: {
|
|
38
38
|
...colors,
|
|
39
|
-
primary: '#
|
|
39
|
+
primary: '#ffffff',
|
|
40
40
|
secondary: '#424242',
|
|
41
|
-
background: '#
|
|
41
|
+
background: '#1a202c',
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -114,6 +114,13 @@ export const getTheme = (themeMode: ThemeMode, primaryColor: string) => {
|
|
|
114
114
|
default: palette.background,
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
|
+
// Looks better in darkmode without background opacity
|
|
118
|
+
// https://mui.com/material-ui/migration/v5-component-changes/#change-dark-mode-background-opacity
|
|
119
|
+
components: {
|
|
120
|
+
MuiPaper: {
|
|
121
|
+
styleOverrides: { root: { backgroundImage: 'unset' } },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
117
124
|
...customizedTheme,
|
|
118
125
|
});
|
|
119
126
|
};
|
|
@@ -20,7 +20,7 @@ const packageMeta = {
|
|
|
20
20
|
dist: {
|
|
21
21
|
fileCount: 0,
|
|
22
22
|
unpackedSize: 0,
|
|
23
|
-
tarball: 'https://registry.
|
|
23
|
+
tarball: 'https://registry.npmjs.org/verdaccio/-/verdaccio-5.26.0.tgz',
|
|
24
24
|
},
|
|
25
25
|
homepage: 'https://verdaccio.org',
|
|
26
26
|
bugs: {
|
|
@@ -7,16 +7,16 @@ import ActionBar from './ActionBar';
|
|
|
7
7
|
const defaultPackageMeta = {
|
|
8
8
|
_uplinks: {},
|
|
9
9
|
latest: {
|
|
10
|
-
name: 'verdaccio
|
|
11
|
-
version: '
|
|
10
|
+
name: 'verdaccio',
|
|
11
|
+
version: '1.0.0',
|
|
12
12
|
dist: {
|
|
13
|
-
fileCount:
|
|
14
|
-
unpackedSize:
|
|
15
|
-
tarball: 'http://localhost:
|
|
13
|
+
fileCount: 1,
|
|
14
|
+
unpackedSize: 171,
|
|
15
|
+
tarball: 'http://localhost:9000/verdaccio/-/verdaccio-1.0.0.tgz',
|
|
16
16
|
},
|
|
17
17
|
homepage: 'https://verdaccio.org',
|
|
18
18
|
bugs: {
|
|
19
|
-
url: 'https://github.com/verdaccio/
|
|
19
|
+
url: 'https://github.com/verdaccio/verdaccio/issues',
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
};
|
|
@@ -27,8 +27,16 @@ describe('<ActionBar /> component', () => {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
test('should render the component in default state', () => {
|
|
30
|
-
|
|
31
|
-
expect(
|
|
30
|
+
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
31
|
+
expect(screen.getByTestId('download-tarball-btn')).toBeInTheDocument();
|
|
32
|
+
expect(screen.getByTestId('BugReportIcon')).toBeInTheDocument();
|
|
33
|
+
expect(screen.getByTestId('HomeIcon')).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('should not render if data is missing', () => {
|
|
37
|
+
// @ts-ignore - testing with missing data
|
|
38
|
+
renderWithStore(<ActionBar packageMeta={undefined} />, store);
|
|
39
|
+
expect(screen.queryByTestId('HomeIcon')).toBeNull();
|
|
32
40
|
});
|
|
33
41
|
|
|
34
42
|
test('when there is no action bar data', () => {
|
|
@@ -45,8 +53,10 @@ describe('<ActionBar /> component', () => {
|
|
|
45
53
|
},
|
|
46
54
|
};
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
expect(
|
|
56
|
+
renderWithStore(<ActionBar packageMeta={packageMeta} />, store);
|
|
57
|
+
expect(screen.queryByTestId('download-tarball-btn')).not.toBeInTheDocument();
|
|
58
|
+
expect(screen.queryByTestId('BugReportIcon')).not.toBeInTheDocument();
|
|
59
|
+
expect(screen.queryByTestId('HomeIcon')).not.toBeInTheDocument();
|
|
50
60
|
});
|
|
51
61
|
|
|
52
62
|
test('when there is a button to download a tarball', () => {
|
|
@@ -54,23 +64,43 @@ describe('<ActionBar /> component', () => {
|
|
|
54
64
|
expect(screen.getByLabelText('action-bar-action.download-tarball')).toBeTruthy();
|
|
55
65
|
});
|
|
56
66
|
|
|
67
|
+
test('when button to download is disabled', () => {
|
|
68
|
+
renderWithStore(
|
|
69
|
+
<ActionBar packageMeta={defaultPackageMeta} showDownloadTarball={false} />,
|
|
70
|
+
store
|
|
71
|
+
);
|
|
72
|
+
expect(screen.queryByTestId('download-tarball-btn')).not.toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
|
|
57
75
|
test('when there is a button to raw manifest', () => {
|
|
58
76
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
59
77
|
expect(screen.getByLabelText('action-bar-action.raw')).toBeTruthy();
|
|
60
78
|
});
|
|
61
79
|
|
|
62
|
-
test('when click button to raw manifest open a dialog with
|
|
80
|
+
test('when click button to raw manifest open a dialog with viewer', async () => {
|
|
63
81
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
82
|
+
expect(screen.queryByTestId('rawViewer--dialog')).toBeFalsy();
|
|
83
|
+
|
|
64
84
|
fireEvent.click(screen.getByLabelText('action-bar-action.raw'));
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
await screen.findByTestId('rawViewer--dialog');
|
|
86
|
+
|
|
87
|
+
fireEvent.click(screen.getByTestId('close-raw-viewer'));
|
|
88
|
+
await screen.getByLabelText('action-bar-action.raw');
|
|
89
|
+
|
|
90
|
+
expect(screen.queryByTestId('rawViewer--dialog')).toBeFalsy();
|
|
67
91
|
});
|
|
68
92
|
|
|
69
93
|
test('should not display download tarball button', () => {
|
|
70
|
-
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={
|
|
94
|
+
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
71
95
|
expect(screen.queryByLabelText('Download tarball')).toBeFalsy();
|
|
72
96
|
});
|
|
73
97
|
|
|
98
|
+
test('when click button to download ', async () => {
|
|
99
|
+
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
100
|
+
fireEvent.click(screen.getByTestId('download-tarball-btn'));
|
|
101
|
+
await store.getState().loading.models.download;
|
|
102
|
+
});
|
|
103
|
+
|
|
74
104
|
test('should not display show raw button', () => {
|
|
75
105
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
76
106
|
expect(screen.queryByLabelText('action-bar-action.raw')).toBeFalsy();
|
|
@@ -78,8 +108,6 @@ describe('<ActionBar /> component', () => {
|
|
|
78
108
|
|
|
79
109
|
test('when there is a button to open an issue', () => {
|
|
80
110
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
81
|
-
// TODO: should be visible by text
|
|
82
|
-
// expect(screen.getByLabelText('action-bar-action.open-an-issue')).toBeTruthy();
|
|
83
111
|
expect(screen.getByTestId('BugReportIcon')).toBeInTheDocument();
|
|
84
112
|
});
|
|
85
113
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/* eslint-disable verdaccio/jsx-spread */
|
|
1
2
|
import Box from '@mui/material/Box';
|
|
3
|
+
import Stack from '@mui/material/Stack';
|
|
2
4
|
import React, { useState } from 'react';
|
|
3
5
|
|
|
4
6
|
import { url } from '../../utils';
|
|
@@ -39,19 +41,21 @@ const ActionBar: React.FC<Props> = ({ showRaw, showDownloadTarball = true, packa
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
return (
|
|
42
|
-
<Box alignItems="center" display="flex"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
<Box alignItems="center" display="flex" sx={{ my: 2 }}>
|
|
45
|
+
<Stack direction="row" spacing={1}>
|
|
46
|
+
{actions.map((action) => (
|
|
47
|
+
<ActionBarAction key={action.type} {...action} />
|
|
48
|
+
))}
|
|
49
|
+
{isRawViewerOpen && (
|
|
50
|
+
<RawViewer
|
|
51
|
+
isOpen={isRawViewerOpen}
|
|
52
|
+
onClose={() => {
|
|
53
|
+
setIsRawViewerOpen(false);
|
|
54
|
+
}}
|
|
55
|
+
packageMeta={packageMeta}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
</Stack>
|
|
55
59
|
</Box>
|
|
56
60
|
);
|
|
57
61
|
};
|
|
@@ -3,25 +3,24 @@ import BugReportIcon from '@mui/icons-material/BugReport';
|
|
|
3
3
|
import DownloadIcon from '@mui/icons-material/CloudDownload';
|
|
4
4
|
import HomeIcon from '@mui/icons-material/Home';
|
|
5
5
|
import RawOnIcon from '@mui/icons-material/RawOn';
|
|
6
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
6
7
|
import FabMUI from '@mui/material/Fab';
|
|
7
8
|
import Tooltip from '@mui/material/Tooltip';
|
|
8
9
|
import React, { useCallback } from 'react';
|
|
9
10
|
import { useTranslation } from 'react-i18next';
|
|
10
|
-
import { useDispatch } from 'react-redux';
|
|
11
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
11
12
|
|
|
12
13
|
import { Theme } from '../../Theme';
|
|
13
|
-
import { Dispatch } from '../../store/store';
|
|
14
|
-
import
|
|
14
|
+
import { Dispatch, RootState } from '../../store/store';
|
|
15
|
+
import LinkExternal from '../LinkExternal';
|
|
15
16
|
|
|
16
17
|
export const Fab = styled(FabMUI)<{ theme?: Theme }>(({ theme }) => ({
|
|
17
18
|
backgroundColor:
|
|
18
19
|
theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
|
|
19
|
-
|
|
20
|
-
marginRight: 10,
|
|
21
|
-
':hover': {
|
|
20
|
+
'&:hover': {
|
|
22
21
|
color: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
|
|
23
|
-
background: theme?.palette.white,
|
|
24
22
|
},
|
|
23
|
+
color: theme?.palette.white,
|
|
25
24
|
}));
|
|
26
25
|
|
|
27
26
|
type ActionType = 'VISIT_HOMEPAGE' | 'OPEN_AN_ISSUE' | 'DOWNLOAD_TARBALL' | 'RAW_DATA';
|
|
@@ -36,6 +35,7 @@ export interface ActionBarActionProps {
|
|
|
36
35
|
const ActionBarAction: React.FC<ActionBarActionProps> = ({ type, link, action }) => {
|
|
37
36
|
const { t } = useTranslation();
|
|
38
37
|
const dispatch = useDispatch<Dispatch>();
|
|
38
|
+
const isLoading = useSelector((state: RootState) => state?.loading?.models.download);
|
|
39
39
|
|
|
40
40
|
const handleDownload = useCallback(async () => {
|
|
41
41
|
dispatch.download.getTarball({ link });
|
|
@@ -45,29 +45,37 @@ const ActionBarAction: React.FC<ActionBarActionProps> = ({ type, link, action })
|
|
|
45
45
|
case 'VISIT_HOMEPAGE':
|
|
46
46
|
return (
|
|
47
47
|
<Tooltip title={t('action-bar-action.visit-home-page') as string}>
|
|
48
|
-
<
|
|
48
|
+
<LinkExternal to={link} variant="button">
|
|
49
49
|
<Fab size="small">
|
|
50
50
|
<HomeIcon />
|
|
51
51
|
</Fab>
|
|
52
|
-
</
|
|
52
|
+
</LinkExternal>
|
|
53
53
|
</Tooltip>
|
|
54
54
|
);
|
|
55
55
|
case 'OPEN_AN_ISSUE':
|
|
56
56
|
return (
|
|
57
57
|
<Tooltip title={t('action-bar-action.open-an-issue') as string}>
|
|
58
|
-
<
|
|
58
|
+
<LinkExternal to={link} variant="button">
|
|
59
59
|
<Fab size="small">
|
|
60
60
|
<BugReportIcon />
|
|
61
61
|
</Fab>
|
|
62
|
-
</
|
|
62
|
+
</LinkExternal>
|
|
63
63
|
</Tooltip>
|
|
64
64
|
);
|
|
65
65
|
case 'DOWNLOAD_TARBALL':
|
|
66
66
|
return (
|
|
67
67
|
<Tooltip title={t('action-bar-action.download-tarball') as string}>
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
68
|
+
{isLoading ? (
|
|
69
|
+
<CircularProgress sx={{ marginX: 0 }}>
|
|
70
|
+
<Fab data-testid="download-tarball-btn" onClick={handleDownload} size="small">
|
|
71
|
+
<DownloadIcon />
|
|
72
|
+
</Fab>
|
|
73
|
+
</CircularProgress>
|
|
74
|
+
) : (
|
|
75
|
+
<Fab data-testid="download-tarball-btn" onClick={handleDownload} size="small">
|
|
76
|
+
<DownloadIcon />
|
|
77
|
+
</Fab>
|
|
78
|
+
)}
|
|
71
79
|
</Tooltip>
|
|
72
80
|
);
|
|
73
81
|
case 'RAW_DATA':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { cleanup, render } from '../../test/test-react-testing-library';
|
|
3
|
+
import { cleanup, render, screen } from '../../test/test-react-testing-library';
|
|
4
4
|
import { PackageMetaInterface } from '../../types/packageMeta';
|
|
5
5
|
import Authors from './Author';
|
|
6
6
|
|
|
@@ -66,4 +66,10 @@ describe('<Author /> component', () => {
|
|
|
66
66
|
const wrapper = render(withAuthorComponent(packageMeta));
|
|
67
67
|
expect(wrapper).toMatchSnapshot();
|
|
68
68
|
});
|
|
69
|
+
|
|
70
|
+
test('should not render if data is missing', () => {
|
|
71
|
+
// @ts-ignore - testing with missing data
|
|
72
|
+
render(withAuthorComponent(undefined));
|
|
73
|
+
expect(screen.queryByText('sidebar.author.title')).toBeNull();
|
|
74
|
+
});
|
|
69
75
|
});
|
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
import Avatar from '@mui/material/Avatar';
|
|
2
1
|
import List from '@mui/material/List';
|
|
3
|
-
import i18next from 'i18next';
|
|
4
2
|
import React, { FC } from 'react';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
6
4
|
|
|
7
|
-
import
|
|
8
|
-
import { AuthorListItem,
|
|
5
|
+
import Person from '../Person';
|
|
6
|
+
import { AuthorListItem, StyledText } from './styles';
|
|
9
7
|
|
|
10
|
-
export function getAuthorName(authorName?: string): string {
|
|
11
|
-
if (!authorName) {
|
|
12
|
-
return i18next.t('author-unknown');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (authorName.toLowerCase() === 'anonymous') {
|
|
16
|
-
return i18next.t('author-anonymous');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return authorName;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param param0
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
8
|
const Author: FC<{ packageMeta }> = ({ packageMeta }) => {
|
|
27
9
|
const { t } = useTranslation();
|
|
28
10
|
|
|
@@ -36,21 +18,10 @@ const Author: FC<{ packageMeta }> = ({ packageMeta }) => {
|
|
|
36
18
|
return null;
|
|
37
19
|
}
|
|
38
20
|
|
|
39
|
-
const { email, name } = author;
|
|
40
|
-
|
|
41
|
-
const avatarComponent = <Avatar alt={author.name} src={author.avatar} />;
|
|
42
|
-
|
|
43
21
|
return (
|
|
44
22
|
<List subheader={<StyledText variant={'subtitle1'}>{t('sidebar.author.title')}</StyledText>}>
|
|
45
|
-
<AuthorListItem>
|
|
46
|
-
{
|
|
47
|
-
avatarComponent
|
|
48
|
-
) : (
|
|
49
|
-
<a href={`mailto:${email}?subject=${packageName}@${version}`} target={'_top'}>
|
|
50
|
-
{avatarComponent}
|
|
51
|
-
</a>
|
|
52
|
-
)}
|
|
53
|
-
{name && <AuthorListItemText primary={getAuthorName(name)} />}
|
|
23
|
+
<AuthorListItem sx={{ my: 1 }}>
|
|
24
|
+
<Person packageName={packageName} person={author} version={version} withText={true} />
|
|
54
25
|
</AuthorListItem>
|
|
55
26
|
</List>
|
|
56
27
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { Typography } from '@mui/material';
|
|
3
3
|
import ListItem from '@mui/material/ListItem';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
4
|
|
|
6
5
|
import { Theme } from '../../Theme';
|
|
7
6
|
|
|
@@ -15,8 +14,3 @@ export const AuthorListItem = styled(ListItem)({
|
|
|
15
14
|
backgroundColor: 'transparent',
|
|
16
15
|
},
|
|
17
16
|
});
|
|
18
|
-
|
|
19
|
-
export const AuthorListItemText = styled(ListItemText)({
|
|
20
|
-
padding: '0 10px',
|
|
21
|
-
margin: 0,
|
|
22
|
-
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen } from '../../test/test-react-testing-library';
|
|
4
|
+
import CopyToClipBoard from './CopyToClipBoard';
|
|
5
|
+
|
|
6
|
+
Object.assign(navigator, {
|
|
7
|
+
clipboard: { writeText: jest.fn().mockImplementation(() => Promise.resolve()) },
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('CopyToClipBoard component', () => {
|
|
11
|
+
test('should copy text to clipboard', async () => {
|
|
12
|
+
const copyThis = 'copy this';
|
|
13
|
+
render(
|
|
14
|
+
<CopyToClipBoard dataTestId={'copy-component'} text={copyThis} title={`npm i verdaccio`} />
|
|
15
|
+
);
|
|
16
|
+
expect(screen.getByTestId('copy-component')).toBeInTheDocument();
|
|
17
|
+
|
|
18
|
+
const copyComponent = await screen.findByTestId('copy-component');
|
|
19
|
+
await fireEvent.click(copyComponent);
|
|
20
|
+
|
|
21
|
+
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(copyThis);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -4,6 +4,7 @@ import IconButton from '@mui/material/IconButton';
|
|
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
+
import { Theme } from '../../Theme';
|
|
7
8
|
import { copyToClipBoardUtility } from './utils';
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
@@ -19,14 +20,14 @@ const Wrapper = styled('div')({
|
|
|
19
20
|
justifyContent: 'space-between',
|
|
20
21
|
});
|
|
21
22
|
|
|
22
|
-
const Content = styled('span')({
|
|
23
|
+
const Content = styled('span')<{ theme?: Theme }>(({ theme }) => ({
|
|
23
24
|
display: 'inline-block',
|
|
24
25
|
overflow: 'hidden',
|
|
25
26
|
textOverflow: 'ellipsis',
|
|
26
27
|
height: 'auto',
|
|
27
28
|
whiteSpace: 'break-spaces',
|
|
28
|
-
fontSize:
|
|
29
|
-
});
|
|
29
|
+
fontSize: theme?.fontSize.sm,
|
|
30
|
+
}));
|
|
30
31
|
|
|
31
32
|
function CopyToClipBoard({ text, children, dataTestId, title, ...props }: Props) {
|
|
32
33
|
return (
|