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] Migrate Schedules Table to typescript #1691

Merged

Conversation

muhsinkamil
Copy link
Contributor

Relates to #1483

  • Migrate Schedules Table and its child components to ts

@netlify
Copy link

netlify bot commented Sep 12, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit d45ed47
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6505ff9635cc8500081441f8
😎 Deploy Preview https://deploy-preview-1691.demo.actualbudget.org/
📱 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 configuration.

@muhsinkamil muhsinkamil marked this pull request as ready for review September 13, 2023 21:01
@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 2023

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
16 2.47 MB → 2.47 MB (-812 B) -0.03%
Changeset
File Δ Size
src/components/schedules/StatusBadge.tsx 📈 +87 B (+2.70%) 3.15 kB → 3.24 kB
src/components/manager/ServerURL.tsx 📈 +18 B (+1.34%) 1.31 kB → 1.33 kB
../loot-core/src/client/data-hooks/payees.tsx 📈 +8 B (+0.98%) 819 B → 827 B
../loot-core/src/client/data-hooks/accounts.tsx 📈 +8 B (+0.95%) 843 B → 851 B
src/components/schedules/SchedulesTable.tsx 📈 +43 B (+0.33%) 12.73 kB → 12.77 kB
../loot-core/src/client/data-hooks/schedules.tsx 📈 +6 B (+0.32%) 1.85 kB → 1.85 kB
src/components/Titlebar.tsx 📉 -10 B (-0.07%) 13.89 kB → 13.88 kB
src/components/schedules/index.tsx 📉 -209 B (-5.07%) 4.03 kB → 3.82 kB
src/components/common/Link.tsx 🔥 -1.42 kB (-100%) 1.42 kB → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/narrow-components.chunk.js 34.9 kB → 34.59 kB (-319 B) -0.89%
static/js/reports.chunk.js 29.03 kB → 28.73 kB (-306 B) -1.03%
static/js/main.js 1.11 MB → 1.11 MB (-148 B) -0.01%
static/js/wide-components.chunk.js 127.02 kB → 126.98 kB (-39 B) -0.03%

Unchanged

Asset File Size % Changed
static/js/678.chunk.js 420.74 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/713.chunk.js 156.56 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/389.chunk.js 12.76 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 903 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 2023

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@@ -274,7 +311,7 @@ export function SchedulesTable({
</Row>
);
}
return renderSchedule({ item });
return renderSchedule({ schedule: item as ScheduleEntity });
Copy link
Contributor Author

@muhsinkamil muhsinkamil Sep 13, 2023

Choose a reason for hiding this comment

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

Unfortunately, had to cast it as the items is a mix of ScheduleEntity & CompletedScheduleItem

