Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog: GraphQL for packages #2552

Merged
merged 46 commits into from
Dec 30, 2021
Merged

Catalog: GraphQL for packages #2552

merged 46 commits into from
Dec 30, 2021

Conversation

nl0
Copy link
Member

@nl0 nl0 commented Nov 23, 2021

Description

  • Move package listing/querying to GraphQL
  • TSify components under containers/Bucket
    • PackageList
    • PackageRevisions
    • PackageTree
    • RevisionInfo
  • utils/useQuery helper
  • Cleanup containers/Bucket/requests/requestsUntyped.js

TODO

@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #2552 (4c01178) into master (f1fd4f4) will decrease coverage by 0.00%.
The diff coverage is 0.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2552      +/-   ##
==========================================
- Coverage   42.93%   42.93%   -0.01%     
==========================================
  Files         520      532      +12     
  Lines       24677    24621      -56     
  Branches     3315     3332      +17     
==========================================
- Hits        10595    10570      -25     
- Misses      13258    13286      +28     
+ Partials      824      765      -59     
Flag Coverage Δ
api-python 90.26% <ø> (ø)
catalog 13.42% <0.46%> (-0.12%) ⬇️
lambda 94.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../app/containers/Bucket/PackageList/PackageList.tsx 0.00% <0.00%> (ø)
...s/Bucket/PackageList/gql/PackageCount.generated.ts 0.00% <0.00%> (ø)
...rs/Bucket/PackageList/gql/PackageList.generated.ts 0.00% <0.00%> (ø)
catalog/app/containers/Bucket/PackageList/index.ts 0.00% <0.00%> (ø)
...iners/Bucket/PackageRevisions/PackageRevisions.tsx 0.00% <0.00%> (ø)
...et/PackageRevisions/gql/RevisionCount.generated.ts 0.00% <0.00%> (ø)
...ket/PackageRevisions/gql/RevisionList.generated.ts 0.00% <0.00%> (ø)
...og/app/containers/Bucket/PackageRevisions/index.ts 0.00% <0.00%> (ø)
.../app/containers/Bucket/PackageTree/PackageLink.tsx 0.00% <ø> (ø)
.../app/containers/Bucket/PackageTree/PackageTree.tsx 0.00% <0.00%> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1fd4f4...4c01178. Read the comment docs.

@nl0 nl0 mentioned this pull request Nov 23, 2021
33 tasks
@nl0 nl0 requested a review from fiskus December 3, 2021 14:10
@nl0
Copy link
Member Author

nl0 commented Dec 3, 2021

@fiskus this one is in working state and deployed to searchminimal along with the related backend changes

const { sort, filter, p } = parseSearch(location.search)
const page = p && parseInt(p, 10)
const { sort, filter, p } = parseSearch(location.search, true)
const page = p ? parseInt(p, 10) : undefined
Copy link
Member

Choose a reason for hiding this comment

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

I see multiple undefined in this module. Can we use null here? I think that it's more straightforward to use null, and leave undefined only when it's really undefined

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we use null here?

here -- yes, but not everywhere (e.g. not as a title attribute for a span, since it only accepts string | undefined)

I think that it's more straightforward to use null, and leave undefined only when it's really undefined

tbh i don't feel much difference in most cases 🤷 (with a notable exception of JSON.strignify)

catalog/app/containers/Bucket/PackageList/PackageList.tsx Outdated Show resolved Hide resolved
catalog/app/containers/Bucket/PackageTree.js Show resolved Hide resolved
catalog/app/utils/useQuery.ts Outdated Show resolved Hide resolved
@nl0
Copy link
Member Author

nl0 commented Dec 7, 2021

@fiskus i've rebased to incorporate your PackageTree changes, pls see if everything's ok

@@ -36,6 +36,7 @@ export function viewModeToSelectOption(m: ViewMode | null): SelectOption | null
export function useViewModes(
path: string,
modeInput: string | null | undefined,
// XXX: consider using a plain boolean here since the contents of this object are unused
Copy link
Member

Choose a reason for hiding this comment

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

It's a deliberate choice. Reusing a small number of data structures reduces cognitive load. Also, it reduces footprint because it doesn't copy data, just passes the link to the object.

@nl0 nl0 merged commit 0d29089 into master Dec 30, 2021
@nl0 nl0 deleted the catalog-packages-gql branch December 30, 2021 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants