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

fix: types for web profile page #115

Merged
merged 4 commits into from
Sep 18, 2023

Conversation

lukicenturi
Copy link
Contributor

So this PR is created to make this rotki/rotki.com#145 can be merged.

So what has been done in this PR

  • Chip label is optional, because we can use slot instead.
  • Data table pagination, if not specified, it's still working (for convenience)
  • Tab component tabValue is optional now.
  • Also expose type TablePaginationData

What is remaining thing to do

  • Fix this type error with the table row slot
rgument of type 'Record<string, any>' is not assignable to parameter of type '{ actions: string[]; status: "Active" | "Cancelled" | "Pending" | "Past Due"; identifier: string; planName: string; durationInMonths: number; pending: boolean; createdDate: string; nextActionDate: string; nextBillingAmount: string; }'.
  Type 'Record<string, any>' is missing the following properties from type '{ actions: string[]; status: "Active" | "Cancelled" | "Pending" | "Past Due"; identifier: string; planName: string; durationInMonths: number; pending: boolean; createdDate: string; nextActionDate: string; nextBillingAmount: string; }': actions, status, identifier, planName, and 5 more.

155         <div v-if="displayActions(row)" class="flex gap-2 justify-end">
                                      ~~~

components/account/home/SubscriptionTable.vue:157:29 - error TS2345: Argument of type 'Record<string, any>' is not assignable to parameter of type '{ actions: string[]; status: "Active" | "Cancelled" | "Pending" | "Past Due"; identifier: string; planName: string; durationInMonths: number; pending: boolean; createdDate: string; nextActionDate: string; nextBillingAmount: string; }'.

157             v-if="hasAction(row, 'cancel')"
                                ~~~

components/account/home/SubscriptionTable.vue:158:13 - error TS2322: Type 'Record<string, any>' is not assignable to type '{ actions: string[]; status: "Active" | "Cancelled" | "Pending" | "Past Due"; identifier: string; planName: string; durationInMonths: number; pending: boolean; createdDate: string; nextActionDate: string; nextBillingAmount: string; }'.

158             :subscription="row"
                ~~~~~~~~~~~~~


components/account/home/SubscriptionTable.vue:161:29 - error TS2345: Argument of type 'Record<string, any>' is not assignable to parameter of type '{ actions: string[]; status: "Active" | "Cancelled" | "Pending" | "Past Due"; identifier: string; planName: string; durationInMonths: number; pending: boolean; createdDate: string; nextActionDate: string; nextBillingAmount: string; }'.

161             v-if="hasAction(row, 'renew')"
                                ~~~


Found 4 errors in the same file, starting at: components/account/home/SubscriptionTable.vue:155

@codecov-commenter
Copy link

Codecov Report

Merging #115 (1b99a94) into main (586c3d1) will increase coverage by 0.09%.
The diff coverage is 93.47%.

@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
+ Coverage   90.78%   90.88%   +0.09%     
==========================================
  Files          39       39              
  Lines        6587     6614      +27     
  Branches      271      271              
==========================================
+ Hits         5980     6011      +31     
+ Misses        607      603       -4     
Files Changed Coverage Δ
src/components/tables/DataTable.vue 84.82% <92.85%> (+0.89%) ⬆️
src/components/chips/Chip.vue 100.00% <100.00%> (ø)
src/components/tabs/tab/Tab.vue 100.00% <100.00%> (ø)

kelsos and others added 4 commits September 18, 2023 12:08
Co-authored-by: Luki Centuri <lukicenturi@gmail.com>
Co-authored-by: Luki Centuri <lukicenturi@gmail.com>
Co-authored-by: Luki Centuri <lukicenturi@gmail.com>
Co-authored-by: Luki Centuri <lukicenturi@gmail.com>
@kelsos kelsos force-pushed the fix-types-for-web-profile-page branch from 1b99a94 to 0d573df Compare September 18, 2023 10:08
Copy link
Member

@kelsos kelsos left a comment

Choose a reason for hiding this comment

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

lgtm, I am gonna merge this and spend some time fixing the typing issues in a separate PR

@kelsos kelsos merged commit 0d573df into rotki:main Sep 18, 2023
5 checks passed
@kelsos kelsos temporarily deployed to github-pages September 18, 2023 13:14 — with GitHub Actions Inactive
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.

3 participants