But not very bad tho, as the implementation still remains the same.,
( except I renamed type === 'show-completed' -> id === 'show-completed to satisfy ts 😃 )

@@ -94,7 +87,6 @@ export function StatusBadge({ status, style }: StatusBadgeProps) {
flexDirection: 'row',
alignItems: 'center',
flexShrink: 0,
...style,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems this is not used anywhere, hence removing it.,

{!minimal && (
<Field width={80} style={{ textAlign: 'center' }}>
{item._date && item._date.frequency && (
{schedule._date && (schedule._date as any).frequency && (
Copy link
Contributor Author

@muhsinkamil muhsinkamil Sep 13, 2023

Choose a reason for hiding this comment

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

Had to do as any, as defining a type to _date would require more additional changes, I plan to look into it when I do EditSchedule component as I can better understand how this _date is set when making new schedule.

Please let me know if there is a better solution to this.,

Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a // eslint-disable-next-line @typescript-eslint/no-explicit-any on the line above so the linter would pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked into it and added a proper type 👍

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Love the changes! Soon we'll be fully ported over to TS :)

@trafico-bot trafico-bot bot added ⚠️ Changes requested Pull Request needs changes before it can be reviewed again and removed 🔍 Ready for Review labels Sep 16, 2023
@trafico-bot trafico-bot bot added 🔍 Ready for Review and removed ⚠️ Changes requested Pull Request needs changes before it can be reviewed again labels Sep 16, 2023
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Amazing

@MatissJanis MatissJanis merged commit 2ee023a into actualbudget:master Sep 17, 2023
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Sep 17, 2023
@muhsinkamil muhsinkamil deleted the refactor/1483-schedules-table branch September 17, 2023 18:28
shall0pass pushed a commit to shall0pass/actual that referenced this pull request Sep 20, 2023
* [refactor] Migrate Schedules Table to typescript (actualbudget#1691)

* 🔧  removing unnecessary manual module resolution (actualbudget#1707)

* 🐛 (mobile) scrolling in lists with pull-to-refresh (actualbudget#1706)

* 💄 (mobile) updating apple home-screen icon (actualbudget#1705)

* Enhance Y-Axis Scaling on Net Worth Graph (actualbudget#1709)

* fix report budget, by adding in the goal coloring

---------

Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
shall0pass added a commit that referenced this pull request Sep 24, 2023
* first pass at progress bar

* db migration / enter goal in db

* add getGoal function

* stabilize

* whoops

* TS

* reset goal in db if no template found

* reconfirm

* release note

* typo

* rename migration

* to ms

* move priority logic, consistent variable names,

* fixup

* clear goal if template removed

* Visual goals (#40)

* 🔥 removing privacyMode feature flag (#1688)

* 🎨  fix multiline label in schedules modal (#1687)

* Update Visual Regression README File (#1689)

* Fix typo in GoCardlessLink.js (#1684)

happend -> happened

* queried cleared balance for tooltip (#1678)

* Dark Theme Reports/Settings (#1512)

* 🐛 Mobile account transaction list: Fix sticky date section headers (#1698)

* 👷  do not cancel github ci jobs on master branch (#1692)

* Sidebar Account Fix (#1703)

* Dark Theme Final (#1513)

* Category autocomplete should only search selectable categories  (#1681)

* set colors based on a goal value

* extra comment

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>

* update release note

* lint

* use null as cleared state

* show goal status via colors (#41)

* cleanup

* I think its working

* lint

* fix the error by adding colors to the report side (#42)

* [refactor] Migrate Schedules Table to typescript (#1691)

* 🔧  removing unnecessary manual module resolution (#1707)

* 🐛 (mobile) scrolling in lists with pull-to-refresh (#1706)

* 💄 (mobile) updating apple home-screen icon (#1705)

* Enhance Y-Axis Scaling on Net Worth Graph (#1709)

* fix report budget, by adding in the goal coloring

---------

Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>

* report budget database updates

* Fix schedule searchbar (#1729)

---------

Co-authored-by: youngcw <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>
Co-authored-by: Mohamed Muhsin <[email protected]>
youngcw added a commit that referenced this pull request Nov 8, 2023
* first pass at progress bar

* db migration / enter goal in db

* add getGoal function

* stabilize

* whoops

* TS

* reset goal in db if no template found

* reconfirm

* release note

* typo

* rename migration

* to ms

* move priority logic, consistent variable names,

* fixup

* clear goal if template removed

* Visual goals (#40)

* 🔥 removing privacyMode feature flag (#1688)

* 🎨  fix multiline label in schedules modal (#1687)

* Update Visual Regression README File (#1689)

* Fix typo in GoCardlessLink.js (#1684)

happend -> happened

* queried cleared balance for tooltip (#1678)

* Dark Theme Reports/Settings (#1512)

* 🐛 Mobile account transaction list: Fix sticky date section headers (#1698)

* 👷  do not cancel github ci jobs on master branch (#1692)

* Sidebar Account Fix (#1703)

* Dark Theme Final (#1513)

* Category autocomplete should only search selectable categories  (#1681)

* set colors based on a goal value

* extra comment

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>

* update release note

* lint

* use null as cleared state

* show goal status via colors (#41)

* cleanup

* I think its working

* lint

* fix report budget, by adding in the goal coloring

* fix the error by adding colors to the report side (#42)

* [refactor] Migrate Schedules Table to typescript (#1691)

* 🔧  removing unnecessary manual module resolution (#1707)

* 🐛 (mobile) scrolling in lists with pull-to-refresh (#1706)

* 💄 (mobile) updating apple home-screen icon (#1705)

* Enhance Y-Axis Scaling on Net Worth Graph (#1709)

* fix report budget, by adding in the goal coloring

---------

Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>

* report budget database updates

* Goal progress bar (#1734)

* first pass at progress bar

* db migration / enter goal in db

* add getGoal function

* stabilize

* whoops

* TS

* reset goal in db if no template found

* reconfirm

* release note

* typo

* rename migration

* to ms

* move priority logic, consistent variable names,

* fixup

* clear goal if template removed

* Visual goals (#40)

* 🔥 removing privacyMode feature flag (#1688)

* 🎨  fix multiline label in schedules modal (#1687)

* Update Visual Regression README File (#1689)

* Fix typo in GoCardlessLink.js (#1684)

happend -> happened

* queried cleared balance for tooltip (#1678)

* Dark Theme Reports/Settings (#1512)

* 🐛 Mobile account transaction list: Fix sticky date section headers (#1698)

* 👷  do not cancel github ci jobs on master branch (#1692)

* Sidebar Account Fix (#1703)

* Dark Theme Final (#1513)

* Category autocomplete should only search selectable categories  (#1681)

* set colors based on a goal value

* extra comment

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>

* update release note

* lint

* use null as cleared state

* show goal status via colors (#41)

* cleanup

* I think its working

* lint

* fix the error by adding colors to the report side (#42)

* [refactor] Migrate Schedules Table to typescript (#1691)

* 🔧  removing unnecessary manual module resolution (#1707)

* 🐛 (mobile) scrolling in lists with pull-to-refresh (#1706)

* 💄 (mobile) updating apple home-screen icon (#1705)

* Enhance Y-Axis Scaling on Net Worth Graph (#1709)

* fix report budget, by adding in the goal coloring

---------

Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>

* report budget database updates

* Fix schedule searchbar (#1729)

---------

Co-authored-by: youngcw <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>
Co-authored-by: Mohamed Muhsin <[email protected]>

* working dynamic colors.  Need to figure out what changes are actually needed

* cleanup

* more cleanup

* lint

* reset the goal when applying a single template

* make getCategory function

* remove some unneeded changes

* actually remove the changes, not just comment

* cleanup some unneeded code that was causing some bugs. Works for me, but should be vetted more

* lint

* add json definitions to database

* use template feature flag to enable colors

* some fixes

* don't set goals for remainders, remove unneeded change

* lint

* release note

* lint again

* fix mobile crash

* undo changes in CellValue.tsx

* lint

* use getStyle

* move status calc to helper

* lint

* recommendations

* suggestion

Co-authored-by: Joel Jeremy Marquez <[email protected]>

---------

Co-authored-by: shall0pass <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>
Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Joel Jeremy Marquez <[email protected]>
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
…albudget#1780)

* first pass at progress bar

* db migration / enter goal in db

* add getGoal function

* stabilize

* whoops

* TS

* reset goal in db if no template found

* reconfirm

* release note

* typo

* rename migration

* to ms

* move priority logic, consistent variable names,

* fixup

* clear goal if template removed

* Visual goals (#40)

* 🔥 removing privacyMode feature flag (actualbudget#1688)

* 🎨  fix multiline label in schedules modal (actualbudget#1687)

* Update Visual Regression README File (actualbudget#1689)

* Fix typo in GoCardlessLink.js (actualbudget#1684)

happend -> happened

* queried cleared balance for tooltip (actualbudget#1678)

* Dark Theme Reports/Settings (actualbudget#1512)

* 🐛 Mobile account transaction list: Fix sticky date section headers (actualbudget#1698)

* 👷  do not cancel github ci jobs on master branch (actualbudget#1692)

* Sidebar Account Fix (actualbudget#1703)

* Dark Theme Final (actualbudget#1513)

* Category autocomplete should only search selectable categories  (actualbudget#1681)

* set colors based on a goal value

* extra comment

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>

* update release note

* lint

* use null as cleared state

* show goal status via colors (actualbudget#41)

* cleanup

* I think its working

* lint

* fix report budget, by adding in the goal coloring

* fix the error by adding colors to the report side (actualbudget#42)

* [refactor] Migrate Schedules Table to typescript (actualbudget#1691)

* 🔧  removing unnecessary manual module resolution (actualbudget#1707)

* 🐛 (mobile) scrolling in lists with pull-to-refresh (actualbudget#1706)

* 💄 (mobile) updating apple home-screen icon (actualbudget#1705)

* Enhance Y-Axis Scaling on Net Worth Graph (actualbudget#1709)

* fix report budget, by adding in the goal coloring

---------

Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>

* report budget database updates

* Goal progress bar (actualbudget#1734)

* first pass at progress bar

* db migration / enter goal in db

* add getGoal function

* stabilize

* whoops

* TS

* reset goal in db if no template found

* reconfirm

* release note

* typo

* rename migration

* to ms

* move priority logic, consistent variable names,

* fixup

* clear goal if template removed

* Visual goals (#40)

* 🔥 removing privacyMode feature flag (actualbudget#1688)

* 🎨  fix multiline label in schedules modal (actualbudget#1687)

* Update Visual Regression README File (actualbudget#1689)

* Fix typo in GoCardlessLink.js (actualbudget#1684)

happend -> happened

* queried cleared balance for tooltip (actualbudget#1678)

* Dark Theme Reports/Settings (actualbudget#1512)

* 🐛 Mobile account transaction list: Fix sticky date section headers (actualbudget#1698)

* 👷  do not cancel github ci jobs on master branch (actualbudget#1692)

* Sidebar Account Fix (actualbudget#1703)

* Dark Theme Final (actualbudget#1513)

* Category autocomplete should only search selectable categories  (actualbudget#1681)

* set colors based on a goal value

* extra comment

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>

* update release note

* lint

* use null as cleared state

* show goal status via colors (actualbudget#41)

* cleanup

* I think its working

* lint

* fix the error by adding colors to the report side (actualbudget#42)

* [refactor] Migrate Schedules Table to typescript (actualbudget#1691)

* 🔧  removing unnecessary manual module resolution (actualbudget#1707)

* 🐛 (mobile) scrolling in lists with pull-to-refresh (actualbudget#1706)

* 💄 (mobile) updating apple home-screen icon (actualbudget#1705)

* Enhance Y-Axis Scaling on Net Worth Graph (actualbudget#1709)

* fix report budget, by adding in the goal coloring

---------

Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>

* report budget database updates

* Fix schedule searchbar (actualbudget#1729)

---------

Co-authored-by: youngcw <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>
Co-authored-by: Mohamed Muhsin <[email protected]>

* working dynamic colors.  Need to figure out what changes are actually needed

* cleanup

* more cleanup

* lint

* reset the goal when applying a single template

* make getCategory function

* remove some unneeded changes

* actually remove the changes, not just comment

* cleanup some unneeded code that was causing some bugs. Works for me, but should be vetted more

* lint

* add json definitions to database

* use template feature flag to enable colors

* some fixes

* don't set goals for remainders, remove unneeded change

* lint

* release note

* lint again

* fix mobile crash

* undo changes in CellValue.tsx

* lint

* use getStyle

* move status calc to helper

* lint

* recommendations

* suggestion

Co-authored-by: Joel Jeremy Marquez <[email protected]>

---------

Co-authored-by: shall0pass <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Crazypkr1099 <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Shaan Khosla <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Trevor Farlow <[email protected]>
Co-authored-by: Mohamed Muhsin <[email protected]>
Co-authored-by: Joel Jeremy Marquez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants