@verdaccio/ui-theme 6.0.0-6-next.9 → 6.0.0-6-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +1 -1
- package/.eslintrc +0 -15
- package/CHANGELOG.md +61 -0
- package/jest/api/packages.json +42 -0
- package/jest/jest.config.js +2 -2
- package/jest/server-handlers.ts +9 -0
- package/jest/server.ts +6 -0
- package/jest/setup-env.ts +18 -0
- package/jest/setup.ts +2 -7
- package/jest/unit/components/__mocks__/token.ts +0 -1
- package/jest/unit/components/store/login.ts +1 -0
- package/package.json +43 -33
- package/src/App/App.test.tsx +75 -51
- package/src/App/App.tsx +7 -42
- package/src/App/AppRoute.tsx +3 -16
- package/src/App/Footer/Footer.test.tsx +0 -1
- package/src/App/Footer/Footer.tsx +35 -22
- package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +208 -302
- package/src/App/Footer/styles.ts +2 -3
- package/src/App/Header/Header.test.tsx +53 -61
- package/src/App/Header/Header.tsx +13 -24
- package/src/App/Header/HeaderGreetings.tsx +0 -1
- package/src/App/Header/HeaderLeft.tsx +0 -1
- package/src/App/Header/HeaderMenu.tsx +6 -6
- package/src/App/Header/HeaderRight.tsx +1 -2
- package/src/App/Header/HeaderToolTip.tsx +0 -1
- package/src/App/Header/HeaderToolTipIcon.tsx +10 -10
- package/src/App/Header/LanguageSwitch.tsx +17 -79
- package/src/App/Header/LoginDialog/LoginDialog.test.tsx +25 -35
- package/src/App/Header/LoginDialog/LoginDialog.tsx +28 -46
- package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +1 -2
- package/src/App/Header/LoginDialog/LoginDialogForm.tsx +0 -1
- package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +1 -2
- package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +4 -4
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -3
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +9 -10
- package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +1 -2
- package/src/App/Header/RegistryInfoDialog/styles.ts +0 -1
- package/src/App/Header/Search/Search.test.tsx +48 -43
- package/src/App/Header/Search/Search.tsx +23 -108
- package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +392 -28
- package/src/App/Header/styles.ts +2 -3
- package/src/App/index.ts +0 -1
- package/src/App/utils/loadable.tsx +3 -1
- package/src/components/ActionBar/ActionBar.test.tsx +13 -14
- package/src/components/ActionBar/ActionBar.tsx +0 -2
- package/src/components/ActionBar/ActionBarAction.tsx +11 -14
- package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +198 -53
- package/src/components/AppBar.tsx +1 -1
- package/src/components/Author/Author.test.tsx +1 -4
- package/src/components/Author/Author.tsx +2 -4
- package/src/components/Author/__snapshots__/Author.test.tsx.snap +804 -48
- package/src/components/Author/styles.ts +0 -1
- package/src/components/AutoComplete/AutoComplete.tsx +85 -163
- package/src/components/AutoComplete/AutoCompleteV2.tsx +8 -10
- package/src/components/AutoComplete/styles.tsx +0 -15
- package/src/components/Avatar.tsx +1 -1
- package/src/components/Box.tsx +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Card.tsx +1 -1
- package/src/components/CardActions.tsx +1 -1
- package/src/components/CardContent.tsx +1 -1
- package/src/components/Chip.tsx +1 -1
- package/src/components/CircularProgress.tsx +2 -2
- package/src/components/CopyToClipBoard.tsx +2 -3
- package/src/components/Dialog.tsx +1 -1
- package/src/components/DialogActions.tsx +2 -2
- package/src/components/DialogContent.tsx +2 -2
- package/src/components/DialogTitle.tsx +1 -1
- package/src/components/Divider.tsx +1 -1
- package/src/components/FloatingActionButton.tsx +1 -1
- package/src/components/FormControl.tsx +1 -1
- package/src/components/FormHelperText.tsx +2 -2
- package/src/components/Grid.tsx +1 -1
- package/src/components/Heading.tsx +1 -1
- package/src/components/IconButton.tsx +1 -1
- package/src/components/Icons/index.ts +1 -17
- package/src/components/Input.tsx +1 -1
- package/src/components/InputAdornment/InputAdornment.tsx +2 -2
- package/src/components/InputLabel.tsx +1 -1
- package/src/components/Label/Label.test.tsx +0 -1
- package/src/components/Label/Label.tsx +2 -3
- package/src/components/List.tsx +1 -1
- package/src/components/ListItem.tsx +1 -1
- package/src/components/ListItemText.tsx +1 -4
- package/src/components/Loading/Loading.test.tsx +0 -1
- package/src/components/Loading/Loading.tsx +1 -2
- package/src/components/Loading/Spinner/Spinner.test.tsx +1 -2
- package/src/components/Loading/Spinner/Spinner.tsx +1 -2
- package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +114 -16
- package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +63 -11
- package/src/components/Loading/styles.ts +1 -2
- package/src/components/Logo/Logo.test.tsx +0 -1
- package/src/components/Logo/Logo.tsx +1 -2
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +2 -0
- package/src/components/Menu.tsx +1 -1
- package/src/components/MenuItem.tsx +1 -1
- package/src/components/NotFound/NotFound.tsx +1 -3
- package/src/components/NotFound/Notfound.test.tsx +1 -2
- package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +138 -11
- package/src/components/NotFound/styles.ts +0 -1
- package/src/components/Paper.tsx +1 -1
- package/src/components/SnackbarContent.tsx +1 -1
- package/src/components/SvgIcon.tsx +1 -1
- package/src/components/Tab.tsx +1 -1
- package/src/components/Tabs.tsx +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/Text/TextConfig.ts +1 -1
- package/src/components/TextField/TextField.test.tsx +0 -1
- package/src/components/TextField/TextField.tsx +2 -2
- package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +216 -3
- package/src/components/Toolbar.tsx +1 -1
- package/src/components/Tooltip.tsx +1 -1
- package/src/design-tokens/ResetStyles.tsx +1 -1
- package/src/design-tokens/StyleBaseline.tsx +2 -2
- package/src/design-tokens/ThemeContext.ts +1 -1
- package/src/design-tokens/ThemeProvider.tsx +15 -12
- package/src/design-tokens/theme.ts +28 -26
- package/src/design-tokens/useTheme.ts +1 -1
- package/src/{design-tokens → hooks}/useLocalStorage.ts +0 -0
- package/src/{design-tokens → hooks}/useOnClickOutside.ts +0 -0
- package/src/i18n/ABOUT_TRANSLATIONS.md +13 -0
- package/src/i18n/__mocks__/loadTranslationFile.ts +5 -0
- package/src/i18n/config.ts +38 -0
- package/src/i18n/crowdin/ui.json +170 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/cs-CZ.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/de-DE.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/en-US.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/es-ES.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/fr-FR.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/ja-JP.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/km-KH.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/pt-BR.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/ru-RU.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/tr-TR.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/uk-UA.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/zh-CN.json +0 -0
- package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/zh-TW.json +0 -0
- package/src/i18n/download_translations/ar-SA/ui.json +170 -0
- package/src/i18n/download_translations/cs-CZ/ui.json +170 -0
- package/src/i18n/download_translations/de-DE/ui.json +170 -0
- package/src/i18n/download_translations/es-ES/ui.json +170 -0
- package/src/i18n/download_translations/fi-FI/ui.json +170 -0
- package/src/i18n/download_translations/fil-PH/ui.json +170 -0
- package/src/i18n/download_translations/fr-FR/ui.json +170 -0
- package/src/i18n/download_translations/gl-ES/ui.json +170 -0
- package/src/i18n/download_translations/hi-IN/ui.json +170 -0
- package/src/i18n/download_translations/it-IT/ui.json +170 -0
- package/src/i18n/download_translations/ja-JP/ui.json +170 -0
- package/src/i18n/download_translations/km-KH/ui.json +170 -0
- package/src/i18n/download_translations/ko-KR/ui.json +170 -0
- package/src/i18n/download_translations/pl-PL/ui.json +170 -0
- package/src/i18n/download_translations/pt-BR/ui.json +170 -0
- package/src/i18n/download_translations/pt-PT/ui.json +170 -0
- package/src/i18n/download_translations/ro-RO/ui.json +170 -0
- package/src/i18n/download_translations/ru-RU/ui.json +170 -0
- package/src/i18n/download_translations/si-LK/ui.json +170 -0
- package/src/i18n/download_translations/sr-CS/ui.json +170 -0
- package/src/i18n/download_translations/sr-SP/ui.json +170 -0
- package/src/i18n/download_translations/tg-TJ/ui.json +170 -0
- package/src/i18n/download_translations/tr-TR/ui.json +170 -0
- package/src/i18n/download_translations/uk-UA/ui.json +170 -0
- package/src/i18n/download_translations/vi-VN/ui.json +170 -0
- package/src/i18n/download_translations/yo-NG/ui.json +170 -0
- package/src/i18n/download_translations/zh-CN/ui.json +170 -0
- package/src/i18n/download_translations/zh-TW/ui.json +170 -0
- package/src/i18n/enabledLanguages.ts +35 -0
- package/src/i18n/loadTranslationFile.ts +14 -0
- package/src/index.tsx +13 -11
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +0 -2
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +1 -3
- package/src/pages/Version/DetailContainer/Dependencies/styles.ts +0 -1
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +1 -3
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +2 -3
- package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +0 -1
- package/src/pages/Version/DetailContainer/DetailContainer.tsx +1 -3
- package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +0 -1
- package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +0 -1
- package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +0 -1
- package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +0 -1
- package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +0 -1
- package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +10 -1
- package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +1 -2
- package/src/pages/Version/DetailContainer/Readme/Readme.tsx +1 -2
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +1 -9
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +1 -3
- package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +184 -26
- package/src/pages/Version/DetailContainer/UpLinks/styles.ts +2 -3
- package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +3 -5
- package/src/pages/Version/DetailContainer/Versions/Versions.tsx +1 -2
- package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +2 -4
- package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +1 -3
- package/src/pages/Version/DetailContainer/Versions/styles.ts +2 -3
- package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +168 -34
- package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +0 -2
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +0 -2
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +1 -2
- package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +0 -1
- package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +3 -5
- package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +3 -5
- package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +0 -1
- package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +328 -40
- package/src/pages/Version/DetailSidebar/Developers/styles.ts +0 -1
- package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +1436 -74
- package/src/pages/Version/DetailSidebar/Dist/styles.ts +2 -1
- package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Engines/styles.ts +0 -1
- package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Install/Install.tsx +0 -2
- package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +0 -1
- package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +1 -3
- package/src/pages/Version/Version.test.tsx +3 -5
- package/src/pages/Version/Version.tsx +21 -6
- package/src/pages/Version/VersionContextProvider.tsx +14 -45
- package/src/pages/Version/VersionLayout.tsx +1 -1
- package/src/pages/Version/context.ts +1 -1
- package/src/pages/home/Home.tsx +9 -28
- package/src/pages/home/PackageList/Help/Help.test.tsx +0 -1
- package/src/pages/home/PackageList/Help/Help.tsx +0 -1
- package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +298 -59
- package/src/pages/home/PackageList/Help/styles.ts +0 -1
- package/src/pages/home/PackageList/Package/Package.test.tsx +5 -4
- package/src/pages/home/PackageList/Package/Package.tsx +20 -28
- package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +0 -1
- package/src/pages/home/PackageList/Package/styles.ts +5 -6
- package/src/pages/home/PackageList/PackageList.tsx +17 -17
- package/src/pages/home/PackageList/Packagelist.test.tsx +6 -5
- package/src/providers/API/api.test.ts +1 -0
- package/src/providers/API/api.ts +7 -3
- package/src/providers/config/AppConfigurationProvider.tsx +3 -3
- package/src/store/index.ts +1 -0
- package/src/store/models/configuration.ts +41 -0
- package/src/store/models/download.ts +30 -0
- package/src/store/models/index.ts +18 -0
- package/src/store/models/login.ts +92 -0
- package/src/store/models/manifest.ts +91 -0
- package/src/store/models/packages.ts +36 -0
- package/src/store/models/search.ts +81 -0
- package/src/store/store.ts +15 -0
- package/src/utils/login.test.ts +3 -4
- package/src/utils/package.test.ts +2 -3
- package/src/utils/package.ts +2 -1
- package/src/utils/sec-utils.ts +1 -1
- package/src/utils/test-react-testing-library.tsx +22 -5
- package/src/utils/url.test.ts +1 -1
- package/src/utils/url.ts +1 -0
- package/static/Dependencies.15768a14646212b71166.js +2 -0
- package/static/Dependencies.15768a14646212b71166.js.LICENSE.txt +78 -0
- package/static/Dist.15768a14646212b71166.js +2 -0
- package/static/Dist.15768a14646212b71166.js.LICENSE.txt +60 -0
- package/static/Engines.15768a14646212b71166.js +2 -0
- package/static/Engines.15768a14646212b71166.js.LICENSE.txt +66 -0
- package/static/Home.15768a14646212b71166.js +2 -0
- package/static/Home.15768a14646212b71166.js.LICENSE.txt +222 -0
- package/static/Install.15768a14646212b71166.js +2 -0
- package/static/Install.15768a14646212b71166.js.LICENSE.txt +66 -0
- package/static/NotFound.15768a14646212b71166.js +2 -0
- package/static/NotFound.15768a14646212b71166.js.LICENSE.txt +40 -0
- package/static/Provider.15768a14646212b71166.js +2 -0
- package/static/Provider.15768a14646212b71166.js.LICENSE.txt +32 -0
- package/static/Repository.15768a14646212b71166.js +2 -0
- package/static/Repository.15768a14646212b71166.js.LICENSE.txt +50 -0
- package/static/UpLinks.15768a14646212b71166.js +2 -0
- package/static/UpLinks.15768a14646212b71166.js.LICENSE.txt +56 -0
- package/static/Version.15768a14646212b71166.js +2 -0
- package/static/Version.15768a14646212b71166.js.LICENSE.txt +380 -0
- package/static/Versions.15768a14646212b71166.js +2 -0
- package/static/Versions.15768a14646212b71166.js.LICENSE.txt +64 -0
- package/static/index.html +1 -1
- package/static/main.15768a14646212b71166.js +2 -0
- package/static/main.15768a14646212b71166.js.LICENSE.txt +972 -0
- package/static/manifest.json +17 -3
- package/static/runtime.15768a14646212b71166.js +2 -0
- package/static/{runtime.9525ddaaf85378590c63.js.LICENSE.txt → runtime.15768a14646212b71166.js.LICENSE.txt} +2 -2
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-123400.15768a14646212b71166.js +2 -0
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-123400.15768a14646212b71166.js.LICENSE.txt +148 -0
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-d2b578.15768a14646212b71166.js +2 -0
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-d2b578.15768a14646212b71166.js.LICENSE.txt +218 -0
- package/static/vendors-node_modules_pnpm_mui_material_5_0_6_033766d34292bd5d464212fd95cb4b6d_node_modules_mu-1fb115.15768a14646212b71166.js +2 -0
- package/static/vendors-node_modules_pnpm_mui_material_5_0_6_033766d34292bd5d464212fd95cb4b6d_node_modules_mu-1fb115.15768a14646212b71166.js.LICENSE.txt +316 -0
- package/static/vendors.15768a14646212b71166.js +103 -0
- package/static/vendors.15768a14646212b71166.js.LICENSE.txt +3158 -0
- package/tools/dev.server.js +0 -1
- package/tools/webpack.dev.config.babel.js +1 -3
- package/tools/webpack.prod.config.babel.js +1 -1
- package/tsconfig.json +1 -3
- package/types/index.ts +3 -20
- package/i18n/config.ts +0 -94
- package/src/App/AppContext.ts +0 -18
- package/src/App/AppContextProvider.tsx +0 -44
- package/src/App/Header/Search/SearchAdornment.tsx +0 -18
- package/src/components/Icons/Austria.tsx +0 -23
- package/src/components/Icons/Brazil.tsx +0 -44
- package/src/components/Icons/China.tsx +0 -33
- package/src/components/Icons/Czech.tsx +0 -21
- package/src/components/Icons/France.tsx +0 -27
- package/src/components/Icons/Germany.tsx +0 -27
- package/src/components/Icons/India.tsx +0 -44
- package/src/components/Icons/Japan.tsx +0 -23
- package/src/components/Icons/Khmer.tsx +0 -40
- package/src/components/Icons/Nicaragua.tsx +0 -66
- package/src/components/Icons/Russia.tsx +0 -27
- package/src/components/Icons/Spain.tsx +0 -43
- package/src/components/Icons/Taiwan.tsx +0 -25
- package/src/components/Icons/Turkey.tsx +0 -23
- package/src/components/Icons/Ukraine.tsx +0 -30
- package/src/components/Icons/Usa.tsx +0 -34
- package/src/design-tokens/emotion.ts +0 -5
- package/src/lib/constants.ts +0 -9
- package/src/pages/Version/DetailSidebar/ActionBar/ActionBar.test.tsx +0 -84
- package/src/pages/Version/DetailSidebar/ActionBar/__snapshots__/ActionBar.test.tsx.snap +0 -122
- package/src/pages/Version/is-package-version-valid.ts +0 -19
- package/src/providers/API/APIProvider.tsx +0 -109
- package/src/providers/API/index.ts +0 -1
- package/static/main.9525ddaaf85378590c63.js +0 -2
- package/static/main.9525ddaaf85378590c63.js.LICENSE.txt +0 -1588
- package/static/runtime.9525ddaaf85378590c63.js +0 -2
- package/static/vendors.9525ddaaf85378590c63.js +0 -2
- package/static/vendors.9525ddaaf85378590c63.js.LICENSE.txt +0 -4540
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
|
|
3
2
|
import Chip from 'verdaccio-ui/components/Chip';
|
|
4
3
|
import FloatingActionButton from 'verdaccio-ui/components/FloatingActionButton';
|
|
5
4
|
import ListItem from 'verdaccio-ui/components/ListItem';
|
|
@@ -14,11 +13,13 @@ export const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
|
14
13
|
export const DistListItem = styled(ListItem)({
|
|
15
14
|
paddingLeft: 0,
|
|
16
15
|
paddingRight: 0,
|
|
16
|
+
flexWrap: 'wrap',
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
export const DistChips = styled(Chip)({
|
|
20
20
|
marginRight: 5,
|
|
21
21
|
textTransform: 'capitalize',
|
|
22
|
+
marginTop: 5,
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
export const DownloadButton = styled(FloatingActionButton)<{ theme?: Theme }>((props) => ({
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { render, cleanup } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
2
|
+
import { cleanup, render } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
3
|
|
|
5
4
|
import { PackageMetaInterface } from '../../../../../types/packageMeta';
|
|
6
5
|
import { DetailContext } from '../../context';
|
|
7
|
-
|
|
8
6
|
import Engine from './Engines';
|
|
9
7
|
|
|
10
8
|
jest.mock('./img/node.png', () => '');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
|
|
4
3
|
import Avatar from 'verdaccio-ui/components/Avatar';
|
|
5
4
|
import Grid from 'verdaccio-ui/components/Grid';
|
|
6
5
|
import List from 'verdaccio-ui/components/List';
|
|
@@ -8,9 +7,8 @@ import ListItemText from 'verdaccio-ui/components/ListItemText';
|
|
|
8
7
|
|
|
9
8
|
import { DetailContext } from '../../context';
|
|
10
9
|
import npm from '../Install/img/npm.svg';
|
|
11
|
-
|
|
12
10
|
import node from './img/node.png';
|
|
13
|
-
import {
|
|
11
|
+
import { EngineListItem, StyledText } from './styles';
|
|
14
12
|
|
|
15
13
|
const Engine: React.FC = () => {
|
|
16
14
|
const { packageMeta } = useContext(DetailContext);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
import { render, screen } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
3
|
|
|
5
4
|
import { DetailContext } from '../../context';
|
|
6
5
|
import { DetailContextProps } from '../../version-config';
|
|
7
|
-
|
|
8
|
-
import data from './__partials__/data.json';
|
|
9
6
|
import Install from './Install';
|
|
7
|
+
import data from './__partials__/data.json';
|
|
10
8
|
|
|
11
9
|
const detailContextValue: Partial<DetailContextProps> = {
|
|
12
10
|
packageName: 'foo',
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
4
|
import List from 'verdaccio-ui/components/List';
|
|
6
5
|
import Text from 'verdaccio-ui/components/Text';
|
|
7
6
|
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
8
7
|
import { useConfig } from 'verdaccio-ui/providers/config';
|
|
9
8
|
|
|
10
9
|
import { DetailContext } from '../..';
|
|
11
|
-
|
|
12
10
|
import InstallListItem, { DependencyManager } from './InstallListItem';
|
|
13
11
|
|
|
14
12
|
const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
4
|
import Avatar from 'verdaccio-ui/components/Avatar';
|
|
6
5
|
import CopyToClipBoard from 'verdaccio-ui/components/CopyToClipBoard';
|
|
7
6
|
import ListItem from 'verdaccio-ui/components/ListItem';
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
import { render } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
3
|
|
|
5
4
|
import { DetailContext } from '../../context';
|
|
6
5
|
import { DetailContextProps } from '../../version-config';
|
|
7
|
-
|
|
8
|
-
import data from './__partials__/data.json';
|
|
9
6
|
import Repository from './Repository';
|
|
7
|
+
import data from './__partials__/data.json';
|
|
10
8
|
|
|
11
9
|
const detailContextValue: DetailContextProps = {
|
|
12
10
|
packageName: 'foo',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
4
|
import Avatar from 'verdaccio-ui/components/Avatar';
|
|
6
5
|
import CopyToClipBoard from 'verdaccio-ui/components/CopyToClipBoard';
|
|
7
6
|
import Link from 'verdaccio-ui/components/Link';
|
|
@@ -13,7 +12,6 @@ import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
|
13
12
|
import { isURL } from 'verdaccio-ui/utils/url';
|
|
14
13
|
|
|
15
14
|
import { DetailContext } from '../../context';
|
|
16
|
-
|
|
17
15
|
import git from './img/git.png';
|
|
18
16
|
|
|
19
17
|
const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
@@ -22,7 +20,7 @@ const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
|
22
20
|
}));
|
|
23
21
|
|
|
24
22
|
const GithubLink = styled(Link)<{ theme?: Theme }>(({ theme }) => ({
|
|
25
|
-
color: theme?.palette.
|
|
23
|
+
color: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.white,
|
|
26
24
|
':hover': {
|
|
27
25
|
color: theme?.palette.dodgerBlue,
|
|
28
26
|
},
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { waitFor } from '@testing-library/dom';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MemoryRouter } from 'react-router';
|
|
4
|
-
|
|
5
4
|
import { render } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
6
5
|
|
|
7
|
-
import translationEN from '
|
|
8
|
-
|
|
6
|
+
import translationEN from '../../i18n/crowdin/ui.json';
|
|
7
|
+
import Version from './Version';
|
|
9
8
|
import data from './__partials__/data.json';
|
|
10
9
|
import { DetailContext } from './context';
|
|
11
|
-
import Version from './Version';
|
|
12
10
|
|
|
13
11
|
// :-) we mock this otherways fails on render, some weird issue on material-ui
|
|
14
12
|
jest.mock('verdaccio-ui/components/Avatar');
|
|
@@ -23,7 +21,7 @@ const detailContextValue = {
|
|
|
23
21
|
version: '1.0.0',
|
|
24
22
|
};
|
|
25
23
|
|
|
26
|
-
describe('test Version page', () => {
|
|
24
|
+
describe.skip('test Version page', () => {
|
|
27
25
|
test('should render the version page', async () => {
|
|
28
26
|
const { getByTestId, getByText } = render(
|
|
29
27
|
<MemoryRouter>
|
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import { useParams } from 'react-router-dom';
|
|
3
4
|
import Loading from 'verdaccio-ui/components/Loading';
|
|
4
5
|
import NotFound from 'verdaccio-ui/components/NotFound';
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import { Dispatch, RootState } from '../../store/store';
|
|
7
8
|
import VersionLayout from './VersionLayout';
|
|
9
|
+
import getRouterPackageName from './get-route-package-name';
|
|
10
|
+
|
|
11
|
+
interface Params {
|
|
12
|
+
scope?: string;
|
|
13
|
+
package: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
}
|
|
8
16
|
|
|
9
17
|
const Version: React.FC = () => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
18
|
+
const { version: packageVersion, package: pkgName, scope } = useParams<Params>();
|
|
19
|
+
const manifestStore = useSelector((state: RootState) => state.manifest);
|
|
20
|
+
const isLoading = useSelector((state: RootState) => state?.loading?.models.manifest);
|
|
21
|
+
const dispatch = useDispatch<Dispatch>();
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const packageName = getRouterPackageName(pkgName, scope);
|
|
25
|
+
dispatch.manifest.getManifest({ packageName, packageVersion });
|
|
26
|
+
}, [dispatch, pkgName, scope, packageVersion]);
|
|
12
27
|
|
|
13
28
|
if (isLoading) {
|
|
14
29
|
return <Loading />;
|
|
15
30
|
}
|
|
16
31
|
|
|
17
|
-
if (hasNotBeenFound) {
|
|
32
|
+
if (manifestStore.hasNotBeenFound) {
|
|
18
33
|
return <NotFound />;
|
|
19
34
|
}
|
|
20
35
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import React, { useEffect
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
2
3
|
import { useParams } from 'react-router-dom';
|
|
3
|
-
import { PackageMetaInterface } from 'types/packageMeta';
|
|
4
|
-
|
|
5
|
-
import { useAPI } from 'verdaccio-ui/providers/API/APIProvider';
|
|
6
4
|
|
|
5
|
+
import { Dispatch, RootState } from '../../store/store';
|
|
7
6
|
import { DetailContext } from './context';
|
|
8
7
|
import getRouterPackageName from './get-route-package-name';
|
|
9
|
-
import isPackageVersionValid from './is-package-version-valid';
|
|
10
8
|
|
|
11
9
|
interface Params {
|
|
12
10
|
scope?: string;
|
|
@@ -15,52 +13,23 @@ interface Params {
|
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
const VersionContextProvider: React.FC = ({ children }) => {
|
|
18
|
-
const { version, package: pkgName, scope } = useParams<Params>();
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const [hasNotBeenFound, setHasNotBeenFound] = useState<boolean>();
|
|
25
|
-
const { callDetailPage, callReadme } = useAPI();
|
|
26
|
-
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const updatedPackageName = getRouterPackageName(pkgName, scope);
|
|
29
|
-
setPackageName(updatedPackageName);
|
|
30
|
-
}, [pkgName, scope]);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setPackageVersion(version);
|
|
34
|
-
}, [version]);
|
|
35
|
-
|
|
36
|
-
const doCalls = useCallback(async () => {
|
|
37
|
-
try {
|
|
38
|
-
const packageMeta = await callDetailPage(packageName, packageVersion);
|
|
39
|
-
const readMe = await callReadme(packageName, packageVersion);
|
|
40
|
-
if (isPackageVersionValid(packageMeta, packageVersion)) {
|
|
41
|
-
setReadme(readMe);
|
|
42
|
-
setPackageMeta(packageMeta);
|
|
43
|
-
setIsLoading(false);
|
|
44
|
-
} else {
|
|
45
|
-
setIsLoading(false);
|
|
46
|
-
setHasNotBeenFound(true);
|
|
47
|
-
}
|
|
48
|
-
} catch (error: any) {
|
|
49
|
-
setHasNotBeenFound(true);
|
|
50
|
-
setIsLoading(false);
|
|
51
|
-
}
|
|
52
|
-
}, [packageName, packageVersion, callDetailPage, callReadme]);
|
|
53
|
-
|
|
16
|
+
const { version: packageVersion, package: pkgName, scope } = useParams<Params>();
|
|
17
|
+
const { manifest, readme, packageName, hasNotBeenFound } = useSelector(
|
|
18
|
+
(state: RootState) => state.manifest
|
|
19
|
+
);
|
|
20
|
+
const isLoading = useSelector((state: RootState) => state?.loading?.models.manifest);
|
|
21
|
+
const dispatch = useDispatch<Dispatch>();
|
|
54
22
|
useEffect(() => {
|
|
55
|
-
|
|
56
|
-
|
|
23
|
+
const packageName = getRouterPackageName(pkgName, scope);
|
|
24
|
+
dispatch.manifest.getManifest({ packageName, packageVersion });
|
|
25
|
+
}, [dispatch, packageVersion, pkgName, scope]);
|
|
57
26
|
|
|
58
27
|
return (
|
|
59
28
|
<DetailContext.Provider
|
|
60
29
|
value={{
|
|
61
|
-
packageMeta,
|
|
30
|
+
packageMeta: manifest,
|
|
62
31
|
packageVersion,
|
|
63
|
-
readMe,
|
|
32
|
+
readMe: readme,
|
|
64
33
|
packageName,
|
|
65
34
|
isLoading,
|
|
66
35
|
hasNotBeenFound,
|
package/src/pages/home/Home.tsx
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
|
-
import React, { useEffect
|
|
2
|
-
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
import Loading from 'verdaccio-ui/components/Loading';
|
|
4
|
-
import { useAPI } from 'verdaccio-ui/providers/API/APIProvider';
|
|
5
4
|
|
|
5
|
+
import { Dispatch, RootState } from '../../store/store';
|
|
6
6
|
import { PackageList } from './PackageList';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const Home: React.FC<Props> = ({ isUserLoggedIn }) => {
|
|
13
|
-
const [packages, setPackages] = useState([]);
|
|
14
|
-
const { getPackages } = useAPI();
|
|
15
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
16
|
-
const loadPackages = useCallback(async () => {
|
|
17
|
-
try {
|
|
18
|
-
const packages = await getPackages();
|
|
19
|
-
// FIXME add correct type for package
|
|
20
|
-
setPackages(packages as never[]);
|
|
21
|
-
} catch (error: any) {
|
|
22
|
-
// FIXME: add dialog
|
|
23
|
-
// eslint-disable-next-line no-console
|
|
24
|
-
console.error({
|
|
25
|
-
title: 'Warning',
|
|
26
|
-
message: `Unable to load package list: ${error.message}`,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
setIsLoading(false);
|
|
30
|
-
}, [getPackages]);
|
|
8
|
+
const Home: React.FC = () => {
|
|
9
|
+
const packages = useSelector((state: RootState) => state.packages.response);
|
|
10
|
+
const isLoading = useSelector((state: RootState) => state?.loading?.models.packages);
|
|
11
|
+
const dispatch = useDispatch<Dispatch>();
|
|
31
12
|
useEffect(() => {
|
|
32
|
-
|
|
33
|
-
}, [
|
|
13
|
+
dispatch.packages.getPackages();
|
|
14
|
+
}, [dispatch]);
|
|
34
15
|
|
|
35
16
|
return (
|
|
36
17
|
<div className="container content" data-testid="home-page-container">
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
|
|
4
3
|
import Button from 'verdaccio-ui/components/Button';
|
|
5
4
|
import CardActions from 'verdaccio-ui/components/CardActions';
|
|
6
5
|
import CardContent from 'verdaccio-ui/components/CardContent';
|