Compare commits

...

373 Commits

Author SHA1 Message Date
Priscila Oliveira
6552f4c13f chore(release): 1.3.0 2020-04-01 13:33:44 +02:00
Priscila Oliveira
9f275b7b00 chore(release): 1.1.0 2020-04-01 13:31:05 +02:00
Priscila Oliveira
f321f7b6fe fix(chore): droped release (#449) 2020-04-01 13:27:39 +02:00
Priscila Oliveira
e7db3e4967 chore(release): 1.1.1 2020-04-01 13:02:08 +02:00
Priscila Oliveira
e0eb6b0a3c chore(release): 1.1.0 2020-04-01 13:00:51 +02:00
Priscila Oliveira
cdad5cf70d feat(style): added dark mode (#446) 2020-03-31 08:44:59 +02:00
Juan Picado @jotadeveloper
91434cc814 chore(release): 1.0.4 2020-03-17 06:52:50 +01:00
Priscila Oliveira
4071e272af Update README.md 2020-03-16 08:26:48 +01:00
Priscila Oliveira
f81c1984da Update README.md 2020-03-16 08:26:11 +01:00
Priscila Oliveira
b2255fca88 ref(readme): added i18n section (#443) 2020-03-16 08:24:36 +01:00
dependabot-preview[bot]
8c2800e156 build(deps): [security] bump acorn from 5.7.3 to 5.7.4 (#442)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. **This update includes a security fix.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-14 07:01:07 +01:00
Juan Picado @jotadeveloper
a5f06cb3af chore(release): 1.0.0 2020-03-13 07:35:00 +01:00
Priscila Oliveira
e27d59bff7 feat(de-translations): added de-DE translations to the UI (#441) 2020-03-12 11:40:12 +01:00
Juan Picado @jotadeveloper
0abe1ef41c feat: spanish translations to UI (#440)
* feat: spanish translations to UI

* chore: enable spanish
2020-03-09 07:01:01 +01:00
Priscila Oliveira
7428384b55 feat(i18n): added i18next for user interface translations (#432) 2020-03-08 16:45:07 +01:00
dependabot-preview[bot]
8d4b3cee7e build(deps-dev): bump @commitlint/cli from 8.3.4 to 8.3.5 (#436)
Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint) from 8.3.4 to 8.3.5.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v8.3.4...v8.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: Priscila Oliveira <priscilawebdev@gmail.com>
2020-03-03 09:32:26 +01:00
dependabot-preview[bot]
d41ba981d2 build(deps-dev): bump react-dom from 16.12.0 to 16.13.0 (#437) 2020-03-02 21:29:16 +01:00
dependabot-preview[bot]
26dbf3d921 build(deps-dev): [security] bump codecov from 3.6.1 to 3.6.5 (#434)
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.6.1 to 3.6.5. **This update includes a security fix.**
- [Release notes](https://github.com/codecov/codecov-node/releases)
- [Commits](https://github.com/codecov/codecov-node/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-20 07:36:02 +01:00
dependabot-preview[bot]
7cb20fa699 build(deps-dev): bump jest-environment-node from 24.9.0 to 25.1.0 (#430)
Bumps [jest-environment-node](https://github.com/facebook/jest/tree/HEAD/packages/jest-environment-node) from 24.9.0 to 25.1.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v25.1.0/packages/jest-environment-node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: Priscila Oliveira <priscilawebdev@gmail.com>
Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2020-02-02 09:21:49 +01:00
Juan Picado @jotadeveloper
e6aad5370f chore(release): 0.3.13 2020-02-02 08:37:41 +01:00
Daniel Ruf
d481f54948 fix: do not capitalize heading - closes #428 (#431) 2020-02-02 08:36:55 +01:00
dependabot-preview[bot]
e6e9cfb2b4 build(deps-dev): bump @typescript-eslint/parser from 2.15.0 to 2.18.0 (#429) 2020-02-01 22:17:53 +01:00
Juan Picado @jotadeveloper
6570e3fba1 chore: add snyk as an action (#230) 2020-01-19 09:46:48 +01:00
Alfonso Austin
d4f2720994 chore(build): add missing export (#417)
Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2020-01-14 07:43:31 +01:00
Juan Picado @jotadeveloper
1eca1f4079 fix: reload packages on log in (#421)
related https://github.com/verdaccio/ui/pull/415
2020-01-14 07:16:39 +01:00
James George
164cea6c10 fix: typo (#423)
Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2020-01-14 04:11:13 +01:00
James George
dad44c46c0 docs: add link to license file (#422) 2020-01-14 03:47:14 +01:00
coolsp
222ffed022 fix: package list refresh based on logged-in user (#415)
* fix: package list refresh based on logged-in user

description:
In `pages/home/Home.tsx` now monitoring any change in a user log-in/out which will trigger a new `API.request` to get the _packages_ from the Verdaccio-server.  This is done by creating a `useEffect` on **isUserLoggedIn**.  Code has been transplanted from `App/App.tsx` including the use of the Loading component during the XHR.  The use of **packages** was removed from other components as no longer needed and tests updated.

Resolves issue #414

* fix: package list refresh based on logged-in user

description:
In `pages/home/Home.tsx` now monitoring any change in a user log-in/out which will trigger a new `API.request` to get the _packages_ from the Verdaccio-server. This is done by creating a `useEffect` on **isUserLoggedIn**. Code has been transplanted from `App/App.tsx` including the use of the Loading component during the XHR. The use of **packages** was removed from other components as no longer needed and tests updated.
Test snapshots updated

Resolves issue #414

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2020-01-12 22:21:29 +01:00
Juan Picado @jotadeveloper
ee1c3f08eb fix: update dependencies (#420)
- just minor updates
- verdaccio internal deps (we know the reason of the major change)
2020-01-12 19:43:05 +01:00
Alfonso Austin
1531cb6226 chore/401 add new script to update tests (#416)
* chore: add new script to update tests #401

* chore: update script name
2020-01-11 22:22:48 +01:00
Juan Picado @jotadeveloper
e514ec95a6 chore(release): 0.3.12 2020-01-09 06:14:09 +01:00
Daniel Ruf
6b322ad553 fix: generate correct registry URL (#413)
* Revert "Revert "fix(#300): correctly reference registry url from options" (#311)"

This reverts commit d955268c25.

* fix: generate full URL from path
2020-01-09 06:12:50 +01:00
Juan Picado @jotadeveloper
3fd0154da3 chore(release): 0.3.11 2020-01-08 19:08:48 +01:00
Juan Picado @jotadeveloper
6bd38b8120 fix: remove prevent default and use react context (#411)
* fix: remove prevent default and use react context

* chore: remove string check
2020-01-08 12:16:13 +01:00
Daniel Ruf
6e2bface93 test: add SonarCloud (#408) 2020-01-03 21:51:40 +01:00
Priscila Oliveira
6eeae630ef fix: removed unused style file (#406) 2020-01-03 00:18:42 +01:00
dependabot-preview[bot]
eaea5f2501 build(deps-dev): bump style-loader from 1.0.2 to 1.1.2 (#405) 2020-01-02 21:41:19 +01:00
dependabot-preview[bot]
c1e4e739c8 build(deps-dev): bump mini-css-extract-plugin from 0.8.2 to 0.9.0 (#394)
Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 0.8.2 to 0.9.0.
- [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.8.2...v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-02 08:38:59 +01:00
dependabot-preview[bot]
4d31aff4a4 build(deps-dev): bump @types/react from 16.9.16 to 16.9.17 (#392)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 16.9.16 to 16.9.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-02 08:38:37 +01:00
dependabot-preview[bot]
d9a9fc4b96 build(deps-dev): bump webpack-dev-server from 3.9.0 to 3.10.1 (#391)
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.9.0 to 3.10.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/v3.10.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.9.0...v3.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-02 08:37:46 +01:00
Juan Picado @jotadeveloper
e4ecc4a2f9 chore(release): 0.3.10 2019-12-30 10:13:47 +01:00
Daniel Ruf
bae9638b23 fix: add missing trailing slash to publicPath - closes #395 (#396)
* fix: add missing trailing slash to publicPath - closes #395

* test: update snapshot

(cherry picked from commit fe6494fec7225928cc510e112c80e4b171160a09)

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2019-12-30 10:12:23 +01:00
Daniel Ruf
544b999f81 fix: remove whitespace from logo image - closes #374 (#400)
* fix: remove whitespace from logo image - closes #374

* test: update snapshot

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2019-12-30 10:12:00 +01:00
Juan Picado @jotadeveloper
d554049699 fix: engine warning on console for ui (#403)
* fix: engine warning on console for ui

* chore: update snapshots

* chore: remove u flag

* chore: add readme note

* chore: update README.md

Co-Authored-By: Daniel Ruf <827205+DanielRuf@users.noreply.github.com>

Co-authored-by: Daniel Ruf <827205+DanielRuf@users.noreply.github.com>
2019-12-30 10:04:42 +01:00
Daniel Ruf
787dda4a01 fix: remove background from styled Avatar components - closes #371 (#398) 2019-12-28 09:33:00 +01:00
Daniel Ruf
797c2381e4 fix: remove double padding and add missing background color - closes #373 (#399)
* fix: remove double padding - closes #373

* fix: add missing background color
2019-12-28 09:32:07 +01:00
dependabot-preview[bot]
3888a268e4 build(deps-dev): bump @types/jest from 24.0.23 to 24.0.24 (#387) 2019-12-20 15:21:47 -03:00
dependabot-preview[bot]
884d76d4a9 build(deps-dev): bump react-hook-form from 3.28.15 to 3.29.4 (#388) 2019-12-20 15:21:26 -03:00
dependabot-preview[bot]
7b55ce5ea2 build(deps-dev): bump webpack from 4.41.3 to 4.41.4 (#389) 2019-12-20 15:21:00 -03:00
dependabot-preview[bot]
1ec62de0bf build(deps-dev): bump @typescript-eslint/parser from 2.11.0 to 2.12.0 (#386) 2019-12-19 17:23:07 -03:00
dependabot-preview[bot]
3fc5c38a8e build(deps-dev): bump style-loader from 1.0.1 to 1.0.2 (#385) 2019-12-19 17:22:52 -03:00
Priscila Oliveira
53e1e63b12 chore: updated @material-ui/core (#384) 2019-12-18 19:49:56 -03:00
dependabot-preview[bot]
ef2b50a329 build(deps-dev): bump css-loader from 3.3.2 to 3.4.0 (#383) 2019-12-18 17:54:27 -03:00
dependabot-preview[bot]
61dc9b0783 build(deps-dev): bump concurrently from 5.0.1 to 5.0.2 (#379) 2019-12-18 17:33:05 -03:00
dependabot-preview[bot]
0e3391ca3d build(deps-dev): bump eslint-plugin-prettier from 3.1.1 to 3.1.2 (#381) 2019-12-18 17:32:22 -03:00
dependabot-preview[bot]
277b44ab94 build(deps-dev): bump dayjs from 1.8.17 to 1.8.18 (#380) 2019-12-18 17:32:12 -03:00
dependabot-preview[bot]
71276e15ef build(deps-dev): bump @types/node from 12.12.20 to 12.12.21 (#382) 2019-12-18 17:31:27 -03:00
Priscila Oliveira
bf093cc27b Feat: added "Fund this package" button (#375) 2019-12-18 17:30:42 -03:00
Priscila Oliveira
3a9f66c023 Refactor: Updated developers component structure (#360) 2019-12-17 22:57:53 -03:00
dependabot-preview[bot]
eef2913dd5 build(deps-dev): bump mini-css-extract-plugin from 0.8.0 to 0.8.2 (#377) 2019-12-17 21:46:04 -03:00
dependabot-preview[bot]
2af2dfe91b build(deps-dev): bump @octokit/rest from 16.35.0 to 16.35.2 (#368) 2019-12-17 19:35:36 -03:00
dependabot-preview[bot]
d4e8dff40f build(deps-dev): bump @types/node from 12.12.17 to 12.12.20 (#376) 2019-12-17 19:35:07 -03:00
dependabot-preview[bot]
cc22574100 build(deps-dev): bump @types/request from 2.48.3 to 2.48.4 (#378) 2019-12-17 19:33:39 -03:00
dependabot-preview[bot]
580b47bea1 build(deps-dev): bump @testing-library/react from 9.3.3 to 9.4.0 (#370) 2019-12-17 07:54:36 -03:00
dependabot-preview[bot]
ea24e1b50e build(deps-dev): bump webpack from 4.41.2 to 4.41.3 (#366)
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.2 to 4.41.3.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.2...v4.41.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 21:43:31 +01:00
dependabot-preview[bot]
a74dc87628 build(deps-dev): bump verdaccio from 4.3.5 to 4.4.0 (#367)
Bumps [verdaccio](https://github.com/verdaccio/verdaccio) from 4.3.5 to 4.4.0.
- [Release notes](https://github.com/verdaccio/verdaccio/releases)
- [Changelog](https://github.com/verdaccio/verdaccio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/verdaccio/verdaccio/compare/v4.3.5...v4.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 21:24:47 +01:00
dependabot-preview[bot]
cecb54c490 build(deps-dev): bump node-mocks-http from 1.8.0 to 1.8.1 (#364)
Bumps [node-mocks-http](https://github.com/howardabrams/node-mocks-http) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/howardabrams/node-mocks-http/releases)
- [Changelog](https://github.com/howardabrams/node-mocks-http/blob/master/HISTORY.md)
- [Commits](https://github.com/howardabrams/node-mocks-http/compare/v1.8.0...v1.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-14 16:05:04 +01:00
dependabot-preview[bot]
b8c68314e9 build(deps-dev): bump css-loader from 3.3.0 to 3.3.2 (#365)
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 3.3.0 to 3.3.2.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/v3.3.2/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v3.3.0...v3.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-14 16:04:45 +01:00
Juan Picado @jotadeveloper
6bb37d6656 chore(release): 0.3.9 2019-12-14 15:06:07 +01:00
Juan Picado @jotadeveloper
ac1a4fa46d chore: test publish 2019-12-14 15:05:36 +01:00
Juan Picado @jotadeveloper
3b228a2a0b chore(release): 0.3.8 2019-12-14 14:34:45 +01:00
Priscila Oliveira
fd99be6818 Refactor: move styles utils to theme (#363) 2019-12-12 12:10:27 -03:00
dependabot-preview[bot]
172e470780 build(deps-dev): bump @types/node from 12.12.16 to 12.12.17 (#362) 2019-12-12 11:23:34 -03:00
dependabot-preview[bot]
a3b41747ca build(deps-dev): bump @material-ui/core from 4.7.1 to 4.7.2 (#350) 2019-12-12 11:22:38 -03:00
dependabot-preview[bot]
7e29182a15 build(deps-dev): bump concurrently from 5.0.0 to 5.0.1 (#353) 2019-12-11 10:34:57 -03:00
dependabot-preview[bot]
8e89c82750 build(deps-dev): bump css-loader from 3.2.1 to 3.3.0 (#354) 2019-12-11 10:34:23 -03:00
dependabot-preview[bot]
f1e468e7e4 build(deps-dev): bump eslint-plugin-import from 2.18.2 to 2.19.1 (#349) 2019-12-11 10:32:28 -03:00
dependabot-preview[bot]
28208d6633 build(deps-dev): bump @babel/plugin-proposal-optional-chaining (#348) 2019-12-11 10:32:17 -03:00
dependabot-preview[bot]
398c5804cf build(deps-dev): bump @types/react from 16.9.15 to 16.9.16 (#355) 2019-12-11 10:31:47 -03:00
dependabot-preview[bot]
4d9ac2bd04 build(deps-dev): bump @typescript-eslint/parser from 2.10.0 to 2.11.0 (#356) 2019-12-11 10:19:30 -03:00
dependabot-preview[bot]
52c941be09 build(deps-dev): bump react-hook-form from 3.28.12 to 3.28.15 (#352) 2019-12-11 10:06:20 -03:00
dependabot-preview[bot]
89b554b07c build(deps-dev): bump @types/enzyme from 3.10.3 to 3.10.4 (#351) 2019-12-11 09:00:52 -03:00
dependabot-preview[bot]
43a6bc0133 build(deps-dev): bump @testing-library/react from 9.3.2 to 9.3.3 (#359)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 9.3.2 to 9.3.3.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v9.3.2...v9.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 09:02:36 +01:00
dependabot-preview[bot]
e40280ffeb build(deps-dev): bump @types/node from 12.12.14 to 12.12.16 (#357) 2019-12-10 15:42:35 +01:00
Priscila Oliveira
ae617a5c04 fix: removed deade import (#346) 2019-12-07 08:45:51 +01:00
Thomas Klein
33f873a8c7 fix: formatDate (#308) 2019-12-06 18:28:37 +01:00
Priscila Oliveira
42d3bb8508 feat: login Dialog Component - Replaced class by func. comp + added react-hook-form (#341)
* refactor: convert class to func

* refactor: changed login form logic

* refactor: conver to testing-library tests

* refactor: moved dependency

* refactor: replaced uglifyjs-webpack-plugin by terser-webpack-plugin

* fix: fixed e2e errors

* fix: fixed e2e test

* Delete settings.json

* fix: vscode settings rollback

* refactor: rollback webpack config

* refactor: updated eslint rule

* fix: removed --fix

* refactor: incresed the bundle size
2019-12-06 18:09:01 +01:00
Priscila Oliveira
501845b5f8 refactor: replaced date fns with dayjs (#345) 2019-12-06 17:58:24 +01:00
dependabot-preview[bot]
474e9e18de build(deps-dev): bump stylelint-webpack-plugin from 1.1.1 to 1.1.2 (#344) 2019-12-05 15:38:06 +01:00
dependabot-preview[bot]
ab810c8caa build(deps-dev): bump typescript from 3.7.2 to 3.7.3 (#342) 2019-12-05 15:37:41 +01:00
dependabot-preview[bot]
a3d7acfd73 build(deps-dev): bump @types/react from 16.9.14 to 16.9.15 (#343) 2019-12-05 15:37:30 +01:00
Priscila Oliveira
6ba721446b Search Component - Replaced class by func. comp (#339) 2019-12-04 17:09:02 +01:00
Priscila Oliveira
09b831a40d fix: updated actionbar snap (#340) 2019-12-03 14:24:10 +01:00
Priscila Oliveira
742971db0d ActionBar Component - Replaced class by func. comp (#330) 2019-12-03 09:44:44 +01:00
dependabot-preview[bot]
fcad6fa794 build(deps-dev): bump css-loader from 3.2.0 to 3.2.1 (#337) 2019-12-03 09:42:09 +01:00
dependabot-preview[bot]
a7b5e6df99 build(deps-dev): bump @typescript-eslint/parser from 2.9.0 to 2.10.0 (#338) 2019-12-03 09:41:39 +01:00
dependabot-preview[bot]
c988f0fac7 build(deps-dev): bump jest-emotion from 10.0.25 to 10.0.26 (#335) 2019-12-03 09:41:23 +01:00
dependabot-preview[bot]
c839970a25 build(deps-dev): bump @types/react from 16.9.13 to 16.9.14 (#336) 2019-12-03 09:40:54 +01:00
dependabot-preview[bot]
200cc289e6 build(deps-dev): bump @material-ui/core from 4.6.1 to 4.7.1 (#331) 2019-12-02 16:05:25 +01:00
dependabot-preview[bot]
11d66b7df1 build(deps-dev): bump eslint from 6.7.1 to 6.7.2 (#333) 2019-12-02 15:28:06 +01:00
dependabot-preview[bot]
7c616fa81a build(deps-dev): bump stylelint-webpack-plugin from 1.1.0 to 1.1.1 (#334) 2019-12-02 15:27:26 +01:00
dependabot-preview[bot]
e6dbf0a187 build(deps-dev): bump jest-emotion from 10.0.17 to 10.0.25 (#332) 2019-12-02 15:27:05 +01:00
dependabot-preview[bot]
764e73bbe2 build(deps-dev): bump codeceptjs from 2.3.5 to 2.3.6 (#318) 2019-12-01 16:19:34 +01:00
Priscila Oliveira
e60ab9e247 Repository Component - Replaced class by func. comp (#323) 2019-12-01 16:14:17 +01:00
dependabot-preview[bot]
d37de29d36 build(deps-dev): bump file-loader from 4.3.0 to 5.0.2 (#322) 2019-12-01 16:12:02 +01:00
dependabot-preview[bot]
764090dad3 build(deps-dev): bump url-loader from 2.3.0 to 3.0.0 (#324) 2019-12-01 16:08:08 +01:00
dependabot-preview[bot]
bedcea9a83 build(deps-dev): bump eslint-plugin-react from 7.16.0 to 7.17.0 (#329) 2019-12-01 15:43:07 +01:00
dependabot-preview[bot]
76142ecda6 build(deps-dev): bump lockfile-lint from 3.0.1 to 3.0.3 (#328) 2019-12-01 15:42:43 +01:00
dependabot-preview[bot]
ddb3b15cf6 build(deps-dev): bump style-loader from 1.0.0 to 1.0.1 (#327) 2019-12-01 13:19:48 +01:00
dependabot-preview[bot]
7a729d558f build(deps-dev): bump lockfile-lint from 2.2.0 to 3.0.1 (#316) 2019-11-27 15:09:59 +01:00
dependabot-preview[bot]
dc195a3446 build(deps-dev): bump lint-staged from 9.4.3 to 9.5.0 (#325) 2019-11-27 15:09:21 +01:00
dependabot-preview[bot]
a830403268 build(deps-dev): bump @types/react-router-dom from 5.1.2 to 5.1.3 (#326) 2019-11-27 15:08:54 +01:00
dependabot-preview[bot]
6a17a498e2 build(deps-dev): bump stylelint-processor-styled-components (#313) 2019-11-26 13:50:25 +01:00
dependabot-preview[bot]
a301eb0e8d build(deps-dev): bump eslint from 6.7.0 to 6.7.1 (#312) 2019-11-26 13:49:43 +01:00
dependabot-preview[bot]
de983f9a13 build(deps-dev): bump @typescript-eslint/parser from 2.8.0 to 2.9.0 (#321) 2019-11-26 13:46:55 +01:00
dependabot-preview[bot]
6da3204c0b build(deps-dev): bump @types/node from 12.12.11 to 12.12.14 (#319) 2019-11-26 13:45:42 +01:00
dependabot-preview[bot]
d4a17edc71 build(deps-dev): bump @types/validator from 12.0.0 to 12.0.1 (#320) 2019-11-26 13:42:27 +01:00
dependabot-preview[bot]
ba4299557e build(deps-dev): bump @types/react from 16.9.11 to 16.9.13 (#317) 2019-11-26 13:41:48 +01:00
Juan Picado @jotadeveloper
dc0cdbdb08 chore(release): 0.3.7 2019-11-24 21:05:59 +01:00
Priscila Oliveira
d955268c25 Revert "fix(#300): correctly reference registry url from options" (#311) 2019-11-24 20:17:28 +01:00
Michael Mok
ee74474811 fix(#300): correctly reference registry url from options 2019-11-24 19:43:19 +01:00
Priscila Oliveira
0d9232a92c Refactor(#209): Converted App component from class to func 2019-11-24 19:21:08 +01:00
Juan Picado @jotadeveloper
0a48906fc8 chore: enable optional chaining and nullish (#306) 2019-11-23 20:15:14 +01:00
dependabot-preview[bot]
58cf730b98 build(deps-dev): bump lint-staged from 8.2.1 to 9.4.3 (#289)
* build(deps-dev): bump lint-staged from 8.2.1 to 9.4.3

Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.2.1 to 9.4.3.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.2.1...v9.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* fix: updated lint-staged conf
2019-11-23 15:40:24 +01:00
Priscila Oliveira
111f0c50e5 feat: Added Theme and migrate to emotion@10.x 🚀 (#286)
* chore: updated emotion dependency

* feat: introduced theme

* refactor: updated emotion styles

* fix: fixed emotion error

* fix: fixed tests

* chore: add missing types

Co-Authored-By: Thomas Klein <tmkn@users.noreply.github.com>
2019-11-23 13:41:14 +01:00
dependabot-preview[bot]
a0dcf87368 build(deps-dev): bump url-loader from 2.2.0 to 2.3.0 (#303) 2019-11-22 13:11:01 +01:00
dependabot-preview[bot]
9ed5a833d9 build(deps-dev): bump date-fns from 2.8.0 to 2.8.1 (#304) 2019-11-22 13:10:35 +01:00
dependabot-preview[bot]
1ed229363a build(deps-dev): bump file-loader from 4.2.0 to 4.3.0 (#305) 2019-11-22 13:10:06 +01:00
dependabot-preview[bot]
34dff06bdb build(deps-dev): bump verdaccio from 4.3.4 to 4.3.5 (#302) 2019-11-22 13:08:38 +01:00
dependabot-preview[bot]
5d300cd9be build(deps-dev): bump eslint-plugin-codeceptjs from 1.1.0 to 1.2.0 (#299) 2019-11-21 12:01:47 +01:00
dependabot-preview[bot]
acfc902a99 build(deps-dev): bump validator from 12.0.0 to 12.1.0 (#298) 2019-11-21 12:01:22 +01:00
dependabot-preview[bot]
2f35eb7790 build(deps-dev): bump stylelint from 11.1.1 to 12.0.0 (#297) 2019-11-21 12:01:07 +01:00
dependabot-preview[bot]
cf6c5e159d build(deps-dev): bump @typescript-eslint/parser from 2.7.0 to 2.8.0 (#293) 2019-11-20 09:40:06 +01:00
dependabot-preview[bot]
fa9e1d3487 build(deps-dev): bump @types/validator from 10.11.3 to 12.0.0 (#292) 2019-11-20 09:39:47 +01:00
dependabot-preview[bot]
d70c78f201 build(deps-dev): bump date-fns from 2.7.0 to 2.8.0 (#296) 2019-11-20 09:38:57 +01:00
dependabot-preview[bot]
effde37c35 build(deps-dev): bump stylelint-webpack-plugin from 1.0.4 to 1.1.0 (#294) 2019-11-20 09:38:29 +01:00
dependabot-preview[bot]
d65483401d build(deps-dev): bump @types/node from 12.12.8 to 12.12.11 (#295) 2019-11-20 09:36:12 +01:00
dependabot-preview[bot]
5f80d00502 build(deps-dev): bump standard-version from 7.0.0 to 7.0.1 (#291)
Bumps [standard-version](https://github.com/conventional-changelog/standard-version) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/conventional-changelog/standard-version/releases)
- [Changelog](https://github.com/conventional-changelog/standard-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/standard-version/compare/v7.0.0...v7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 06:40:57 +01:00
dependabot-preview[bot]
430608d276 build(deps-dev): bump @types/lodash from 4.14.148 to 4.14.149 (#288)
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.148 to 4.14.149.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 06:39:50 +01:00
dependabot-preview[bot]
9975edbb6f build(deps): [security] bump https-proxy-agent from 2.2.2 to 2.2.4 (#287) 2019-11-19 08:46:47 +01:00
Juan Picado @jotadeveloper
dbaa0c43b8 fix: restore lint-staged@8.2.1 2019-11-19 05:46:04 +01:00
Juan Picado @jotadeveloper
fd306def95 fix: update snapshots 2019-11-19 05:45:38 +01:00
Priscila Oliveira
ec3f69a542 fix (#285): fixed tests errors 2019-11-18 22:47:57 +01:00
dependabot-preview[bot]
fc4a7ee12c build(deps-dev): bump @types/lodash from 4.14.147 to 4.14.148 (#282) 2019-11-18 09:41:44 +01:00
dependabot-preview[bot]
5c6d9f68ca build(deps-dev): bump husky from 3.0.9 to 3.1.0 (#281) 2019-11-18 09:38:52 +01:00
dependabot-preview[bot]
3e8af72193 build(deps-dev): bump react-hot-loader from 4.12.17 to 4.12.18 (#283) 2019-11-18 09:20:49 +01:00
dependabot-preview[bot]
3f58be32b3 build(deps-dev): bump @types/node from 12.12.7 to 12.12.8 (#284) 2019-11-18 09:20:25 +01:00
dependabot-preview[bot]
042571e72f build(deps-dev): bump react-hot-loader from 4.12.16 to 4.12.17 (#270) 2019-11-15 23:19:04 +01:00
dependabot-preview[bot]
dd6ba2cbe9 build(deps-dev): bump ora from 4.0.2 to 4.0.3 (#273) 2019-11-15 23:06:26 +01:00
dependabot-preview[bot]
bf613231f4 build(deps-dev): bump @types/lodash from 4.14.146 to 4.14.147 (#274) 2019-11-15 23:06:00 +01:00
dependabot-preview[bot]
7074eddf27 build(deps-dev): bump lint-staged from 9.4.2 to 9.4.3 (#275) 2019-11-15 23:04:57 +01:00
dependabot-preview[bot]
d3ddd439d1 build(deps-dev): bump stylelint-webpack-plugin from 1.0.3 to 1.0.4 (#276) 2019-11-15 23:03:46 +01:00
dependabot-preview[bot]
26724bb20e build(deps-dev): bump react-dom from 16.11.0 to 16.12.0 (#277) 2019-11-15 22:57:31 +01:00
dependabot-preview[bot]
cba41ceead build(deps-dev): bump eslint-plugin-react-hooks from 2.2.0 to 2.3.0 (#278) 2019-11-15 22:50:16 +01:00
dependabot-preview[bot]
2688b59f5b build(deps-dev): bump react from 16.11.0 to 16.12.0 (#279) 2019-11-15 22:38:50 +01:00
dependabot-preview[bot]
4d285dbb00 build(deps-dev): bump @types/jest from 24.0.22 to 24.0.23 (#271) 2019-11-13 09:07:22 +01:00
dependabot-preview[bot]
739333b1f1 build(deps-dev): bump @material-ui/core from 4.6.0 to 4.6.1 (#272) 2019-11-13 09:05:08 +01:00
dependabot-preview[bot]
5809a9f7cb build(deps-dev): bump @octokit/rest from 16.34.1 to 16.35.0 (#261) 2019-11-12 21:19:34 +01:00
dependabot-preview[bot]
e1c5e30b4c build(deps-dev): bump @typescript-eslint/parser from 2.5.0 to 2.7.0 (#264) 2019-11-12 20:49:49 +01:00
dependabot-preview[bot]
5a3ea02449 build(deps-dev): bump @verdaccio/commons-api from 8.2.0 to 8.3.0 (#265) 2019-11-12 20:49:35 +01:00
dependabot-preview[bot]
535d8f9c85 build(deps-dev): bump typescript from 3.7.1-rc to 3.7.2 (#266) 2019-11-12 20:49:15 +01:00
dependabot-preview[bot]
8a46678698 build(deps-dev): bump resolve-url-loader from 3.1.0 to 3.1.1 (#267) 2019-11-12 20:48:52 +01:00
dependabot-preview[bot]
3265ed561d build(deps-dev): bump @types/node from 12.12.6 to 12.12.7 (#268) 2019-11-12 20:48:29 +01:00
dependabot-preview[bot]
3a6c6f7fb9 build(deps-dev): bump @testing-library/react from 9.3.0 to 9.3.2 (#255) 2019-11-12 08:27:54 +01:00
Priscila Oliveira
09fe1db850 Refactor(#240): Created Reset CSS and added local fonts 2019-11-12 08:18:05 +01:00
dependabot-preview[bot]
f265b6ba33 build(deps-dev): bump validator from 11.1.0 to 12.0.0 (#256) 2019-11-11 13:50:38 +01:00
dependabot-preview[bot]
185b2016d3 build(deps-dev): bump react-hot-loader from 4.12.15 to 4.12.16 (#257) 2019-11-11 13:50:22 +01:00
dependabot-preview[bot]
3751acef1c build(deps-dev): bump lint-staged from 8.2.1 to 9.4.2 (#258) 2019-11-11 13:50:04 +01:00
dependabot-preview[bot]
50fa39f7d6 build(deps-dev): bump date-fns from 2.6.0 to 2.7.0 (#260) 2019-11-11 13:49:41 +01:00
dependabot-preview[bot]
cd2e36513e build(deps-dev): bump prettier from 1.18.2 to 1.19.1 (#254) 2019-11-11 13:49:22 +01:00
dependabot-preview[bot]
b20fe3f44a build(deps-dev): bump @types/lodash from 4.14.144 to 4.14.146 (#253) 2019-11-11 13:49:05 +01:00
dependabot-preview[bot]
be30cbdd14 build(deps-dev): bump @types/jest from 24.0.20 to 24.0.22 (#262) 2019-11-11 13:45:56 +01:00
dependabot-preview[bot]
c6e3fd0b92 build(deps-dev): bump detect-secrets from 1.0.4 to 1.0.5 (#252) 2019-11-11 13:15:39 +01:00
dependabot-preview[bot]
f27254ca6b build(deps-dev): bump @types/react-router-dom from 5.1.0 to 5.1.2 (#247) 2019-11-10 22:08:27 +01:00
dependabot-preview[bot]
f4dd8b01b4 build(deps-dev): bump verdaccio-auth-memory from 8.2.0 to 8.3.0 (#250)
Bumps [verdaccio-auth-memory](https://github.com/verdaccio/monorepo/tree/HEAD/plugins/auth-memory) from 8.2.0 to 8.3.0.
- [Release notes](https://github.com/verdaccio/monorepo/releases)
- [Changelog](https://github.com/verdaccio/monorepo/blob/master/plugins/auth-memory/CHANGELOG.md)
- [Commits](https://github.com/verdaccio/monorepo/commits/v8.3.0/plugins/auth-memory)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-09 08:22:39 +01:00
dependabot-preview[bot]
a94485e614 build(deps-dev): bump @types/react-dom from 16.9.3 to 16.9.4 (#248)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 16.9.3 to 16.9.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-09 00:18:50 +01:00
dependabot-preview[bot]
ce4b13d3b5 build(deps-dev): bump verdaccio-memory from 8.2.0 to 8.3.0 (#249)
Bumps [verdaccio-memory](https://github.com/verdaccio/monorepo/tree/HEAD/plugins/memory) from 8.2.0 to 8.3.0.
- [Release notes](https://github.com/verdaccio/monorepo/releases)
- [Changelog](https://github.com/verdaccio/monorepo/blob/master/plugins/memory/CHANGELOG.md)
- [Commits](https://github.com/verdaccio/monorepo/commits/v8.3.0/plugins/memory)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-09 00:09:57 +01:00
dependabot-preview[bot]
fcd471ef6f build(deps-dev): bump lockfile-lint from 2.1.6 to 2.2.0 (#244)
Bumps [lockfile-lint](https://github.com/lirantal/lockfile-lint) from 2.1.6 to 2.2.0.
- [Release notes](https://github.com/lirantal/lockfile-lint/releases)
- [Commits](https://github.com/lirantal/lockfile-lint/compare/lockfile-lint@2.1.6...lockfile-lint@2.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-08 07:07:01 +01:00
dependabot-preview[bot]
9915fb6193 build(deps-dev): bump @verdaccio/types from 8.1.0 to 8.3.0 (#242)
Bumps [@verdaccio/types](https://github.com/verdaccio/monorepo/tree/HEAD/core/types) from 8.1.0 to 8.3.0.
- [Release notes](https://github.com/verdaccio/monorepo/releases)
- [Changelog](https://github.com/verdaccio/monorepo/blob/master/core/types/CHANGELOG.md)
- [Commits](https://github.com/verdaccio/monorepo/commits/v8.3.0/core/types)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-08 06:47:52 +01:00
dependabot-preview[bot]
886684817b build(deps-dev): bump @types/node from 12.11.7 to 12.12.6 (#243)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.11.7 to 12.12.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-08 06:44:58 +01:00
dependabot-preview[bot]
76d11d4674 build(deps-dev): bump @octokit/rest from 16.34.0 to 16.34.1 (#241)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 16.34.0 to 16.34.1.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v16.34.0...v16.34.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-08 06:44:22 +01:00
dependabot-preview[bot]
322197dc70 build(deps-dev): bump webpack-cli from 3.3.9 to 3.3.10 (#245)
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.9 to 3.3.10.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/v3.3.10/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.9...v3.3.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-08 06:37:20 +01:00
Juan Picado @jotadeveloper
d2e9d68c6d chore(release): 0.3.6 2019-11-08 06:36:19 +01:00
Juan Picado @jotadeveloper
f1971edf6d build: fix e2e (#246)
* fix: e2e testing

* fix: e2e testing

* fix: e2e testing

* fix: e2e testing

* fix: e2e testing

* fix: e2e testing
2019-11-08 06:23:22 +01:00
Juan Picado @jotadeveloper
c9f6bf43ae chore(release): 0.3.5 2019-11-07 18:11:26 +01:00
Anix
bdef686914 feat: added download tarball button at list (#237)
* chore: added download button at packagelist

* feat: added download btn in package list
2019-11-07 18:11:08 +01:00
Priscila Oliveira
84257e1a84 chore: updated material-ui dependencies (#239)
* chore: update material-ui dependencies

* fix: updated snaps
2019-11-07 17:55:20 +01:00
Alfonso Austin
b74ca2285e fix: refactor/116 RegistryInfoContent is converted to functional component (#229)
* refactor:116[PackageList] component is converted to functional

* Refactor:#116 - Registry info content is converted to functional component

* refactor/116 - fix lint error

* refactor:116 - more lint errors

* refactor/116 - lint error

* refactor:116 - remove snapshot

* refactor: address code review comments #116

* refactor: fix lint error

* refactor: code review changes

* refactor add missed file

* refactor: lint error

* refactor: lint

* refactor: lint

* refactor: fix lint error
2019-11-02 17:53:21 +01:00
Ayush Sharma
803da1c532 fix: adds unit tests for api service (#235)
* refactor: adds unit tests for api service

* refactor: fix test dummy url
2019-11-01 07:18:55 +01:00
Andrew Hughson
5cb47ed49e fix: convert Engine component to hooks (#233)
* refactor: convert Engine component to hooks

* inline engine test data only used by one test

* remove  from engines tests

* remove confusing test abstraction

* change tests to not use mutations
2019-10-31 22:17:16 +01:00
Priscila Oliveira
b56e43846b fix: rest MUI components - Introduced ForwardRef (#224)
* refactor(162): added forwardRef Card

* refactor(162): introduced forwardRefDivider

* refactor(162): introduced forwardRef MuiComponents

* refactor(162): introducing forwardRef

* refactor(162): introduced forwardRef

* refactor(162): introduced forwardRef

* fix(162): fixed link

* fix: fixed port number

* fix: fixed duplicated id

* fix: fixed ref iconbutton

* fix: updated snaps

* fix: fixed port

* fix: fixed eslint errors

* fix: the item should be a button

* fix: fixed eslint errors
2019-10-31 08:12:18 +01:00
Ayush Sharma
a4cdd145d2 feat: update date fns to v2 (#232)
* chore: updates date-fns@2

* chore: updates date-fns@2  to new apis

* chore: updates date-fns@2, updates format
2019-10-30 07:02:07 +01:00
Juan Picado @jotadeveloper
0eb0566cde chore(#228): add canary package generator 2019-10-28 10:35:40 +01:00
Juan Picado @jotadeveloper
e6b53c0479 chore: migrate eslint@6.6.0 (#227)
* chore: migrate to eslint6

* chore: migrate to eslint6
2019-10-27 15:49:30 +01:00
Juan Picado @jotadeveloper
2a2784ba39 chore(release): 0.3.4 2019-10-26 18:20:11 +02:00
Juan Picado @jotadeveloper
6d553ea607 chore(#225): Update stack (#225) 2019-10-26 17:17:38 +02:00
Juan Picado @jotadeveloper
95f173d29a chore(#223): update stack dev 2019-10-26 14:00:06 +02:00
Ayush Sharma
531295a6d0 refactor: adds missing test spec for button click in not found (#222)
* refactor: adds missing test spec for button click in not found

* refactor: improves test description
2019-10-26 13:13:47 +02:00
Priscila Oliveira
a38b93e127 refactor(162): introduced forwardRefDivider (#218) 2019-10-26 12:19:14 +02:00
Ayush Sharma
52ed8ad67b refactor: adds download tarball spec to action bar (#220)
* refactor: adds download tarball spec to action bar

* refactor: fixes typo
2019-10-26 12:02:03 +02:00
Alfonso Austin
ae0222cf65 fix: PackageList component is converted to functional (#219) #116 2019-10-26 11:36:16 +02:00
Priscila Oliveira
2bc49f3ab7 fix(162): added forwardRef Card (#216) 2019-10-26 08:44:25 +02:00
Ayush Sharma
ade548a7da fix: adds no uplink spec (#213) 2019-10-25 20:21:48 +02:00
Ayush Sharma
6dfcd70025 refactor: adds test for registry info component (#214) 2019-10-25 10:45:42 +02:00
Anix
4498aad4bf fix(installlistitem): changed the wrong icon (#211) 2019-10-24 23:51:27 +02:00
Thomas Klein
5d6ad3d783 fix: api typings (#210) 2019-10-22 22:31:39 +02:00
Priscila Oliveira
5c06ace14a fix: routes - Replaced class by func. comp (#159)
* refactor: updated routes

* fix: fixed conflicts issues

* fix: rollback port
2019-10-19 10:49:04 +02:00
Priscila Oliveira
8c66dbc4d7 chore(#203): updated typescript to version 3.7 - beta 2019-10-18 12:36:17 +02:00
hugoazevedosoares
302f4dbd89 chore(#206): remove snapshot test and added more relevant tests 2019-10-18 10:26:08 +02:00
hugoazevedosoares
ff791a35f7 chore(#207): added more descriptive tests 2019-10-17 11:52:11 +02:00
Priscila Oliveira
f5c77ff43c fix: version Page - Replaces class by func. (#171)
* refactor: updated version page

* refactor: rollback context

* fix: added version provider
2019-10-17 07:36:41 +02:00
Juan Picado @jotadeveloper
d69fc1b260 Update README.md 2019-10-16 18:54:49 +02:00
Brian Pedersen
16b12ddc76 refactor(#204): copyToClipBoard.test, moved test of utility to it's own test 2019-10-16 10:00:05 +02:00
Juan Picado @jotadeveloper
dd532955de chore: add more info about commits 2019-10-16 07:49:21 +02:00
Juan Picado @jotadeveloper
0d581718ab chore(release): 0.3.3 2019-10-16 07:45:59 +02:00
Juan Picado @jotadeveloper
7de6983d1e chore: add some extra notes to readme 2019-10-16 07:44:26 +02:00
Sergio Hg
48c03fe472 fix(deps): remove types from dependencies (#201) 2019-10-15 20:34:45 +02:00
Thomas Klein
1abc15603e refactor: Added typings for getRecentReleases (#190) 2019-10-15 12:08:16 +02:00
Andrew Smith
6f87be68be fix: changes font size for items of the register-info component (#196)
* fix: changes font size for items of the register-info component

This changes the font size for items of the register-info component to 1rem
Fixes #193.

* chore: added missing snapshots for previous commit
2019-10-15 07:37:39 +02:00
Thomas Klein
cfb29ce325 fix: added typings for react-autosuggest (#200) 2019-10-15 07:36:35 +02:00
Daniel Ruf
245247cbed ci: use node-version (#197) 2019-10-13 18:21:43 +02:00
Thomas Klein
e0e7c07bce fix: better type inference for MediaQuery (#180) 2019-10-13 10:49:55 +02:00
Juan Picado @jotadeveloper
d1b3e6e3b5 build: e2e integration with puppeteer (#192)
* build: add e2e testing scripts

* build: add e2e testing scripts

* chore: fix script

* chore: fix script

* chore: ignore e2e normal test

* chore: fix node_latest_browser

* chore: move lint to prepare

* chore: fix lint

* chore: add local theme

* fix: e2e tests
2019-10-13 10:27:01 +02:00
Priscila Oliveira
0c4fb7da13 fix: introduced forwardRef (#181) 2019-10-12 22:26:56 +02:00
Priscila Oliveira
a8deeb9b9d fix: typography Component - Introduced ForwardRef (#179)
* refactor: introduced forwardref

* refacttor: updated ref's

* fix: fixed func's name

* fix: fixed snapshots

* fix: updated snap
2019-10-12 21:41:42 +02:00
Priscila Oliveira
82d7107de7 fix: listItem Component - Introduced ForwardRef (#183)
* refactor: introduced forwardRef

* fix: fixed button prop listItem

* chore: rollback package upgrade

* fix: fixed snap
2019-10-12 21:11:23 +02:00
Thomas Klein
d2c1130efd fix: removed tsignore for AppContext (#188) 2019-10-12 19:59:47 +02:00
Priscila Oliveira
fdbdb6303b feat: new not found component (#170)
* refactor: updated not found component

* chore: removed react-router

* refactored: applied feedbacks

* fix: removed doc folder

* refactor: rollback yarn.lock
2019-10-12 13:23:14 +02:00
Juan Picado @jotadeveloper
7529c02e58 chore: add codecov setup (#186)
* chore: add codecov setup

* chore: add dump functions

* chore: update codecov

* chore: update codecov

* chore: update codecov

* chore: update codecov

* chore: update codecov

* chore: update codecov

* chore: update codecov

* chore: update codecov

* chore: update codecov
2019-10-12 12:05:07 +02:00
Priscila Oliveira
8b86ded434 fix: introduced SvgIcon (#184) 2019-10-12 11:42:29 +02:00
Thomas Klein
3b4d823845 build: added typings for hot reload (#187) 2019-10-12 11:41:54 +02:00
Priscila Oliveira
7548c89401 fix: introduced forwardRef (#185) 2019-10-12 09:55:37 +02:00
Priscila Oliveira
af8ed8b3e3 fix: introduced ForwardRef (#177)
* refactor: introduced forwardref - circular progress

* refactor: replaced HTMLElementTagNameMap with HTMLElementDiv

* fix: fixed func name
2019-10-12 09:54:52 +02:00
Priscila Oliveira
d0d4139dd3 fix: fixed import (#176) 2019-10-12 09:26:53 +02:00
Priscila Oliveira
3888736e45 fix: fixed imports & func's name (#182) 2019-10-12 08:45:39 +02:00
Thomas Klein
752e2b963d fix: dist-tags attribute #175 (#178) 2019-10-12 00:06:18 +02:00
Antoine Chalifour
99621b6baf Refactor: Dependencies - Replaced class with func. comp (#169) 2019-10-11 15:02:53 +02:00
Thomas Klein
e0642a9d0d fix: improved typing (#174) 2019-10-10 22:20:05 +02:00
Thomas Klein
68b7171de4 chore: readded null check (#173) 2019-10-10 20:52:59 +02:00
Priscila Oliveira
d1ce82854a fix: Header Component - Replaced class by func. comp (#142)
* refactor: replaced class by func.comp

* refactor: replacing jest test by react-testing-library

* refactor: added test todos

* feat: added more unit tests

* fix: fixed tooltip import

* fix: fixed test

* fix: fixed typo

* fix: fixed imports
2019-10-08 07:47:11 +02:00
Priscila Oliveira
ae73772a37 feat(eslint-config): add order rule in import
* refactor: added eslint-plugin-import

* refactor: disable some rules for muiComponents

* fix: fixed import
2019-10-07 22:19:18 +02:00
Antoine Chalifour
950f6defca refactor: migrate Uplinks to function component (#165) 2019-10-07 14:13:05 +02:00
Juan Picado @jotadeveloper
0ca89dcbe7 Merge pull request #153 from antoinechalifour/fix-ts-ignore
Fix a few ts-ignore
2019-10-07 07:52:47 +02:00
antoinechalifour
f4da5e692d fix(Developers): remove compilation warnings 2019-10-06 18:32:51 +02:00
antoinechalifour
6f52838531 fix: media query ts ignore 2019-10-06 18:32:51 +02:00
antoinechalifour
a8eb1f36fc fix(api): remove unnecessary ts ignore 2019-10-06 18:32:51 +02:00
antoinechalifour
1fb0bf96d1 fix(Footer): remove unnecessary ts ignore 2019-10-06 18:32:51 +02:00
antoinechalifour
f6eb74736a fix(App): ts ignore 2019-10-06 18:32:51 +02:00
Antoine Chalifour
35d691c1e0 fix: fix DependencyBlock props interface 2019-10-06 18:32:51 +02:00
Antoine Chalifour
b35baa069f fix: add new window property to interface definition 2019-10-06 18:32:51 +02:00
Antoine Chalifour
7a8b158188 fix: remove unnecessary ts ignore 2019-10-06 18:32:51 +02:00
Antoine Chalifour
852f6eeb22 fix: improve jest mock typings 2019-10-06 18:32:51 +02:00
Antoine Chalifour
b1804d7644 fix: remove ts ignore from some components 2019-10-06 18:31:30 +02:00
Antoine Chalifour
32f4389b73 fix: remove unnecessary ts ignore 2019-10-06 18:31:30 +02:00
Antoine Chalifour
3166673875 fix: spinner typings 2019-10-06 18:31:30 +02:00
Priscila Oliveira
626bcce5cb fix: introduced forwardRef (#163) 2019-10-06 18:30:05 +02:00
Priscila Oliveira
909a8d9fb8 fix: introduced forwardRef (#164) 2019-10-06 17:17:36 +02:00
Priscila Oliveira
9eb698f7e1 fix: install Component - Replaced class by func. comp (#152)
* refactor: convert class to func comp

* fix: fixed wrong maintainer type

* refactor: created a partials folder

* fix: fixed test
2019-10-06 16:55:49 +02:00
Andrew Hughson
43a9628ec4 fix: incorrect Tooltip import in avatar component (#160) 2019-10-06 16:01:58 +02:00
Andrew Hughson
d2f1f1c06a refactor: convert Author component to hooks (#150) 2019-10-06 15:44:48 +02:00
Antoine Chalifour
a365ec548a feat: use React.lazy for loading components (#158) 2019-10-05 20:13:36 +02:00
Andrew Hughson
f1f8f8ae3f fix: convert Dist component to hooks (#156) 2019-10-05 10:33:31 +02:00
Antoine Chalifour
583ddd555a fix: some warnings in console (#155)
* fix: remove react emotion selector warning

* fix: validate DOM nesting
2019-10-04 23:19:50 +02:00
Juan Picado @jotadeveloper
7bd9eb7a07 fix: lock file was corrupted 2019-10-04 19:12:00 +02:00
Thomas Klein
61a400fbd8 chore: added typings (#157) 2019-10-04 14:56:20 +02:00
Priscila Oliveira
f84fd79c5b fix: detailContainer Component - Replaced class by func. comp (#130)
* refactor: coverted class comp. into func.comp

* refactor: added forward ref comp.

* fix: fixed external link color

* fix: fixed typo

* refactor: applied feedbacks
2019-10-03 18:17:04 +02:00
Juan Picado @jotadeveloper
28c982a7da chore: trigger ci on pr 2019-10-03 14:19:13 +02:00
Suman Bhattarai
f8e3013b59 fix: tarball download not working on Firefox and Edge (#144)
* fix tarball download not working on firefox and edge

* update lastModified to be a date number
2019-10-03 12:47:30 +02:00
Priscila Oliveira
1d705da38c feat: version Component - Replaced classes by func. comp (#129)
* refactor: replaced classes by func comp

* fix: fixed space margin

* refactor: changed display logic

* fix: fixed types

* fix: fixed Version test

* fix: fixed version style
2019-10-03 10:27:08 +02:00
Jesús Márquez
1a74c08b5d chore: update react version to 16.10.0 (#149) 2019-10-03 09:11:52 +02:00
Thomas Klein
f8a1f2cbb8 feat: upgraded typescript to 3.6.3 (#145) 2019-10-02 22:32:31 +02:00
Gagan Deep
74576bda12 fix: linter error fixed (#143) 2019-10-02 21:52:27 +02:00
Daniel Ruf
cf050f234d docs: remove contributing link (#146) 2019-10-02 17:01:20 +02:00
Antoine Chalifour
e14729006a fix: warning about modules with names differing in casing (#148) 2019-10-02 16:46:29 +02:00
Juan Picado @jotadeveloper
584f4c141e chore(release): 0.3.2 2019-09-30 20:28:36 +02:00
Juan Picado @jotadeveloper
91d818c478 fix: sidebar view on small screens (#136) 2019-09-30 20:28:02 +02:00
Sergio Hg
ae6e479f16 Merge pull request #139 from verdaccio/security-deps
chore(deps): bump detect-secrets for enhanced dev workflow
2019-09-29 23:46:38 +02:00
Juan Picado @jotadeveloper
18ef27eac6 Merge branch 'master' into security-deps 2019-09-29 20:21:43 +02:00
Juan Picado @jotadeveloper
eabc0b9f5b chore: add detect-secrets deps 2019-09-29 20:20:10 +02:00
Juan Picado @jotadeveloper
3779caa4e3 chore(release): 0.3.1 2019-09-29 20:03:29 +02:00
Juan Picado @jotadeveloper
543877a077 chore: add detect-secrets deps 2019-09-29 18:33:04 +02:00
Juan Picado @jotadeveloper
7e6702c34b chore: update dependencies (#138)
* chore: update dependencies

dependencies maintenance

* chore: restore date-fns@1.30.1
2019-09-29 18:26:04 +02:00
Filip Messa
2e50981514 fix(ui): fix the hover effect on the packageItem's author area (#137) 2019-09-29 16:44:10 +02:00
Daniel Ruf
f61913c2d3 fix: correctly load font files - closes #128 (#134)
* fix: correctly load font files - closes #128

* Resolve issue with the moduleNameWrapper in Jest
2019-09-29 16:36:38 +02:00
Priscila Oliveira
ffc97c373c chore: pumped mui version (#131)
* chore: updated mui libs

* fix: updated snap
2019-09-28 00:31:01 +02:00
Sergio Hg
3a889b67ee Merge pull request #127 from verdaccio/refactor-ci
chore: refactor ci
2019-09-11 22:55:04 +02:00
Sergio Herrera Guzmán
de0f91a6d2 test: skip non-deterministic test 2019-09-11 22:47:45 +02:00
Sergio Herrera Guzmán
195a79a809 ci: drop Node 8 support 2019-09-11 22:35:29 +02:00
Sergio Herrera Guzmán
0a7428edab chore: fix Prettier and Stylelint glob expansion for Windows 2019-09-11 15:53:57 +02:00
Sergio Herrera Guzmán
9ad506d569 test: fix one failing snapshot 2019-09-11 15:53:07 +02:00
Sergio Herrera Guzmán
3b52a17623 chore: update lockfile 2019-09-11 15:53:07 +02:00
Sergio Herrera Guzmán
3309e449d1 ci(circleci): improve workflow and add linting 2019-09-11 15:53:07 +02:00
Sergio Herrera Guzmán
7853ec2acb ci(github): remove workflow before deprecation and improve current 2019-09-11 15:53:07 +02:00
Juan Picado @jotadeveloper
2890e5a27e chore(release): 0.3.0 2019-09-01 13:16:44 +02:00
Juan Picado @jotadeveloper
1904179af3 feat: add browser features to browse by version (#125)
* feat: add browser features to browse by version

* chore: verify whether version exist

* chore: add link on versions

* chore: udpate imports

* chore: use mui links

* test: add unit test

* chore: Add todo list

* chore: remove imports
2019-09-01 04:09:23 -07:00
Juan Picado @jotadeveloper
bbec54d602 chore(release): 0.2.4 2019-08-31 11:08:06 +02:00
Juan Picado @jotadeveloper
67d7188cf5 feat: update material-ui@4.x (#123)
* chore: update material-ui@4.x

* test: update test for ActionBar and TestField

* chore: add types

* chore: update types

* test: update test for Author

* chore: fixed bunch of unit test

* chore: remove unused import

* chore: remove comments

* chore: replace shallow my mount

* chore: update git hooks

* chore: fix styles

* chore: update dependencies

* chore: remove types material-ui
2019-08-31 02:02:46 -07:00
Juan Picado @jotadeveloper
376b84f8c9 chore(release): 0.2.3 2019-08-25 17:55:59 +02:00
Juan Picado @jotadeveloper
5a9bd6001a fix: remove ToReplaceByVerdaccio #108 (#122)
* fix: remove ToReplaceByVerdaccio #108

it populates CSS url() props with ToReplaceByVerdaccio which cannot be replaced anyway, this PR remove that string.

https://github.com/verdaccio/ui/issues/108

* chore: remove comment
2019-08-25 08:53:30 -07:00
Juan Picado @jotadeveloper
ac58730e8c fix: missing headers on search endpoint with token (#121)
Headers should be part of the options if we override options.

https://github.com/verdaccio/ui/issues/118
2019-08-25 08:39:15 -07:00
Juan Picado @jotadeveloper
97e8448098 fix: refactoring version page / fix issue not found page #100 (#117)
* chore: refactoring version page

* refactor: migrate version page to hooks

* refactor: Version page better imports

* fix: #100 render not found on click item

* test: add test for version page

* chore: update mocks

* test: add scenario for not found package

* chore: fix wrong mock path

* chore: update mock

* chore: add todo list
2019-08-25 14:34:27 +02:00
Juan Picado @jotadeveloper
e7d3c461cd Merge pull request #120 from verdaccio/adds-unit-test-for-version-component
chore: adds unit test for version component
2019-08-25 07:11:09 +02:00
Ayush Sharma
003f879a87 chore: adds unit test for version component 2019-08-24 16:57:51 +02:00
Juan Picado @jotadeveloper
d81b610e2e Merge pull request #115 from verdaccio/hooks-first-step
hooks first step
2019-08-15 21:48:07 +02:00
Juan Picado @jotadeveloper
3d7b230c71 chore: add note 2019-08-12 07:54:14 +02:00
Juan Picado @jotadeveloper
ce3b22579f chore: update snapshots 2019-08-12 07:45:16 +02:00
Juan Picado @jotadeveloper
e46020f9b0 refactor: Developers component
Using React hooks
2019-08-12 07:06:10 +02:00
Juan Picado @jotadeveloper
502c0903ab chore: add react hooks eslint conf 2019-08-11 07:24:54 +02:00
Juan Picado @jotadeveloper
542212a479 Merge pull request #114 from verdaccio/update-stack
chore: update stack
2019-08-10 22:30:47 +02:00
Juan Picado @jotadeveloper
1cb9b56940 Merge branch 'master' into update-stack 2019-08-10 22:25:04 +02:00
Juan Picado @jotadeveloper
1446c8e5fb Merge pull request #112 from ThisIsMissEm/master
fix(api): correctly handle responses with missing content-type header
2019-08-10 22:22:19 +02:00
Juan Picado @jotadeveloper
155987d837 chore: update css-loader 2019-08-10 22:01:02 +02:00
Juan Picado @jotadeveloper
a44e76fded chore: update webpack 2019-08-10 21:52:25 +02:00
Juan Picado @jotadeveloper
2dfa7aa4d6 Merge remote-tracking branch 'origin/master' into update-stack 2019-08-10 21:41:10 +02:00
Juan Picado @jotadeveloper
cfb0caf2bb Merge branch 'master' into master 2019-08-10 21:39:16 +02:00
Juan Picado @jotadeveloper
62b6edc821 Update nodejs.yml 2019-08-10 21:38:21 +02:00
Juan Picado @jotadeveloper
9b55b75f8a Update nodejs.yml 2019-08-10 21:29:56 +02:00
Juan Picado @jotadeveloper
ade58caf41 Update nodejs.yml 2019-08-10 21:25:03 +02:00
Juan Picado @jotadeveloper
2e9703346c Update nodejs.yml 2019-08-10 21:19:03 +02:00
Juan Picado @jotadeveloper
ccc2cb3fa6 chore: update dependencies 2019-08-10 20:32:35 +02:00
Juan Picado @jotadeveloper
3746a0466f chore: trying github ci 2019-08-10 13:54:27 +02:00
Juan Picado @jotadeveloper
dcfda4483f Merge pull request #113 from griffithtp/fix/107_refactor-suggest-styles
Fix/107 refactor suggest styles
2019-08-09 05:56:33 +02:00
Griffithtp
d44cc7f662 refactor: update all reusable fontWeights 2019-08-08 22:08:37 +01:00
Griffithtp
4a526c92bb refactor: add reusable styles properties 2019-08-08 22:03:54 +01:00
Emelia Smith
2049022477 fix(api): correctly handle responses with missing content-type header
Also prevents non .tgz requests from being handled as tgz requests — the previous if condition was incorrect
2019-08-08 14:26:30 +02:00
Juan Picado @jotadeveloper
40a25a2507 refactor: update dependencies
development keys deps updated
add eslint-plugin-codeceptjs to fix eslint issues for acceptant test
2019-08-04 11:40:45 +02:00
Juan Picado @jotadeveloper
58cb4c7465 Merge branch '4.x-master' of github.com:verdaccio/ui into 4.x-master 2019-08-04 11:17:41 +02:00
Juan Picado @jotadeveloper
e1d8eafb7a Merge pull request #44 from DanielRuf/test/bdd-acceptance-testing-setup
test: BDD / acceptance tests
2019-08-04 11:17:04 +02:00
Juan Picado @jotadeveloper
cb876f936e Merge branch '4.x-master' into test/bdd-acceptance-testing-setup 2019-08-04 11:10:56 +02:00
Juan Picado @jotadeveloper
94ca0e146d Merge pull request #96 from verdaccio/4.x-adds-unit-tests-for-repository-component
chore: adds unit tests for <Repository /> component
2019-08-04 11:06:59 +02:00
Juan Picado @jotadeveloper
8774fd51c7 Merge branch '4.x-master' into 4.x-adds-unit-tests-for-repository-component 2019-08-04 10:24:09 +02:00
Juan Picado @jotadeveloper
6f8d891c42 chore: improve local dev displaying 2 packages by default
vue and jquery as examples
2019-08-04 10:17:43 +02:00
Juan Picado @jotadeveloper
240535ddad chore(release): 0.2.2 2019-07-29 16:33:18 +02:00
Juan Picado @jotadeveloper
3c6fe5d947 Merge pull request #110 from verdaccio/issue-token
fix: download protected tarballs
2019-07-29 16:32:27 +02:00
Juan Picado @jotadeveloper
f8374084b5 test: add scenario for handleResponseType tgz 2019-07-29 08:42:37 +02:00
Juan Picado @jotadeveloper
8c9cffbc6a test: add scenario for action bar
Wether the metadata has a tarball distribution file
2019-07-29 00:12:14 +02:00
Juan Picado @jotadeveloper
62431038bb chore: improve types and checks 2019-07-28 17:51:46 +02:00
Juan Picado @jotadeveloper
12974ea54f test: add unit test for extractFileName 2019-07-28 16:44:31 +02:00
Juan Picado @jotadeveloper
f47ab2490b refactor: add download file method 2019-07-28 14:12:18 +02:00
Juan Picado @jotadeveloper
83b6a9d247 chore: update snapshots for actionbar 2019-07-28 11:59:58 +02:00
Juan Picado @jotadeveloper
5c484bba9a fix: proxy webpack setting
- it allows download tarballls in the same origin
- update webpack dev server
- add scenario for blob
2019-07-28 11:53:23 +02:00
Juan Picado @jotadeveloper
9d006ad6f7 chore: first try to download files with fetch 2019-07-28 11:53:23 +02:00
Juan Picado @jotadeveloper
fd74c52bd1 fix: token were not being send it 2019-07-28 11:53:22 +02:00
Juan Picado @jotadeveloper
a25fc6ec78 chore: upgrade dependencies
it upgrade non key dependencies
2019-07-28 00:10:53 +02:00
Juan Picado @jotadeveloper
dd54aaaf94 Merge branch '4.x-master' into 4.x-adds-unit-tests-for-repository-component 2019-07-28 00:03:42 +02:00
Juan Picado @jotadeveloper
64c003943c Merge pull request #104 from verdaccio/97-unify-emotion-css-definition-format
Part of 97 - Unify Emotion CSS format
2019-07-16 16:30:30 +02:00
Sergio Herrera Guzmán
115be1bb6e refactor: move cascaded CSS from templates to JS objects 2019-07-16 16:15:56 +02:00
Juan Picado @jotadeveloper
9d7b90fc34 Merge branch '4.x-master' into 4.x-adds-unit-tests-for-repository-component 2019-07-16 15:57:05 +02:00
Sergio Herrera Guzmán
8ea017d871 refactor: move basic CSS from templates to JS objects 2019-07-16 14:59:54 +02:00
Sergio Herrera Guzmán
786da9975f chore: disable stylelint on files with no CSS templates 2019-07-16 14:59:54 +02:00
Juan Picado @jotadeveloper
684e989fbd Merge pull request #103 from verdaccio/fix-commitlint
chore: execute commitlint on commit-msg and not pre-commit
2019-07-15 14:58:04 +02:00
Juan Picado @jotadeveloper
4dd953e553 Merge branch '4.x-master' into fix-commitlint 2019-07-15 14:57:03 +02:00
Juan Picado @jotadeveloper
9343503372 Merge pull request #106 from verdaccio/bugfix-css-logo
fix: css repetition is not closed in Logo component
2019-07-15 14:50:25 +02:00
Sergio Herrera Guzmán
ec243b1352 fix: css repetition is not closed in Logo component 2019-07-15 14:43:44 +02:00
Sergio Herrera Guzmán
2ffb2b5bf1 chore: execute commitlint on commit-msg and not pre-commit 2019-07-14 18:08:48 +02:00
Juan Picado @jotadeveloper
cad5ac91e7 Merge pull request #101 from griffithtp/fix/76_download-button-hidden-for-localhost
fix: 76 download button hidden for localhost
2019-07-14 14:27:44 +02:00
Griffithtp
ecc4521314 refactor: remove getBaseNamePath() and history.ts 2019-07-14 12:50:47 +01:00
Griffithtp
795544a14c test: add unit test for url utils 2019-07-13 15:46:08 +01:00
Daniel Ruf
67fff03b87 Merge branch '4.x-master' into fix/76_download-button-hidden-for-localhost 2019-07-13 14:01:29 +02:00
Griffithtp
5148fdca66 refactor: add @types/validator 2019-07-13 07:53:23 +01:00
Juan Picado @jotadeveloper
46ae0d21a3 Merge pull request #98 from verdaccio/dependabot/npm_and_yarn/lodash.merge-4.6.2
chore(deps): bump lodash.merge from 4.6.1 to 4.6.2
2019-07-11 22:20:51 +02:00
Juan Picado @jotadeveloper
9ade2a0ee7 Merge branch '4.x-master' into dependabot/npm_and_yarn/lodash.merge-4.6.2 2019-07-11 22:20:46 +02:00
Juan Picado @jotadeveloper
e346819035 Merge pull request #99 from verdaccio/dependabot/npm_and_yarn/lodash.template-4.5.0
chore(deps): bump lodash.template from 4.4.0 to 4.5.0
2019-07-11 22:20:30 +02:00
dependabot[bot]
46e5f09dbf chore(deps): bump lodash.template from 4.4.0 to 4.5.0
Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-11 07:17:47 +00:00
Griffithtp
cca2c3c0d7 fix: localhost domain download tarball button 2019-07-10 23:51:25 +01:00
dependabot[bot]
c814080957 chore(deps): bump lodash.merge from 4.6.1 to 4.6.2
Bumps [lodash.merge](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-10 22:51:21 +00:00
Ayush Sharma
157addfd00 Merge branch '4.x-master' into 4.x-adds-unit-tests-for-repository-component 2019-07-10 22:13:41 +02:00
Juan Picado @jotadeveloper
6ab3aa2885 Merge branch '4.x-master' into 4.x-adds-unit-tests-for-repository-component 2019-07-10 07:30:39 +02:00
Ayush Sharma
9e0c9db78c chore: adds unit tests for <Repository /> component 2019-07-09 23:48:46 +02:00
Juan Picado @jotadeveloper
df4e45cd6c Merge branch '4.x-master' into test/bdd-acceptance-testing-setup 2019-05-08 22:07:24 +02:00
Juan Picado @jotadeveloper
df58d463e8 Merge branch '4.x-master' into test/bdd-acceptance-testing-setup 2019-05-04 12:15:18 +02:00
Juan Picado @jotadeveloper
313fb33480 Merge branch '4.x-master' into test/bdd-acceptance-testing-setup 2019-05-03 08:05:06 +02:00
Daniel Ruf
d468ca7c5f test: BDD / acceptance tests
Implement acceptance testing using codeceptjs and puppeteer.
2019-05-02 11:15:33 +02:00
370 changed files with 100305 additions and 10403 deletions

View File

@@ -1,5 +1,8 @@
{
"presets": [
["@verdaccio", { "typescript": true }]
"presets": [["@verdaccio"]],
"plugins": [
"emotion",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator"
]
}

View File

@@ -1,31 +1,28 @@
version: 2
aliases:
- &repo_path
~/ui-theme
- &defaults
working_directory: ~/ui-theme
- &node11_executor
working_directory: *repo_path
- &node_latest_browser
docker:
- image: circleci/node:11.10.1
- &node8_executor
- image: circleci/node:latest-browsers
- &node_latest_executor
docker:
- image: circleci/node:8
- &node10_executor
- image: circleci/node:latest
- &node_lts_executor
docker:
- image: circleci/node:10
- image: circleci/node:lts
- &default_executor
<<: *node10_executor
- &repo_key
repo-{{ .Branch }}-{{ .Revision }}
- &coverage_key
coverage-{{ .Branch }}-{{ .Revision }}
- &base_config_key
base-config-{{ .Branch }}-{{ .Revision }}
<<: *node_latest_executor
- &yarn_cache_key
yarn-sha-{{ checksum "yarn.lock" }}
- &coverage_key
coverage-{{ .Branch }}-{{ .Revision }}
- &restore_repo
restore_cache:
keys:
- *repo_key
attach_workspace:
at: *repo_path
- &ignore_non_dev_branches
filters:
tags:
@@ -36,7 +33,7 @@ aliases:
- &execute_on_release
filters:
tags:
only: /(v)?[0-9]+(\.[0-9]+)*/
only: /v?[0-9]+(\.[0-9]+)*([-+\.][a-zA-Z0-9]+)*/
branches:
ignore:
- /.*/
@@ -48,34 +45,28 @@ jobs:
steps:
- *restore_repo
- checkout
- restore_cache:
key: *base_config_key
- run:
name: 'Base environment setup'
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- save_cache:
key: *base_config_key
paths:
- ~/.npmrc
- ~/.gitconfig
- restore_cache:
key: *yarn_cache_key
- run:
name: Install Js dependencies
command: yarn install --no-progress --registry https://registry.verdaccio.org --no-lockfile
name: Install dependencies
command: yarn install --frozen-lockfile
- run:
name: Lint code
command: yarn lint
- run:
name: Build project
command: yarn run build
command: yarn build
- save_cache:
key: *yarn_cache_key
paths:
- ~/.yarn
- ~/.cache/yarn
- node_modules
- save_cache:
key: *repo_key
- persist_to_workspace:
root: *repo_path
paths:
- ~/ui-theme
- ./*
test_bundlesize:
<<: *defaults
<<: *default_executor
@@ -85,37 +76,37 @@ jobs:
name: Test BundleSize
command: yarn test:size
test_node11:
test_node_latest:
<<: *defaults
<<: *node11_executor
<<: *node_latest_executor
steps:
- *restore_repo
- run:
name: Test with Node 11
name: Test with Node (Latest)
command: yarn test
test_node8:
<<: *defaults
<<: *node8_executor
steps:
- *restore_repo
- run:
name: Test with Node 8
command: yarn test
test_node10:
<<: *defaults
<<: *node10_executor
steps:
- *restore_repo
- run:
name: Test with Node 10
command: yarn run test
- save_cache:
key: *coverage_key
paths:
- coverage
test_e2e:
<<: *defaults
<<: *node_latest_browser
steps:
- *restore_repo
- run:
name: Test E2E Node (LTS)
command: yarn test:e2e
test_node_lts:
<<: *defaults
<<: *node_lts_executor
steps:
- *restore_repo
- run:
name: Test with Node (LTS)
command: yarn test
coverage:
<<: *defaults
<<: *default_executor
@@ -140,11 +131,12 @@ jobs:
<<: *default_executor
steps:
- *restore_repo
- restore_cache:
key: *base_config_key
- run:
name: 'Setup publish credentials'
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run:
name: Publish
command: yarn publish
command: npm publish
workflows:
version: 2
@@ -152,29 +144,31 @@ workflows:
jobs:
- prepare:
<<: *ignore_non_dev_branches
- test_node11:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_node8:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_node10:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_bundlesize:
requires:
- test_node11
- test_node8
- test_node10
- prepare
<<: *ignore_non_dev_branches
- test_node_latest:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_node_lts:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_e2e:
requires:
- prepare
<<: *ignore_non_dev_branches
- coverage:
requires:
- test_bundlesize
- test_node_latest
<<: *ignore_non_dev_branches
- publish_package:
requires:
- test_bundlesize
- test_node_latest
- test_node_lts
- test_e2e
- coverage
<<: *execute_on_release

View File

@@ -3,6 +3,7 @@ coverage/
static/
.github/
.circleci/
build
*.md
*.lock
*.yaml
@@ -10,3 +11,4 @@ Dockerfile
*.html
*.scss
*.png
doc

View File

@@ -5,26 +5,32 @@
"plugin:jest/recommended",
"plugin:prettier/recommended",
"plugin:verdaccio/recommended",
"plugin:jsx-a11y/recommended"
"plugin:jsx-a11y/recommended",
"plugin:import/typescript"
],
"plugins": [
"react",
"jest",
"prettier",
"verdaccio",
"jsx-a11y"
"jsx-a11y",
"codeceptjs",
"react-hooks",
"import"
],
"settings": {
"react": {
"version": "detect"
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"import/order": ["error", {"newlines-between": "always"}],
"babel/no-invalid-this": 0,
"no-invalid-this": 0,
"no-console": ["error", { "allow": ["warn", "error"] }],
@@ -39,11 +45,8 @@
}
}
],
"@typescript-eslint/explicit-function-return-type": ["warn",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true
}],
"@typescript-eslint/explicit-function-return-type": 0,
"react/display-name": 0,
"react/no-deprecated": 1,
"react/jsx-no-target-blank": 1,
"react/destructuring-assignment": ["error", "always"],
@@ -69,7 +72,7 @@
"arrow": "parens",
"condition": "parens",
"logical": "parens",
"prop": "parens"
"prop": "ignore"
}],
"react/jsx-boolean-value": ["error", "always"],
"react/jsx-closing-tag-location": ["error"],
@@ -80,7 +83,7 @@
"react/jsx-indent": ["error", 2],
"react/jsx-indent-props": ["error", 2],
"react/jsx-key": ["error"],
"react/jsx-max-depth": ["error", { "max": 2}],
"react/jsx-max-depth":["error", { "max": 5}],
"react/jsx-max-props-per-line": ["error", {"maximum": 3, "when": "multiline" }],
"react/jsx-no-bind": ["error"],
"react/jsx-no-comment-textnodes": ["error"],
@@ -106,6 +109,8 @@
2,
"always"
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"verdaccio/jsx-no-style": ["warn"],
"verdaccio/jsx-spread": ["warn"],
"jest/expect-expect": 0,
@@ -119,6 +124,7 @@
},
"env": {
"browser": true,
"jest/globals": true
"jest/globals": true,
"codeceptjs/codeceptjs": true,
}
}

67
.github/main.workflow vendored
View File

@@ -1,67 +0,0 @@
################################################
# Workflow for a github release when a tag is
# pushed
################################################
workflow "github release" {
resolves = [
"release.github",
"release.lint",
]
on = "push"
}
action "release.filter" {
uses = "actions/bin/filter@master"
args = "tag v*"
}
action "release.install" {
uses = "docker://node:10"
needs = ["release.filter"]
args = "yarn install"
}
action "release.build" {
uses = "docker://node:10"
needs = ["release.install"]
args = "yarn run build"
}
action "release.lint" {
uses = "docker://node:10"
needs = ["release.install"]
args = "yarn run lint"
}
action "release.test" {
uses = "docker://node:10"
needs = ["release.build"]
args = "yarn run test"
}
action "release.auth" {
needs = ["release.test"]
uses = "actions/bin/filter@master"
args = ["actor", "octocat", "torvalds"]
}
action "release.npm.publish" {
needs = ["release.auth"]
uses = "docker://node:10"
args = "sh scripts/publish.sh"
secrets = [
"REGISTRY_AUTH_TOKEN",
]
env = {
REGISTRY_URL = "registry.npmjs.org"
}
}
action "release.github" {
needs = ["release.npm.publish"]
uses = "docker://node:10"
args = "sh scripts/github-release.sh"
secrets = [
"GITHUB_TOKEN",
]
}

50
.github/workflows/canary.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: CI Canary
on: [pull_request]
jobs:
build_test_lint:
name: Node Smoke Test Befor Canary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://registry.verdaccio.org'
- name: Install
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build
run: yarn build
- name: Archive production artifacts
uses: actions/upload-artifact@v1
with:
name: static
path: static
canary:
name: Publish Canary Version of a PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Download math result for job 2
uses: actions/download-artifact@v1
with:
name: static
- uses: verdaccio/github-actions/canary@v0.4.0
with:
message: 'Thanks for your PR, the @verdaccio/ui package will be accessible from here for testing purposes:'
is-global: false
package-name: '@verdaccio/ui-theme'
registry: 'https://registry.verdaccio.org'
repo-token: ${{ secrets.GITHUB_TOKEN }}
bot-token: ${{ secrets.VERDACCIO_BOT_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://registry.verdaccio.org'
- run: npm publish --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
needs: build_test_lint

28
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: CI
on: [push, pull_request]
jobs:
build_test_lint:
name: Node ${{ matrix.node_version }} and ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node_version: [12, 13]
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Install
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build
run: yarn build

11
.github/workflows/security.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
name: Security Flow
on: push
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@0.1.0
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

2
.gitignore vendored
View File

@@ -2,6 +2,8 @@ npm-debug.log
verdaccio-*.tgz
.DS_Store
build/
doc
###
node_modules
package-lock.json

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
stable

View File

@@ -1,4 +1,5 @@
{
"endOfLine": "auto",
"useTabs": false,
"printWidth": 160,
"tabWidth": 2,

40
.secrets-baseline Normal file
View File

@@ -0,0 +1,40 @@
{
"exclude": {
"files": null,
"lines": null
},
"generated_at": "2019-09-29T18:19:50Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
},
{
"name": "ArtifactoryDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
},
{
"name": "BasicAuthDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
},
{
"name": "KeywordDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SlackDetector"
},
{
"name": "StripeDetector"
}
],
"results": {},
"version": "0.12.4"
}

0
.sonarcloud.properties Normal file
View File

View File

@@ -26,6 +26,7 @@
"no-descending-specificity": [true, { "severity": "warning" }],
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": true,
"no-empty-source": null,
"no-extra-semicolons": true,
"no-invalid-double-slash-comments": true,
"property-no-unknown": true,

View File

@@ -5,5 +5,6 @@
"javascriptreact",
"typescript",
"typescriptreact"
]
}
],
"typescript.tsdk": "node_modules/typescript/lib"
}

View File

@@ -1,2 +1,2 @@
save-prefix ""
registry "http://registry.npmjs.org/"
registry "https://registry.verdaccio.org"

View File

@@ -1,7 +1,263 @@
# Change Log
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.3.0](https://github.com/verdaccio/ui/compare/v1.0.4...v1.3.0) (2020-04-01)
### Features
* **style:** added dark mode ([#446](https://github.com/verdaccio/ui/issues/446)) ([cdad5cf](https://github.com/verdaccio/ui/commit/cdad5cf70d69b7bb045fce461a32108def81721d))
### Bug Fixes
* **chore:** droped release ([#449](https://github.com/verdaccio/ui/issues/449)) ([f321f7b](https://github.com/verdaccio/ui/commit/f321f7b6fe1ac44897753f0bfdbbaa6ca7eca515))
## [1.2.0](https://github.com/verdaccio/ui/compare/v1.0.4...v1.2.0) (2020-04-01)
### Features
* **style:** added dark mode ([#446](https://github.com/verdaccio/ui/issues/446)) ([cdad5cf](https://github.com/verdaccio/ui/commit/cdad5cf70d69b7bb045fce461a32108def81721d))
### Bug Fixes
* **chore:** droped release ([#449](https://github.com/verdaccio/ui/issues/449)) ([f321f7b](https://github.com/verdaccio/ui/commit/f321f7b6fe1ac44897753f0bfdbbaa6ca7eca515))
## [1.1.0](https://github.com/verdaccio/ui/compare/v1.0.4...v1.1.0) (2020-04-01)
### Features
* **style:** added dark mode ([#446](https://github.com/verdaccio/ui/issues/446)) ([cdad5cf](https://github.com/verdaccio/ui/commit/cdad5cf70d69b7bb045fce461a32108def81721d))
### Bug Fixes
* **chore:** droped release ([#449](https://github.com/verdaccio/ui/issues/449)) ([f321f7b](https://github.com/verdaccio/ui/commit/f321f7b6fe1ac44897753f0bfdbbaa6ca7eca515))
### [1.0.4](https://github.com/verdaccio/ui/compare/v1.0.0...v1.0.4) (2020-03-17)
## [1.0.0](https://github.com/verdaccio/ui/compare/v0.3.13...v1.0.0) (2020-03-13)
### Features
* **de-translations:** added de-DE translations to the UI ([#441](https://github.com/verdaccio/ui/issues/441)) ([e27d59b](https://github.com/verdaccio/ui/commit/e27d59bff7039473e566090fa0f825f7e462aa4e))
* spanish translations to UI ([#440](https://github.com/verdaccio/ui/issues/440)) ([0abe1ef](https://github.com/verdaccio/ui/commit/0abe1ef41ca93b900ddda72e2d873ee52078221c))
* **i18n:** added i18next for user interface translations ([#432](https://github.com/verdaccio/ui/issues/432)) ([7428384](https://github.com/verdaccio/ui/commit/7428384b55e6089dbe45e6b216eee0b670dff576))
### [0.3.13](https://github.com/verdaccio/ui/compare/v0.3.12...v0.3.13) (2020-02-02)
### Bug Fixes
* do not capitalize heading - closes [#428](https://github.com/verdaccio/ui/issues/428) ([#431](https://github.com/verdaccio/ui/issues/431)) ([d481f54](https://github.com/verdaccio/ui/commit/d481f549484361c1d1bc011e0858e8f99b8a2528))
* package list refresh based on logged-in user ([#415](https://github.com/verdaccio/ui/issues/415)) ([222ffed](https://github.com/verdaccio/ui/commit/222ffed0226f5aaa62f2d5b91bb08717b2aa24ef)), closes [#414](https://github.com/verdaccio/ui/issues/414) [#414](https://github.com/verdaccio/ui/issues/414)
* reload packages on log in ([#421](https://github.com/verdaccio/ui/issues/421)) ([1eca1f4](https://github.com/verdaccio/ui/commit/1eca1f40797790e87d9592204ca061527d09c4ae))
* typo ([#423](https://github.com/verdaccio/ui/issues/423)) ([164cea6](https://github.com/verdaccio/ui/commit/164cea6c10804c1d2097c2a582eb3e1e51814d4a))
* update dependencies ([#420](https://github.com/verdaccio/ui/issues/420)) ([ee1c3f0](https://github.com/verdaccio/ui/commit/ee1c3f08eb16da2313d8841cfab18358d7f4ea10))
### [0.3.12](https://github.com/verdaccio/ui/compare/v0.3.11...v0.3.12) (2020-01-09)
### Bug Fixes
* generate correct registry URL ([#413](https://github.com/verdaccio/ui/issues/413)) ([6b322ad](https://github.com/verdaccio/ui/commit/6b322ad553e9fb3ee65b2968dcfe856ba42a0bfb)), closes [#300](https://github.com/verdaccio/ui/issues/300) [#311](https://github.com/verdaccio/ui/issues/311)
### [0.3.11](https://github.com/verdaccio/ui/compare/v0.3.10...v0.3.11) (2020-01-08)
### Bug Fixes
* remove prevent default and use react context ([#411](https://github.com/verdaccio/ui/issues/411)) ([6bd38b8](https://github.com/verdaccio/ui/commit/6bd38b812032857bb19af8978d48f6f8969af6cf))
* removed unused style file ([#406](https://github.com/verdaccio/ui/issues/406)) ([6eeae63](https://github.com/verdaccio/ui/commit/6eeae630ef441a871d06b888b6a21178e36e0db7))
### [0.3.10](https://github.com/verdaccio/ui/compare/v0.3.9...v0.3.10) (2019-12-30)
### Features
* added "Fund this package" button ([#375](https://github.com/verdaccio/ui/issues/375)) ([bf093cc](https://github.com/verdaccio/ui/commit/bf093cc27b8625cdc50dbfc9b8dd7e37f4e24da9))
### Bug Fixes
* add missing trailing slash to publicPath - closes [#395](https://github.com/verdaccio/ui/issues/395) ([#396](https://github.com/verdaccio/ui/issues/396)) ([bae9638](https://github.com/verdaccio/ui/commit/bae9638b23b70eff78b78b8ca52ff40162333354))
* engine warning on console for ui ([#403](https://github.com/verdaccio/ui/issues/403)) ([d554049](https://github.com/verdaccio/ui/commit/d554049699494e946f4caf345177839b4f0cba8b))
* remove background from styled Avatar components - closes [#371](https://github.com/verdaccio/ui/issues/371) ([#398](https://github.com/verdaccio/ui/issues/398)) ([787dda4](https://github.com/verdaccio/ui/commit/787dda4a016a1fcd1142bd4b705e2c71e232d13e))
* remove double padding and add missing background color - closes [#373](https://github.com/verdaccio/ui/issues/373) ([#399](https://github.com/verdaccio/ui/issues/399)) ([797c238](https://github.com/verdaccio/ui/commit/797c2381e453d4f40e1703402f192eb7675d6fbe))
* remove whitespace from logo image - closes [#374](https://github.com/verdaccio/ui/issues/374) ([#400](https://github.com/verdaccio/ui/issues/400)) ([544b999](https://github.com/verdaccio/ui/commit/544b999f81e39557e0fc002d21b24c512cfebc54))
### [0.3.9](https://github.com/verdaccio/ui/compare/v0.3.8...v0.3.9) (2019-12-14)
### [0.3.8](https://github.com/verdaccio/ui/compare/v0.3.7...v0.3.8) (2019-12-14)
### Features
* login Dialog Component - Replaced class by func. comp + added react-hook-form ([#341](https://github.com/verdaccio/ui/issues/341)) ([42d3bb8](https://github.com/verdaccio/ui/commit/42d3bb8508c666c28250432ada734d58ccb0eca8))
### Bug Fixes
* formatDate ([#308](https://github.com/verdaccio/ui/issues/308)) ([33f873a](https://github.com/verdaccio/ui/commit/33f873a8c78e419a36e3a29f7ea216714172b174))
* removed deade import ([#346](https://github.com/verdaccio/ui/issues/346)) ([ae617a5](https://github.com/verdaccio/ui/commit/ae617a5c04ad1b82309d36d3bdcf6b6b6fd925d0))
* updated actionbar snap ([#340](https://github.com/verdaccio/ui/issues/340)) ([09b831a](https://github.com/verdaccio/ui/commit/09b831a40d4e82a122f8fae3e45bdd161a3281bb))
### [0.3.7](https://github.com/verdaccio/ui/compare/v0.3.6...v0.3.7) (2019-11-24)
### Features
* Added Theme and migrate to emotion@10.x 🚀 ([#286](https://github.com/verdaccio/ui/issues/286)) ([111f0c5](https://github.com/verdaccio/ui/commit/111f0c50e5053202ca55fe4f3f28dd30e4932240))
### Bug Fixes
* **#300:** correctly reference registry url from options ([ee74474](https://github.com/verdaccio/ui/commit/ee74474811eb609072e1678bcb90db33756dcf38)), closes [#300](https://github.com/verdaccio/ui/issues/300)
* restore lint-staged@8.2.1 ([dbaa0c4](https://github.com/verdaccio/ui/commit/dbaa0c43b8104b350e4907387f89d4e9e719741f))
* update snapshots ([fd306de](https://github.com/verdaccio/ui/commit/fd306def9535d9168dc79ab020ec288a4d5df1a8))
### [0.3.6](https://github.com/verdaccio/ui/compare/v0.3.5...v0.3.6) (2019-11-08)
### [0.3.5](https://github.com/verdaccio/ui/compare/v0.3.4...v0.3.5) (2019-11-07)
### Bug Fixes
* adds unit tests for api service ([#235](https://github.com/verdaccio/ui/issues/235)) ([803da1c](https://github.com/verdaccio/ui/commit/803da1c))
* convert Engine component to hooks ([#233](https://github.com/verdaccio/ui/issues/233)) ([5cb47ed](https://github.com/verdaccio/ui/commit/5cb47ed))
* refactor/116 RegistryInfoContent is converted to functional component ([#229](https://github.com/verdaccio/ui/issues/229)) ([b74ca22](https://github.com/verdaccio/ui/commit/b74ca22)), closes [#116](https://github.com/verdaccio/ui/issues/116) [#116](https://github.com/verdaccio/ui/issues/116)
* rest MUI components - Introduced ForwardRef ([#224](https://github.com/verdaccio/ui/issues/224)) ([b56e438](https://github.com/verdaccio/ui/commit/b56e438))
### Features
* added download tarball button at list ([#237](https://github.com/verdaccio/ui/issues/237)) ([bdef686](https://github.com/verdaccio/ui/commit/bdef686))
* update date fns to v2 ([#232](https://github.com/verdaccio/ui/issues/232)) ([a4cdd14](https://github.com/verdaccio/ui/commit/a4cdd14))
### [0.3.4](https://github.com/verdaccio/ui/compare/v0.3.3...v0.3.4) (2019-10-26)
### Bug Fixes
* adds no uplink spec ([#213](https://github.com/verdaccio/ui/issues/213)) ([ade548a](https://github.com/verdaccio/ui/commit/ade548a))
* api typings ([#210](https://github.com/verdaccio/ui/issues/210)) ([5d6ad3d](https://github.com/verdaccio/ui/commit/5d6ad3d))
* PackageList component is converted to functional ([#219](https://github.com/verdaccio/ui/issues/219)) [#116](https://github.com/verdaccio/ui/issues/116) ([ae0222c](https://github.com/verdaccio/ui/commit/ae0222c))
* routes - Replaced class by func. comp ([#159](https://github.com/verdaccio/ui/issues/159)) ([5c06ace](https://github.com/verdaccio/ui/commit/5c06ace))
* version Page - Replaces class by func. ([#171](https://github.com/verdaccio/ui/issues/171)) ([f5c77ff](https://github.com/verdaccio/ui/commit/f5c77ff))
* **162:** added forwardRef Card ([#216](https://github.com/verdaccio/ui/issues/216)) ([2bc49f3](https://github.com/verdaccio/ui/commit/2bc49f3))
* **installlistitem:** changed the wrong icon ([#211](https://github.com/verdaccio/ui/issues/211)) ([4498aad](https://github.com/verdaccio/ui/commit/4498aad))
### [0.3.3](https://github.com/verdaccio/ui/compare/v0.3.2...v0.3.3) (2019-10-16)
### Bug Fixes
* **deps:** remove types from dependencies ([#201](https://github.com/verdaccio/ui/issues/201)) ([48c03fe](https://github.com/verdaccio/ui/commit/48c03fe))
* add new window property to interface definition ([b35baa0](https://github.com/verdaccio/ui/commit/b35baa0))
* added typings for react-autosuggest ([#200](https://github.com/verdaccio/ui/issues/200)) ([cfb29ce](https://github.com/verdaccio/ui/commit/cfb29ce))
* better type inference for MediaQuery ([#180](https://github.com/verdaccio/ui/issues/180)) ([e0e7c07](https://github.com/verdaccio/ui/commit/e0e7c07))
* changes font size for items of the register-info component ([#196](https://github.com/verdaccio/ui/issues/196)) ([6f87be6](https://github.com/verdaccio/ui/commit/6f87be6)), closes [#193](https://github.com/verdaccio/ui/issues/193)
* convert Dist component to hooks ([#156](https://github.com/verdaccio/ui/issues/156)) ([f1f8f8a](https://github.com/verdaccio/ui/commit/f1f8f8a))
* detailContainer Component - Replaced class by func. comp ([#130](https://github.com/verdaccio/ui/issues/130)) ([f84fd79](https://github.com/verdaccio/ui/commit/f84fd79))
* dist-tags attribute [#175](https://github.com/verdaccio/ui/issues/175) ([#178](https://github.com/verdaccio/ui/issues/178)) ([752e2b9](https://github.com/verdaccio/ui/commit/752e2b9))
* fix DependencyBlock props interface ([35d691c](https://github.com/verdaccio/ui/commit/35d691c))
* fixed import ([#176](https://github.com/verdaccio/ui/issues/176)) ([d0d4139](https://github.com/verdaccio/ui/commit/d0d4139))
* fixed imports & func's name ([#182](https://github.com/verdaccio/ui/issues/182)) ([3888736](https://github.com/verdaccio/ui/commit/3888736))
* Header Component - Replaced class by func. comp ([#142](https://github.com/verdaccio/ui/issues/142)) ([d1ce828](https://github.com/verdaccio/ui/commit/d1ce828))
* improve jest mock typings ([852f6ee](https://github.com/verdaccio/ui/commit/852f6ee))
* improved typing ([#174](https://github.com/verdaccio/ui/issues/174)) ([e0642a9](https://github.com/verdaccio/ui/commit/e0642a9))
* incorrect Tooltip import in avatar component ([#160](https://github.com/verdaccio/ui/issues/160)) ([43a9628](https://github.com/verdaccio/ui/commit/43a9628))
* install Component - Replaced class by func. comp ([#152](https://github.com/verdaccio/ui/issues/152)) ([9eb698f](https://github.com/verdaccio/ui/commit/9eb698f))
* introduced forwardRef ([#163](https://github.com/verdaccio/ui/issues/163)) ([626bcce](https://github.com/verdaccio/ui/commit/626bcce))
* introduced forwardRef ([#164](https://github.com/verdaccio/ui/issues/164)) ([909a8d9](https://github.com/verdaccio/ui/commit/909a8d9))
* introduced ForwardRef ([#177](https://github.com/verdaccio/ui/issues/177)) ([af8ed8b](https://github.com/verdaccio/ui/commit/af8ed8b))
* introduced forwardRef ([#181](https://github.com/verdaccio/ui/issues/181)) ([0c4fb7d](https://github.com/verdaccio/ui/commit/0c4fb7d))
* introduced forwardRef ([#185](https://github.com/verdaccio/ui/issues/185)) ([7548c89](https://github.com/verdaccio/ui/commit/7548c89))
* introduced SvgIcon ([#184](https://github.com/verdaccio/ui/issues/184)) ([8b86ded](https://github.com/verdaccio/ui/commit/8b86ded))
* linter error fixed ([#143](https://github.com/verdaccio/ui/issues/143)) ([74576bd](https://github.com/verdaccio/ui/commit/74576bd))
* listItem Component - Introduced ForwardRef ([#183](https://github.com/verdaccio/ui/issues/183)) ([82d7107](https://github.com/verdaccio/ui/commit/82d7107))
* lock file was corrupted ([7bd9eb7](https://github.com/verdaccio/ui/commit/7bd9eb7))
* media query ts ignore ([6f52838](https://github.com/verdaccio/ui/commit/6f52838))
* remove ts ignore from some components ([b1804d7](https://github.com/verdaccio/ui/commit/b1804d7))
* remove unnecessary ts ignore ([7a8b158](https://github.com/verdaccio/ui/commit/7a8b158))
* remove unnecessary ts ignore ([32f4389](https://github.com/verdaccio/ui/commit/32f4389))
* removed tsignore for AppContext ([#188](https://github.com/verdaccio/ui/issues/188)) ([d2c1130](https://github.com/verdaccio/ui/commit/d2c1130))
* typography Component - Introduced ForwardRef ([#179](https://github.com/verdaccio/ui/issues/179)) ([a8deeb9](https://github.com/verdaccio/ui/commit/a8deeb9))
* **api:** remove unnecessary ts ignore ([a8eb1f3](https://github.com/verdaccio/ui/commit/a8eb1f3))
* **App:** ts ignore ([f6eb747](https://github.com/verdaccio/ui/commit/f6eb747))
* **Developers:** remove compilation warnings ([f4da5e6](https://github.com/verdaccio/ui/commit/f4da5e6))
* **Footer:** remove unnecessary ts ignore ([1fb0bf9](https://github.com/verdaccio/ui/commit/1fb0bf9))
* some warnings in console ([#155](https://github.com/verdaccio/ui/issues/155)) ([583ddd5](https://github.com/verdaccio/ui/commit/583ddd5))
* spinner typings ([3166673](https://github.com/verdaccio/ui/commit/3166673))
* tarball download not working on Firefox and Edge ([#144](https://github.com/verdaccio/ui/issues/144)) ([f8e3013](https://github.com/verdaccio/ui/commit/f8e3013))
* warning about modules with names differing in casing ([#148](https://github.com/verdaccio/ui/issues/148)) ([e147290](https://github.com/verdaccio/ui/commit/e147290))
### Features
* new not found component ([#170](https://github.com/verdaccio/ui/issues/170)) ([fdbdb63](https://github.com/verdaccio/ui/commit/fdbdb63))
* **eslint-config:** add order rule in import ([ae73772](https://github.com/verdaccio/ui/commit/ae73772))
* upgraded typescript to 3.6.3 ([#145](https://github.com/verdaccio/ui/issues/145)) ([f8a1f2c](https://github.com/verdaccio/ui/commit/f8a1f2c))
* use React.lazy for loading components ([#158](https://github.com/verdaccio/ui/issues/158)) ([a365ec5](https://github.com/verdaccio/ui/commit/a365ec5))
* version Component - Replaced classes by func. comp ([#129](https://github.com/verdaccio/ui/issues/129)) ([1d705da](https://github.com/verdaccio/ui/commit/1d705da))
### [0.3.2](https://github.com/verdaccio/ui/compare/v0.3.1...v0.3.2) (2019-09-30)
### Bug Fixes
* sidebar view on small screens ([#136](https://github.com/verdaccio/ui/issues/136)) ([91d818c](https://github.com/verdaccio/ui/commit/91d818c))
### [0.3.1](https://github.com/verdaccio/ui/compare/v0.3.0...v0.3.1) (2019-09-29)
### Bug Fixes
* **ui:** fix the hover effect on the packageItem's author area ([#137](https://github.com/verdaccio/ui/issues/137)) ([2e50981](https://github.com/verdaccio/ui/commit/2e50981))
* correctly load font files - closes [#128](https://github.com/verdaccio/ui/issues/128) ([#134](https://github.com/verdaccio/ui/issues/134)) ([f61913c](https://github.com/verdaccio/ui/commit/f61913c))
## [0.3.0](https://github.com/verdaccio/ui/compare/v0.2.4...v0.3.0) (2019-09-01)
### Features
* add browser features to browse by version ([#125](https://github.com/verdaccio/ui/issues/125)) ([1904179](https://github.com/verdaccio/ui/commit/1904179))
### [0.2.4](https://github.com/verdaccio/ui/compare/v0.2.3...v0.2.4) (2019-08-31)
### Features
* update material-ui@4.x ([#123](https://github.com/verdaccio/ui/issues/123)) ([67d7188](https://github.com/verdaccio/ui/commit/67d7188))
### [0.2.3](https://github.com/verdaccio/ui/compare/v0.2.2...v0.2.3) (2019-08-25)
### Bug Fixes
* missing headers on search endpoint with token ([#121](https://github.com/verdaccio/ui/issues/121)) ([ac58730](https://github.com/verdaccio/ui/commit/ac58730))
* refactoring version page / fix issue not found page [#100](https://github.com/verdaccio/ui/issues/100) ([#117](https://github.com/verdaccio/ui/issues/117)) ([97e8448](https://github.com/verdaccio/ui/commit/97e8448))
* remove ToReplaceByVerdaccio [#108](https://github.com/verdaccio/ui/issues/108) ([#122](https://github.com/verdaccio/ui/issues/122)) ([5a9bd60](https://github.com/verdaccio/ui/commit/5a9bd60))
* **api:** correctly handle responses with missing content-type header ([2049022](https://github.com/verdaccio/ui/commit/2049022))
<a name="0.2.2"></a>
## [0.2.2](https://github.com/verdaccio/ui/compare/v0.2.1...v0.2.2) (2019-07-29)
### Bug Fixes
* css repetition is not closed in Logo component ([ec243b1](https://github.com/verdaccio/ui/commit/ec243b1))
* localhost domain download tarball button ([cca2c3c](https://github.com/verdaccio/ui/commit/cca2c3c))
* proxy webpack setting ([5c484bb](https://github.com/verdaccio/ui/commit/5c484bb))
* token were not being send it ([fd74c52](https://github.com/verdaccio/ui/commit/fd74c52))
<a name="0.2.1"></a>
## [0.2.1](https://github.com/verdaccio/ui/compare/v0.2.0...v0.2.1) (2019-07-10)
@@ -149,4 +405,4 @@ All notable changes to this project will be documented in this file. See [standa
<a name="0.0.3"></a>
## 0.0.3 (2019-04-04)
## 0.0.3 (2019-04-04)

View File

@@ -12,7 +12,7 @@
[![stackshare](https://img.shields.io/badge/Follow%20on-StackShare-blue.svg?logo=stackshare&style=flat)](https://stackshare.io/verdaccio)
[![discord](https://img.shields.io/discord/388674437219745793.svg)](http://chat.verdaccio.org/)
[![node](https://img.shields.io/node/v/@verdaccio/ui-theme/latest.svg)](https://www.npmjs.com/package/@verdaccio/ui-theme)
![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)
[![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./LICENSE)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/verdaccio/localized.svg)](https://crowdin.com/project/verdaccio)
[![codecov](https://codecov.io/gh/verdaccio/ui/branch/master/graph/badge.svg)](https://codecov.io/gh/verdaccio/ui)
@@ -22,25 +22,43 @@
## Contributing
We use `>=yarn@1.13.0`, keep on mind we use lock file.
We use `>=yarn@1.13.0`, keep in mind that we use lockfiles and use at least Node `v10.13.0` to be able to build the project.
For development run the following command, it will execute `webpack` and `verdaccio` to
```
```bash
yarn dev
```
The configuration file is located on `tools/_config.yaml`.
Run linting tooling and test to check your code is clean before commit.
```
> ⚠️ The development mode just emulate interaction of the UI development with a real verdaccio server, but it is not the real integration. UI is just a theme plugin dependency in the [Verdaccio project](https://github.com/verdaccio/verdaccio).
### Before commit
Don't forget run the following commands before commit and push your code, it will save you time.
```bash
yarn lint && yarn test
```
#### Commits
Remember we follow the [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0-beta.4/).
🤓 Feel free to participate in code reviews, let us know if you want to participate in this plugin.
### End to End Testing
Additionally, we recommend run E2E testing before push and verify your changes do not break anything. These command will run in our CI anyway.
```bash
yarn build && yarn test:e2e
```
> `yarn build` will build with webpack the production files.
## Open Collective Sponsors
@@ -65,7 +83,7 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
This project exists thanks to all the people who contribute.
[![contrubitors](https://opencollective.com/verdaccio/contributors.svg?width=890&button=true)](../../graphs/contributors)
@@ -75,7 +93,7 @@ If you have any issue you can try the following options, do no desist to ask or
* [Blog](https://medium.com/verdaccio)
* [Donations](https://opencollective.com/verdaccio)
* [Roadmaps](https://github.com/verdaccio/verdaccio/projects)
* [Roadmaps](https://github.com/verdaccio/ui/projects)
* [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)
* [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)
* [Chat](http://chat.verdaccio.org/)
@@ -83,6 +101,10 @@ If you have any issue you can try the following options, do no desist to ask or
* [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)
* [Docker Examples](https://github.com/verdaccio/docker-examples)
### Translations
Translations are handled locally. I18n files can be found in the folder ```i18n/translations/*``` of this repository. We would love to provide translations from other languages, embracing all our users, but unfortunately we cannot do this without your help. Would you like to help us? Please feel **super welcome** to add a locale by opening a pull request.
### License
Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)

21
codecept.conf.js Normal file
View File

@@ -0,0 +1,21 @@
exports.config = {
tests: './test/acceptance/*_test.js',
output: './test/acceptance/output',
helpers: {
Puppeteer: {
url: 'http://localhost:8080',
// "show": true,
chrome: {
// headless: false
},
},
},
include: {
I: './test/acceptance/steps_file.js',
},
smartWait: 30000,
bootstrap: null,
plugins: {},
mocha: {},
name: '@verdaccio/ui-theme',
};

29
codecov.yml Normal file
View File

@@ -0,0 +1,29 @@
codecov:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: "80...85"
status:
project:
default:
target: auto
threshold: 1%
base: auto
patch: no
changes: no
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment:
layout: "diff,flags,tree"
behavior: default
require_changes: no

40
i18n/config.ts Normal file
View File

@@ -0,0 +1,40 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import translationEN from './translations/en-US.json';
import translationPT from './translations/pt-BR.json';
import translationES from './translations/es-ES.json';
import translationDE from './translations/de-DE.json';
i18n
// pass the i18n instance to react-i18next.
.use(initReactI18next)
// init i18next
// for all options read: https://www.i18next.com/overview/configuration-options
.init({
// in case window.VEDACCIO_LANGUAGE is undefined,it will fall back to 'en-US'
lng: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.language,
fallbackLng: 'en-US',
whitelist: ['en-US', 'pt-BR', 'es-ES', 'de-DE'],
load: 'currentOnly',
resources: {
'en-US': {
translation: translationEN,
},
'pt-BR': {
translation: translationPT,
},
'es-ES': {
translation: translationES,
},
'de-DE': {
translation: translationDE,
},
},
debug: false,
interpolation: {
escapeValue: false, // react already safes from xss
},
});
export default i18n;

View File

@@ -0,0 +1,139 @@
{
"copy-to-clipboard": "In die Zwischenablage kopieren",
"author-anonymous": "Anonymus",
"action-bar-action": {
"visit-home-page": "Zur Homepage",
"open-an-issue": "Einen Fehler melden",
"download-tarball": "Archiv (Tarball) herunterladen"
},
"dialog": {
"registry-info": {
"title": "Registrierungsinformationen"
}
},
"header": {
"documentation": "Dokumentation",
"registry-info": "Registrierungsinformationen",
"greetings": "Hallo "
},
"search": {
"packages": "Pakete suchen"
},
"auto-complete": {
"loading": "wird geladen...",
"no-results-found": "Kein Ergebnis gefunden"
},
"tab": {
"uplinks": "Uplinks",
"versions": "Versionen",
"dependencies": "Abhängigkeiten",
"readme": "Liesmich"
},
"uplinks": {
"title": "Uplinks",
"no-items": "{{name}} hat keine Uplinks."
},
"versions": {
"current-tags": "Aktuelle Tags",
"version-history": "Versionsgeschichte",
"not-available": "Nicht verfĂĽgbar"
},
"package": {
"published-on": "Veröffentlicht am {{time}} •",
"version": "v{{version}}",
"visit-home-page": "Zur Homepage",
"homepage": "Homepage",
"open-an-issue": "Einen Fehler melden",
"bugs": "Fehler",
"download": "{{what}} herunterladen",
"the-tar-file": "die tar-Datei",
"tarball": "Archiv (Tarball)"
},
"dependencies": {
"has-no-dependencies": "{{package}} hat keine Abhängigkeiten",
"dependency-block": "{{package}}@{{version}}"
},
"form": {
"username": "Benutzername",
"password": "Passwort"
},
"form-placeholder": {
"username": "Dein Benutzername",
"password": "Dein sicheres Passwort"
},
"form-validation": {
"required-field": "Dieses Feld ist erforderlich",
"required-min-length": "Dieses Feld erfordert eine Mindestlänge von {{length}}",
"unable-to-sign-in": "Anmeldung nicht möglich",
"username-or-password-cant-be-empty": "Benutzername und Passwort dĂĽrfen nicht leer sein!"
},
"help": {
"title": "Noch kein Paket publiziert.",
"sub-title": "Um dein erstes Paket einfach zu publizieren:",
"first-step": "1. Einloggen",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. Publizieren",
"second-step-command-line": "npm publish --registry {{registryUrl}}",
"third-step": "3. Diese Seite aktualisieren."
},
"sidebar": {
"detail": {
"latest-version": "Letzte v{{version}}",
"version": "v{{version}}"
},
"installation": {
"title": "Installierung",
"install-using-yarn": "Mit yarn installieren",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "Mit npm installieren",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "Mit pnpm installieren",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
"title": "Repository"
},
"author": {
"title": "Autor(in)"
},
"distribution": {
"title": "Neueste Distribution",
"license": "Lizenz",
"size": "Größe",
"file-count": "Anzahl der Dateien"
},
"maintainers": {
"title": "Maintainer"
},
"contributors": {
"title": "Contributor"
},
"engines": {
"npm-version": "NPM Version",
"node-js": "NODE JS"
}
},
"footer": {
"powered-by": "UnterstĂĽtzt von",
"made-with-love-on": "Gemacht mit <0>♥</0> in"
},
"button": {
"close": "SchlieĂźen",
"cancel": "Abbrechen",
"login": "Einloggen",
"logout": "Ausloggen",
"go-to-the-home-page": "Zur Homepage",
"learn-more": "Mehr erfahren",
"fund-this-package": "Dieses Paket <0>finanzieren</0>"
},
"error": {
"unspecific": "Etwas ist schief gelaufen.",
"404": {
"page-not-found": "404 - Seite nicht gefunden",
"sorry-we-could-not-find-it": "Entschuldigung, wir konnten es nicht finden..."
},
"app-context-not-correct-used": "Der App-Kontext wurde nicht korrekt verwendet",
"theme-context-not-correct-used": "Der Theme-Kontext wurde nicht korrekt verwendet",
"package-meta-is-required-at-detail-context": "packageMeta wird bei DetailContext benötigt"
}
}

View File

@@ -0,0 +1,139 @@
{
"copy-to-clipboard": "Copy to clipboard",
"author-anonymous": "Anonymous",
"action-bar-action": {
"visit-home-page": "Visit homepage",
"open-an-issue": "Open an issue",
"download-tarball": "Download tarball"
},
"dialog": {
"registry-info": {
"title": "Register Info"
}
},
"header": {
"documentation": "Documentation",
"registry-info": "Registry Information",
"greetings": "Hi "
},
"search": {
"packages": "Search Packages"
},
"auto-complete": {
"loading": "Loading...",
"no-results-found": "No results found"
},
"tab": {
"uplinks": "Uplinks",
"versions": "Versions",
"dependencies": "Dependencies",
"readme": "Readme"
},
"uplinks": {
"title": "Uplinks",
"no-items": "{{name}} has no uplinks."
},
"versions": {
"current-tags": "Current Tags",
"version-history": "Version history",
"not-available": "Not available"
},
"package": {
"published-on": "Published on {{time}} •",
"version": "v{{version}}",
"visit-home-page": "Visit homepage",
"homepage": "Homepage",
"open-an-issue": "Open an issue",
"bugs": "Bugs",
"download": "Download {{what}}",
"the-tar-file": "the tar file",
"tarball": "Tarball"
},
"dependencies": {
"has-no-dependencies": "{{package}} has no dependencies.",
"dependency-block": "{{package}}@{{version}}"
},
"form": {
"username": "Username",
"password": "Password"
},
"form-placeholder": {
"username": "Your username",
"password": "Your strong password"
},
"form-validation": {
"required-field": "This field is required",
"required-min-length": "This field required the min length of {{length}}",
"unable-to-sign-in": "Unable to sign in",
"username-or-password-cant-be-empty": "Username or password can't be empty!"
},
"help": {
"title": "No Package Published Yet.",
"sub-title": "To publish your first package just:",
"first-step": "1. Login",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. Publish",
"second-step-command-line": "npm publish --registry {{registryUrl}}",
"third-step": "3. Refresh this page."
},
"sidebar": {
"detail": {
"latest-version": "Latest v{{version}}",
"version": "v{{version}}"
},
"installation": {
"title": "Installation",
"install-using-yarn": "Install using yarn",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "Install using npm",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "Install using pnpm",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
"title": "Repository"
},
"author": {
"title": "Author"
},
"distribution": {
"title": "Latest Distribution",
"license": "License",
"size": "Size",
"file-count": "file count"
},
"maintainers": {
"title": "Maintainers"
},
"contributors": {
"title": "Contributors"
},
"engines": {
"npm-version": "NPM Version",
"node-js": "NODE JS"
}
},
"footer": {
"powered-by": "Powered by",
"made-with-love-on": "Made with <0>♥</0> on"
},
"button": {
"close": "Close",
"cancel": "Cancel",
"login": "Login",
"logout": "Logout",
"go-to-the-home-page": "Go to the home page",
"learn-more": "Learn More",
"fund-this-package": "<0>Fund</0> this package"
},
"error": {
"unspecific": "Something went wrong.",
"404": {
"page-not-found": "404 - Page not found",
"sorry-we-could-not-find-it": "Sorry, we couldn't find it..."
},
"app-context-not-correct-used": "The app context was not correct used",
"theme-context-not-correct-used": "The theme context was not correct used",
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext"
}
}

View File

@@ -0,0 +1,139 @@
{
"copy-to-clipboard": "Copiar al portapapeles",
"author-anonymous": "AnĂłnimo",
"action-bar-action": {
"visit-home-page": "Visitar página principal",
"open-an-issue": "Reportar un error",
"download-tarball": "Descargar libreria"
},
"dialog": {
"registry-info": {
"title": "InformaciĂłn del Registro"
}
},
"header": {
"documentation": "DocumentaciĂłn",
"registry-info": "InformaciĂłn del Registro",
"greetings": "Hola "
},
"search": {
"packages": "Buscar paquetes"
},
"auto-complete": {
"loading": "Cargando...",
"no-results-found": "Sin resultados encontrados"
},
"tab": {
"uplinks": "Remoto",
"versions": "Versiones",
"dependencies": "Dependencias",
"readme": "Léeme"
},
"uplinks": {
"title": "Remoto",
"no-items": "{{name}} not tiene remotos."
},
"versions": {
"current-tags": "Etiquetas actuales",
"version-history": "Historial de versiones",
"not-available": "No disponible"
},
"package": {
"published-on": "Publicado en {{time}} •",
"version": "v{{version}}",
"visit-home-page": "Ir a la página principal",
"homepage": "Página pricinpal",
"open-an-issue": "Reportar un problema",
"bugs": "Errores",
"download": "Descargar {{what}}",
"the-tar-file": "el archivo tar",
"tarball": "Libreria"
},
"dependencies": {
"has-no-dependencies": "{{package}} no tiene dependencias.",
"dependency-block": "{{package}}@{{version}}"
},
"form": {
"username": "Usuario",
"password": "Contraseña"
},
"form-placeholder": {
"username": "Tu usuario",
"password": "Tu fuerte conntraseña"
},
"form-validation": {
"required-field": "Este campo es requerido",
"required-min-length": "Este campo es requerido y la mĂ­nima longitud es {{length}}",
"unable-to-sign-in": "No se ha podido iniciar sesiĂłn",
"username-or-password-cant-be-empty": "Nombre de usuario o contraseña no puede estar vacio!"
},
"help": {
"title": "NingĂşn paquete ha sido publicado aun.",
"sub-title": "Para publicar tu primer paquete:",
"first-step": "1. Inicia sesiĂłn",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. Publica",
"second-step-command-line": "npm publish --registry {{registryUrl}}",
"third-step": "3. Refresca la página."
},
"sidebar": {
"detail": {
"latest-version": "Ăšltima v{{version}}",
"version": "v{{version}}"
},
"installation": {
"title": "InstalaciĂłn",
"install-using-yarn": "Instala usando yarn",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "Instala usando npm",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "Instala usando pnpm",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
"title": "Repositorio"
},
"author": {
"title": "Autor"
},
"distribution": {
"title": "Ăšltima distribuciĂłn",
"license": "Licencia",
"size": "Tamaño",
"file-count": "archivo cuenta"
},
"maintainers": {
"title": "Mantenedores"
},
"contributors": {
"title": "Colaboradores"
},
"engines": {
"npm-version": "Version NPM",
"node-js": "NODE JS"
}
},
"footer": {
"powered-by": "Hecho con",
"made-with-love-on": "Hecho con <0>♥</0> on"
},
"button": {
"close": "Cerrar",
"cancel": "Cancelar",
"login": "Iniciar sesiĂłn",
"logout": "Cerrar sesiĂłn",
"go-to-the-home-page": "Ir a la página principal",
"learn-more": "Aprender más",
"fund-this-package": "<0>Donar</0> a este paquete"
},
"error": {
"unspecific": "Algo ha salido mal.",
"404": {
"page-not-found": "404 - Paquete no encontrado",
"sorry-we-could-not-find-it": "Lo siento, no hemos podido encontrarlo..."
},
"app-context-not-correct-used": "El contexto de la aplicaciĂłn no fue correctamente usado",
"theme-context-not-correct-used": "El contexto del tema no fue correctamente usado",
"package-meta-is-required-at-detail-context": "packageMeta es requerido en DetailContext"
}
}

View File

@@ -0,0 +1,139 @@
{
"copy-to-clipboard": "Copiar para área de transferência",
"author-anonymous": "AnĂ´nimo(a)",
"action-bar-action": {
"visit-home-page": "Visitar a página inicial",
"open-an-issue": "Criar um incidente",
"download-tarball": "Baixar Tarball"
},
"dialog": {
"registry-info": {
"title": "Informações do Registro"
}
},
"header": {
"documentation": "Documentação",
"registry-info": "Informações do Registro",
"greetings": "Oi "
},
"search": {
"packages": "Pesquisar Pacotes"
},
"auto-complete": {
"loading": "Carregando...",
"no-results-found": "Nenhum resultado encontrado"
},
"tab": {
"uplinks": "Uplinks",
"versions": "Versões",
"dependencies": "DependĂŞncias",
"readme": "Leia-me"
},
"uplinks": {
"title": "Uplinks",
"no-items": "{{name}} nĂŁo tem uplinks."
},
"versions": {
"current-tags": "Tags atuais",
"version-history": "Histórico de versões",
"not-available": "NĂŁo disponĂ­vel"
},
"package": {
"published-on": "Publicado em {{time}} •",
"version": "v{{version}}",
"visit-home-page": "Visitar a página inicial",
"homepage": "Página inicial",
"open-an-issue": "Criar um incidente",
"bugs": "Erros",
"download": "Baixar {{what}}",
"the-tar-file": "o arquivo tar",
"tarball": "Tarball"
},
"dependencies": {
"has-no-dependencies": "{{package}} nĂŁo tem dependĂŞncias.",
"dependency-block": "{{package}}@{{version}}"
},
"form": {
"username": "Nome do usuário",
"password": "Senha"
},
"form-placeholder": {
"username": "O seu nome",
"password": "A sua senha forte"
},
"form-validation": {
"required-field": "Este campo Ă© obrigatĂłrio",
"required-min-length": "Este campo requer o mĂ­nimo de {{length}} caracteres",
"unable-to-sign-in": "NĂŁo foi possĂ­vel fazer login",
"username-or-password-cant-be-empty": "Nome de usuário ou senha não podem estar vazios!"
},
"help": {
"title": "Nenhum pacote publicado ainda.",
"sub-title": "Para publicar seu primeiro pacote apenas:",
"first-step": "1. Faça login",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. Publique",
"second-step-command-line": "npm publish --registry {{registryUrl}}",
"third-step": "3. Atualize esta página."
},
"sidebar": {
"detail": {
"latest-version": "Ăšltima versĂŁo: v{{version}}",
"version": "v{{version}}"
},
"installation": {
"title": "Instalação",
"install-using-yarn": "Instale usando yarn",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "Instale usando npm",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "Instale usando pnpm",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
"title": "RepositĂłrio"
},
"author": {
"title": "Autor(a)"
},
"distribution": {
"title": "Distribuição mais recente",
"license": "Licença",
"size": "Tamanho",
"file-count": "Contagem de arquivos"
},
"maintainers": {
"title": "Mantenedores(as)"
},
"contributors": {
"title": "Contribuidores(as)"
},
"engines": {
"npm-version": "VersĂŁo NPM",
"node-js": "NODE JS"
}
},
"footer": {
"powered-by": "DistribuĂ­do por",
"made-with-love-on": "Feito com amor <0>♥</0> no(a)"
},
"button": {
"close": "Fechar",
"cancel": "Cancelar",
"login": "Conectar",
"logout": "Desconectar",
"go-to-the-home-page": "Ir para a página inicial",
"learn-more": "Leia mais",
"fund-this-package": "<0>Financie</0> este pacote"
},
"error": {
"unspecific": "Algo deu errado.",
"404": {
"page-not-found": "404 - Página não encontrada",
"sorry-we-could-not-find-it": "Desculpe, nĂŁo conseguimos encontrar..."
},
"app-context-not-correct-used": "O contexto do aplicativo nĂŁo foi usado corretamente",
"theme-context-not-correct-used": "O contexto do tema nĂŁo foi usado corretamente",
"package-meta-is-required-at-detail-context": "packageMeta Ă© requerido em DetailContext"
}
}

View File

@@ -1,36 +0,0 @@
module.exports = {
name: 'verdaccio-ui-jest',
verbose: true,
collectCoverage: true,
testEnvironment: 'jest-environment-jsdom-global',
moduleFileExtensions: ['js', 'ts', 'tsx'],
testURL: 'http://localhost',
rootDir: '..',
setupFiles: ['<rootDir>/test/setup.js'],
transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
modulePathIgnorePatterns: ['<rootDir>/coverage', '<rootDir>/scripts', '<rootDir>/.circleci', '<rootDir>/tools', '<rootDir>/build', '<rootDir>/.vscode/'],
snapshotSerializers: ['enzyme-to-json/serializer', 'jest-emotion'],
moduleNameMapper: {
'\\.(s?css)$': '<rootDir>/node_modules/identity-obj-proxy',
'github-markdown-css': '<rootDir>/node_modules/identity-obj-proxy',
'\\.(png)$': '<rootDir>/node_modules/identity-obj-proxy',
'\\.(svg)$': '<rootDir>/test/unit/empty.ts',
},
};
// module.exports = {
// name: 'verdaccio-unit-jest',
// verbose: true,
// collectCoverage: true,
// testEnvironment: 'jest-environment-jsdom-global',
// testURL: 'http://localhost',
// testRegex: '../src/components/CopyToClipBoard/CopyToClipBoard.test.tsx',
// setupFiles: ['./setup.ts'],
// // Some unit tests rely on data folders that look like packages. This confuses jest-hast-map
// // when it tries to scan for package.json files.
// modulePathIgnorePatterns: ['<rootDir>/coverage', '<rootDir>/scripts', '<rootDir>/.circleci', '<rootDir>/tools', '<rootDir>/build', '<rootDir>/.vscode/'],
// // testPathIgnorePatterns: ['__snapshots__', '<rootDir>/build'],
// snapshotSerializers: ['enzyme-to-json/serializer', 'jest-emotion'],
// // coveragePathIgnorePatterns: ['node_modules', 'fixtures', '<rootDir>/src/api/debug', '<rootDir>/test'],
// // transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
// };

View File

@@ -3,6 +3,7 @@ const { defaults } = require('jest-config');
module.exports = {
name: 'verdaccio-ui-jest',
verbose: true,
automock: false,
collectCoverage: true,
testEnvironment: 'jest-environment-jsdom-global',
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
@@ -10,7 +11,15 @@ module.exports = {
rootDir: '..',
setupFiles: ['<rootDir>/jest/setup.ts'],
transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
modulePathIgnorePatterns: ['<rootDir>/coverage', '<rootDir>/scripts', '<rootDir>/.circleci', '<rootDir>/tools', '<rootDir>/build', '<rootDir>/.vscode/'],
modulePathIgnorePatterns: [
'<rootDir>/coverage',
'<rootDir>/scripts',
'<rootDir>/.circleci',
'<rootDir>/tools',
'<rootDir>/build',
'<rootDir>/.vscode/',
'<rootDir>/test/e2e/',
],
snapshotSerializers: ['enzyme-to-json/serializer', 'jest-emotion'],
moduleNameMapper: {
'\\.(s?css)$': '<rootDir>/node_modules/identity-obj-proxy',

View File

@@ -1 +1 @@
require.requireActual('babel/polyfill');
jest.requireActual('babel/polyfill');

View File

@@ -5,14 +5,21 @@
import 'raf/polyfill';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { GlobalWithFetchMock } from 'jest-fetch-mock';
import 'mutationobserver-shim';
// @ts-ignore : Only a void function can be called with the 'new' keyword
configure({ adapter: new Adapter() });
// @ts-ignore : Property '__APP_VERSION__' does not exist on type 'Global'.
global.__APP_VERSION__ = '1.0.0';
// @ts-ignore : Property '__VERDACCIO_BASENAME_UI_OPTIONS' does not exist on type 'Global'.
global.__VERDACCIO_BASENAME_UI_OPTIONS = {};
global.__VERDACCIO_BASENAME_UI_OPTIONS = { base: 'http://localhost' };
// @ts-ignore : Property 'VERDACCIO_API_URL' does not exist on type 'Global'.
global.VERDACCIO_API_URL = 'https://verdaccio.tld';
const customGlobal: GlobalWithFetchMock = global as GlobalWithFetchMock;
customGlobal.fetch = require('jest-fetch-mock');
customGlobal.fetchMock = customGlobal.fetch;
// mocking few DOM methods
// @ts-ignore : Property 'document' does not exist on type 'Global'.

View File

@@ -1,5 +0,0 @@
{
"rules": {
"@typescript-eslint/explicit-function-return-type": 0
}
}

View File

@@ -3,18 +3,30 @@
*/
import { Base64 } from 'js-base64';
import addHours from 'date-fns/add_hours';
import dayjs from 'dayjs';
export function generateTokenWithTimeRange(limit = 0) {
export function generateTokenWithTimeRange(amount = 0) {
const payload = {
username: 'verdaccio',
exp: Number.parseInt(String(addHours(new Date(), limit).getTime() / 1000), 10),
exp: Number.parseInt(
String(
dayjs(new Date())
.add(amount, 'hour')
.valueOf() / 1000
),
10
),
};
return `xxxxxx.${Base64.encode(JSON.stringify(payload))}.xxxxxx`;
}
export function generateTokenWithExpirationAsString() {
const payload = { username: 'verdaccio', exp: 'I am not a number' };
return `xxxxxx.${Base64.encode(JSON.stringify(payload))}.xxxxxx`;
}
export function generateInvalidToken() {
const payload = `invalidtoken`;
return `xxxxxx.${Base64.encode(payload)}.xxxxxx`;
}

View File

@@ -192,7 +192,7 @@ export const packageMeta = {
jest: { snapshotSerializers: ['jest-serializer-enzyme'] },
engines: { node: '>=4.6.1', npm: '>=2.15.9' },
preferGlobal: true,
publishConfig: { registry: 'http://localhost:4873/' },
publishConfig: { registry: 'https://registry.verdaccio.org' },
license: 'WTFPL',
contributors: [
{
@@ -578,7 +578,7 @@ export const packageMeta = {
_npmUser: {},
dist: {
shasum: '958c919180e7f2ed6775f48d4ec64bd8de2a14df',
tarball: 'http://localhost:4873/verdaccio/-/verdaccio-2.7.1.tgz',
tarball: 'https://registry.verdaccio.org/verdaccio/-/verdaccio-2.7.1.tgz',
},
},
};

View File

@@ -1,102 +1,134 @@
{
"name": "@verdaccio/ui-theme",
"version": "0.2.1",
"version": "1.3.0",
"description": "Verdaccio User Interface",
"author": {
"name": "Verdaccio Core Team"
"name": "Verdaccio Core Team",
"email": "verdaccio.npm@gmail.com"
},
"repository": {
"type": "git",
"url": "git://github.com/verdaccio/ui"
},
"homepage": "https://verdaccio.org",
"main": "index.js",
"devDependencies": {
"@commitlint/cli": "8.0.0",
"@commitlint/config-conventional": "8.0.0",
"@material-ui/core": "3.9.3",
"@material-ui/icons": "3.0.2",
"@octokit/rest": "16.23.2",
"@types/enzyme": "3.9.3",
"@types/lodash": "4.14.134",
"@types/material-ui": "0.21.6",
"@types/node": "12.0.8",
"@types/react": "16.8.16",
"@types/react-dom": "16.8.4",
"@types/react-router-dom": "4.3.2",
"@verdaccio/babel-preset": "0.2.1",
"@verdaccio/eslint-config": "0.0.1",
"@verdaccio/types": "6.1.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.8.0",
"@babel/plugin-proposal-optional-chaining": "7.8.0",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@emotion/core": "10.0.22",
"@emotion/styled": "10.0.23",
"@material-ui/core": "4.8.0",
"@material-ui/icons": "4.5.1",
"@octokit/rest": "16.35.2",
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.4.0",
"@types/autosuggest-highlight": "3.1.0",
"@types/enzyme": "3.10.4",
"@types/jest": "24.0.24",
"@types/js-base64": "2.3.1",
"@types/lodash": "4.14.149",
"@types/node": "13.1.6",
"@types/react": "16.9.17",
"@types/react-autosuggest": "9.3.13",
"@types/react-dom": "16.9.4",
"@types/react-router-dom": "5.1.3",
"@types/request": "2.48.4",
"@types/validator": "12.0.1",
"@types/webpack-env": "1.15.0",
"@typescript-eslint/parser": "2.18.0",
"@verdaccio/babel-preset": "9.0.0",
"@verdaccio/commons-api": "9.0.0",
"@verdaccio/eslint-config": "8.4.2",
"@verdaccio/types": "9.0.0",
"autosuggest-highlight": "3.1.1",
"babel-loader": "8.0.6",
"bundlesize": "0.17.2",
"codecov": "3.5.0",
"concurrently": "4.1.0",
"cross-env": "5.2.0",
"css-loader": "0.28.10",
"date-fns": "1.30.1",
"emotion": "9.2.12",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"enzyme-to-json": "3.3.5",
"eslint": "5.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.13.0",
"eslint-plugin-verdaccio": "0.0.5",
"file-loader": "2.0.0",
"bundlesize": "0.18.0",
"codeceptjs": "2.4.0",
"codecov": "3.6.5",
"concurrently": "5.0.2",
"cross-env": "6.0.3",
"css-loader": "3.4.2",
"dayjs": "1.8.19",
"detect-secrets": "1.0.5",
"emotion": "10.0.27",
"emotion-theming": "10.0.27",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2",
"enzyme-to-json": "3.4.3",
"eslint": "6.7.2",
"eslint-plugin-codeceptjs": "1.2.0",
"eslint-plugin-import": "2.19.1",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "7.17.0",
"eslint-plugin-react-hooks": "2.3.0",
"eslint-plugin-verdaccio": "8.4.2",
"file-loader": "5.0.2",
"friendly-errors-webpack-plugin": "1.7.0",
"get-stdin": "6.0.0",
"github-markdown-css": "2.10.0",
"get-stdin": "7.0.0",
"github-markdown-css": "3.0.1",
"html-webpack-plugin": "3.2.0",
"husky": "2.4.1",
"husky": "3.1.0",
"i18next": "19.1.0",
"identity-obj-proxy": "3.0.0",
"in-publish": "2.0.0",
"jest": "24.8.0",
"jest-emotion": "10.0.11",
"jest-environment-jsdom": "24.8.0",
"jest": "24.9.0",
"jest-emotion": "10.0.27",
"jest-environment-jsdom": "24.9.0",
"jest-environment-jsdom-global": "1.2.0",
"jest-environment-node": "24.8.0",
"jest-environment-node": "25.1.0",
"jest-fetch-mock": "3.0.1",
"js-base64": "2.5.1",
"js-yaml": "3.13.1",
"lint-staged": "9.5.0",
"localstorage-memory": "1.0.3",
"mini-css-extract-plugin": "0.7.0",
"node-mocks-http": "1.7.3",
"lockfile-lint": "3.0.5",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "0.9.0",
"mutationobserver-shim": "0.3.3",
"node-mocks-http": "1.8.1",
"normalize.css": "8.0.1",
"optimize-css-assets-webpack-plugin": "5.0.1",
"ora": "3.4.0",
"prettier": "1.18.2",
"optimize-css-assets-webpack-plugin": "5.0.3",
"ora": "4.0.3",
"prettier": "1.19.1",
"prop-types": "15.7.2",
"puppeteer": "1.17.0",
"react": "16.8.3",
"react-autosuggest": "9.4.2",
"react-dom": "16.8.3",
"react-emotion": "9.2.12",
"react-hot-loader": "4.7.1",
"react-router": "4.3.1",
"react-router-dom": "4.3.1",
"resolve-url-loader": "3.0.1",
"rimraf": "2.6.3",
"puppeteer": "2.0.0",
"react": "16.12.0",
"react-autosuggest": "9.4.3",
"react-dom": "16.13.0",
"react-hook-form": "3.29.4",
"react-hot-loader": "4.12.18",
"react-i18next": "11.3.1",
"react-router-dom": "5.1.2",
"request": "2.88.0",
"resolve-url-loader": "3.1.1",
"rimraf": "3.0.0",
"source-map-loader": "0.2.4",
"standard-version": "4.4.0",
"style-loader": "0.23.1",
"stylelint": "10.1.0",
"stylelint-config-recommended": "2.2.0",
"standard-version": "7.0.1",
"style-loader": "1.1.2",
"stylelint": "12.0.0",
"stylelint-config-recommended": "3.0.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.8.0",
"stylelint-webpack-plugin": "0.10.5",
"stylelint-processor-styled-components": "1.9.0",
"stylelint-webpack-plugin": "1.1.2",
"supertest": "4.0.2",
"typeface-roboto": "0.0.54",
"typescript": "3.5.2",
"url-loader": "1.1.2",
"validator": "10.11.0",
"verdaccio": "4.0.3",
"verdaccio-auth-memory": "0.0.4",
"verdaccio-memory": "2.0.0",
"webpack": "4.20.2",
"webpack-bundle-analyzer": "3.3.2",
"webpack-bundle-size-analyzer": "3.0.0",
"webpack-cli": "3.2.3",
"webpack-dev-server": "3.2.1",
"webpack-merge": "4.2.1",
"typeface-roboto": "0.0.75",
"typescript": "3.7.4",
"uglifyjs-webpack-plugin": "2.2.0",
"url-loader": "3.0.0",
"validator": "12.1.0",
"verdaccio": "4.4.2",
"verdaccio-auth-memory": "9.0.0",
"verdaccio-memory": "9.0.0",
"wait-on": "3.3.0",
"webpack": "4.41.5",
"webpack-bundle-analyzer": "3.6.0",
"webpack-bundle-size-analyzer": "3.1.0",
"webpack-cli": "3.3.10",
"webpack-dev-server": "3.10.1",
"webpack-merge": "4.2.2",
"whatwg-fetch": "3.0.0",
"xss": "1.0.6"
},
@@ -108,7 +140,7 @@
"bundlesize": [
{
"path": "./static/vendors.*.js",
"maxSize": "180 kB"
"maxSize": "200 kB"
},
{
"path": "./static/main.*.js",
@@ -132,17 +164,23 @@
}
],
"scripts": {
"type-check": "tsc --noEmit",
"type-check": "tsc --noEmit --pretty",
"type-check:watch": "npm run type-check -- --watch",
"release": "standard-version -a -s",
"test": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --config ./jest/jest.config.js --maxWorkers 2",
"type-check-strict:watch": "tsc --project ./tsconfig.strict.json --noEmit --pretty --watch",
"release": "standard-version -a",
"test:clean": "npx jest --clearCache",
"test:acceptance": "codeceptjs run --steps",
"test:acceptance:server": "concurrently --kill-others \"npm run verdaccio:server\" \"npm run test:acceptance\"",
"test:e2e": "cross-env BABEL_ENV=test jest --config ./test/jest.config.e2e.js",
"test": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --config ./jest/jest.config.js --maxWorkers 2 --passWithNoTests",
"test:update-snapshot": "npm run test -- -u",
"test:size": "bundlesize",
"lint": "npm run lint:js && npm run lint:css",
"lint": "npm run lint:js && npm run lint:css && npm run lint:lockfile",
"lint:js": "npm run type-check && eslint . --ext .js,.ts,.tsx",
"lint:css": "stylelint 'src/**/styles.ts'",
"lint:css": "stylelint \"src/**/styles.ts\"",
"lint:lockfile": "lockfile-lint --path yarn.lock --type yarn --validate-https --allowed-hosts verdaccio npm yarn",
"coverage:publish": "codecov",
"pre:webpack": "rimraf static/*",
"prepublish": "in-publish && npm run build || not-in-publish",
"dev:web": "cross-env BABEL_ENV=ui babel-node tools/dev.server.js",
"verdaccio:server": "node tools/verdaccio.js",
"build": "npm run pre:webpack && cross-env BABEL_ENV=ui webpack --config tools/webpack.prod.config.babel.js",
@@ -151,14 +189,25 @@
"dev": "concurrently --kill-others \"npm run dev:web\" \"npm run verdaccio:server\""
},
"engines": {
"node": ">=8",
"node": ">= 8",
"npm": ">=5"
},
"husky": {
"hooks": {
"pre-commit": "commitlint -e $GIT_PARAMS"
"pre-commit": "lint-staged --relative",
"commit-msg": "commitlint -e $GIT_PARAMS"
}
},
"lint-staged": {
"*.{js,tsx,ts}": [
"eslint . --ext .js,.ts,.tsx",
"prettier --write"
],
"*": [
"detect-secrets-launcher --baseline .secrets-baseline",
"git add"
]
},
"license": "MIT",
"commitlint": {
"extends": [

View File

@@ -0,0 +1 @@
{"list":["vue","jquery"],"secret":"3bb332943c7086716a35dea44754b43b956ee655af1fe61866fbdaf38486836c"}

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,26 +1,28 @@
import React from 'react';
import { mount } from 'enzyme';
import storage from '../utils/storage';
import App from './App';
import { render, waitForElement, fireEvent } from '../utils/test-react-testing-library';
import storage from '../utils/storage';
// eslint-disable-next-line jest/no-mocks-import
import { generateTokenWithTimeRange } from '../../jest/unit/components/__mocks__/token';
import App from './App';
jest.mock('../utils/storage', () => {
class LocalStorageMock {
private store: object;
private store: Record<string, string>;
public constructor() {
this.store = {};
}
public clear(): void {
this.store = {};
}
public getItem(key): unknown {
public getItem(key: string): unknown {
return this.store[key] || null;
}
public setItem(key, value): void {
public setItem(key: string, value: string): void {
this.store[key] = value.toString();
}
public removeItem(key): void {
public removeItem(key: string): void {
delete this.store[key];
}
}
@@ -28,66 +30,75 @@ jest.mock('../utils/storage', () => {
});
jest.mock('../utils/api', () => ({
// eslint-disable-next-line jest/no-mocks-import
request: require('../../jest/unit/components/__mocks__/api').default.request,
}));
describe('App', () => {
let wrapper;
/* eslint-disable react/jsx-no-bind*/
describe('<App />', () => {
test('should display the Loading component at the beginning ', () => {
const { container, queryByTestId } = render(<App />);
beforeEach(() => {
wrapper = mount(<App />);
expect(container.firstChild).toMatchSnapshot();
expect(queryByTestId('loading')).toBeTruthy();
});
test('toggleLoginModal: should toggle the value in state', () => {
const { handleToggleLoginModal } = wrapper.instance();
expect(wrapper.state().showLoginModal).toBeFalsy();
handleToggleLoginModal();
expect(wrapper.state('showLoginModal')).toBeTruthy();
expect(wrapper.state('error')).toEqual(undefined);
test('should display the Header component ', async () => {
const { container, queryByTestId } = render(<App />);
expect(container.firstChild).toMatchSnapshot();
expect(queryByTestId('loading')).toBeTruthy();
// wait for the Header component appearance and return the element
const headerElement = await waitForElement(() => queryByTestId('header'));
expect(headerElement).toBeTruthy();
});
test('handleLogout - logouts the user and clear localstorage', async () => {
storage.setItem('username', 'verdaccio');
storage.setItem('token', generateTokenWithTimeRange(24));
const { queryByTestId } = render(<App />);
// wait for the Account's circle element component appearance and return the element
const accountCircleElement = await waitForElement(() => queryByTestId('header--menu-accountcircle'));
expect(accountCircleElement).toBeTruthy();
if (accountCircleElement) {
fireEvent.click(accountCircleElement);
// wait for the Button's logout element component appearance and return the element
const buttonLogoutElement = await waitForElement(() => queryByTestId('header--button-logout'));
expect(buttonLogoutElement).toBeTruthy();
if (buttonLogoutElement) {
fireEvent.click(buttonLogoutElement);
expect(queryByTestId('greetings-label')).toBeFalsy();
}
}
});
test('isUserAlreadyLoggedIn: token already available in storage', async () => {
storage.setItem('username', 'verdaccio');
storage.setItem('token', generateTokenWithTimeRange(24));
const { isUserAlreadyLoggedIn } = wrapper.instance();
isUserAlreadyLoggedIn();
const { queryByTestId, queryAllByText } = render(<App />);
expect(wrapper.state('user').username).toEqual('verdaccio');
});
// wait for the Account's circle element component appearance and return the element
const accountCircleElement = await waitForElement(() => queryByTestId('header--menu-accountcircle'));
expect(accountCircleElement).toBeTruthy();
test('handleLogout - logouts the user and clear localstorage', async () => {
const { handleLogout } = wrapper.instance();
storage.setItem('username', 'verdaccio');
storage.setItem('token', 'xxxx.TOKEN.xxxx');
if (accountCircleElement) {
fireEvent.click(accountCircleElement);
await handleLogout();
expect(wrapper.state('user')).toEqual({});
expect(wrapper.state('isUserLoggedIn')).toBeFalsy();
});
// wait for the Greeting's label element component appearance and return the element
const greetingsLabelElement = await waitForElement(() => queryByTestId('greetings-label'));
expect(greetingsLabelElement).toBeTruthy();
test('handleDoLogin - login the user successfully', async () => {
const { handleDoLogin } = wrapper.instance();
await handleDoLogin('sam', '1234');
const result = {
username: 'sam',
};
expect(wrapper.state('isUserLoggedIn')).toBeTruthy();
expect(wrapper.state('showLoginModal')).toBeFalsy();
expect(storage.getItem('username')).toEqual('sam');
expect(storage.getItem('token')).toEqual('TEST_TOKEN');
expect(wrapper.state('user')).toEqual(result);
});
test('handleDoLogin - authentication failure', async () => {
const { handleDoLogin } = wrapper.instance();
await handleDoLogin('sam', '12345');
const result = {
description: 'bad username/password, access denied',
title: 'Unable to login',
type: 'error',
};
expect(wrapper.state('user')).toEqual({});
expect(wrapper.state('error')).toEqual(result);
if (greetingsLabelElement) {
expect(queryAllByText('verdaccio')).toBeTruthy();
}
}
});
});

View File

@@ -1,197 +1,86 @@
import React, { Component, ReactElement } from 'react';
/* eslint-disable react/jsx-max-depth */
import React, { useState, useEffect, Suspense } from 'react';
import styled from '@emotion/styled';
import isNil from 'lodash/isNil';
import { Router } from 'react-router-dom';
import '../../i18n/config';
import storage from '../utils/storage';
import { makeLogin, isTokenExpire } from '../utils/login';
import Loading from '../components/Loading';
import LoginModal from '../components/Login';
import { isTokenExpire } from '../utils/login';
import Header from '../components/Header';
import { Container, Content } from '../components/Layout';
import RouterApp from '../router';
import API from '../utils/api';
import '../styles/typeface-roboto.css';
import '../utils/styles/global';
import 'normalize.css';
import Footer from '../components/Footer';
import { FormError } from 'src/components/Login/Login';
import Loading from '../components/Loading';
import Box from '../muiComponents/Box';
import StyleBaseline from '../design-tokens/StyleBaseline';
import { Theme } from '../design-tokens/theme';
export const AppContext = React.createContext<{}>({});
export const AppContextProvider = AppContext.Provider;
export const AppContextConsumer = AppContext.Consumer;
import AppContextProvider from './AppContextProvider';
import AppRoute, { history } from './AppRoute';
import loadDayJSLocale from './load-dayjs-locale';
export interface AppStateInterface {
error?: FormError;
logoUrl: string;
user: {
username?: string;
};
scope: string;
showLoginModal: boolean;
isUserLoggedIn: boolean;
packages: [];
isLoading: boolean;
}
export default class App extends Component<{}, AppStateInterface> {
public state: AppStateInterface = {
// @ts-ignore
logoUrl: window.VERDACCIO_LOGO,
user: {},
// @ts-ignore
scope: window.VERDACCIO_SCOPE ? `${window.VERDACCIO_SCOPE}:` : '',
showLoginModal: false,
isUserLoggedIn: false,
packages: [],
isLoading: true,
const StyledBox = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
backgroundColor: theme?.palette.background.default,
}));
const StyledBoxContent = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
[`@media screen and (min-width: ${theme && theme.breakPoints.container}px)`]: {
maxWidth: theme && theme.breakPoints.container,
width: '100%',
marginLeft: 'auto',
marginRight: 'auto',
},
}));
/* eslint-disable react/jsx-no-bind */
/* eslint-disable react-hooks/exhaustive-deps */
const App: React.FC = () => {
const [user, setUser] = useState();
/**
* Logout user
* Required by: <Header />
*/
const logout = () => {
storage.removeItem('username');
storage.removeItem('token');
setUser(undefined);
};
public componentDidMount(): void {
this.isUserAlreadyLoggedIn();
this.loadOnHandler();
}
// eslint-disable-next-line no-unused-vars
public componentDidUpdate(_, prevState): void {
const { isUserLoggedIn } = this.state;
if (prevState.isUserLoggedIn !== isUserLoggedIn) {
this.loadOnHandler();
}
}
public render(): React.ReactElement<HTMLDivElement> {
const { isLoading, isUserLoggedIn, packages, logoUrl, user, scope } = this.state;
const context = { isUserLoggedIn, packages, logoUrl, user, scope };
return (
// @ts-ignore
<Container isLoading={isLoading}>
{isLoading ? <Loading /> : <AppContextProvider value={context}>{this.renderContent()}</AppContextProvider>}
{this.renderLoginModal()}
</Container>
);
}
public isUserAlreadyLoggedIn = () => {
const checkUserAlreadyLoggedIn = () => {
// checks for token validity
const token = storage.getItem('token');
const username = storage.getItem('username');
if (isTokenExpire(token) || isNil(username)) {
this.handleLogout();
} else {
this.setState({
user: { username },
isUserLoggedIn: true,
});
}
};
public loadOnHandler = async () => {
try {
// @ts-ignore
this.req = await API.request('packages', 'GET');
this.setState({
// @ts-ignore
packages: this.req,
isLoading: false,
});
} catch (error) {
// FIXME: add dialog
console.error({
title: 'Warning',
message: `Unable to load package list: ${error.message}`,
});
this.setLoading(false);
}
};
public setLoading = isLoading =>
this.setState({
isLoading,
});
/**
* Toggles the login modal
* Required by: <LoginModal /> <Header />
*/
public handleToggleLoginModal = () => {
this.setState(prevState => ({
// @ts-ignore
showLoginModal: !prevState.showLoginModal,
}));
};
/**
* handles login
* Required by: <Header />
*/
public handleDoLogin = async (usernameValue, passwordValue) => {
// @ts-ignore
const { username, token, error } = await makeLogin(usernameValue, passwordValue);
if (username && token) {
storage.setItem('username', username);
storage.setItem('token', token);
this.setLoggedUser(username);
logout();
return;
}
if (error) {
this.setState({
user: {},
error,
});
}
setUser({ username });
};
public setLoggedUser = username => {
this.setState({
user: {
username,
},
isUserLoggedIn: true, // close login modal after successful login
showLoginModal: false, // set isUserLoggedIn to true
});
};
useEffect(() => {
checkUserAlreadyLoggedIn();
loadDayJSLocale();
}, []);
/**
* Logouts user
* Required by: <Header />
*/
public handleLogout = () => {
storage.removeItem('username');
storage.removeItem('token');
this.setState({
user: {},
isUserLoggedIn: false,
});
};
return (
<Suspense fallback={<Loading />}>
<StyleBaseline />
<StyledBox display="flex" flexDirection="column" height="100%">
<>
<Router history={history}>
<AppContextProvider user={user}>
<Header />
<StyledBoxContent flexGrow={1}>
<AppRoute />
</StyledBoxContent>
</AppContextProvider>
</Router>
<Footer />
</>
</StyledBox>
</Suspense>
);
};
public renderLoginModal = (): ReactElement<HTMLElement> => {
const { error, showLoginModal } = this.state;
return <LoginModal error={error} onCancel={this.handleToggleLoginModal} onSubmit={this.handleDoLogin} visibility={showLoginModal} />;
};
public renderContent = (): ReactElement<HTMLElement> => {
return (
<>
<Content>
<RouterApp onLogout={this.handleLogout} onToggleLoginModal={this.handleToggleLoginModal}>
{this.renderHeader()}
</RouterApp>
</Content>
<Footer />
</>
);
};
public renderHeader = (): ReactElement<HTMLElement> => {
const {
logoUrl,
// @ts-ignore
user: { username },
scope,
} = this.state;
return <Header logo={logoUrl} onLogout={this.handleLogout} onToggleLoginModal={this.handleToggleLoginModal} scope={scope} username={username} />;
};
}
export default App;

18
src/App/AppContext.ts Normal file
View File

@@ -0,0 +1,18 @@
import { createContext } from 'react';
export interface AppProps {
user?: User;
scope: string;
}
export interface User {
username: string;
}
export interface AppContextProps extends AppProps {
setUser: (user?: User) => void;
}
const AppContext = createContext<undefined | AppContextProps>(undefined);
export default AppContext;

View File

@@ -0,0 +1,41 @@
import React, { useState, useEffect } from 'react';
import AppContext, { AppProps, User } from './AppContext';
interface Props {
user?: User;
}
/* eslint-disable react-hooks/exhaustive-deps */
const AppContextProvider: React.FC<Props> = ({ children, user }) => {
const [state, setState] = useState<AppProps>({
scope: window.VERDACCIO_SCOPE || '',
user,
});
useEffect(() => {
setState({
...state,
user,
});
}, [user]);
const setUser = (user?: User) => {
setState({
...state,
user,
});
};
return (
<AppContext.Provider
value={{
...state,
setUser,
}}>
{children}
</AppContext.Provider>
);
};
export default AppContextProvider;

38
src/App/AppError.tsx Normal file
View File

@@ -0,0 +1,38 @@
import React, { Component } from 'react';
export interface ErrorProps {
children: any;
}
export interface ErrorAppState {
hasError: boolean;
error: Error | null;
info: object | null;
}
export default class ErrorBoundary extends Component<ErrorProps, ErrorAppState> {
constructor(props: ErrorProps) {
super(props);
this.state = { hasError: false, error: null, info: null };
}
public componentDidCatch(error: Error, info: object) {
this.setState({ hasError: true, error, info });
}
public render(): JSX.Element {
const { hasError, error, info } = this.state;
const { children } = this.props;
if (hasError) {
return (
<>
<h1>{'Something went wrong.'}</h1>
<p>{`error: ${error}`}</p>
<p>{`info: ${JSON.stringify(info)}`}</p>
</>
);
}
return children;
}
}

71
src/App/AppRoute.tsx Normal file
View File

@@ -0,0 +1,71 @@
import React, { lazy, useContext } from 'react';
import { Route as ReactRouterDomRoute, Switch, Router } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { useTranslation } from 'react-i18next';
import AppContext from './AppContext';
const NotFound = lazy(() => import('../components/NotFound'));
const VersionContextProvider = lazy(() => import('../pages/Version/VersionContextProvider'));
const VersionPage = lazy(() => import('../pages/Version'));
const HomePage = lazy(() => import('../pages/home'));
enum Route {
ROOT = '/',
SCOPE_PACKAGE = '/-/web/detail/@:scope/:package',
SCOPE_PACKAGE_VERSION = '/-/web/detail/@:scope/:package/v/:version',
PACKAGE = '/-/web/detail/:package',
PACKAGE_VERSION = '/-/web/detail/:package/v/:version',
}
export const history = createBrowserHistory({
basename: window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix,
});
const AppRoute: React.FC = () => {
const appContext = useContext(AppContext);
const { t } = useTranslation();
if (!appContext) {
throw Error(t('app-context-not-correct-used'));
}
const { user } = appContext;
const isUserLoggedIn = user && user.username;
return (
<Router history={history}>
<Switch>
<ReactRouterDomRoute exact={true} path={Route.ROOT}>
<HomePage isUserLoggedIn={!!isUserLoggedIn} />
</ReactRouterDomRoute>
<ReactRouterDomRoute exact={true} path={Route.PACKAGE}>
<VersionContextProvider>
<VersionPage />
</VersionContextProvider>
</ReactRouterDomRoute>
<ReactRouterDomRoute exact={true} path={Route.PACKAGE_VERSION}>
<VersionContextProvider>
<VersionPage />
</VersionContextProvider>
</ReactRouterDomRoute>
<ReactRouterDomRoute exact={true} path={Route.SCOPE_PACKAGE_VERSION}>
<VersionContextProvider>
<VersionPage />
</VersionContextProvider>
</ReactRouterDomRoute>
<ReactRouterDomRoute exact={true} path={Route.SCOPE_PACKAGE}>
<VersionContextProvider>
<VersionPage />
</VersionContextProvider>
</ReactRouterDomRoute>
<ReactRouterDomRoute>
<NotFound />
</ReactRouterDomRoute>
</Switch>
</Router>
);
};
export default AppRoute;

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,2 @@
export { default } from './App';
export { default as AppContextProvider } from './AppContextProvider';

View File

@@ -0,0 +1,52 @@
import dayjs from 'dayjs';
import i18n from 'i18next';
function getFallFackLanguage(): string | undefined {
const fallbackLanguage = i18n.options.fallbackLng;
if (Array.isArray(fallbackLanguage)) {
return fallbackLanguage[0];
}
if (typeof fallbackLanguage === 'string') {
return fallbackLanguage;
}
return undefined;
}
function loadDayJSLocale() {
const fallbackLanguage = getFallFackLanguage();
const locale = i18n.language || fallbackLanguage;
// dayjs loades en-US by default
if (!locale || locale === 'en-US') {
return;
}
switch (locale.toLowerCase()) {
// At the moment we only support pt-BR, please see: i18n/translations/*
case 'pt-br':
{
require('dayjs/locale/pt-br');
dayjs.locale('pt-br');
}
break;
case 'de':
{
require('dayjs/locale/de');
dayjs.locale('de');
}
break;
case 'es-es':
{
require('dayjs/locale/es');
dayjs.locale('es');
}
break;
default:
break;
}
}
export default loadDayJSLocale;

View File

@@ -1,17 +0,0 @@
import { css } from 'emotion';
import colors from '../utils/styles/colors';
export const alertError = css`
background-color: ${colors.red} !important;
min-width: inherit !important;
`;
export const alertErrorMsg = css`
display: flex;
align-items: center;
`;
export const alertIcon = css({
opacity: 0.9,
marginRight: '8px',
});

View File

@@ -1,48 +1,71 @@
import React from 'react';
import { shallow } from 'enzyme';
import { render, cleanup } from '../../utils/test-react-testing-library';
import { DetailContext, DetailContextProps } from '../../pages/Version';
import ActionBar from './ActionBar';
const detailContextValue: DetailContextProps = {
packageName: 'foo',
readMe: 'test',
enableLoading: () => {},
isLoading: false,
hasNotBeenFound: false,
packageMeta: {
_uplinks: {},
latest: {
name: '@verdaccio/local-storage',
version: '8.0.1-next.1',
dist: { fileCount: 0, unpackedSize: 0, tarball: 'http://localhost:8080/bootstrap/-/bootstrap-4.3.1.tgz' },
homepage: 'https://verdaccio.org',
bugs: {
url: 'https://github.com/verdaccio/monorepo/issues',
},
},
},
};
const ComponentToBeRendered: React.FC<{ contextValue: DetailContextProps }> = ({ contextValue }) => (
<DetailContext.Provider value={contextValue}>
<ActionBar />
</DetailContext.Provider>
);
describe('<ActionBar /> component', () => {
beforeEach(() => {
jest.resetModules();
afterEach(() => {
cleanup();
});
test('should render the component in default state', () => {
const packageMeta = {
latest: {
homepage: 'https://verdaccio.tld',
bugs: {
url: 'https://verdaccio.tld/bugs',
},
dist: {
tarball: 'https://verdaccio.tld/download',
},
},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const ActionBar = require('./ActionBar').default;
const wrapper = shallow(<ActionBar />);
expect(wrapper.html()).toMatchSnapshot();
const { container } = render(<ComponentToBeRendered contextValue={detailContextValue} />);
expect(container.firstChild).toMatchSnapshot();
});
test('when there is no action bar data', () => {
const packageMeta = {
latest: {},
...detailContextValue.packageMeta,
latest: {
...detailContextValue.packageMeta.latest,
homepage: undefined,
bugs: undefined,
dist: {
...detailContextValue.packageMeta.latest.dist,
tarball: undefined,
},
},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const { container } = render(<ComponentToBeRendered contextValue={{ ...detailContextValue, packageMeta }} />);
expect(container.firstChild).toMatchSnapshot();
});
const ActionBar = require('./ActionBar').default;
const wrapper = shallow(<ActionBar />);
expect(wrapper.html()).toEqual('');
test('when there is a button to download a tarball', () => {
const { getByTitle } = render(<ComponentToBeRendered contextValue={{ ...detailContextValue }} />);
expect(getByTitle('Download tarball')).toBeTruthy();
});
test('when there is a button to open an issue', () => {
const { getByTitle } = render(<ComponentToBeRendered contextValue={{ ...detailContextValue }} />);
expect(getByTitle('Open an issue')).toBeTruthy();
});
});

View File

@@ -1,83 +1,44 @@
import React, { Component, ReactElement } from 'react';
import React from 'react';
import BugReportIcon from '@material-ui/icons/BugReport';
import DownloadIcon from '@material-ui/icons/CloudDownload';
import HomeIcon from '@material-ui/icons/Home';
import List from '@material-ui/core/List';
import Tooltip from '@material-ui/core/Tooltip';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
import { Fab, ActionListItem } from './styles';
import { DetailContext } from '../../pages/Version';
import { isURL } from '../../utils/url';
import Box from '../../muiComponents/Box';
const ACTIONS = {
homepage: {
icon: <HomeIcon />,
title: 'Visit homepage',
},
issue: {
icon: <BugReportIcon />,
title: 'Open an issue',
},
tarball: {
icon: <DownloadIcon />,
title: 'Download tarball',
},
import ActionBarAction, { ActionBarActionProps } from './ActionBarAction';
/* eslint-disable verdaccio/jsx-spread */
const ActionBar: React.FC = () => {
const detailContext = React.useContext(DetailContext);
const { packageMeta } = detailContext;
if (!packageMeta?.latest) {
return null;
}
const { homepage, bugs, dist } = packageMeta.latest;
const actions: Array<ActionBarActionProps> = [];
if (homepage && isURL(homepage)) {
actions.push({ type: 'VISIT_HOMEPAGE', link: homepage });
}
if (bugs?.url && isURL(bugs.url)) {
actions.push({ type: 'OPEN_AN_ISSUE', link: bugs.url });
}
if (dist?.tarball && isURL(dist.tarball)) {
actions.push({ type: 'DOWNLOAD_TARBALL', link: dist.tarball });
}
return (
<Box alignItems="center" display="flex" marginBottom="8px">
{actions.map(action => (
<ActionBarAction key={action.link} {...action} />
))}
</Box>
);
};
class ActionBar extends Component {
public render(): ReactElement<HTMLElement> {
return (
<DetailContextConsumer>
{context => {
return this.renderActionBar(context as VersionPageConsumerProps);
}}
</DetailContextConsumer>
);
}
private renderIconsWithLink(link: string, component: JSX.Element): ReactElement<HTMLElement> {
return (
<a href={link} target={'_blank'}>
{component}
</a>
);
}
private renderActionBar = ({ packageMeta }) => {
// @ts-ignore
const { latest: { bugs: { url: issue } = {}, homepage, dist: { tarball } = {} } = {} } = packageMeta;
const actionsMap = {
homepage,
issue,
tarball,
};
const renderList = Object.keys(actionsMap).reduce((component, value, key) => {
const link = actionsMap[value];
if (link && isURL(link)) {
const fab = <Fab size={'small'}>{ACTIONS[value]['icon']}</Fab>;
component.push(
// @ts-ignore
<Tooltip key={key} title={ACTIONS[value]['title']}>
<>{this.renderIconsWithLink(link, fab)}</>
</Tooltip>
);
}
return component;
}, []);
if (renderList.length > 0) {
return (
<List>
<ActionListItem alignItems={'flex-start'}>{renderList}</ActionListItem>
</List>
);
}
return null;
};
}
export default ActionBar;

View File

@@ -0,0 +1,63 @@
import React from 'react';
import styled from '@emotion/styled';
import BugReportIcon from '@material-ui/icons/BugReport';
import DownloadIcon from '@material-ui/icons/CloudDownload';
import HomeIcon from '@material-ui/icons/Home';
import { useTranslation } from 'react-i18next';
import Tooltip from '../../muiComponents/Tooltip';
import Link from '../Link';
import FloatingActionButton from '../../muiComponents/FloatingActionButton';
import { Theme } from '../../design-tokens/theme';
import downloadTarball from './download-tarball';
export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>(props => ({
backgroundColor: props.theme && props.theme.palette.primary.main,
color: props.theme && props.theme.palette.white,
marginRight: 10,
}));
type ActionType = 'VISIT_HOMEPAGE' | 'OPEN_AN_ISSUE' | 'DOWNLOAD_TARBALL';
export interface ActionBarActionProps {
type: ActionType;
link: string;
}
/* eslint-disable react/jsx-no-bind */
const ActionBarAction: React.FC<ActionBarActionProps> = ({ type, link }) => {
const { t } = useTranslation();
switch (type) {
case 'VISIT_HOMEPAGE':
return (
<Tooltip title={t('action-bar-action.visit-home-page')}>
<Link external={true} to={link}>
<Fab size="small">
<HomeIcon />
</Fab>
</Link>
</Tooltip>
);
case 'OPEN_AN_ISSUE':
return (
<Tooltip title={t('action-bar-action.open-an-issue')}>
<Link external={true} to={link}>
<Fab size="small">
<BugReportIcon />
</Fab>
</Link>
</Tooltip>
);
case 'DOWNLOAD_TARBALL':
return (
<Tooltip title={t('action-bar-action.download-tarball')}>
<Fab data-testid="download-tarball-btn" onClick={downloadTarball(link)} size="small">
<DownloadIcon />
</Fab>
</Tooltip>
);
}
};
export default ActionBarAction;

View File

@@ -1,3 +1,118 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<ActionBar /> component should render the component in default state 1`] = `"<ul class=\\"MuiList-root-1 MuiList-padding-2\\"><li class=\\"MuiListItem-root-5 MuiListItem-default-8 MuiListItem-gutters-13 MuiListItem-alignItemsFlexStart-10 css-9q3x3c eux6shq0\\"><a href=\\"https://verdaccio.tld\\" target=\\"_blank\\"><button class=\\"MuiButtonBase-root-35 MuiFab-root-25 MuiFab-sizeSmall-33 css-96oxa0 eux6shq1\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiFab-label-26\\"><svg class=\\"MuiSvgIcon-root-38\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path d=\\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\\"></path><path fill=\\"none\\" d=\\"M0 0h24v24H0z\\"></path></svg></span></button></a><a href=\\"https://verdaccio.tld/bugs\\" target=\\"_blank\\"><button class=\\"MuiButtonBase-root-35 MuiFab-root-25 MuiFab-sizeSmall-33 css-96oxa0 eux6shq1\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiFab-label-26\\"><svg class=\\"MuiSvgIcon-root-38\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path fill=\\"none\\" d=\\"M0 0h24v24H0z\\"></path><path d=\\"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z\\"></path></svg></span></button></a><a href=\\"https://verdaccio.tld/download\\" target=\\"_blank\\"><button class=\\"MuiButtonBase-root-35 MuiFab-root-25 MuiFab-sizeSmall-33 css-96oxa0 eux6shq1\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiFab-label-26\\"><svg class=\\"MuiSvgIcon-root-38\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path fill=\\"none\\" d=\\"M0 0h24v24H0z\\"></path><path d=\\"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z\\"></path></svg></span></button></a></li></ul>"`;
exports[`<ActionBar /> component should render the component in default state 1`] = `
.emotion-0 {
background-color: #4b5e40;
color: #fff;
margin-right: 10px;
}
<div
class="MuiBox-root MuiBox-root-2"
>
<a
class=""
href="https://verdaccio.org"
rel="noopener noreferrer"
target="_blank"
title="Visit homepage"
>
<h6
class="MuiTypography-root MuiTypography-subtitle1"
>
<button
class="MuiButtonBase-root MuiFab-root emotion-0 emotion-1 MuiFab-sizeSmall"
tabindex="0"
type="button"
>
<span
class="MuiFab-label"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"
/>
</svg>
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
</h6>
</a>
<a
class=""
href="https://github.com/verdaccio/monorepo/issues"
rel="noopener noreferrer"
target="_blank"
title="Open an issue"
>
<h6
class="MuiTypography-root MuiTypography-subtitle1"
>
<button
class="MuiButtonBase-root MuiFab-root emotion-0 emotion-1 MuiFab-sizeSmall"
tabindex="0"
type="button"
>
<span
class="MuiFab-label"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"
/>
</svg>
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
</h6>
</a>
<button
class="MuiButtonBase-root MuiFab-root emotion-0 emotion-1 MuiFab-sizeSmall"
data-testid="download-tarball-btn"
tabindex="0"
title="Download tarball"
type="button"
>
<span
class="MuiFab-label"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"
/>
</svg>
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
</div>
`;
exports[`<ActionBar /> component when there is no action bar data 1`] = `
<div
class="MuiBox-root MuiBox-root-77"
/>
`;

View File

@@ -0,0 +1,18 @@
import api from '../../utils/api';
import { extractFileName, downloadFile } from '../../utils/url';
function downloadTarball(link: string) {
return async function downloadHandler(): Promise<void> {
const fileStream: Blob = await api.request(link, 'GET', {
headers: {
['accept']:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
},
credentials: 'include',
});
const fileName = extractFileName(link);
downloadFile(fileStream, fileName);
};
}
export default downloadTarball;

View File

@@ -1 +1,2 @@
export { default } from './ActionBar';
export { default as downloadTarball } from './download-tarball';

View File

@@ -1,21 +0,0 @@
import styled from 'react-emotion';
import { default as MuiFab } from '@material-ui/core/Fab';
import ListItem from '@material-ui/core/ListItem';
import colors from '../../utils/styles/colors';
export const ActionListItem = styled(ListItem)`
&& {
padding-top: 0;
padding-left: 0;
padding-right: 0;
}
`;
export const Fab = styled(MuiFab)`
&& {
background-color: ${colors.primary};
color: ${colors.white};
margin-right: 10px;
}
`;

View File

@@ -1,9 +1,19 @@
import React from 'react';
import { shallow } from 'enzyme';
import { mount } from '../../utils/test-enzyme';
import { DetailContext } from '../../pages/Version';
import Authors from './Author';
const withAuthorComponent = (packageMeta: React.ContextType<typeof DetailContext>['packageMeta']): JSX.Element => (
<DetailContext.Provider value={{ packageMeta }}>
<Authors />
</DetailContext.Provider>
);
describe('<Author /> component', () => {
beforeEach(() => {
jest.resetModules();
jest.resetAllMocks();
});
test('should render the component in default state', () => {
@@ -17,17 +27,12 @@ describe('<Author /> component', () => {
url: '',
avatar: 'https://www.gravatar.com/avatar/000000',
},
dist: { fileCount: 0, unpackedSize: 0 },
},
_uplinks: {},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Author = require('./Author').default;
const wrapper = shallow(<Author />);
const wrapper = mount(withAuthorComponent(packageMeta));
expect(wrapper.html()).toMatchSnapshot();
});
@@ -36,18 +41,13 @@ describe('<Author /> component', () => {
latest: {
name: 'verdaccio',
version: '4.0.0',
dist: { fileCount: 0, unpackedSize: 0 },
},
_uplinks: {},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Author = require('./Author').default;
const wrapper = shallow(<Author />);
expect(wrapper.html()).toEqual('');
const wrapper = mount(withAuthorComponent(packageMeta));
expect(wrapper.html()).toBeNull();
});
test('should render the component when there is no author email', () => {
@@ -60,17 +60,12 @@ describe('<Author /> component', () => {
url: '',
avatar: 'https://www.gravatar.com/avatar/000000',
},
dist: { fileCount: 0, unpackedSize: 0 },
},
_uplinks: {},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Author = require('./Author').default;
const wrapper = shallow(<Author />);
const wrapper = mount(withAuthorComponent(packageMeta));
expect(wrapper.html()).toMatchSnapshot();
});
});

View File

@@ -1,53 +1,46 @@
import React, { Component, ReactNode, ReactElement } from 'react';
import React, { FC, useContext } from 'react';
import { useTranslation } from 'react-i18next';
import Avatar from '@material-ui/core/Avatar';
import List from '@material-ui/core/List';
import ListItemText from '@material-ui/core/ListItemText';
import { DetailContextConsumer } from '../../pages/version/Version';
import { Heading, AuthorListItem } from './styles';
import { DetailContext } from '../../pages/Version';
import { isEmail } from '../../utils/url';
import Avatar from '../../muiComponents/Avatar';
import List from '../../muiComponents/List';
import { getAuthorName } from '../../utils/package';
class Authors extends Component {
public render(): ReactElement<HTMLElement> {
return (
<DetailContextConsumer>
{context => {
return context && context.packageMeta && this.renderAuthor(context.packageMeta);
}}
</DetailContextConsumer>
);
import { StyledText, AuthorListItem, AuthorListItemText } from './styles';
const Author: FC = () => {
const { packageMeta } = useContext(DetailContext);
const { t } = useTranslation();
if (!packageMeta) {
return null;
}
public renderLinkForMail(email: string, avatarComponent: ReactNode, packageName: string, version: string): ReactElement<HTMLElement> | ReactNode {
if (!email || isEmail(email) === false) {
return avatarComponent;
}
const { author, name: packageName, version } = packageMeta.latest;
return (
<a href={`mailto:${email}?subject=${packageName}@${version}`} target={'_top'}>
{avatarComponent}
</a>
);
if (!author) {
return null;
}
public renderAuthor = packageMeta => {
const { author, name: packageName, version } = packageMeta.latest;
const { email, name } = author;
if (!author) {
return null;
}
const avatarComponent = <Avatar alt={author.name} src={author.avatar} />;
const avatarComponent = <Avatar alt={author.name} src={author.avatar} />;
return (
<List subheader={<Heading variant={'subheading'}>{'Author'}</Heading>}>
<AuthorListItem>
{this.renderLinkForMail(author.email, avatarComponent, packageName, version)}
<ListItemText primary={author.name} />
</AuthorListItem>
</List>
);
};
}
return (
<List subheader={<StyledText variant={'subtitle1'}>{t('sidebar.author.title')}</StyledText>}>
<AuthorListItem button={true}>
{!email || !isEmail(email) ? (
avatarComponent
) : (
<a href={`mailto:${email}?subject=${packageName}@${version}`} target={'_top'}>
{avatarComponent}
</a>
)}
{name && <AuthorListItemText primary={getAuthorName(name)} />}
</AuthorListItem>
</List>
);
};
export default Authors;
export default Author;

View File

@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Author /> component should render the component in default state 1`] = `"<ul class=\\"MuiList-root-1 MuiList-padding-2 MuiList-subheader-4\\"><h3 class=\\"MuiTypography-root-5 MuiTypography-subheading-12 css-hyrz44 e1xuehjw0\\">Author</h3><li class=\\"MuiListItem-root-41 MuiListItem-default-44 MuiListItem-gutters-49 css-z8a2h0 e1xuehjw1\\"><a href=\\"mailto:verdaccio.user@verdaccio.org?subject=verdaccio@4.0.0\\" target=\\"_top\\"><div class=\\"MuiAvatar-root-53\\"><img alt=\\"verdaccio user\\" src=\\"https://www.gravatar.com/avatar/000000\\" class=\\"MuiAvatar-img-55\\"/></div></a><div class=\\"MuiListItemText-root-56\\"><span class=\\"MuiTypography-root-5 MuiTypography-subheading-12 MuiListItemText-primary-59\\">verdaccio user</span></div></li></ul>"`;
exports[`<Author /> component should render the component in default state 1`] = `"<ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-5wp24z-StyledText e1xuehjw0 MuiTypography-subtitle1\\">sidebar.author.title</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-1k45khb-AuthorListItem e1xuehjw1 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><a href=\\"mailto:verdaccio.user@verdaccio.org?subject=verdaccio@4.0.0\\" target=\\"_top\\"><div class=\\"MuiAvatar-root MuiAvatar-circle\\"><img alt=\\"verdaccio user\\" src=\\"https://www.gravatar.com/avatar/000000\\" class=\\"MuiAvatar-img\\"></div></a><div class=\\"MuiListItemText-root css-1cnlq5d-AuthorListItemText e1xuehjw2\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">verdaccio user</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul>"`;
exports[`<Author /> component should render the component when there is no author email 1`] = `"<ul class=\\"MuiList-root-62 MuiList-padding-63 MuiList-subheader-65\\"><h3 class=\\"MuiTypography-root-66 MuiTypography-subheading-73 css-hyrz44 e1xuehjw0\\">Author</h3><li class=\\"MuiListItem-root-102 MuiListItem-default-105 MuiListItem-gutters-110 css-z8a2h0 e1xuehjw1\\"><div class=\\"MuiAvatar-root-114\\"><img alt=\\"verdaccio user\\" src=\\"https://www.gravatar.com/avatar/000000\\" class=\\"MuiAvatar-img-116\\"/></div><div class=\\"MuiListItemText-root-117\\"><span class=\\"MuiTypography-root-66 MuiTypography-subheading-73 MuiListItemText-primary-120\\">verdaccio user</span></div></li></ul>"`;
exports[`<Author /> component should render the component when there is no author email 1`] = `"<ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-5wp24z-StyledText e1xuehjw0 MuiTypography-subtitle1\\">sidebar.author.title</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-1k45khb-AuthorListItem e1xuehjw1 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><div class=\\"MuiAvatar-root MuiAvatar-circle\\"><img alt=\\"verdaccio user\\" src=\\"https://www.gravatar.com/avatar/000000\\" class=\\"MuiAvatar-img\\"></div><div class=\\"MuiListItemText-root css-1cnlq5d-AuthorListItemText e1xuehjw2\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">verdaccio user</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul>"`;

View File

@@ -1,16 +1,22 @@
import styled from 'react-emotion';
import ListItem from '@material-ui/core/ListItem';
import Typography from '@material-ui/core/Typography';
import styled from '@emotion/styled';
export const Heading = styled(Typography)`
&& {
font-weight: 700;
text-transform: capitalize;
}
`;
export const AuthorListItem = styled(ListItem)`
&& {
padding-left: 0;
padding-right: 0;
}
`;
import ListItem from '../../muiComponents/ListItem';
import Text from '../../muiComponents/Text';
import ListItemText from '../../muiComponents/ListItemText';
import { Theme } from '../../design-tokens/theme';
export const StyledText = styled(Text)<{ theme?: Theme }>(props => ({
fontWeight: props.theme && props.theme.fontWeight.bold,
}));
export const AuthorListItem = styled(ListItem)({
padding: 0,
':hover': {
backgroundColor: 'transparent',
},
});
export const AuthorListItemText = styled(ListItemText)({
padding: '0 10px',
margin: 0,
});

View File

@@ -1,36 +1,48 @@
import React, { KeyboardEvent } from 'react';
import { css } from 'emotion';
import Autosuggest from 'react-autosuggest';
import React, { KeyboardEvent, memo } from 'react';
import styled from '@emotion/styled';
import Autosuggest, { SuggestionSelectedEventData, InputProps, ChangeEvent } from 'react-autosuggest';
import match from 'autosuggest-highlight/match';
import parse from 'autosuggest-highlight/parse';
import MenuItem from '@material-ui/core/MenuItem';
import { useTranslation } from 'react-i18next';
import MenuItem from '../../muiComponents/MenuItem';
import { Theme } from '../../design-tokens/theme';
import { fontWeight } from '../../utils/styles/sizes';
import { Wrapper, InputField, SuggestionContainer } from './styles';
const StyledAnchor = styled('a')<{ highlight: boolean; theme?: Theme }>(props => ({
fontWeight: props.theme && props.highlight ? props.theme.fontWeight.semiBold : props.theme.fontWeight.light,
}));
const StyledMenuItem = styled(MenuItem)({
cursor: 'pointer',
});
interface Props {
suggestions: unknown[];
suggestionsLoading?: boolean;
suggestionsLoaded?: boolean;
suggestionsError?: boolean;
apiLoading?: boolean;
color?: string;
value?: string;
placeholder?: string;
startAdornment?: JSX.Element;
disableUnderline?: boolean;
onChange?: (event: KeyboardEvent<HTMLInputElement>, { newValue, method }: { newValue: string; method: string }) => void;
onSuggestionsFetch?: ({ value: string }) => Promise<void>;
onChange: (event: React.FormEvent<HTMLInputElement>, params: ChangeEvent) => void;
onSuggestionsFetch: ({ value: string }) => Promise<void>;
onCleanSuggestions?: () => void;
onClick?: (event: KeyboardEvent<HTMLInputElement>, { suggestionValue, method }: { suggestionValue: string[]; method: string }) => void;
onClick?: (event: React.FormEvent<HTMLInputElement>, data: SuggestionSelectedEventData<unknown>) => void;
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
onBlur?: (event: KeyboardEvent<HTMLInputElement>) => void;
onBlur?: (event: React.FormEvent<HTMLInputElement>) => void;
}
/* eslint-disable react/jsx-sort-props */
/* eslint-disable verdaccio/jsx-spread */
const renderInputComponent = (inputProps): JSX.Element => {
const { ref, startAdornment, disableUnderline, onKeyDown, ...others } = inputProps;
return (
<InputField
fullWidth={true}
InputProps={{
inputRef: node => {
ref(node);
@@ -39,7 +51,6 @@ const renderInputComponent = (inputProps): JSX.Element => {
disableUnderline,
onKeyDown,
}}
fullWidth={true}
{...others}
/>
);
@@ -51,23 +62,17 @@ const renderSuggestion = (suggestion, { query, isHighlighted }): JSX.Element =>
const matches = match(suggestion.name, query);
const parts = parse(suggestion.name, matches);
return (
<MenuItem component="div" selected={isHighlighted}>
<StyledMenuItem component="div" selected={isHighlighted}>
<div>
{parts.map((part, index) => {
const fw = part.highlight ? fontWeight.semiBold : fontWeight.light;
return (
<a
className={css`
font-weight: ${fw};
`}
href={suggestion.link}
key={String(index)}>
<StyledAnchor highlight={part.highlight} key={String(index)}>
{part.text}
</a>
</StyledAnchor>
);
})}
</div>
</MenuItem>
</StyledMenuItem>
);
};
@@ -79,65 +84,68 @@ const renderMessage = (message): JSX.Element => {
);
};
const SUGGESTIONS_RESPONSE = {
LOADING: 'Loading...',
FAILURE: 'Something went wrong.',
NO_RESULT: 'No results found.',
};
const AutoComplete = ({
suggestions,
startAdornment,
onChange,
onSuggestionsFetch,
onCleanSuggestions,
value = '',
placeholder = '',
disableUnderline = false,
color,
onClick,
onKeyDown,
onBlur,
suggestionsLoading = false,
suggestionsLoaded = false,
suggestionsError = false,
}: Props): JSX.Element => {
const autosuggestProps = {
renderInputComponent,
const AutoComplete = memo(
({
suggestions,
getSuggestionValue,
renderSuggestion,
onSuggestionsFetchRequested: onSuggestionsFetch,
onSuggestionsClearRequested: onCleanSuggestions,
};
const inputProps = {
value,
onChange,
placeholder,
startAdornment,
disableUnderline,
color,
onChange,
onSuggestionsFetch,
onCleanSuggestions,
value = '',
placeholder = '',
disableUnderline = false,
onClick,
onKeyDown,
onBlur,
};
suggestionsLoading = false,
suggestionsLoaded = false,
suggestionsError = false,
}: Props) => {
const { t } = useTranslation();
const autosuggestProps = {
renderInputComponent,
suggestions,
getSuggestionValue,
renderSuggestion,
onSuggestionsFetchRequested: onSuggestionsFetch,
onSuggestionsClearRequested: onCleanSuggestions,
};
const inputProps: InputProps<unknown> = {
value,
onChange,
placeholder,
// material-ui@4.5.1 introduce better types for TextInput, check readme
// @ts-ignore
startAdornment,
disableUnderline,
onKeyDown,
onBlur,
};
// this format avoid arrow function eslint rule
function renderSuggestionsContainer({ containerProps, children, query }): JSX.Element {
return (
<SuggestionContainer {...containerProps} square={true}>
{suggestionsLoaded && children === null && query && renderMessage(t('auto-complete.no-results-found'))}
{suggestionsLoading && query && renderMessage(t('auto-complete.loading'))}
{suggestionsError && renderMessage(t('error.unspecific'))}
{children}
</SuggestionContainer>
);
}
// this format avoid arrow function eslint rule
function renderSuggestionsContainer({ containerProps, children, query }): JSX.Element {
return (
<SuggestionContainer {...containerProps} square={true}>
{suggestionsLoaded && children === null && query && renderMessage(SUGGESTIONS_RESPONSE.NO_RESULT)}
{suggestionsLoading && query && renderMessage(SUGGESTIONS_RESPONSE.LOADING)}
{suggestionsError && renderMessage(SUGGESTIONS_RESPONSE.FAILURE)}
{children}
</SuggestionContainer>
<Wrapper>
<Autosuggest
{...autosuggestProps}
inputProps={inputProps}
onSuggestionSelected={onClick}
renderSuggestionsContainer={renderSuggestionsContainer}
/>
</Wrapper>
);
}
return (
<Wrapper>
<Autosuggest {...autosuggestProps} inputProps={inputProps} onSuggestionSelected={onClick} renderSuggestionsContainer={renderSuggestionsContainer} />
</Wrapper>
);
};
);
export default AutoComplete;

View File

@@ -1,59 +1,44 @@
import React from 'react';
import styled, { css } from 'react-emotion';
import Paper from '@material-ui/core/Paper';
import styled from '@emotion/styled';
import TextField from '../TextField';
import TextField from '../../muiComponents/TextField';
import Paper from '../../muiComponents/Paper';
import { Theme } from '../../design-tokens/theme';
export interface InputFieldProps {
color: string;
}
export const Wrapper = styled('div')`
&& {
width: 100%;
height: 32px;
position: relative;
z-index: 1;
}
`;
export const Wrapper = styled('div')({
width: '100%',
height: '32px',
position: 'relative',
zIndex: 1,
});
export const InputField: React.FC<InputFieldProps> = ({ color, ...others }) => (
<TextField
{...others}
classes={{
// @ts-ignore
input: css`
&& {
${color &&
css`
color: ${color};
`};
}
`,
root: css`
&& {
&:before {
content: '';
border: none;
}
&:after {
${color &&
css`
border-color: ${color};
`};
}
&:hover:before {
content: none;
}
}
`,
}}
/>
);
export const StyledTextField = styled(TextField)<{ theme?: Theme }>(props => ({
'& .MuiInputBase-root': {
':before': {
content: "''",
border: 'none',
},
':after': {
borderColor: props.theme && props.theme.palette.white,
},
':hover:before': {
content: 'none',
},
},
'& .MuiInputBase-input': {
color: props.theme && props.theme.palette.white,
},
}));
export const SuggestionContainer = styled(Paper)`
&& {
max-height: 500px;
overflow-y: auto;
}
`;
/* eslint-disable verdaccio/jsx-spread */
// @ts-ignore types of color are incompatible
export const InputField: React.FC<InputFieldProps> = ({ ...others }) => <StyledTextField {...others} />;
export const SuggestionContainer = styled(Paper)({
maxHeight: '500px',
overflowY: 'auto',
});

View File

@@ -1,38 +1,28 @@
import React from 'react';
import { shallow } from 'enzyme';
import { ReactWrapper } from 'enzyme';
import { copyToClipBoardUtility } from '../../utils/cli-utils';
import { mount } from '../../utils/test-enzyme';
import CopyToClipBoard from './CopyToClipBoard';
import { CopyIcon } from './styles';
jest.mock('../../utils/cli-utils');
describe('<CopyToClipBoard /> component', () => {
let wrapper;
let wrapper: ReactWrapper;
const copyText = 'copy text';
beforeEach(() => {
wrapper = shallow(<CopyToClipBoard text={'copy text'} />);
wrapper = mount(<CopyToClipBoard text={copyText} />);
});
test('render the component', () => {
test('should load the component in default state', () => {
expect(wrapper.html()).toMatchSnapshot();
});
test('should call the DOM APIs for copy to clipboard utility', () => {
const event = {
preventDefault: jest.fn(),
};
// @ts-ignore: Property 'getSelection' does not exist on type 'Global'.
global.getSelection = jest.fn(() => ({
removeAllRanges: () => {},
addRange: () => {},
}));
// @ts-ignore: Property 'document/getSelection' does not exist on type 'Global'.
const { document, getSelection } = global;
wrapper.find(CopyIcon).simulate('click', event);
expect(event.preventDefault).toHaveBeenCalled();
expect(document.createRange).toHaveBeenCalled();
expect(getSelection).toHaveBeenCalled();
expect(document.execCommand).toHaveBeenCalledWith('copy');
test('should call the copyToClipBoardUtility for copy to clipboard utility', () => {
wrapper.find(CopyIcon).simulate('click');
expect(copyToClipBoardUtility).toHaveBeenCalledWith(copyText);
});
});

View File

@@ -1,9 +1,9 @@
import Tooltip from '@material-ui/core/Tooltip';
import FileCopy from '@material-ui/icons/FileCopy';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { copyToClipBoardUtility } from '../../utils/cli-utils';
import { TEXT } from '../../utils/constants';
import Tooltip from '../../muiComponents/Tooltip';
import { ClipBoardCopy, ClipBoardCopyText, CopyIcon } from './styles';
@@ -12,7 +12,7 @@ interface Props {
children?: React.ReactNode;
}
const renderText = (text, children): JSX.Element => {
const renderText = (text: string, children: React.ReactNode): JSX.Element => {
if (children) {
return <ClipBoardCopyText>{children}</ClipBoardCopyText>;
}
@@ -20,19 +20,16 @@ const renderText = (text, children): JSX.Element => {
return <ClipBoardCopyText>{text}</ClipBoardCopyText>;
};
const renderToolTipFileCopy = (text: string): React.ReactElement<HTMLElement> => (
<Tooltip disableFocusListener={true} title={TEXT.CLIPBOARD_COPY}>
<CopyIcon onClick={copyToClipBoardUtility(text)}>
<FileCopy />
</CopyIcon>
</Tooltip>
);
const CopyToClipBoard: React.FC<Props> = ({ text, children }) => {
const { t } = useTranslation();
return (
<ClipBoardCopy>
{renderText(text, children)}
{renderToolTipFileCopy(text)}
<Tooltip disableFocusListener={true} title={t('copy-to-clipboard')}>
<CopyIcon onClick={copyToClipBoardUtility(text)}>
<FileCopy />
</CopyIcon>
</Tooltip>
</ClipBoardCopy>
);
};

View File

@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<CopyToClipBoard /> component render the component 1`] = `"<div class=\\"css-1mta3t8 eb8w2fo0\\"><span class=\\"css-1m8aenu eb8w2fo1\\">copy text</span><button class=\\"MuiButtonBase-root-15 MuiIconButton-root-9 css-56v3u0 eb8w2fo2\\" tabindex=\\"0\\" type=\\"button\\" title=\\"Copy to Clipboard\\"><span class=\\"MuiIconButton-label-14\\"><svg class=\\"MuiSvgIcon-root-18\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path fill=\\"none\\" d=\\"M0 0h24v24H0z\\"></path><path d=\\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z\\"></path></svg></span></button></div>"`;
exports[`<CopyToClipBoard /> component should load the component in default state 1`] = `"<div class=\\"css-1in239f-ClipBoardCopy eb8w2fo0\\"><span class=\\"css-7gar9h-ClipBoardCopyText eb8w2fo1\\">copy text</span><button class=\\"MuiButtonBase-root MuiIconButton-root css-1fs86cq-CopyIcon eb8w2fo2\\" tabindex=\\"0\\" type=\\"button\\" title=\\"copy-to-clipboard\\"><span class=\\"MuiIconButton-label\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path d=\\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z\\"></path></svg></span><span class=\\"MuiTouchRipple-root\\"></span></button></div>"`;

View File

@@ -1,26 +1,20 @@
import IconButton from '@material-ui/core/IconButton';
import styled from 'react-emotion';
import styled from '@emotion/styled';
export const ClipBoardCopy = styled('div')`
&& {
display: flex;
align-items: center;
justify-content: space-between;
}
`;
import IconButton from '../../muiComponents/IconButton';
export const ClipBoardCopyText = styled('span')`
&& {
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
height: 21px;
}
`;
export const ClipBoardCopy = styled('div')({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
});
export const CopyIcon = styled(IconButton)`
&& {
margin: 0 0 0 10px;
}
`;
export const ClipBoardCopyText = styled('span')({
display: 'inline-block',
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
height: '21px',
fontSize: '1rem',
});
export const CopyIcon = styled(IconButton)({});

View File

@@ -0,0 +1,92 @@
import React from 'react';
import { HashRouter } from 'react-router-dom';
import { DetailContextProvider } from '../../pages/Version';
import { render } from '../../utils/test-react-testing-library';
import Dependencies from './Dependencies';
describe('<Dependencies /> component', () => {
test('Renders a message when there are no dependencies', () => {
// Given
const packageMeta = {
latest: {
name: 'verdaccio',
version: '4.0.0',
author: {
name: 'verdaccio user',
email: 'verdaccio.user@verdaccio.org',
url: '',
avatar: 'https://www.gravatar.com/avatar/000000',
},
dist: { fileCount: 0, unpackedSize: 0 },
dependencies: {},
devDependencies: {},
peerDependencies: {},
},
_uplinks: {},
};
// When
const { getByText } = render(
<DetailContextProvider value={{ packageMeta }}>
<Dependencies />
</DetailContextProvider>
);
// Then
expect(getByText('verdaccio has no dependencies.')).toBeDefined();
});
test('Renders a link to each dependency', () => {
// Given
const packageMeta = {
latest: {
name: 'verdaccio',
version: '4.0.0',
author: {
name: 'verdaccio user',
email: 'verdaccio.user@verdaccio.org',
url: '',
avatar: 'https://www.gravatar.com/avatar/000000',
},
dist: { fileCount: 0, unpackedSize: 0 },
dependencies: {
react: '16.9.0',
'react-dom': '16.9.0',
},
devDependencies: {
'babel-core': '7.0.0-beta6',
},
peerDependencies: {
'styled-components': '5.0.0',
},
},
_uplinks: {},
};
// When
const { getByText } = render(
<HashRouter>
<DetailContextProvider value={{ packageMeta }}>
<Dependencies />
</DetailContextProvider>
</HashRouter>
);
// Then
// FIXME: currently MaterialUI chips do not support the children
// prop, therefore it is impossible to use proper links for
// dependencies. Those are for now clickable spans
expect(getByText('dependencies (2)')).toBeDefined();
expect(getByText('react@16.9.0').tagName).toBe('SPAN');
expect(getByText('react-dom@16.9.0').tagName).toBe('SPAN');
expect(getByText('devDependencies (1)')).toBeDefined();
expect(getByText('babel-core@7.0.0-beta6').tagName).toBe('SPAN');
expect(getByText('peerDependencies (1)')).toBeDefined();
expect(getByText('styled-components@5.0.0').tagName).toBe('SPAN');
});
});

View File

@@ -1,119 +1,87 @@
import React, { Component, Fragment, ReactElement } from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import CardContent from '@material-ui/core/CardContent';
import React, { useContext } from 'react';
import { useHistory } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
import { CardWrap, Heading, Tags, Tag } from './styles';
import CardContent from '../../muiComponents/CardContent';
import { PackageDependencies } from '../../../types/packageMeta';
import { DetailContext } from '../../pages/Version';
import NoItems from '../NoItems';
type DepDetailProps = {
name: string;
version: string;
onLoading?: () => void;
} & RouteComponentProps;
import { CardWrap, StyledText, Tags, Tag } from './styles';
interface DepDetailState {
name: string;
version: string;
interface DependencyBlockProps {
title: string;
dependencies: PackageDependencies;
}
class DepDetail extends Component<DepDetailProps, DepDetailState> {
constructor(props: DepDetailProps) {
super(props);
const { name, version } = this.props;
const DependencyBlock: React.FC<DependencyBlockProps> = ({ title, dependencies }) => {
const { enableLoading } = useContext(DetailContext);
const history = useHistory();
const { t } = useTranslation();
this.state = {
name,
version,
};
}
const deps = Object.entries(dependencies);
public render(): ReactElement<HTMLElement> {
const { name, version } = this.state;
const tagText = `${name}@${version}`;
return <Tag className={'dep-tag'} clickable={true} component={'div'} label={tagText} onClick={this.handleOnClick} />;
}
function handleClick(name: string): void {
enableLoading && enableLoading();
private handleOnClick = () => {
const { name } = this.state;
const { onLoading, history } = this.props;
onLoading && onLoading();
history.push(`/-/web/detail/${name}`);
};
}
return (
<CardWrap>
<CardContent>
<StyledText variant="subtitle1">{`${title} (${deps.length})`}</StyledText>
<Tags>
{deps.map(([name, version]) => (
<Tag
className={'dep-tag'}
clickable={true}
key={name}
label={t('dependencies.dependency-block', { package: name, version })}
// eslint-disable-next-line
onClick={() => handleClick(name)}
/>
))}
</Tags>
</CardContent>
</CardWrap>
);
};
function hasKeys(object?: { [key: string]: any }): boolean {
return !!object && Object.keys(object).length > 0;
}
const WrapperDependencyDetail = withRouter(DepDetail);
const Dependencies: React.FC<{}> = () => {
const { packageMeta } = useContext(DetailContext);
const { t } = useTranslation();
class DependencyBlock extends Component<{ title: string; dependencies: [] }> {
public render(): ReactElement<HTMLElement> {
const { dependencies, title } = this.props;
const deps = Object.entries(dependencies) as [];
if (!packageMeta) {
throw new Error(t('error.package-meta-is-required-at-detail-context'));
}
const { latest } = packageMeta;
// FIXME: add dependencies to package meta type
// @ts-ignore
const { dependencies, devDependencies, peerDependencies, name } = latest;
const dependencyMap = { dependencies, devDependencies, peerDependencies };
const hasDependencies = hasKeys(dependencies) || hasKeys(devDependencies) || hasKeys(peerDependencies);
if (hasDependencies) {
return (
<DetailContextConsumer>
{({ enableLoading }) => {
return (
<CardWrap>
<CardContent>
<Heading variant="subheading">{`${title} (${deps.length})`}</Heading>
<Tags>{this.renderTags(deps, enableLoading)}</Tags>
</CardContent>
</CardWrap>
);
}}
</DetailContextConsumer>
<>
{Object.entries(dependencyMap).map(([dependencyType, dependencies]) => {
if (!dependencies || Object.keys(dependencies).length === 0) {
return null;
}
return <DependencyBlock dependencies={dependencies} key={dependencyType} title={dependencyType} />;
})}
</>
);
}
private renderTags = (deps: [], enableLoading?: () => void) =>
deps.map(dep => {
const [name, version] = dep as [string, string];
return <WrapperDependencyDetail key={name} name={name} onLoading={enableLoading} version={version} />;
});
}
class Dependencies extends Component {
public state = {
tabPosition: 0,
};
public render(): ReactElement<HTMLElement> {
return (
<DetailContextConsumer>
{packageMeta => {
return this.renderDependencies(packageMeta as VersionPageConsumerProps);
}}
</DetailContextConsumer>
);
}
private checkDependencyLength<T>(dependency: Record<string, T> = {}): boolean {
return Object.keys(dependency).length > 0;
}
private renderDependencies({ packageMeta }): ReactElement<HTMLElement> {
const { latest } = packageMeta;
const { dependencies, devDependencies, peerDependencies, name } = latest;
const dependencyMap = { dependencies, devDependencies, peerDependencies };
const dependencyList = Object.keys(dependencyMap).reduce((result, value, key) => {
const selectedDepndency = dependencyMap[value];
if (selectedDepndency && this.checkDependencyLength(selectedDepndency)) {
// @ts-ignore
result.push(<DependencyBlock className="dependency-block" dependencies={selectedDepndency} key={key} title={value} />);
}
return result;
}, []);
if (dependencyList.length) {
return <Fragment>{dependencyList}</Fragment>;
}
return <NoItems className="no-dependencies" text={`${name} has no dependencies.`} />;
}
}
return <NoItems className="no-dependencies" text={t('dependencies.has-no-dependencies', { package: name })} />;
};
export default Dependencies;

View File

@@ -1,32 +1,26 @@
import styled from 'react-emotion';
import Card from '@material-ui/core/Card';
import Typography from '@material-ui/core/Typography';
import Chip from '@material-ui/core/Chip';
import styled from '@emotion/styled';
export const CardWrap = styled(Card)`
&& {
margin: 0 0 16px;
}
`;
import Text from '../../muiComponents/Text';
import Card from '../../muiComponents/Card';
import Chip from '../../muiComponents/Chip';
import { Theme } from '../../design-tokens/theme';
export const Heading = styled(Typography)`
&& {
font-weight: 700;
text-transform: capitalize;
}
`;
export const CardWrap = styled(Card)({
margin: '0 0 16px',
});
export const Tags = styled('div')`
&& {
display: flex;
justify-content: start;
flex-wrap: wrap;
margin: 0 -5px;
}
`;
export const StyledText = styled(Text)<{ theme?: Theme }>(props => ({
fontWeight: props.theme && props.theme.fontWeight.bold,
textTransform: 'capitalize',
}));
export const Tag = styled(Chip)`
&& {
margin: 5px;
}
`;
export const Tags = styled('div')({
display: 'flex',
justifyContent: 'start',
flexWrap: 'wrap',
margin: '0 -5px',
});
export const Tag = styled(Chip)({
margin: '5px',
});

View File

@@ -0,0 +1,13 @@
import React from 'react';
import { render } from '../../utils/test-react-testing-library';
import DetailContainer from './DetailContainer';
describe('DetailContainer', () => {
test('renders correctly', () => {
const { container } = render(<DetailContainer />);
expect(container.firstChild).toMatchSnapshot();
});
test.todo('should test click on tabs');
});

View File

@@ -1,72 +1,28 @@
import React, { Component, ReactElement, Fragment } from 'react';
import React, { useState, useContext } from 'react';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
import Readme from '../Readme';
import Versions from '../Versions';
import { preventXSS } from '../../utils/sec-utils';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import { Content } from './styles';
import Dependencies from '../Dependencies';
import UpLinks from '../UpLinks';
import { DetailContext } from '../../pages/Version';
import Box from '../../muiComponents/Box';
interface DetailContainerState {
tabPosition: number;
}
import DetailContainerTabs from './DetailContainerTabs';
import DetailContainerContent from './DetailContainerContent';
import { TabPosition } from './tabs';
class DetailContainer<P> extends Component<P, DetailContainerState> {
public state = {
tabPosition: 0,
const DetailContainer: React.FC = () => {
const tabs = Object.values(TabPosition);
const [tabPosition, setTabPosition] = useState(0);
const detailContext = useContext(DetailContext);
const { readMe } = detailContext;
const handleChange = (event, newValue) => {
setTabPosition(newValue);
};
public render(): ReactElement<HTMLElement> {
return (
<DetailContextConsumer>
{context => {
return this.renderTabs(context as VersionPageConsumerProps);
}}
</DetailContextConsumer>
);
}
private handleChange = (event: React.ChangeEvent<{}>, tabPosition: number) => {
event.preventDefault();
this.setState({ tabPosition });
};
private renderListTabs(tabPosition: number): React.ReactElement<HTMLElement> {
return (
<Tabs indicatorColor={'primary'} onChange={this.handleChange} textColor={'primary'} value={tabPosition} variant={'fullWidth'}>
<Tab id={'readme-tab'} label={'Readme'} />
<Tab id={'dependencies-tab'} label={'Dependencies'} />
<Tab id={'versions-tab'} label={'Versions'} />
<Tab id={'uplinks-tab'} label={'Uplinks'} />
</Tabs>
);
}
private renderTabs = ({ readMe }) => {
const { tabPosition } = this.state;
return (
<Fragment>
<Content>
{this.renderListTabs(tabPosition)}
<br />
{tabPosition === 0 && this.renderReadme(readMe)}
{tabPosition === 1 && <Dependencies />}
{tabPosition === 2 && <Versions />}
{tabPosition === 3 && <UpLinks />}
</Content>
</Fragment>
);
};
private renderReadme = (readMe: string): ReactElement<HTMLElement> => {
const encodedReadme = preventXSS(readMe);
return <Readme description={encodedReadme} />;
};
}
return (
<Box component="div" display="flex" flexDirection="column" padding={2}>
<DetailContainerTabs onChange={handleChange} tabPosition={tabPosition} />
<DetailContainerContent readDescription={readMe} tabPosition={tabs[tabPosition]} />
</Box>
);
};
export default DetailContainer;

View File

@@ -0,0 +1,30 @@
import React from 'react';
import Dependencies from '../Dependencies';
import UpLinks from '../UpLinks';
import Versions from '../Versions';
import DetailContainerContentReadme from './DetailContainerContentReadme';
import { TabPosition } from './tabs';
interface Props {
tabPosition: TabPosition;
readDescription?: string;
}
const DetailContainerContent: React.FC<Props> = ({ tabPosition, readDescription }) => {
switch (tabPosition) {
case TabPosition.README:
return <DetailContainerContentReadme description={readDescription} />;
case TabPosition.UPLINKS:
return <UpLinks />;
case TabPosition.VERSIONS:
return <Versions />;
case TabPosition.DEPENDENCIES:
return <Dependencies />;
default:
return null;
}
};
export default DetailContainerContent;

View File

@@ -0,0 +1,16 @@
import React from 'react';
import { preventXSS } from '../../utils/sec-utils';
import Readme from '../Readme';
interface Props {
description?: string;
}
const DetailContainerContentReadme: React.FC<Props> = ({ description }) => {
if (!description) return null;
const encodedReadme = preventXSS(description);
return <Readme description={encodedReadme} />;
};
export default DetailContainerContentReadme;

View File

@@ -0,0 +1,31 @@
import React from 'react';
import styled from '@emotion/styled';
import { useTranslation } from 'react-i18next';
import { default as MuiTabs } from '../../muiComponents/Tabs';
import Tab from '../../muiComponents/Tab';
import { Theme } from '../../design-tokens/theme';
interface Props {
onChange: (event, newValue) => void;
tabPosition: number;
}
const DetailContainerTabs: React.FC<Props> = ({ tabPosition, onChange }) => {
const { t } = useTranslation();
return (
<Tabs color={'primary'} indicatorColor={'primary'} onChange={onChange} value={tabPosition} variant={'fullWidth'}>
<Tab data-testid={'readme-tab'} id={'readme-tab'} label={t('tab.readme')} />
<Tab data-testid={'dependencies-tab'} id={'dependencies-tab'} label={t('tab.dependencies')} />
<Tab data-testid={'versions-tab'} id={'versions-tab'} label={t('tab.versions')} />
<Tab data-testid={'uplinks-tab'} id={'uplinks-tab'} label={t('tab.uplinks')} />
</Tabs>
);
};
export default DetailContainerTabs;
const Tabs = styled(MuiTabs)<{ theme?: Theme }>({
marginBottom: 16,
});

View File

@@ -0,0 +1,103 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DetailContainer renders correctly 1`] = `
.emotion-0 {
margin-bottom: 16px;
}
<div
class="MuiBox-root MuiBox-root-2"
>
<div
class="MuiTabs-root emotion-0 emotion-1"
color="primary"
>
<div
class="MuiTabs-scroller MuiTabs-fixed"
style="overflow: hidden;"
>
<div
class="MuiTabs-flexContainer"
role="tablist"
>
<button
aria-selected="true"
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit Mui-selected MuiTab-fullWidth"
data-testid="readme-tab"
id="readme-tab"
role="tab"
tabindex="0"
type="button"
>
<span
class="MuiTab-wrapper"
>
Readme
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
<button
aria-selected="false"
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit MuiTab-fullWidth"
data-testid="dependencies-tab"
id="dependencies-tab"
role="tab"
tabindex="0"
type="button"
>
<span
class="MuiTab-wrapper"
>
Dependencies
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
<button
aria-selected="false"
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit MuiTab-fullWidth"
data-testid="versions-tab"
id="versions-tab"
role="tab"
tabindex="0"
type="button"
>
<span
class="MuiTab-wrapper"
>
Versions
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
<button
aria-selected="false"
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit MuiTab-fullWidth"
data-testid="uplinks-tab"
id="uplinks-tab"
role="tab"
tabindex="0"
type="button"
>
<span
class="MuiTab-wrapper"
>
Uplinks
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
</div>
<span
class="PrivateTabIndicator-root-27 PrivateTabIndicator-colorPrimary-28 MuiTabs-indicator"
style="left: 0px; width: 0px;"
/>
</div>
</div>
</div>
`;

View File

@@ -1,7 +0,0 @@
import styled from 'react-emotion';
export const Content = styled('div')`
&& {
padding: 15px;
}
`;

View File

@@ -0,0 +1,6 @@
export enum TabPosition {
README = 'readme',
DEPENDENCIES = 'dependencies',
VERSIONS = 'versions',
UPLINKS = 'uplinks',
}

View File

@@ -1,7 +0,0 @@
import { ReactNode } from 'react';
export interface Props {
children: ReactNode;
open: boolean;
onClose: () => void;
}

View File

@@ -1,87 +1,52 @@
import React, { Component, ReactElement } from 'react';
import React, { useContext } from 'react';
import styled from '@emotion/styled';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import List from '@material-ui/core/List';
import ActionBar from '../ActionBar/ActionBar';
import Author from '../Author';
import Developers from '../Developers';
import Dist from '../Dist/Dist';
import Engine from '../Engines/Engines';
import { DetailContext } from '../../pages/Version';
import Paper from '../../muiComponents/Paper';
import ActionBar from '../ActionBar';
import Repository from '../Repository';
import Engines from '../Engines';
import Dist from '../Dist';
import Install from '../Install';
import Repository from '../Repository/Repository';
import Author from '../Author';
import Developers, { DeveloperType } from '../Developers';
import { Theme } from '../../design-tokens/theme';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
import DetailSidebarTitle from './DetailSidebarTitle';
import DetailSidebarFundButton from './DetailSidebarFundButton';
import { TitleListItem, TitleListItemText } from './styles';
const DetailSidebar: React.FC = () => {
const detailContext = useContext(DetailContext);
class DetailSidebar extends Component {
public render(): ReactElement<HTMLElement> {
return <DetailContextConsumer>{context => this.renderSideBar(context as VersionPageConsumerProps)}</DetailContextConsumer>;
const { packageMeta, packageName, packageVersion } = detailContext;
if (!packageMeta || !packageName) {
return null;
}
private renderSideBar = ({ packageName, packageMeta }): ReactElement<HTMLElement> => {
return (
<div className={'sidebar-info'}>
<Card>
<CardContent>
{this.renderTitle(packageName, packageMeta)}
{this.renderActionBar()}
{this.renderCopyCLI()}
{this.renderRepository()}
{this.renderEngine()}
{this.renderDist()}
{this.renderAuthor()}
{this.renderMaintainers()}
{this.renderContributors()}
</CardContent>
</Card>
</div>
);
};
private renderTitle = (packageName, packageMeta) => {
return (
<List className="detail-info">
<TitleListItem alignItems="flex-start">
<TitleListItemText primary={<b>{packageName}</b>} secondary={packageMeta.latest.description} />
</TitleListItem>
</List>
);
};
private renderCopyCLI = () => {
return <Install />;
};
private renderMaintainers = () => {
return <Developers type="maintainers" />;
};
private renderContributors = () => {
return <Developers type="contributors" />;
};
private renderRepository = () => {
return <Repository />;
};
private renderAuthor = () => {
return <Author />;
};
private renderEngine = () => {
return <Engine />;
};
private renderDist = () => {
return <Dist />;
};
private renderActionBar = () => {
return <ActionBar />;
};
}
return (
<StyledPaper className={'sidebar-info'}>
<DetailSidebarTitle
description={packageMeta.latest?.description}
isLatest={typeof packageVersion === 'undefined'}
packageName={packageName}
version={packageVersion || packageMeta.latest.version}
/>
<ActionBar />
<Install />
<DetailSidebarFundButton />
<Repository />
<Engines />
<Dist />
<Author />
<Developers type={DeveloperType.MAINTAINERS} />
<Developers type={DeveloperType.CONTRIBUTORS} />
</StyledPaper>
);
};
export default DetailSidebar;
const StyledPaper = styled(Paper)<{ theme?: Theme }>(({ theme }) => ({
padding: theme?.spacing(3, 2),
}));

View File

@@ -0,0 +1,103 @@
import React from 'react';
import _ from 'lodash';
import { render } from '../../utils/test-react-testing-library';
import { DetailContext, DetailContextProps } from '../../pages/Version';
import DetailSidebarFundButton from './DetailSidebarFundButton';
const ComponentToBeRendered: React.FC<{ contextValue: DetailContextProps }> = ({ contextValue }) => (
<DetailContext.Provider value={contextValue}>
<DetailSidebarFundButton />
</DetailContext.Provider>
);
const detailContextValue: DetailContextProps = {
packageName: 'foo',
readMe: 'test',
enableLoading: () => {},
isLoading: false,
hasNotBeenFound: false,
packageMeta: {
_uplinks: {},
latest: {
name: '@verdaccio/local-storage',
version: '8.0.1-next.1',
dist: { fileCount: 0, unpackedSize: 0, tarball: 'http://localhost:8080/bootstrap/-/bootstrap-4.3.1.tgz' },
homepage: 'https://verdaccio.org',
bugs: {
url: 'https://github.com/verdaccio/monorepo/issues',
},
},
},
};
describe('test DetailSidebarFundButton', () => {
test('should not display the button if fund is missing', () => {
const wrapper = render(<ComponentToBeRendered contextValue={detailContextValue} />);
expect(wrapper.queryByText('Fund')).toBeNull();
});
test('should not display the button if url is missing', () => {
const value = _.merge(detailContextValue, {
packageMeta: {
latest: {
funding: {},
},
},
});
const wrapper = render(<ComponentToBeRendered contextValue={value} />);
expect(wrapper.queryByText('Fund')).toBeNull();
});
test('should not display the button if url is not a string', () => {
const value = _.merge(detailContextValue, {
packageMeta: {
latest: {
funding: {
url: null,
},
},
},
});
const wrapper = render(<ComponentToBeRendered contextValue={value} />);
expect(wrapper.queryByText('Fund')).toBeNull();
});
test('should not display the button if url is not an url', () => {
const value = _.merge(detailContextValue, {
packageMeta: {
latest: {
funding: {
url: 'somethign different as url',
},
},
},
});
const wrapper = render(<ComponentToBeRendered contextValue={value} />);
expect(wrapper.queryByText('Fund')).toBeNull();
});
test('should display the button if url is a valid url', () => {
const value = _.merge(detailContextValue, {
packageMeta: {
latest: {
funding: {
url: 'https://opencollective.com/verdaccio',
},
},
},
});
const wrapper = render(<ComponentToBeRendered contextValue={value} />);
expect(wrapper.getByText('Fund')).toBeTruthy();
});
});

View File

@@ -0,0 +1,48 @@
import React, { useContext } from 'react';
import styled from '@emotion/styled';
import Favorite from '@material-ui/icons/Favorite';
import { Trans } from 'react-i18next';
import Button from '../../muiComponents/Button';
import Link from '../Link';
import { isURL } from '../../utils/url';
import { Theme } from '../../design-tokens/theme';
import { DetailContext } from '../../pages/Version';
const StyledLink = styled(Link)<{ theme?: Theme }>(({ theme }) => ({
marginTop: theme && theme.spacing(1),
marginBottom: theme && theme.spacing(1),
textDecoration: 'none',
display: 'block',
}));
const StyledFavoriteIcon = styled(Favorite)<{ theme?: Theme }>(({ theme }) => ({
color: theme && theme.palette.orange,
}));
const StyledFundStrong = styled('strong')({
marginRight: 3,
});
/* eslint-disable react/jsx-no-bind */
const DetailSidebarFundButton: React.FC = () => {
const detailContext = useContext(DetailContext);
const { packageMeta } = detailContext;
const fundingUrl = packageMeta?.latest?.funding?.url as string;
if (!isURL(fundingUrl)) {
return null;
}
return (
<StyledLink external={true} to={fundingUrl}>
<Button color="primary" fullWidth={true} startIcon={<StyledFavoriteIcon />} variant="outlined">
<Trans components={[<StyledFundStrong key="fund" />]} i18nKey="button.fund-this-package" />
</Button>
</StyledLink>
);
};
export default DetailSidebarFundButton;

View File

@@ -0,0 +1,38 @@
import React from 'react';
import styled from '@emotion/styled';
import { useTranslation } from 'react-i18next';
import Box from '../../muiComponents/Box';
import Heading from '../../muiComponents/Heading';
import { Theme } from '../../design-tokens/theme';
interface Props {
packageName: string;
description?: string;
version: string;
isLatest: boolean;
}
const DetailSidebarTitle: React.FC<Props> = ({ description, packageName, version, isLatest }) => {
const { t } = useTranslation();
return (
<Box className={'detail-info'} display="flex" flexDirection="column" marginBottom="8px">
<StyledHeading>{packageName}</StyledHeading>
{description && <div>{description}</div>}
<StyledBoxVersion>
{isLatest ? t('sidebar.detail.latest-version', { version }) : t('sidebar.detail.version', { version })}
</StyledBoxVersion>
</Box>
);
};
export default DetailSidebarTitle;
const StyledHeading = styled(Heading)({
fontSize: '1rem',
fontWeight: 700,
});
const StyledBoxVersion = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
color: theme && theme.palette.text.secondary,
}));

View File

@@ -1,30 +0,0 @@
import styled from 'react-emotion';
import Avatar from '@material-ui/core/Avatar';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';
import colors from '../../utils/styles/colors';
export const TitleListItem = styled(ListItem)`
&& {
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
}
`;
export const TitleListItemText = styled(ListItemText)`
&& {
padding-left: 0;
padding-right: 0;
padding-top: 8px;
}
`;
export const TitleAvatar = styled(Avatar)`
&& {
color: ${colors.greySuperLight};
background-color: ${colors.primary};
text-transform: capitalize;
}
`;

View File

@@ -0,0 +1,102 @@
import React from 'react';
import { mount } from '../../utils/test-enzyme';
import { DetailContextProvider } from '../../pages/Version';
import Developers, { Fab } from './Developers';
import { DeveloperType } from './types';
describe('test Developers', () => {
const packageMeta = {
latest: {
packageName: 'foo',
version: '1.0.0',
maintainers: [
{
name: 'dmethvin',
email: 'dave.methvin@gmail.com',
},
{
name: 'mgol',
email: 'm.goleb@gmail.com',
},
],
contributors: [
{
name: 'dmethvin',
email: 'dave.methvin@gmail.com',
},
{
name: 'mgol',
email: 'm.goleb@gmail.com',
},
],
},
};
test('should render the component with no items', () => {
const packageMeta = {
latest: {},
};
const wrapper = mount(
// @ts-ignore
<DetailContextProvider value={{ packageMeta }}>
<Developers type={DeveloperType.MAINTAINERS} />
</DetailContextProvider>
);
expect(wrapper).toMatchSnapshot();
});
test('should render the component for maintainers with items', () => {
const wrapper = mount(
// @ts-ignore
<DetailContextProvider value={{ packageMeta }}>
<Developers type={DeveloperType.MAINTAINERS} />
</DetailContextProvider>
);
expect(wrapper).toMatchSnapshot();
});
test('should render the component for contributors with items', () => {
const wrapper = mount(
// @ts-ignore
<DetailContextProvider value={{ packageMeta }}>
<Developers type={DeveloperType.CONTRIBUTORS} />
</DetailContextProvider>
);
expect(wrapper).toMatchSnapshot();
});
test('should test onClick the component avatar', () => {
const packageMeta = {
latest: {
packageName: 'foo',
version: '1.0.0',
contributors: [
{
name: 'dmethvin',
email: 'dave.methvin@gmail.com',
},
{
name: 'dmethvin2',
email: 'dave2.methvin@gmail.com',
},
],
},
};
const wrapper = mount(
// @ts-ignore
<DetailContextProvider value={{ packageMeta }}>
<Developers type={DeveloperType.CONTRIBUTORS} visibleMax={1} />
</DetailContextProvider>
);
const item2 = wrapper.find(Fab);
// TODO: I am not sure here how to verify the method inside the component was called.
item2.simulate('click');
});
});

View File

@@ -1,79 +1,81 @@
import React, { Component } from 'react';
import Avatar from '@material-ui/core/Avatar';
import React, { useState, useCallback, useContext, useEffect, useMemo } from 'react';
import Add from '@material-ui/icons/Add';
import Tooltip from '@material-ui/core/Tooltip';
import styled from '@emotion/styled';
import { useTranslation } from 'react-i18next';
import { DetailContextConsumer } from '../../pages/version/Version';
import { Details, Heading, Content, Fab } from './styles';
import { isEmail } from '../../utils/url';
import { DetailContext } from '../../pages/Version';
import Tooltip from '../../muiComponents/Tooltip';
import Avatar from '../../muiComponents/Avatar';
import Box from '../../muiComponents/Box';
import FloatingActionButton from '../../muiComponents/FloatingActionButton';
import { Theme } from '../../design-tokens/theme';
import getUniqueDeveloperValues from './get-unique-developer-values';
import DevelopersTitle from './DevelopersTitle';
import { DeveloperType } from './types';
export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>(props => ({
backgroundColor: props.theme && props.theme.palette.primary.main,
color: props.theme && props.theme.palette.white,
}));
interface Props {
type: 'contributors' | 'maintainers';
}
interface State {
visibleDevs: number;
type: DeveloperType;
visibleMax?: number;
}
class Developers extends Component<Props, State> {
public state = {
visibleDevs: 6,
};
const StyledBox = styled(Box)({
'> *': {
margin: 5,
},
});
public render(): JSX.Element {
return (
<DetailContextConsumer>
{({ packageMeta }) => {
const { type } = this.props;
const developerType = packageMeta && packageMeta.latest[type];
if (!developerType || developerType.length === 0) return null;
return this.renderDevelopers(developerType, packageMeta);
}}
</DetailContextConsumer>
);
export const VISIBLE_MAX = 6;
const Developers: React.FC<Props> = ({ type, visibleMax = VISIBLE_MAX }) => {
const detailContext = useContext(DetailContext);
const { t } = useTranslation();
if (!detailContext) {
throw Error(t('app-context-not-correct-used'));
}
public handleLoadMore = () => {
this.setState(prev => ({ visibleDevs: prev.visibleDevs + 6 }));
};
const developers = useMemo(() => getUniqueDeveloperValues(detailContext.packageMeta?.latest[type]), [
detailContext.packageMeta,
type,
]);
private renderDevelopers = (developers, packageMeta) => {
const { type } = this.props;
const { visibleDevs } = this.state;
return (
<>
<Heading variant={'subheading'}>{type}</Heading>
<Content>
{developers.slice(0, visibleDevs).map(developer => (
<Details key={developer.email}>{this.renderDeveloperDetails(developer, packageMeta)}</Details>
))}
{visibleDevs < developers.length && (
<Fab onClick={this.handleLoadMore} size="small">
<Add />
</Fab>
)}
</Content>
</>
);
};
const [visibleDevelopersMax, setVisibleDevelopersMax] = useState(visibleMax);
const [visibleDevelopers, setVisibleDevelopers] = useState(developers);
private renderLinkForMail(email, avatarComponent, packageName, version): JSX.Element {
if (!email || isEmail(email) === false) {
return avatarComponent;
}
return (
<a href={`mailto:${email}?subject=${packageName}@${version}`} target={'_top'}>
{avatarComponent}
</a>
);
}
useEffect(() => {
if (!developers) return;
setVisibleDevelopers(developers.slice(0, visibleDevelopersMax));
}, [developers, visibleDevelopersMax]);
private renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => {
const { name: packageName, version } = packageMeta.latest;
const handleSetVisibleDevelopersMax = useCallback(() => {
setVisibleDevelopersMax(visibleDevelopersMax + VISIBLE_MAX);
}, [visibleDevelopersMax]);
const avatarComponent = <Avatar aria-label={name} src={avatar} />;
return <Tooltip title={name}>{this.renderLinkForMail(email, avatarComponent, packageName, version)}</Tooltip>;
};
}
if (!visibleDevelopers || !developers) return null;
return (
<>
<DevelopersTitle type={type} />
<StyledBox display="flex" flexWrap="wrap" margin="10px 0 10px 0">
{visibleDevelopers.map(visibleDeveloper => (
<Tooltip key={visibleDeveloper.email} title={visibleDeveloper.name}>
<Avatar alt={visibleDeveloper.name} src={visibleDeveloper.avatar} />
</Tooltip>
))}
{visibleDevelopersMax < developers.length && (
<Fab onClick={handleSetVisibleDevelopersMax} size="small">
<Add />
</Fab>
)}
</StyledBox>
</>
);
};
export default Developers;

View File

@@ -0,0 +1,30 @@
import React from 'react';
import styled from '@emotion/styled';
import { useTranslation } from 'react-i18next';
import Text from '../../muiComponents/Text';
import { Theme } from '../../design-tokens/theme';
import { DeveloperType } from './types';
interface Props {
type: DeveloperType;
}
const DevelopersTitle: React.FC<Props> = ({ type }) => {
const { t } = useTranslation();
switch (type) {
case DeveloperType.CONTRIBUTORS:
return <StyledText variant={'subtitle1'}>{t('sidebar.contributors.title')}</StyledText>;
case DeveloperType.MAINTAINERS:
return <StyledText variant={'subtitle1'}>{t('sidebar.maintainers.title')}</StyledText>;
return null;
}
};
export default DevelopersTitle;
const StyledText = styled(Text)<{ theme?: Theme }>(({ theme }) => ({
fontWeight: theme && theme.fontWeight.bold,
marginBottom: '10px',
}));

View File

@@ -0,0 +1,859 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`test Developers should render the component for contributors with items 1`] = `
.emotion-0 {
font-weight: 700;
margin-bottom: 10px;
}
.emotion-8 > * {
margin: 5px;
}
<Developers
type="contributors"
>
<DevelopersTitle
type="contributors"
>
<StyledText
variant="subtitle1"
>
<ForwardRef(Text)
className="emotion-0 emotion-1"
variant="subtitle1"
>
<WithStyles(ForwardRef(Typography))
className="emotion-0 emotion-1"
variant="subtitle1"
>
<ForwardRef(Typography)
className="emotion-0 emotion-1"
classes={
Object {
"alignCenter": "MuiTypography-alignCenter",
"alignJustify": "MuiTypography-alignJustify",
"alignLeft": "MuiTypography-alignLeft",
"alignRight": "MuiTypography-alignRight",
"body1": "MuiTypography-body1",
"body2": "MuiTypography-body2",
"button": "MuiTypography-button",
"caption": "MuiTypography-caption",
"colorError": "MuiTypography-colorError",
"colorInherit": "MuiTypography-colorInherit",
"colorPrimary": "MuiTypography-colorPrimary",
"colorSecondary": "MuiTypography-colorSecondary",
"colorTextPrimary": "MuiTypography-colorTextPrimary",
"colorTextSecondary": "MuiTypography-colorTextSecondary",
"displayBlock": "MuiTypography-displayBlock",
"displayInline": "MuiTypography-displayInline",
"gutterBottom": "MuiTypography-gutterBottom",
"h1": "MuiTypography-h1",
"h2": "MuiTypography-h2",
"h3": "MuiTypography-h3",
"h4": "MuiTypography-h4",
"h5": "MuiTypography-h5",
"h6": "MuiTypography-h6",
"noWrap": "MuiTypography-noWrap",
"overline": "MuiTypography-overline",
"paragraph": "MuiTypography-paragraph",
"root": "MuiTypography-root",
"srOnly": "MuiTypography-srOnly",
"subtitle1": "MuiTypography-subtitle1",
"subtitle2": "MuiTypography-subtitle2",
}
}
variant="subtitle1"
>
<h6
className="MuiTypography-root emotion-0 emotion-1 MuiTypography-subtitle1"
>
sidebar.contributors.title
</h6>
</ForwardRef(Typography)>
</WithStyles(ForwardRef(Typography))>
</ForwardRef(Text)>
</StyledText>
</DevelopersTitle>
<StyledBox
display="flex"
flexWrap="wrap"
margin="10px 0 10px 0"
>
<Box
className="emotion-8 emotion-9"
display="flex"
flexWrap="wrap"
margin="10px 0 10px 0"
>
<Styled(MuiBox)
className="emotion-8 emotion-9"
display="flex"
flexWrap="wrap"
margin="10px 0 10px 0"
>
<div
className="MuiBox-root MuiBox-root-91 emotion-8 emotion-9"
>
<ForwardRef(ToolTip)
key="dave.methvin@gmail.com"
title="dmethvin"
>
<WithStyles(ForwardRef(Tooltip))
innerRef={null}
title="dmethvin"
>
<ForwardRef(Tooltip)
classes={
Object {
"arrow": "MuiTooltip-arrow",
"popper": "MuiTooltip-popper",
"popperArrow": "MuiTooltip-popperArrow",
"popperInteractive": "MuiTooltip-popperInteractive",
"tooltip": "MuiTooltip-tooltip",
"tooltipArrow": "MuiTooltip-tooltipArrow",
"tooltipPlacementBottom": "MuiTooltip-tooltipPlacementBottom",
"tooltipPlacementLeft": "MuiTooltip-tooltipPlacementLeft",
"tooltipPlacementRight": "MuiTooltip-tooltipPlacementRight",
"tooltipPlacementTop": "MuiTooltip-tooltipPlacementTop",
"touch": "MuiTooltip-touch",
}
}
title="dmethvin"
>
<ForwardRef(Avatar)
alt="dmethvin"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<WithStyles(ForwardRef(Avatar))
alt="dmethvin"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<ForwardRef(Avatar)
alt="dmethvin"
aria-describedby={null}
className=""
classes={
Object {
"circle": "MuiAvatar-circle",
"colorDefault": "MuiAvatar-colorDefault",
"fallback": "MuiAvatar-fallback",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
"rounded": "MuiAvatar-rounded",
"square": "MuiAvatar-square",
}
}
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<div
aria-describedby={null}
className="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<ForwardRef
className="MuiAvatar-fallback"
>
<WithStyles(ForwardRef(SvgIcon))
className="MuiAvatar-fallback"
>
<ForwardRef(SvgIcon)
className="MuiAvatar-fallback"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction",
"colorDisabled": "MuiSvgIcon-colorDisabled",
"colorError": "MuiSvgIcon-colorError",
"colorPrimary": "MuiSvgIcon-colorPrimary",
"colorSecondary": "MuiSvgIcon-colorSecondary",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall",
"root": "MuiSvgIcon-root",
}
}
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</ForwardRef(SvgIcon)>
</WithStyles(ForwardRef(SvgIcon))>
</ForwardRef>
</div>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
<ForwardRef(Popper)
anchorEl={
<div
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
title="dmethvin"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</div>
}
className="MuiTooltip-popper"
id={null}
open={false}
placement="bottom"
popperOptions={
Object {
"modifiers": Object {
"arrow": Object {
"element": null,
"enabled": false,
},
},
}
}
transition={true}
/>
</ForwardRef(Tooltip)>
</WithStyles(ForwardRef(Tooltip))>
</ForwardRef(ToolTip)>
<ForwardRef(ToolTip)
key="m.goleb@gmail.com"
title="mgol"
>
<WithStyles(ForwardRef(Tooltip))
innerRef={null}
title="mgol"
>
<ForwardRef(Tooltip)
classes={
Object {
"arrow": "MuiTooltip-arrow",
"popper": "MuiTooltip-popper",
"popperArrow": "MuiTooltip-popperArrow",
"popperInteractive": "MuiTooltip-popperInteractive",
"tooltip": "MuiTooltip-tooltip",
"tooltipArrow": "MuiTooltip-tooltipArrow",
"tooltipPlacementBottom": "MuiTooltip-tooltipPlacementBottom",
"tooltipPlacementLeft": "MuiTooltip-tooltipPlacementLeft",
"tooltipPlacementRight": "MuiTooltip-tooltipPlacementRight",
"tooltipPlacementTop": "MuiTooltip-tooltipPlacementTop",
"touch": "MuiTooltip-touch",
}
}
title="mgol"
>
<ForwardRef(Avatar)
alt="mgol"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<WithStyles(ForwardRef(Avatar))
alt="mgol"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<ForwardRef(Avatar)
alt="mgol"
aria-describedby={null}
className=""
classes={
Object {
"circle": "MuiAvatar-circle",
"colorDefault": "MuiAvatar-colorDefault",
"fallback": "MuiAvatar-fallback",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
"rounded": "MuiAvatar-rounded",
"square": "MuiAvatar-square",
}
}
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<div
aria-describedby={null}
className="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<ForwardRef
className="MuiAvatar-fallback"
>
<WithStyles(ForwardRef(SvgIcon))
className="MuiAvatar-fallback"
>
<ForwardRef(SvgIcon)
className="MuiAvatar-fallback"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction",
"colorDisabled": "MuiSvgIcon-colorDisabled",
"colorError": "MuiSvgIcon-colorError",
"colorPrimary": "MuiSvgIcon-colorPrimary",
"colorSecondary": "MuiSvgIcon-colorSecondary",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall",
"root": "MuiSvgIcon-root",
}
}
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</ForwardRef(SvgIcon)>
</WithStyles(ForwardRef(SvgIcon))>
</ForwardRef>
</div>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
<ForwardRef(Popper)
anchorEl={
<div
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
title="mgol"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</div>
}
className="MuiTooltip-popper"
id={null}
open={false}
placement="bottom"
popperOptions={
Object {
"modifiers": Object {
"arrow": Object {
"element": null,
"enabled": false,
},
},
}
}
transition={true}
/>
</ForwardRef(Tooltip)>
</WithStyles(ForwardRef(Tooltip))>
</ForwardRef(ToolTip)>
</div>
</Styled(MuiBox)>
</Box>
</StyledBox>
</Developers>
`;
exports[`test Developers should render the component for maintainers with items 1`] = `
.emotion-0 {
font-weight: 700;
margin-bottom: 10px;
}
.emotion-8 > * {
margin: 5px;
}
<Developers
type="maintainers"
>
<DevelopersTitle
type="maintainers"
>
<StyledText
variant="subtitle1"
>
<ForwardRef(Text)
className="emotion-0 emotion-1"
variant="subtitle1"
>
<WithStyles(ForwardRef(Typography))
className="emotion-0 emotion-1"
variant="subtitle1"
>
<ForwardRef(Typography)
className="emotion-0 emotion-1"
classes={
Object {
"alignCenter": "MuiTypography-alignCenter",
"alignJustify": "MuiTypography-alignJustify",
"alignLeft": "MuiTypography-alignLeft",
"alignRight": "MuiTypography-alignRight",
"body1": "MuiTypography-body1",
"body2": "MuiTypography-body2",
"button": "MuiTypography-button",
"caption": "MuiTypography-caption",
"colorError": "MuiTypography-colorError",
"colorInherit": "MuiTypography-colorInherit",
"colorPrimary": "MuiTypography-colorPrimary",
"colorSecondary": "MuiTypography-colorSecondary",
"colorTextPrimary": "MuiTypography-colorTextPrimary",
"colorTextSecondary": "MuiTypography-colorTextSecondary",
"displayBlock": "MuiTypography-displayBlock",
"displayInline": "MuiTypography-displayInline",
"gutterBottom": "MuiTypography-gutterBottom",
"h1": "MuiTypography-h1",
"h2": "MuiTypography-h2",
"h3": "MuiTypography-h3",
"h4": "MuiTypography-h4",
"h5": "MuiTypography-h5",
"h6": "MuiTypography-h6",
"noWrap": "MuiTypography-noWrap",
"overline": "MuiTypography-overline",
"paragraph": "MuiTypography-paragraph",
"root": "MuiTypography-root",
"srOnly": "MuiTypography-srOnly",
"subtitle1": "MuiTypography-subtitle1",
"subtitle2": "MuiTypography-subtitle2",
}
}
variant="subtitle1"
>
<h6
className="MuiTypography-root emotion-0 emotion-1 MuiTypography-subtitle1"
>
sidebar.maintainers.title
</h6>
</ForwardRef(Typography)>
</WithStyles(ForwardRef(Typography))>
</ForwardRef(Text)>
</StyledText>
</DevelopersTitle>
<StyledBox
display="flex"
flexWrap="wrap"
margin="10px 0 10px 0"
>
<Box
className="emotion-8 emotion-9"
display="flex"
flexWrap="wrap"
margin="10px 0 10px 0"
>
<Styled(MuiBox)
className="emotion-8 emotion-9"
display="flex"
flexWrap="wrap"
margin="10px 0 10px 0"
>
<div
className="MuiBox-root MuiBox-root-32 emotion-8 emotion-9"
>
<ForwardRef(ToolTip)
key="dave.methvin@gmail.com"
title="dmethvin"
>
<WithStyles(ForwardRef(Tooltip))
innerRef={null}
title="dmethvin"
>
<ForwardRef(Tooltip)
classes={
Object {
"arrow": "MuiTooltip-arrow",
"popper": "MuiTooltip-popper",
"popperArrow": "MuiTooltip-popperArrow",
"popperInteractive": "MuiTooltip-popperInteractive",
"tooltip": "MuiTooltip-tooltip",
"tooltipArrow": "MuiTooltip-tooltipArrow",
"tooltipPlacementBottom": "MuiTooltip-tooltipPlacementBottom",
"tooltipPlacementLeft": "MuiTooltip-tooltipPlacementLeft",
"tooltipPlacementRight": "MuiTooltip-tooltipPlacementRight",
"tooltipPlacementTop": "MuiTooltip-tooltipPlacementTop",
"touch": "MuiTooltip-touch",
}
}
title="dmethvin"
>
<ForwardRef(Avatar)
alt="dmethvin"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<WithStyles(ForwardRef(Avatar))
alt="dmethvin"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<ForwardRef(Avatar)
alt="dmethvin"
aria-describedby={null}
className=""
classes={
Object {
"circle": "MuiAvatar-circle",
"colorDefault": "MuiAvatar-colorDefault",
"fallback": "MuiAvatar-fallback",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
"rounded": "MuiAvatar-rounded",
"square": "MuiAvatar-square",
}
}
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<div
aria-describedby={null}
className="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="dmethvin"
>
<ForwardRef
className="MuiAvatar-fallback"
>
<WithStyles(ForwardRef(SvgIcon))
className="MuiAvatar-fallback"
>
<ForwardRef(SvgIcon)
className="MuiAvatar-fallback"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction",
"colorDisabled": "MuiSvgIcon-colorDisabled",
"colorError": "MuiSvgIcon-colorError",
"colorPrimary": "MuiSvgIcon-colorPrimary",
"colorSecondary": "MuiSvgIcon-colorSecondary",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall",
"root": "MuiSvgIcon-root",
}
}
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</ForwardRef(SvgIcon)>
</WithStyles(ForwardRef(SvgIcon))>
</ForwardRef>
</div>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
<ForwardRef(Popper)
anchorEl={
<div
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
title="dmethvin"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</div>
}
className="MuiTooltip-popper"
id={null}
open={false}
placement="bottom"
popperOptions={
Object {
"modifiers": Object {
"arrow": Object {
"element": null,
"enabled": false,
},
},
}
}
transition={true}
/>
</ForwardRef(Tooltip)>
</WithStyles(ForwardRef(Tooltip))>
</ForwardRef(ToolTip)>
<ForwardRef(ToolTip)
key="m.goleb@gmail.com"
title="mgol"
>
<WithStyles(ForwardRef(Tooltip))
innerRef={null}
title="mgol"
>
<ForwardRef(Tooltip)
classes={
Object {
"arrow": "MuiTooltip-arrow",
"popper": "MuiTooltip-popper",
"popperArrow": "MuiTooltip-popperArrow",
"popperInteractive": "MuiTooltip-popperInteractive",
"tooltip": "MuiTooltip-tooltip",
"tooltipArrow": "MuiTooltip-tooltipArrow",
"tooltipPlacementBottom": "MuiTooltip-tooltipPlacementBottom",
"tooltipPlacementLeft": "MuiTooltip-tooltipPlacementLeft",
"tooltipPlacementRight": "MuiTooltip-tooltipPlacementRight",
"tooltipPlacementTop": "MuiTooltip-tooltipPlacementTop",
"touch": "MuiTooltip-touch",
}
}
title="mgol"
>
<ForwardRef(Avatar)
alt="mgol"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<WithStyles(ForwardRef(Avatar))
alt="mgol"
aria-describedby={null}
className=""
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<ForwardRef(Avatar)
alt="mgol"
aria-describedby={null}
className=""
classes={
Object {
"circle": "MuiAvatar-circle",
"colorDefault": "MuiAvatar-colorDefault",
"fallback": "MuiAvatar-fallback",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
"rounded": "MuiAvatar-rounded",
"square": "MuiAvatar-square",
}
}
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<div
aria-describedby={null}
className="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="mgol"
>
<ForwardRef
className="MuiAvatar-fallback"
>
<WithStyles(ForwardRef(SvgIcon))
className="MuiAvatar-fallback"
>
<ForwardRef(SvgIcon)
className="MuiAvatar-fallback"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction",
"colorDisabled": "MuiSvgIcon-colorDisabled",
"colorError": "MuiSvgIcon-colorError",
"colorPrimary": "MuiSvgIcon-colorPrimary",
"colorSecondary": "MuiSvgIcon-colorSecondary",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall",
"root": "MuiSvgIcon-root",
}
}
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</ForwardRef(SvgIcon)>
</WithStyles(ForwardRef(SvgIcon))>
</ForwardRef>
</div>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
<ForwardRef(Popper)
anchorEl={
<div
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
title="mgol"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiAvatar-fallback"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
</div>
}
className="MuiTooltip-popper"
id={null}
open={false}
placement="bottom"
popperOptions={
Object {
"modifiers": Object {
"arrow": Object {
"element": null,
"enabled": false,
},
},
}
}
transition={true}
/>
</ForwardRef(Tooltip)>
</WithStyles(ForwardRef(Tooltip))>
</ForwardRef(ToolTip)>
</div>
</Styled(MuiBox)>
</Box>
</StyledBox>
</Developers>
`;
exports[`test Developers should render the component with no items 1`] = `
<Developers
type="maintainers"
/>
`;

View File

@@ -0,0 +1,12 @@
import { Developer } from '../../../types/packageMeta';
function getUniqueDeveloperValues(developers?: Array<Developer>): undefined | Array<Developer> {
if (!developers) return;
return developers.reduce(
(accumulator: Array<Developer>, current: Developer) =>
accumulator.some(developer => developer.email === current.email) ? accumulator : [...accumulator, current],
[]
);
}
export default getUniqueDeveloperValues;

View File

@@ -1 +1,2 @@
export { default } from './Developers';
export { DeveloperType } from './types';

View File

@@ -1,34 +1,31 @@
import styled from 'react-emotion';
import Typography from '@material-ui/core/Typography';
import { default as MuiFab } from '@material-ui/core/Fab';
import colors from '../../utils/styles/colors';
import styled from '@emotion/styled';
export const Details = styled('span')`
display: flex;
flex-direction: column;
align-items: center;
`;
import Text from '../../muiComponents/Text';
import FloatingActionButton from '../../muiComponents/FloatingActionButton';
import { Theme } from '../../design-tokens/theme';
export const Content = styled('div')`
margin: 10px 0 10px 0;
display: flex;
flex-wrap: wrap;
> * {
margin: 5px;
}
`;
export const Details = styled('span')({
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
});
export const Heading = styled(Typography)`
&& {
font-weight: 700;
margin-bottom: 10px;
text-transform: capitalize;
}
`;
export const Content = styled('div')({
margin: '10px 0 10px 0',
display: 'flex',
flexWrap: 'wrap',
'> *': {
margin: '5px',
},
});
export const Fab = styled(MuiFab)`
&& {
background-color: ${colors.primary};
color: ${colors.white};
}
`;
export const StyledText = styled(Text)<{ theme?: Theme }>(props => ({
fontWeight: props.theme && props.theme.fontWeight.bold,
marginBottom: '10px',
textTransform: 'capitalize',
}));
export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>(props => ({
backgroundColor: props.theme && props.theme.palette.primary.main,
color: props.theme && props.theme.palette.white,
}));

View File

@@ -0,0 +1,4 @@
export enum DeveloperType {
CONTRIBUTORS = 'contributors',
MAINTAINERS = 'maintainers',
}

View File

@@ -1,11 +1,17 @@
import React from 'react';
import { shallow } from 'enzyme';
import { mount } from '../../utils/test-enzyme';
import { DetailContext } from '../../pages/Version';
import Dist from './Dist';
const withDistComponent = (packageMeta: React.ContextType<typeof DetailContext>['packageMeta']): JSX.Element => (
<DetailContext.Provider value={{ packageMeta }}>
<Dist />
</DetailContext.Provider>
);
describe('<Dist /> component', () => {
beforeEach(() => {
jest.resetModules();
});
test('should render the component in default state', () => {
const packageMeta = {
latest: {
@@ -17,15 +23,10 @@ describe('<Dist /> component', () => {
},
license: '',
},
_uplinks: {},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Dist = require('./Dist').default;
const wrapper = shallow(<Dist />);
const wrapper = mount(withDistComponent(packageMeta));
expect(wrapper.html()).toMatchSnapshot();
});
@@ -40,15 +41,10 @@ describe('<Dist /> component', () => {
},
license: 'MIT',
},
_uplinks: {},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Dist = require('./Dist').default;
const wrapper = shallow(<Dist />);
const wrapper = mount(withDistComponent(packageMeta));
expect(wrapper.html()).toMatchSnapshot();
});
@@ -66,15 +62,10 @@ describe('<Dist /> component', () => {
url: 'https://www.opensource.org/licenses/mit-license.php',
},
},
_uplinks: {},
};
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Dist = require('./Dist').default;
const wrapper = shallow(<Dist />);
const wrapper = mount(withDistComponent(packageMeta));
expect(wrapper.html()).toMatchSnapshot();
});
});

View File

@@ -1,56 +1,45 @@
import React, { Component } from 'react';
import React, { FC, useContext } from 'react';
import { useTranslation } from 'react-i18next';
import List from '@material-ui/core/List';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
import { Heading, DistListItem, DistChips } from './styles';
import { DetailContext } from '../../pages/Version';
import fileSizeSI from '../../utils/file-size';
import { PackageMetaInterface } from 'types/packageMeta';
import { formatLicense } from '../../utils/package';
import List from '../../muiComponents/List';
class Dist extends Component {
public render(): JSX.Element {
return (
<DetailContextConsumer>
{(context: Partial<VersionPageConsumerProps>) => {
return context && context.packageMeta && this.renderDist(context.packageMeta);
}}
</DetailContextConsumer>
);
}
import { StyledText, DistListItem, DistChips } from './styles';
private renderChips(dist, license: PackageMetaInterface['latest']['license']): (JSX.Element | undefined)[] {
const distDict = {
'file-count': dist.fileCount,
size: dist.unpackedSize && fileSizeSI(dist.unpackedSize),
license,
};
const chipsList = Object.keys(distDict).map((dist, key) => {
if (!distDict[dist]) return;
const value = dist === 'license' ? formatLicense(distDict[dist]) : distDict[dist];
const label = (
const DistChip: FC<{ name: string }> = ({ name, children }) =>
children ? (
<DistChips
label={
<>
{/* eslint-disable-next-line */}
<b>{dist.replace('-', ' ')}</b>: {value}
<b>{name}</b>
{': '}
{children}
</>
);
return <DistChips key={key} label={label} />;
});
}
/>
) : null;
return chipsList;
const Dist: FC = () => {
const { packageMeta } = useContext(DetailContext);
const { t } = useTranslation();
if (!packageMeta) {
return null;
}
private renderDist = (packageMeta: PackageMetaInterface) => {
const { dist, license } = packageMeta && packageMeta.latest;
const { dist, license } = packageMeta && packageMeta.latest;
return (
<List subheader={<Heading variant="subheading">{'Latest Distribution'}</Heading>}>
<DistListItem>{this.renderChips(dist, license)}</DistListItem>
</List>
);
};
}
return (
<List subheader={<StyledText variant="subtitle1">{t('sidebar.distribution.title')}</StyledText>}>
<DistListItem button={true}>
<DistChip name={t('sidebar.distribution.file-count')}>{dist.fileCount}</DistChip>
<DistChip name={t('sidebar.distribution.size')}>{dist.unpackedSize && fileSizeSI(dist.unpackedSize)}</DistChip>
<DistChip name={t('sidebar.distribution.license')}>{formatLicense(license)}</DistChip>
</DistListItem>
</List>
);
};
export default Dist;

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Dist /> component should render the component in default state 1`] = `"<ul class=\\"MuiList-root-1 MuiList-padding-2 MuiList-subheader-4\\"><h3 class=\\"MuiTypography-root-5 MuiTypography-subheading-12 css-hyrz44 estxrtg0\\">Latest Distribution</h3><li class=\\"MuiListItem-root-41 MuiListItem-default-44 MuiListItem-gutters-49 css-z8a2h0 estxrtg1\\"><div role=\\"button\\" class=\\"MuiChip-root-53 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-72\\"><b>file count</b>: 7</span></div><div role=\\"button\\" class=\\"MuiChip-root-53 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-72\\"><b>size</b>: 10.00 Bytes</span></div></li></ul>"`;
exports[`<Dist /> component should render the component in default state 1`] = `"<ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-1na337r-StyledText estxrtg0 MuiTypography-subtitle1\\">sidebar.distribution.title</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-1mms18p-DistListItem estxrtg1 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.file-count</b>: 7</span></div><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.size</b>: 10.00 Bytes</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul>"`;
exports[`<Dist /> component should render the component with license as object 1`] = `"<ul class=\\"MuiList-root-155 MuiList-padding-156 MuiList-subheader-158\\"><h3 class=\\"MuiTypography-root-159 MuiTypography-subheading-166 css-hyrz44 estxrtg0\\">Latest Distribution</h3><li class=\\"MuiListItem-root-195 MuiListItem-default-198 MuiListItem-gutters-203 css-z8a2h0 estxrtg1\\"><div role=\\"button\\" class=\\"MuiChip-root-207 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-226\\"><b>file count</b>: 7</span></div><div role=\\"button\\" class=\\"MuiChip-root-207 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-226\\"><b>size</b>: 10.00 Bytes</span></div><div role=\\"button\\" class=\\"MuiChip-root-207 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-226\\"><b>license</b>: MIT</span></div></li></ul>"`;
exports[`<Dist /> component should render the component with license as object 1`] = `"<ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-1na337r-StyledText estxrtg0 MuiTypography-subtitle1\\">sidebar.distribution.title</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-1mms18p-DistListItem estxrtg1 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.file-count</b>: 7</span></div><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.size</b>: 10.00 Bytes</span></div><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.license</b>: MIT</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul>"`;
exports[`<Dist /> component should render the component with license as string 1`] = `"<ul class=\\"MuiList-root-78 MuiList-padding-79 MuiList-subheader-81\\"><h3 class=\\"MuiTypography-root-82 MuiTypography-subheading-89 css-hyrz44 estxrtg0\\">Latest Distribution</h3><li class=\\"MuiListItem-root-118 MuiListItem-default-121 MuiListItem-gutters-126 css-z8a2h0 estxrtg1\\"><div role=\\"button\\" class=\\"MuiChip-root-130 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-149\\"><b>file count</b>: 7</span></div><div role=\\"button\\" class=\\"MuiChip-root-130 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-149\\"><b>size</b>: 10.00 Bytes</span></div><div role=\\"button\\" class=\\"MuiChip-root-130 css-1le6jk6 estxrtg2\\" tabindex=\\"-1\\"><span class=\\"MuiChip-label-149\\"><b>license</b>: MIT</span></div></li></ul>"`;
exports[`<Dist /> component should render the component with license as string 1`] = `"<ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-1na337r-StyledText estxrtg0 MuiTypography-subtitle1\\">sidebar.distribution.title</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-1mms18p-DistListItem estxrtg1 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.file-count</b>: 7</span></div><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.size</b>: 10.00 Bytes</span></div><div class=\\"MuiChip-root css-e2le7v-DistChips estxrtg2\\"><span class=\\"MuiChip-label\\"><b>sidebar.distribution.license</b>: MIT</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul>"`;

View File

@@ -1,35 +1,27 @@
import styled from 'react-emotion';
import { default as MuiFab } from '@material-ui/core/Fab';
import Chip from '@material-ui/core/Chip';
import ListItem from '@material-ui/core/ListItem';
import Typography from '@material-ui/core/Typography';
import styled from '@emotion/styled';
import colors from '../../utils/styles/colors';
import ListItem from '../../muiComponents/ListItem';
import Text from '../../muiComponents/Text';
import FloatingActionButton from '../../muiComponents/FloatingActionButton';
import Chip from '../../muiComponents/Chip';
import { Theme } from '../../design-tokens/theme';
export const Heading = styled(Typography)`
&& {
font-weight: 700;
text-transform: capitalize;
}
`;
export const StyledText = styled(Text)<{ theme?: Theme }>(props => ({
fontWeight: props.theme && props.theme.fontWeight.bold,
textTransform: 'capitalize',
}));
export const DistListItem = styled(ListItem)`
&& {
padding-left: 0;
padding-right: 0;
}
`;
export const DistListItem = styled(ListItem)({
paddingLeft: 0,
paddingRight: 0,
});
export const DistChips = styled(Chip)`
&& {
margin-right: 5px;
text-transform: capitalize;
}
`;
export const DistChips = styled(Chip)({
marginRight: 5,
textTransform: 'capitalize',
});
export const DownloadButton = styled(MuiFab)`
&& {
background-color: ${colors.primary};
color: ${colors.white};
}
`;
export const DownloadButton = styled(FloatingActionButton)<{ theme?: Theme }>(props => ({
backgroundColor: props.theme && props.theme.palette.primary.main,
color: props.theme && props.theme.palette.white,
}));

View File

@@ -1,66 +1,61 @@
import React from 'react';
import { shallow } from 'enzyme';
import { mount } from '../../utils/test-enzyme';
import { DetailContext } from '../../pages/Version';
import { PackageMetaInterface } from '../../../types/packageMeta';
import Engine from './Engines';
jest.mock('./img/node.png', () => '');
jest.mock('../Install/img/npm.svg', () => '');
const mockPackageMeta = (engines?: PackageMetaInterface['latest']['engines']): PackageMetaInterface => ({
latest: {
name: 'verdaccio',
version: '0.0.0',
dist: {
fileCount: 1,
unpackedSize: 1,
},
...(engines && { engines }),
},
_uplinks: {},
});
describe('<Engines /> component', () => {
beforeEach(() => {
jest.resetModules();
});
test('should render the component in default state', () => {
const packageMeta = {
latest: {
engines: {
node: '>= 0.1.98',
npm: '>3',
},
},
};
const packageMeta = mockPackageMeta({
node: '>= 0.1.98',
npm: '>3',
});
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Engines = require('./Engines').default;
const wrapper = shallow(<Engines />);
const wrapper = mount(
<DetailContext.Provider value={{ packageMeta }}>
<Engine />
</DetailContext.Provider>
);
expect(wrapper.html()).toMatchSnapshot();
});
test('should render the component when there is no engine key in package meta', () => {
const packageMeta = {
latest: {},
};
const packageMeta = mockPackageMeta();
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Engines = require('./Engines').default;
const wrapper = shallow(<Engines />);
expect(wrapper.html()).toEqual('');
const wrapper = mount(
<DetailContext.Provider value={{ packageMeta }}>
<Engine />
</DetailContext.Provider>
);
expect(wrapper.html()).toBeNull();
});
test('should render the component when there is no keys in engine in package meta', () => {
const packageMeta = {
latest: {
engines: {},
},
};
const packageMeta = mockPackageMeta({});
jest.doMock('../../pages/version/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Engines = require('./Engines').default;
const wrapper = shallow(<Engines />);
expect(wrapper.html()).toEqual('');
const wrapper = mount(
<DetailContext.Provider value={{ packageMeta }}>
<Engine />
</DetailContext.Provider>
);
expect(wrapper.html()).toBeNull();
});
});

View File

@@ -1,73 +1,51 @@
import React, { Component, ReactElement } from 'react';
import React, { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import Avatar from '@material-ui/core/Avatar';
import Grid from '@material-ui/core/Grid';
import List from '@material-ui/core/List';
import ListItemText from '@material-ui/core/ListItemText';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
import { Heading, EngineListItem } from './styles';
// @ts-ignore
import node from './img/node.png';
import { DetailContext } from '../../pages/Version';
import Avatar from '../../muiComponents/Avatar';
import List from '../../muiComponents/List';
import npm from '../Install/img/npm.svg';
import ListItemText from '../../muiComponents/ListItemText';
import Grid from '../../muiComponents/Grid';
const ICONS = {
'node-JS': <Avatar src={node} />,
'NPM-version': <Avatar src={npm} />,
};
import { StyledText, EngineListItem } from './styles';
import node from './img/node.png';
class Engine extends Component {
public render(): ReactElement<HTMLElement> {
return (
<DetailContextConsumer>
{context => {
return this.renderEngine(context as VersionPageConsumerProps);
}}
</DetailContextConsumer>
);
const Engine: React.FC = () => {
const { packageMeta } = useContext(DetailContext);
const { t } = useTranslation();
const engines = packageMeta?.latest?.engines;
if (!engines || (!engines.node && !engines.npm)) {
return null;
}
private renderEngine = ({ packageMeta }): ReactElement<HTMLElement> | null => {
const { engines } = packageMeta.latest;
if (!engines) {
return null;
}
return (
<Grid container={true}>
{engines.node && (
<Grid item={true} xs={6}>
<List subheader={<StyledText variant={'subtitle1'}>{t('sidebar.engines.node-js')}</StyledText>}>
<EngineListItem button={true}>
<Avatar src={node} />
<ListItemText primary={engines.node} />
</EngineListItem>
</List>
</Grid>
)}
const engineDict = {
'node-JS': engines.node,
'NPM-version': engines.npm,
};
const accumulator: React.ReactNode[] = [];
const items = Object.keys(engineDict).reduce((markup, text, key) => {
const heading = engineDict[text];
if (heading) {
markup.push(
<Grid item={true} key={key} xs={6}>
{this.renderListItems(heading, text)}
</Grid>
);
}
return markup;
}, accumulator);
if (items.length < 1) {
return null;
}
return <Grid container={true}>{items}</Grid>;
};
private renderListItems = (heading, text) => {
return (
<List subheader={<Heading variant={'subheading'}>{text.split('-').join(' ')}</Heading>}>
<EngineListItem>
{ICONS[text]}
<ListItemText primary={heading} />
</EngineListItem>
</List>
);
};
}
{engines.npm && (
<Grid item={true} xs={6}>
<List subheader={<StyledText variant={'subtitle1'}>{t('sidebar.engines.npm-version')}</StyledText>}>
<EngineListItem button={true}>
<Avatar src={npm} />
<ListItemText primary={engines.npm} />
</EngineListItem>
</List>
</Grid>
)}
</Grid>
);
};
export default Engine;

View File

@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Engines /> component should render the component in default state 1`] = `"<div class=\\"MuiGrid-container-1\\"><div class=\\"MuiGrid-item-2 MuiGrid-grid-xs-6-35\\"><ul class=\\"MuiList-root-98 MuiList-padding-99 MuiList-subheader-101\\"><h3 class=\\"MuiTypography-root-102 MuiTypography-subheading-109 css-hyrz44 et66bt70\\">node JS</h3><li class=\\"MuiListItem-root-138 MuiListItem-default-141 MuiListItem-gutters-146 css-dt93b2 et66bt71\\"><div class=\\"MuiAvatar-root-150 MuiAvatar-colorDefault-151\\"></div><div class=\\"MuiListItemText-root-153\\"><span class=\\"MuiTypography-root-102 MuiTypography-subheading-109 MuiListItemText-primary-156\\">&gt;= 0.1.98</span></div></li></ul></div><div class=\\"MuiGrid-item-2 MuiGrid-grid-xs-6-35\\"><ul class=\\"MuiList-root-98 MuiList-padding-99 MuiList-subheader-101\\"><h3 class=\\"MuiTypography-root-102 MuiTypography-subheading-109 css-hyrz44 et66bt70\\">NPM version</h3><li class=\\"MuiListItem-root-138 MuiListItem-default-141 MuiListItem-gutters-146 css-dt93b2 et66bt71\\"><div class=\\"MuiAvatar-root-150 MuiAvatar-colorDefault-151\\"></div><div class=\\"MuiListItemText-root-153\\"><span class=\\"MuiTypography-root-102 MuiTypography-subheading-109 MuiListItemText-primary-156\\">&gt;3</span></div></li></ul></div></div>"`;
exports[`<Engines /> component should render the component in default state 1`] = `"<div class=\\"MuiGrid-root MuiGrid-container\\"><div class=\\"MuiGrid-root MuiGrid-item MuiGrid-grid-xs-6\\"><ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-1na337r-StyledText et66bt70 MuiTypography-subtitle1\\">sidebar.engines.node-js</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-18b06t0-EngineListItem et66bt71 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><div class=\\"MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault\\"><svg class=\\"MuiSvgIcon-root MuiAvatar-fallback\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path d=\\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\\"></path></svg></div><div class=\\"MuiListItemText-root\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">&gt;= 0.1.98</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul></div><div class=\\"MuiGrid-root MuiGrid-item MuiGrid-grid-xs-6\\"><ul class=\\"MuiList-root MuiList-padding MuiList-subheader\\"><h6 class=\\"MuiTypography-root css-1na337r-StyledText et66bt70 MuiTypography-subtitle1\\">sidebar.engines.npm-version</h6><div class=\\"MuiButtonBase-root MuiListItem-root css-18b06t0-EngineListItem et66bt71 MuiListItem-gutters MuiListItem-button\\" tabindex=\\"0\\" role=\\"button\\" aria-disabled=\\"false\\"><div class=\\"MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault\\"><svg class=\\"MuiSvgIcon-root MuiAvatar-fallback\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path d=\\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\\"></path></svg></div><div class=\\"MuiListItemText-root\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">&gt;3</span></div><span class=\\"MuiTouchRipple-root\\"></span></div></ul></div></div>"`;

View File

@@ -1,16 +1,14 @@
import styled from 'react-emotion';
import ListItem from '@material-ui/core/ListItem';
import Typography from '@material-ui/core/Typography';
import styled from '@emotion/styled';
export const Heading = styled(Typography)`
&& {
font-weight: 700;
text-transform: capitalize;
}
`;
import ListItem from '../../muiComponents/ListItem';
import Text from '../../muiComponents/Text';
import { Theme } from '../../design-tokens/theme';
export const EngineListItem = styled(ListItem)`
&& {
padding-left: 0;
}
`;
export const StyledText = styled(Text)<{ theme?: Theme }>(props => ({
fontWeight: props.theme && props.theme.fontWeight.bold,
textTransform: 'capitalize',
}));
export const EngineListItem = styled(ListItem)({
paddingLeft: 0,
});

View File

@@ -1,23 +1,20 @@
import React from 'react';
import { mount } from 'enzyme';
import { render } from '../../utils/test-react-testing-library';
import Footer from './Footer';
jest.mock('../../../package.json', () => ({
version: '4.0.0-alpha.3',
}));
describe('<Footer /> component', () => {
let wrapper;
beforeEach(() => {
// @ts-ignore : Property 'VERDACCIO_VERSION' does not exist on type 'Window'
beforeAll(() => {
window.VERDACCIO_VERSION = 'v.1.0.0';
wrapper = mount(<Footer />);
// @ts-ignore : Property 'VERDACCIO_VERSION' does not exist on type 'Window'
});
afterAll(() => {
delete window.VERDACCIO_VERSION;
});
test('should load the initial state of Footer component', () => {
expect(wrapper.html()).toMatchSnapshot();
const { container } = render(<Footer />);
expect(container.firstChild).toMatchSnapshot();
});
});

View File

@@ -1,53 +1,38 @@
import React from 'react';
import { useTranslation, Trans } from 'react-i18next';
import { Wrapper, Left, Right, Earth, Flags, Love, Flag, Logo, Inner, ToolTip } from './styles';
import { goToVerdaccioWebsite } from '../../utils/windows';
const renderTooltip = (): JSX.Element => (
<ToolTip>
<Earth name="earth" size="md" />
<Flags>
<Flag name="spain" size="md" />
<Flag name="nicaragua" size="md" />
<Flag name="india" size="md" />
<Flag name="brazil" size="md" />
<Flag name="china" size="md" />
<Flag name="austria" size="md" />
</Flags>
</ToolTip>
);
const POWERED_LABEL = 'Powered by';
const MADEWITH_LABEL = ' Made with';
const ON_LABEL = 'on';
const HEARTH_EMOJI = '♥';
import { Wrapper, Left, Right, Earth, Flags, Love, Flag, Logo, Inner, ToolTip } from './styles';
// @ts-ignore
const renderRight = (version = window.VERDACCIO_VERSION): JSX.Element => {
/* eslint-disable react/jsx-key */
const Footer: React.FC = () => {
const { t } = useTranslation();
return (
<Right>
{POWERED_LABEL}
<Logo img={true} name="verdaccio" onClick={goToVerdaccioWebsite} pointer={true} size="md" />
{`/ ${version}`}
</Right>
<Wrapper>
<Inner>
<Left>
<Trans components={[<Love />]} i18nKey="footer.made-with-love-on" />
<ToolTip>
<Earth name="earth" size="md" />
<Flags>
<Flag name="spain" size="md" />
<Flag name="nicaragua" size="md" />
<Flag name="india" size="md" />
<Flag name="brazil" size="md" />
<Flag name="china" size="md" />
<Flag name="austria" size="md" />
</Flags>
</ToolTip>
</Left>
<Right>
{t('footer.powered-by')}
<Logo img={true} name="verdaccio" onClick={goToVerdaccioWebsite} pointer={true} size="md" />
{`/ ${window.VERDACCIO_VERSION}`}
</Right>
</Inner>
</Wrapper>
);
};
const renderLeft = (): JSX.Element => (
<Left>
{MADEWITH_LABEL}
<Love>{HEARTH_EMOJI}</Love>
{ON_LABEL}
{renderTooltip()}
</Left>
);
const Footer: React.FC = () => (
<Wrapper>
<Inner>
{renderLeft()}
{renderRight()}
</Inner>
</Wrapper>
);
export default Footer;

View File

@@ -1,3 +1,274 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Footer /> component should load the initial state of Footer component 1`] = `"<div class=\\"css-i0nj2g ezbsl480\\"><div class=\\"css-hzfs9b ezbsl481\\"><div class=\\"css-d8nsp7 ezbsl482\\"> Made with<span class=\\"css-1so4oe0 ezbsl487\\">♥</span>on<span class=\\"css-1ie354y ezbsl484\\"><svg class=\\"ezbsl485 css-1kgp95j ek145dl0\\"><title>Earth</title><use xlink:href=\\"[object Object]#earth\\"></use></svg><span class=\\"css-8631ip ezbsl486\\"><svg class=\\"ezbsl488 css-f1ndto ek145dl0\\"><title>Spain</title><use xlink:href=\\"[object Object]#spain\\"></use></svg><svg class=\\"ezbsl488 css-f1ndto ek145dl0\\"><title>Nicaragua</title><use xlink:href=\\"[object Object]#nicaragua\\"></use></svg><svg class=\\"ezbsl488 css-f1ndto ek145dl0\\"><title>India</title><use xlink:href=\\"[object Object]#india\\"></use></svg><svg class=\\"ezbsl488 css-f1ndto ek145dl0\\"><title>Brazil</title><use xlink:href=\\"[object Object]#brazil\\"></use></svg><svg class=\\"ezbsl488 css-f1ndto ek145dl0\\"><title>China</title><use xlink:href=\\"[object Object]#china\\"></use></svg><svg class=\\"ezbsl488 css-f1ndto ek145dl0\\"><title>Austria</title><use xlink:href=\\"[object Object]#austria\\"></use></svg></span></span></div><div class=\\"css-1wbzdyy ezbsl483\\">Powered by<span class=\\"ezbsl488 css-i15wza ek145dl1\\" name=\\"verdaccio\\" title=\\"Verdaccio\\"><img alt=\\"Verdaccio\\" src=\\"[object Object]\\" class=\\"css-1ncdhax ek145dl2\\"></span>/ v.1.0.0</div></div></div>"`;
exports[`<Footer /> component should load the initial state of Footer component 1`] = `
.emotion-38 {
background: #f9f9f9;
border-top: 1px solid #e3e3e3;
color: #999999;
font-size: 14px;
padding: 20px;
}
.emotion-36 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
width: 100%;
}
@media (min-width:768px) {
.emotion-36 {
min-width: 400px;
max-width: 800px;
margin: auto;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
}
@media (min-width:1024px) {
.emotion-36 {
max-width: 1240px;
}
}
.emotion-27 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: none;
}
@media (min-width:768px) {
.emotion-27 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
}
.emotion-0 {
color: #e25555;
padding: 0 5px;
}
.emotion-25 {
position: relative;
height: 18px;
}
.emotion-25:hover .emotion-24 {
visibility: visible;
}
.emotion-3 {
box-sizing: initial;
display: inline-block;
cursor: default;
width: 18px;
height: 18px;
padding: 0 10px;
}
.emotion-23 {
position: absolute;
background: #d3dddd;
padding: 1px 4px;
border-radius: 3px;
height: 20px;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
visibility: hidden;
top: -2px;
}
.emotion-23:before {
content: '';
position: absolute;
top: 29%;
left: -4px;
margin-left: -5px;
border: 5px solid;
border-color: #d3dddd transparent transparent transparent;
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.emotion-6 {
box-sizing: initial;
display: inline-block;
cursor: default;
width: 18px;
height: 18px;
padding: 0 5px;
}
.emotion-34 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: none;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
@media (min-width:768px) {
.emotion-34 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
}
.emotion-32 {
box-sizing: initial;
display: inline-block;
cursor: pointer;
width: 18px;
height: 18px;
padding: 0 5px;
}
.emotion-29 {
width: 100%;
height: auto;
}
<div
class="emotion-38 emotion-39"
>
<div
class="emotion-36 emotion-37"
>
<div
class="emotion-27 emotion-28"
>
Made with
<span
class="emotion-0 emotion-1"
>
♥
</span>
on
<span
class="emotion-25 emotion-26"
>
<svg
class="emotion-2 emotion-3 emotion-4"
>
<title>
Earth
</title>
<use
xlink:href="[object Object]#earth"
/>
</svg>
<span
class="emotion-23 emotion-24"
>
<svg
class="emotion-5 emotion-6 emotion-4"
>
<title>
Spain
</title>
<use
xlink:href="[object Object]#spain"
/>
</svg>
<svg
class="emotion-5 emotion-6 emotion-4"
>
<title>
Nicaragua
</title>
<use
xlink:href="[object Object]#nicaragua"
/>
</svg>
<svg
class="emotion-5 emotion-6 emotion-4"
>
<title>
India
</title>
<use
xlink:href="[object Object]#india"
/>
</svg>
<svg
class="emotion-5 emotion-6 emotion-4"
>
<title>
Brazil
</title>
<use
xlink:href="[object Object]#brazil"
/>
</svg>
<svg
class="emotion-5 emotion-6 emotion-4"
>
<title>
China
</title>
<use
xlink:href="[object Object]#china"
/>
</svg>
<svg
class="emotion-5 emotion-6 emotion-4"
>
<title>
Austria
</title>
<use
xlink:href="[object Object]#austria"
/>
</svg>
</span>
</span>
</div>
<div
class="emotion-34 emotion-35"
>
Powered by
<span
class="emotion-5 emotion-32 emotion-33"
title="Verdaccio"
>
<img
alt="Verdaccio"
class="emotion-29 emotion-30"
src="[object Object]"
/>
</span>
/ v.1.0.0
</div>
</div>
</div>
`;

Some files were not shown because too many files have changed in this diff Show More