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

refactor: Add types to useRepositoriesList hook #277

Merged
merged 10 commits into from Sep 2, 2022

Conversation

chadstewart
Copy link
Contributor

@chadstewart chadstewart commented Aug 29, 2022

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

This PR adds the feature of adding types to the API response from the repo/list end point.

Details:

  • Created the file next-types.d.ts and moved the types into this file. This is the file we will add our types to for refactor: correct typescript types usage across the applicationΒ #212. You can learn a bit more about this here (the documentation recommends the file name additional.d.ts).
  • Types RepoList and Meta are the responses copied over from the GitSense API response.

Related Tickets & Documents

Fixes #273

Mobile & Desktop Screenshots/Recordings

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Aug 29, 2022

βœ… Deploy Preview for oss-insights ready!

Name Link
πŸ”¨ Latest commit cde4361
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/63113103847fe700078ce00b
😎 Deploy Preview https://deploy-preview-277--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 29, 2022

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit cde4361
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/63113103ab737600089ad8e7
😎 Deploy Preview https://deploy-preview-277--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@chadstewart chadstewart changed the title refactot!: Added types to useRepositoriesList hook refactor!: Added types to useRepositoriesList hook Aug 29, 2022
@chadstewart
Copy link
Contributor Author

@bdougie
Copy link
Member

bdougie commented Aug 30, 2022

Hey @0-vortex, is this what you meant for this issue?

These types might be better in a https://github.com/open-sauced/hot/blob/beta/src/vite-types.d.ts like file than inline in the hook. The link provided is vite, but next recommend something similar.

@chadstewart chadstewart marked this pull request as ready for review August 30, 2022 16:13
@0-vortex
Copy link
Contributor

Hey @0-vortex, is this what you meant for this issue?

These types might be better in a https://github.com/open-sauced/hot/blob/beta/src/vite-types.d.ts like file than inline in the hook. The link provided is vite, but next recommend something similar.

Correct, database types should be renamed to DbType and conform to the types displayed in the API. With that being said, this PR was supposed to correct the SWR usage, as the initial types mocked single repo usage, not a list. As this was not correctly implemented anywhere, adding the correct types in does not call it a day. πŸ˜…

I'm adding the required steps to make this ready for some prime time usage, we will have the same kind of listings across all API services, so it doesn't make sense to avoid doing this.

Copy link
Contributor

@0-vortex 0-vortex left a comment

Choose a reason for hiding this comment

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

"minor" changes πŸ˜…

additional.d.ts Outdated Show resolved Hide resolved
additional.d.ts Outdated Show resolved Hide resolved
additional.d.ts Outdated Show resolved Hide resolved
components/molecules/SelectableTable/repository-table.tsx Outdated Show resolved Hide resolved
components/organisms/Dashboard/dashboard.tsx Outdated Show resolved Hide resolved
lib/hooks/useDashboardData.ts Outdated Show resolved Hide resolved
lib/hooks/useNav.ts Outdated Show resolved Hide resolved
lib/hooks/useRepositoriesList.ts Outdated Show resolved Hide resolved
lib/hooks/useRepositoriesList.ts Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
…named selectabletable file to repository table. Will reach out to TED for help with remaining code review updates.
Copy link
Member

@bdougie bdougie left a comment

Choose a reason for hiding this comment

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

Looks good

@chadstewart chadstewart changed the title refactor!: Added types to useRepositoriesList hook refactor: Add types to useRepositoriesList hook Sep 1, 2022
Copy link
Contributor

@0-vortex 0-vortex left a comment

Choose a reason for hiding this comment

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

LGTM! πŸ‘

@chadstewart chadstewart merged commit 4f1a771 into beta Sep 2, 2022
@chadstewart chadstewart deleted the 273-update-useRepositoriesList-types branch September 2, 2022 01:48
github-actions bot pushed a commit that referenced this pull request Sep 2, 2022
## [1.4.0-beta.2](v1.4.0-beta.1...v1.4.0-beta.2) (2022-09-02)

### πŸ§‘β€πŸ’» Code Refactoring

* Add types to useRepositoriesList hook ([#277](#277)) ([4f1a771](4f1a771))
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

πŸŽ‰ This PR is included in version 1.4.0-beta.2 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request Sep 6, 2022
## [1.4.0](v1.3.0...v1.4.0) (2022-09-06)

### πŸ§‘β€πŸ’» Code Refactoring

* Add types to useRepositoriesList hook ([#277](#277)) ([4f1a771](4f1a771))

### πŸ• Features

* Add download CSV funtionality to Reports page ([#286](#286)) ([ada79d3](ada79d3))
* **footer:** swap out footer text ([#296](#296)) ([737df5b](737df5b))
* Update Scatter Chart Legend ([#260](#260)) ([309ef62](309ef62))

### πŸ› Bug Fixes

* Add background to selectable tr table ([#252](#252)) ([7d6ae16](7d6ae16)), closes [#183](#183) [#289](#289)
* Contributor card overlap on smaller devices ([#298](#298)) ([777f6ba](777f6ba)), closes [#290](#290)
* correct netlify build supabase redirect url ([#283](#283)) ([0b2b80a](0b2b80a))
* Filter dropdown can only be closed by clicking on the filter button ([#299](#299)) ([bce1f8e](bce1f8e)), closes [#292](#292)
* Fixing issues with TopNav and Highlight Card ([#294](#294)) ([218f30d](218f30d)), closes [#287](#287) [#291](#291)
* grammar for header description ([#279](#279)) ([a019912](a019912))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.4.0-beta.2](open-sauced/app@v1.4.0-beta.1...v1.4.0-beta.2) (2022-09-02)

### πŸ§‘β€πŸ’» Code Refactoring

* Add types to useRepositoriesList hook ([#277](open-sauced/app#277)) ([4f1a771](open-sauced/app@4f1a771))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.4.0](open-sauced/app@v1.3.0...v1.4.0) (2022-09-06)

### πŸ§‘β€πŸ’» Code Refactoring

* Add types to useRepositoriesList hook ([#277](open-sauced/app#277)) ([4f1a771](open-sauced/app@4f1a771))

### πŸ• Features

* Add download CSV funtionality to Reports page ([#286](open-sauced/app#286)) ([ada79d3](open-sauced/app@ada79d3))
* **footer:** swap out footer text ([#296](open-sauced/app#296)) ([737df5b](open-sauced/app@737df5b))
* Update Scatter Chart Legend ([#260](open-sauced/app#260)) ([309ef62](open-sauced/app@309ef62))

### πŸ› Bug Fixes

* Add background to selectable tr table ([#252](open-sauced/app#252)) ([7d6ae16](open-sauced/app@7d6ae16)), closes [#183](open-sauced/app#183) [#289](open-sauced/app#289)
* Contributor card overlap on smaller devices ([#298](open-sauced/app#298)) ([777f6ba](open-sauced/app@777f6ba)), closes [#290](open-sauced/app#290)
* correct netlify build supabase redirect url ([#283](open-sauced/app#283)) ([0b2b80a](open-sauced/app@0b2b80a))
* Filter dropdown can only be closed by clicking on the filter button ([#299](open-sauced/app#299)) ([bce1f8e](open-sauced/app@bce1f8e)), closes [#292](open-sauced/app#292)
* Fixing issues with TopNav and Highlight Card ([#294](open-sauced/app#294)) ([218f30d](open-sauced/app@218f30d)), closes [#287](open-sauced/app#287) [#291](open-sauced/app#291)
* grammar for header description ([#279](open-sauced/app#279)) ([a019912](open-sauced/app@a019912))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] Update useRepositoriesList type definitions.
3 participants