Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Version Page - Replaces class by func. #171

Merged
merged 14 commits into from
Oct 17, 2019

Conversation

priscilawebdev
Copy link
Contributor

Type: Refactor

The following has been addressed in the PR: #116

Unit or Functional tests are included in the PR?
I updated the current tests

Description:

in order to use react hooks, in this PR I updated the Version Page by changing it from a class to a functional component. I have also splitted it's content so that it is clearer.

@priscilawebdev priscilawebdev changed the title Version Page - Replaces class by func. WIP: Version Page - Replaces class by func. Oct 9, 2019
@codecov
Copy link

codecov bot commented Oct 12, 2019

Codecov Report

Merging #171 into master will decrease coverage by 1.88%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
- Coverage   88.73%   86.84%   -1.89%     
==========================================
  Files         117      116       -1     
  Lines         932      882      -50     
  Branches      147      162      +15     
==========================================
- Hits          827      766      -61     
- Misses         92      100       +8     
- Partials       13       16       +3
Impacted Files Coverage Δ
src/pages/Version/VersionLayout.tsx 100% <100%> (ø)
src/router.tsx 88.23% <100%> (+5.88%) ⬆️
src/pages/Version/context.ts 100% <100%> (ø) ⬆️
src/pages/Version/Version.tsx 87.5% <87.5%> (ø) ⬆️
src/utils/calls.ts 0% <0%> (-75%) ⬇️
src/utils/api.ts 32% <0%> (-48%) ⬇️
src/components/ActionBar/ActionBar.tsx 71.87% <0%> (-12.5%) ⬇️
src/utils/styles/media.ts 81.81% <0%> (ø) ⬆️
src/components/DetailSidebar/DetailSidebar.tsx 85% <0%> (ø) ⬆️
src/App/AppError.tsx

@priscilawebdev priscilawebdev changed the title WIP: Version Page - Replaces class by func. Version Page - Replaces class by func. Oct 12, 2019
Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the detail page, it is not loading.

…hub.com:verdaccio/ui into refactor/116_convert_class_to_func_version_page
@priscilawebdev
Copy link
Contributor Author

Hmmm, I need to check this e2e test. The page is loading here, I just tested everything ... but maybe something doesn't match the test

@juanpicado
Copy link
Member

@priscilawebdev FYI I added E2E (see workflow details), the page does not load, take your time.

@priscilawebdev
Copy link
Contributor Author

priscilawebdev commented Oct 16, 2019

@juanpicado I have only merged master in this branch and now the e2e tests are passing 🧐 interesting.

@juanpicado juanpicado self-requested a review October 17, 2019 04:35
@@ -0,0 +1,9 @@
function getRouterPackageName(packageName: string, scope?: string): string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to utilities in a new PR, also router is misleading, it just build a package name based on scope. A getPackageName would fit better here.

import { PackageMetaInterface } from '../../../types/packageMeta';

function isPackageVersionValid(packageMeta: Partial<PackageMetaInterface>, packageVersion?: string): boolean {
if (!packageVersion || typeof packageVersion === 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a utilities. The main reason is is much easier to jest.mock one file rather 10 in the same unit test.

Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 now it works.

@juanpicado juanpicado merged commit f5c77ff into master Oct 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the refactor/116_convert_class_to_func_version_page branch October 17, 2019 05:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants