@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
package/.babelrc
CHANGED
package/.eslintrc
CHANGED
|
@@ -11,21 +11,6 @@
|
|
|
11
11
|
"verdaccio"
|
|
12
12
|
],
|
|
13
13
|
"rules": {
|
|
14
|
-
"import/order": ["error", {
|
|
15
|
-
"pathGroups": [
|
|
16
|
-
{
|
|
17
|
-
"pattern": "verdaccio-ui/**",
|
|
18
|
-
"group": "external",
|
|
19
|
-
"position": "after"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"pathGroupsExcludedImportTypes": ["verdaccio-ui"],
|
|
23
|
-
"alphabetize": {
|
|
24
|
-
"order": "asc",
|
|
25
|
-
"caseInsensitive": true
|
|
26
|
-
},
|
|
27
|
-
"newlines-between": "always"
|
|
28
|
-
}],
|
|
29
14
|
"react/display-name": 0,
|
|
30
15
|
"react/no-deprecated": 1,
|
|
31
16
|
"react/jsx-no-target-blank": 1,
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# @verdaccio/ui-theme
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.13
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 000d4374: feat: upgrade to material ui 5
|
|
8
|
+
|
|
9
|
+
## 6.0.0-6-next.12
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 794af76c: Remove Node 12 support
|
|
14
|
+
|
|
15
|
+
- We need move to the new `undici` and does not support Node.js 12
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 154b2ecd: refactor: remove @verdaccio/commons-api in favor @verdaccio/core and remove duplications
|
|
20
|
+
|
|
21
|
+
## 6.0.0-6-next.11
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 5fed1955: feat: integrate rematch for ui state storage
|
|
26
|
+
|
|
27
|
+
## 6.0.0-6-next.10
|
|
28
|
+
|
|
29
|
+
### Major Changes
|
|
30
|
+
|
|
31
|
+
- 459b6fa7: refactor: search v1 endpoint and local-database
|
|
32
|
+
|
|
33
|
+
- refactor search `api v1` endpoint, improve performance
|
|
34
|
+
- remove usage of `async` dependency https://github.com/verdaccio/verdaccio/issues/1225
|
|
35
|
+
- refactor method storage class
|
|
36
|
+
- create new module `core` to reduce the ammount of modules with utilities
|
|
37
|
+
- use `undici` instead `node-fetch`
|
|
38
|
+
- use `fastify` instead `express` for functional test
|
|
39
|
+
|
|
40
|
+
### Breaking changes
|
|
41
|
+
|
|
42
|
+
- plugin storage API changes
|
|
43
|
+
- remove old search endpoint (return 404)
|
|
44
|
+
- filter local private packages at plugin level
|
|
45
|
+
|
|
46
|
+
The storage api changes for methods `get`, `add`, `remove` as promise base. The `search` methods also changes and recieves a `query` object that contains all query params from the client.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
export interface IPluginStorage<T> extends IPlugin {
|
|
50
|
+
add(name: string): Promise<void>;
|
|
51
|
+
remove(name: string): Promise<void>;
|
|
52
|
+
get(): Promise<any>;
|
|
53
|
+
init(): Promise<void>;
|
|
54
|
+
getSecret(): Promise<string>;
|
|
55
|
+
setSecret(secret: string): Promise<any>;
|
|
56
|
+
getPackageStorage(packageInfo: string): IPackageStorage;
|
|
57
|
+
search(query: searchUtils.SearchQuery): Promise<searchUtils.SearchItem[]>;
|
|
58
|
+
saveToken(token: Token): Promise<any>;
|
|
59
|
+
deleteToken(user: string, tokenKey: string): Promise<any>;
|
|
60
|
+
readTokens(filter: TokenFilter): Promise<Token[]>;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
3
64
|
## 6.0.0-6-next.9
|
|
4
65
|
|
|
5
66
|
### Minor Changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "test",
|
|
4
|
+
"version": "1.0.22",
|
|
5
|
+
"description": "test",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "http",
|
|
12
|
+
"url": "git+https://github.com/test/test.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "",
|
|
17
|
+
"email": "",
|
|
18
|
+
"url": "",
|
|
19
|
+
"avatar": "data:image/svg+xml;utf8,%3Csvg%20height%3D%22100%22%20viewBox%3D%22-27%2024%20100%20100%22%20width%3D%22100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cdefs%3E%3Ccircle%20cx%3D%2223%22%20cy%3D%2274%22%20id%3D%22a%22%20r%3D%2250%22%2F%3E%3C%2Fdefs%3E%3Cuse%20fill%3D%22%23F5EEE5%22%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23a%22%2F%3E%3CclipPath%20id%3D%22b%22%3E%3Cuse%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23a%22%2F%3E%3C%2FclipPath%3E%3Cg%20clip-path%3D%22url(%23b)%22%3E%3Cdefs%3E%3Cpath%20d%3D%22M36%2095.9c0%204%204.7%205.2%207.1%205.8%207.6%202%2022.8%205.9%2022.8%205.9%203.2%201.1%205.7%203.5%207.1%206.6v9.8H-27v-9.8c1.3-3.1%203.9-5.5%207.1-6.6%200%200%2015.2-3.9%2022.8-5.9%202.4-.6%207.1-1.8%207.1-5.8V85h26v10.9z%22%20id%3D%22c%22%2F%3E%3C%2Fdefs%3E%3Cuse%20fill%3D%22%23E6C19C%22%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23c%22%2F%3E%3CclipPath%20id%3D%22d%22%3E%3Cuse%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23c%22%2F%3E%3C%2FclipPath%3E%3Cpath%20clip-path%3D%22url(%23d)%22%20d%3D%22M23.2%2035h.2c3.3%200%208.2.2%2011.4%202%203.3%201.9%207.3%205.6%208.5%2012.1%202.4%2013.7-2.1%2035.4-6.3%2042.4-4%206.7-9.8%209.2-13.5%209.4H23h-.1c-3.7-.2-9.5-2.7-13.5-9.4-4.2-7-8.7-28.7-6.3-42.4%201.2-6.5%205.2-10.2%208.5-12.1%203.2-1.8%208.1-2%2011.4-2h.2z%22%20fill%3D%22%23D4B08C%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M22.6%2040c19.1%200%2020.7%2013.8%2020.8%2015.1%201.1%2011.9-3%2028.1-6.8%2033.7-4%205.9-9.8%208.1-13.5%208.3h-.5c-3.8-.3-9.6-2.5-13.6-8.4-3.8-5.6-7.9-21.8-6.8-33.8C2.3%2053.7%203.5%2040%2022.6%2040z%22%20fill%3D%22%23F2CEA5%22%2F%3E%3C%2Fsvg%3E"
|
|
20
|
+
},
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"lodash": "^4.17.21"
|
|
24
|
+
},
|
|
25
|
+
"readmeFilename": "README.md",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/test/test/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/test/test#readme",
|
|
30
|
+
"_id": "test@1.0.22",
|
|
31
|
+
"_nodeVersion": "14.17.4",
|
|
32
|
+
"_npmVersion": "7.20.5",
|
|
33
|
+
"dist": {
|
|
34
|
+
"integrity": "sha512-2IDD0lLzGUL7YJ+17Oh9VtbOwdKLqBLS+ZFATDXi5R22TL2hZ9LBFE10bzsDovNc4xtgwZAk1/K+5LHTye4ztg==",
|
|
35
|
+
"shasum": "c9152f57636bce762ccb5a83113c42a5831579bc",
|
|
36
|
+
"tarball": "http://localhost:4873/test/-/test-1.0.22.tgz"
|
|
37
|
+
},
|
|
38
|
+
"contributors": [],
|
|
39
|
+
"time": "2021-08-14T20:15:19.336Z",
|
|
40
|
+
"users": {}
|
|
41
|
+
}
|
|
42
|
+
]
|
package/jest/jest.config.js
CHANGED
|
@@ -10,9 +10,9 @@ module.exports = Object.assign({}, config, {
|
|
|
10
10
|
'^.+\\.(js|ts|tsx)$': 'babel-jest',
|
|
11
11
|
},
|
|
12
12
|
moduleFileExtensions: ['js', 'ts', 'tsx'],
|
|
13
|
-
testURL: 'http://localhost',
|
|
13
|
+
testURL: 'http://localhost:9000/',
|
|
14
14
|
rootDir: '..',
|
|
15
|
-
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
|
|
15
|
+
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect', '<rootDir>/jest/setup-env.ts'],
|
|
16
16
|
setupFiles: ['<rootDir>/jest/setup.ts'],
|
|
17
17
|
transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
|
|
18
18
|
modulePathIgnorePatterns: [
|
package/jest/server.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
2
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
3
|
+
import 'whatwg-fetch';
|
|
4
|
+
|
|
5
|
+
import { server } from './server';
|
|
6
|
+
|
|
7
|
+
// mock load translations to avoid warnings
|
|
8
|
+
jest.mock('../src/i18n/loadTranslationFile');
|
|
9
|
+
|
|
10
|
+
beforeAll(() => {
|
|
11
|
+
server.listen({
|
|
12
|
+
onUnhandledRequest: 'warn',
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => server.resetHandlers());
|
|
16
|
+
afterAll(() => {
|
|
17
|
+
server.close();
|
|
18
|
+
});
|
package/jest/setup.ts
CHANGED
|
@@ -2,29 +2,24 @@
|
|
|
2
2
|
* Setup configuration for Jest
|
|
3
3
|
* This file includes global settings for the JEST environment.
|
|
4
4
|
*/
|
|
5
|
-
import { GlobalWithFetchMock } from 'jest-fetch-mock';
|
|
6
5
|
import 'mutationobserver-shim';
|
|
7
6
|
|
|
8
7
|
// @ts-ignore : Property '__VERDACCIO_BASENAME_UI_OPTIONS' does not exist on type 'Global'.
|
|
9
8
|
global.__VERDACCIO_BASENAME_UI_OPTIONS = {
|
|
10
|
-
base: 'http://localhost',
|
|
9
|
+
base: 'http://localhost:9000/',
|
|
11
10
|
protocol: 'http',
|
|
12
11
|
host: 'localhost',
|
|
13
12
|
primaryColor: '#4b5e40',
|
|
14
13
|
url_prefix: '',
|
|
15
14
|
darkMode: false,
|
|
16
15
|
language: 'en-US',
|
|
17
|
-
uri: 'http://localhost:
|
|
16
|
+
uri: 'http://localhost:9000/',
|
|
18
17
|
pkgManagers: ['pnpm', 'yarn', 'npm'],
|
|
19
18
|
title: 'Verdaccio Dev UI',
|
|
20
19
|
scope: '',
|
|
21
20
|
version: 'v1.0.0',
|
|
22
21
|
};
|
|
23
22
|
|
|
24
|
-
const customGlobal: GlobalWithFetchMock = global as GlobalWithFetchMock;
|
|
25
|
-
customGlobal.fetch = require('jest-fetch-mock');
|
|
26
|
-
customGlobal.fetchMock = customGlobal.fetch;
|
|
27
|
-
|
|
28
23
|
// mocking few DOM methods
|
|
29
24
|
// @ts-ignore : Property 'document' does not exist on type 'Global'.
|
|
30
25
|
if (global.document) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/ui-theme",
|
|
3
|
-
"version": "6.0.0-6-next.
|
|
3
|
+
"version": "6.0.0-6-next.13",
|
|
4
4
|
"description": "Verdaccio User Interface",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Verdaccio Contributors",
|
|
@@ -13,38 +13,46 @@
|
|
|
13
13
|
"homepage": "https://verdaccio.org",
|
|
14
14
|
"main": "index.js",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
16
|
+
"node": ">=14",
|
|
17
17
|
"npm": ">=6"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
20
|
+
"@types/react": "17.0.37",
|
|
21
|
+
"@types/react-autosuggest": "10.1.5",
|
|
22
|
+
"@types/react-dom": "17.0.11",
|
|
23
|
+
"@types/react-helmet": "6.1.4",
|
|
24
|
+
"@types/redux": "3.6.0",
|
|
25
|
+
"@types/react-router-dom": "5.3.2",
|
|
26
|
+
"@types/react-virtualized": "9.21.15",
|
|
27
|
+
"@emotion/react": "11.5.0",
|
|
28
|
+
"@emotion/jest": "11.5.0",
|
|
29
|
+
"@emotion/styled": "11.3.0",
|
|
30
|
+
"@emotion/css": "11.5.0",
|
|
31
|
+
"@emotion/babel-plugin": "11.0.0",
|
|
32
|
+
"@mui/icons-material": "5.0.5",
|
|
33
|
+
"@mui/material": "5.0.6",
|
|
34
|
+
"@mui/styles": "5.0.2",
|
|
35
|
+
"@rematch/core": "2.2.0",
|
|
36
|
+
"@rematch/loading": "2.1.2",
|
|
37
|
+
"@testing-library/dom": "8.11.1",
|
|
38
|
+
"@testing-library/jest-dom": "5.16.1",
|
|
39
|
+
"@testing-library/react": "12.1.2",
|
|
40
|
+
"@verdaccio/node-api": "6.0.0-6-next.25",
|
|
41
|
+
"@verdaccio/types": "11.0.0-6-next.10",
|
|
42
|
+
"babel-loader": "8.2.3",
|
|
33
43
|
"babel-plugin-dynamic-import-node": "2.3.3",
|
|
34
|
-
"babel-plugin-emotion": "10.0.33",
|
|
35
44
|
"bundlesize": "0.18.1",
|
|
36
|
-
"css-loader": "6.
|
|
37
|
-
"dayjs": "1.10.
|
|
38
|
-
"emotion": "10.0.27",
|
|
39
|
-
"emotion-theming": "10.0.27",
|
|
45
|
+
"css-loader": "6.5.1",
|
|
46
|
+
"dayjs": "1.10.7",
|
|
40
47
|
"friendly-errors-webpack-plugin": "1.7.0",
|
|
41
48
|
"github-markdown-css": "4.0.0",
|
|
42
49
|
"harmony-reflect": "1.6.2",
|
|
43
50
|
"history": "4.10.1",
|
|
44
|
-
"html-webpack-plugin": "5.
|
|
45
|
-
"i18next": "20.6.
|
|
51
|
+
"html-webpack-plugin": "5.4.0",
|
|
52
|
+
"i18next": "20.6.1",
|
|
46
53
|
"in-publish": "2.0.1",
|
|
47
|
-
"
|
|
54
|
+
"country-flag-icons": "1.4.19",
|
|
55
|
+
"js-base64": "3.7.2",
|
|
48
56
|
"js-yaml": "3.14.1",
|
|
49
57
|
"localstorage-memory": "1.0.3",
|
|
50
58
|
"lodash": "4.17.21",
|
|
@@ -56,15 +64,17 @@
|
|
|
56
64
|
"ora": "5.4.1",
|
|
57
65
|
"prop-types": "15.7.2",
|
|
58
66
|
"react": "17.0.2",
|
|
59
|
-
"react-autosuggest": "10.1.0",
|
|
60
67
|
"react-dom": "17.0.2",
|
|
61
|
-
"react-hook-form": "7.
|
|
68
|
+
"react-hook-form": "7.15.3",
|
|
62
69
|
"react-hot-loader": "4.13.0",
|
|
63
|
-
"react-i18next": "11.
|
|
70
|
+
"react-i18next": "11.12.0",
|
|
64
71
|
"react-router": "5.2.1",
|
|
65
|
-
"react-router-dom": "5.
|
|
72
|
+
"react-router-dom": "5.3.0",
|
|
66
73
|
"react-virtualized": "9.22.3",
|
|
74
|
+
"react-redux": "7.2.6",
|
|
75
|
+
"redux": "4.1.2",
|
|
67
76
|
"rimraf": "3.0.2",
|
|
77
|
+
"msw": "0.35.0",
|
|
68
78
|
"standard-version": "9.3.1",
|
|
69
79
|
"style-loader": "3.2.1",
|
|
70
80
|
"stylelint": "13.13.1",
|
|
@@ -73,18 +83,18 @@
|
|
|
73
83
|
"stylelint-processor-styled-components": "1.10.0",
|
|
74
84
|
"stylelint-webpack-plugin": "3.0.1",
|
|
75
85
|
"supertest": "6.1.6",
|
|
76
|
-
"terser-webpack-plugin": "5.2.
|
|
86
|
+
"terser-webpack-plugin": "5.2.5",
|
|
77
87
|
"url-loader": "4.1.1",
|
|
78
|
-
"validator": "13.
|
|
79
|
-
"webpack": "5.
|
|
88
|
+
"validator": "13.7.0",
|
|
89
|
+
"webpack": "5.64.0",
|
|
80
90
|
"webpack-bundle-analyzer": "4.4.2",
|
|
81
91
|
"webpack-bundle-size-analyzer": "3.1.0",
|
|
82
92
|
"webpack-cli": "^4.7.2",
|
|
83
|
-
"webpack-dev-server": "3.11.
|
|
93
|
+
"webpack-dev-server": "3.11.3",
|
|
84
94
|
"webpack-manifest-plugin": "4.0.2",
|
|
85
95
|
"webpack-merge": "5.8.0",
|
|
86
96
|
"whatwg-fetch": "3.6.2",
|
|
87
|
-
"xss": "1.0.
|
|
97
|
+
"xss": "1.0.10"
|
|
88
98
|
},
|
|
89
99
|
"keywords": [
|
|
90
100
|
"private",
|
|
@@ -129,7 +139,7 @@
|
|
|
129
139
|
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
130
140
|
"start": "babel-node tools/dev.server.js",
|
|
131
141
|
"test:clean": "jest --clearCache",
|
|
132
|
-
"test": "cross-env BABEL_ENV=test cross-env NODE_ENV=test cross-env TZ=UTC jest --config ./jest/jest.config.js --
|
|
142
|
+
"test": "cross-env BABEL_ENV=test cross-env NODE_ENV=test cross-env TZ=UTC jest --config ./jest/jest.config.js --runInBand",
|
|
133
143
|
"test:update-snapshot": "yarn run test -- -u",
|
|
134
144
|
"test:size": "bundlesize",
|
|
135
145
|
"lint": "pnpm lint:js && pnpm lint:css",
|
package/src/App/App.test.tsx
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
act,
|
|
4
|
+
fireEvent,
|
|
5
|
+
renderWithStore,
|
|
6
|
+
screen,
|
|
7
|
+
waitFor,
|
|
8
|
+
} from 'verdaccio-ui/utils/test-react-testing-library';
|
|
5
9
|
|
|
6
10
|
// eslint-disable-next-line jest/no-mocks-import
|
|
7
11
|
import { generateTokenWithTimeRange } from '../../jest/unit/components/__mocks__/token';
|
|
8
|
-
|
|
12
|
+
import { store } from '../store';
|
|
9
13
|
import App from './App';
|
|
10
14
|
|
|
11
15
|
jest.mock('verdaccio-ui/utils/storage', () => {
|
|
@@ -30,68 +34,88 @@ jest.mock('verdaccio-ui/utils/storage', () => {
|
|
|
30
34
|
return new LocalStorageMock();
|
|
31
35
|
});
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
// force the windows to expand to display items
|
|
38
|
+
// https://github.com/bvaughn/react-virtualized/issues/493#issuecomment-640084107
|
|
39
|
+
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(600);
|
|
40
|
+
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(600);
|
|
37
41
|
|
|
38
42
|
/* eslint-disable react/jsx-no-bind*/
|
|
39
43
|
describe('<App />', () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
describe('login - log out', () => {
|
|
45
|
+
test('handleLogout - logouts the user and clear localstorage', async () => {
|
|
46
|
+
const { queryByTestId } = renderWithStore(<App />, store);
|
|
47
|
+
store.dispatch.login.logInUser({
|
|
48
|
+
username: 'verdaccio',
|
|
49
|
+
token: generateTokenWithTimeRange(24),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// wait for the Account's circle element component appearance and return the element
|
|
53
|
+
const accountCircleElement = await waitFor(() => queryByTestId('logInDialogIcon'));
|
|
54
|
+
expect(accountCircleElement).toBeTruthy();
|
|
55
|
+
|
|
56
|
+
if (accountCircleElement) {
|
|
57
|
+
fireEvent.click(accountCircleElement);
|
|
58
|
+
|
|
59
|
+
// wait for the Button's logout element component appearance and return the element
|
|
60
|
+
const buttonLogoutElement = await waitFor(() => queryByTestId('logOutDialogIcon'));
|
|
61
|
+
expect(buttonLogoutElement).toBeTruthy();
|
|
62
|
+
|
|
63
|
+
if (buttonLogoutElement) {
|
|
64
|
+
fireEvent.click(buttonLogoutElement);
|
|
65
|
+
|
|
66
|
+
expect(queryByTestId('greetings-label')).toBeFalsy();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, 10000);
|
|
55
70
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
test('isUserAlreadyLoggedIn: token already available in storage', async () => {
|
|
72
|
+
const { queryByTestId, queryAllByText } = renderWithStore(<App />, store);
|
|
73
|
+
store.dispatch.login.logInUser({
|
|
74
|
+
username: 'verdaccio',
|
|
75
|
+
token: generateTokenWithTimeRange(24),
|
|
76
|
+
});
|
|
59
77
|
|
|
60
|
-
|
|
61
|
-
|
|
78
|
+
// wait for the Account's circle element component appearance and return the element
|
|
79
|
+
const accountCircleElement = await waitFor(() => queryByTestId('logInDialogIcon'));
|
|
80
|
+
expect(accountCircleElement).toBeTruthy();
|
|
62
81
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
expect(buttonLogoutElement).toBeTruthy();
|
|
82
|
+
if (accountCircleElement) {
|
|
83
|
+
fireEvent.click(accountCircleElement);
|
|
66
84
|
|
|
67
|
-
|
|
68
|
-
|
|
85
|
+
// wait for the Greeting's label element component appearance and return the element
|
|
86
|
+
const greetingsLabelElement = await waitFor(() => queryByTestId('greetings-label'));
|
|
87
|
+
expect(greetingsLabelElement).toBeTruthy();
|
|
69
88
|
|
|
70
|
-
|
|
89
|
+
if (greetingsLabelElement) {
|
|
90
|
+
expect(queryAllByText('verdaccio')).toBeTruthy();
|
|
91
|
+
}
|
|
71
92
|
}
|
|
72
|
-
}
|
|
93
|
+
}, 10000);
|
|
73
94
|
});
|
|
74
95
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
96
|
+
describe('list packages', () => {
|
|
97
|
+
test('should display the Header component', async () => {
|
|
98
|
+
renderWithStore(<App />, store);
|
|
78
99
|
|
|
79
|
-
|
|
100
|
+
await waitFor(() => {
|
|
101
|
+
expect(screen.queryByTestId('loading')).toBeTruthy();
|
|
102
|
+
});
|
|
80
103
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
// wait for the Header component appearance and return the element
|
|
105
|
+
const headerElement = await waitFor(() => screen.queryByTestId('header'));
|
|
106
|
+
expect(headerElement).toBeTruthy();
|
|
107
|
+
});
|
|
84
108
|
|
|
85
|
-
|
|
86
|
-
|
|
109
|
+
test('should display package lists', async () => {
|
|
110
|
+
act(() => {
|
|
111
|
+
renderWithStore(<App />, store);
|
|
112
|
+
});
|
|
87
113
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
114
|
+
await waitFor(() => {
|
|
115
|
+
expect(screen.getByTestId('package-item-list')).toBeInTheDocument();
|
|
116
|
+
});
|
|
91
117
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
}
|
|
118
|
+
expect(store.getState().packages.response).toHaveLength(1);
|
|
119
|
+
}, 10000);
|
|
96
120
|
});
|
|
97
121
|
});
|
package/src/App/App.tsx
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-max-depth */
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import
|
|
4
|
-
import React, { useState, useEffect, Suspense } from 'react';
|
|
3
|
+
import React, { Suspense, useEffect } from 'react';
|
|
5
4
|
import { Router } from 'react-router-dom';
|
|
6
|
-
|
|
7
5
|
import Box from 'verdaccio-ui/components/Box';
|
|
8
6
|
import Loading from 'verdaccio-ui/components/Loading';
|
|
9
|
-
import loadDayJSLocale from 'verdaccio-ui/design-tokens/load-dayjs-locale';
|
|
10
7
|
import StyleBaseline from 'verdaccio-ui/design-tokens/StyleBaseline';
|
|
8
|
+
import loadDayJSLocale from 'verdaccio-ui/design-tokens/load-dayjs-locale';
|
|
11
9
|
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
12
|
-
import { isTokenExpire } from 'verdaccio-ui/utils/login';
|
|
13
|
-
import storage from 'verdaccio-ui/utils/storage';
|
|
14
10
|
|
|
15
|
-
import
|
|
11
|
+
import '../i18n/config';
|
|
16
12
|
import AppRoute, { history } from './AppRoute';
|
|
17
13
|
import Footer from './Footer';
|
|
18
14
|
import Header from './Header';
|
|
19
15
|
|
|
20
|
-
import '../../i18n/config';
|
|
21
|
-
|
|
22
16
|
const StyledBox = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
|
|
23
17
|
backgroundColor: theme?.palette.background.default,
|
|
24
18
|
}));
|
|
@@ -32,35 +26,8 @@ const StyledBoxContent = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
|
|
|
32
26
|
},
|
|
33
27
|
}));
|
|
34
28
|
|
|
35
|
-
/* eslint-disable react/jsx-no-bind */
|
|
36
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
37
29
|
const App: React.FC = () => {
|
|
38
|
-
const [user, setUser] = useState<undefined | { username: string | null }>();
|
|
39
|
-
/**
|
|
40
|
-
* Logout user
|
|
41
|
-
* Required by: <Header />
|
|
42
|
-
*/
|
|
43
|
-
const logout = () => {
|
|
44
|
-
storage.removeItem('username');
|
|
45
|
-
storage.removeItem('token');
|
|
46
|
-
setUser(undefined);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const checkUserAlreadyLoggedIn = () => {
|
|
50
|
-
// checks for token validity
|
|
51
|
-
const token = storage.getItem('token');
|
|
52
|
-
const username = storage.getItem('username');
|
|
53
|
-
|
|
54
|
-
if (isTokenExpire(token) || isNil(username)) {
|
|
55
|
-
logout();
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
setUser({ username });
|
|
60
|
-
};
|
|
61
|
-
|
|
62
30
|
useEffect(() => {
|
|
63
|
-
checkUserAlreadyLoggedIn();
|
|
64
31
|
loadDayJSLocale();
|
|
65
32
|
}, []);
|
|
66
33
|
|
|
@@ -70,12 +37,10 @@ const App: React.FC = () => {
|
|
|
70
37
|
<StyledBox display="flex" flexDirection="column" height="100%">
|
|
71
38
|
<>
|
|
72
39
|
<Router history={history}>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
</StyledBoxContent>
|
|
78
|
-
</AppContextProvider>
|
|
40
|
+
<Header />
|
|
41
|
+
<StyledBoxContent flexGrow={1}>
|
|
42
|
+
<AppRoute />
|
|
43
|
+
</StyledBoxContent>
|
|
79
44
|
</Router>
|
|
80
45
|
<Footer />
|
|
81
46
|
</>
|
package/src/App/AppRoute.tsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createBrowserHistory } from 'history';
|
|
2
|
-
import React
|
|
3
|
-
import {
|
|
4
|
-
import { Route as ReactRouterDomRoute, Switch, Router } from 'react-router-dom';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Route as ReactRouterDomRoute, Router, Switch } from 'react-router-dom';
|
|
5
4
|
|
|
6
|
-
import AppContext from './AppContext';
|
|
7
5
|
import loadable from './utils/loadable';
|
|
8
6
|
|
|
9
7
|
const NotFound = loadable(
|
|
@@ -28,22 +26,11 @@ export const history = createBrowserHistory({
|
|
|
28
26
|
});
|
|
29
27
|
|
|
30
28
|
const AppRoute: React.FC = () => {
|
|
31
|
-
const appContext = useContext(AppContext);
|
|
32
|
-
const { t } = useTranslation();
|
|
33
|
-
|
|
34
|
-
if (!appContext) {
|
|
35
|
-
throw Error(t('app-context-not-correct-used'));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const { user } = appContext;
|
|
39
|
-
|
|
40
|
-
const isUserLoggedIn = user?.username;
|
|
41
|
-
|
|
42
29
|
return (
|
|
43
30
|
<Router history={history}>
|
|
44
31
|
<Switch>
|
|
45
32
|
<ReactRouterDomRoute exact={true} path={Route.ROOT}>
|
|
46
|
-
<HomePage
|
|
33
|
+
<HomePage />
|
|
47
34
|
</ReactRouterDomRoute>
|
|
48
35
|
<ReactRouterDomRoute exact={true} path={Route.PACKAGE}>
|
|
49
36
|
<VersionContextProvider>
|