-
Notifications
You must be signed in to change notification settings - Fork 367
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
tech-story: [M3-8784] - Tanstack routing for Domains #11418
Conversation
@@ -15,7 +15,7 @@ import { useCreateAccountBetaMutation } from 'src/queries/account/betas'; | |||
import { useBetaQuery } from 'src/queries/betas'; | |||
|
|||
export const BetaSignup = () => { | |||
const betaAgreement = `# Early Adopter Testing Program | |||
const betaAgreement = `### Early Adopter Testing Program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was caught by my route test once I made it more resilient. It caught two H1
headers on the page 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, solid test!
// paramKey: 'volumeId', | ||
// queryHook: useVolumeQuery, | ||
// redirectToOnNotFound: '/volumes', | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left over code i had forgotten to cleanup
ended: DateTime.now().plus({ days: 5 }).toISO(), | ||
enrolled: undefined, | ||
started: DateTime.now().minus({ days: 30 }).toISO(), | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to PR - just bettering the mocking experience in /betas
to have an active non-enrolled one featured in the list
http.get('*/domains/*/records', () => { | ||
const records = domainRecordFactory.buildList(1); | ||
return HttpResponse.json(makeResourcePage(records)); | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were missing those, resulting in test failures with the route testing
useQuery<Domain, APIError[]>({ | ||
...domainQueries.domain(id), | ||
enabled, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding an enabled
toggle
|
||
export const domainDetailLazyRoute = createLazyRoute('/domains/$domainId')({ | ||
component: DomainDetail, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder we have decided to consolidate lazy routes in their own file (there is no particular need to have them within the component itself, which could be problematic for HMR)
}; | ||
}), | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition allows to bypass any loading
state from react-query
so we can always assert for a header
Coverage Report: ❌ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests & checks pass ✅
Navigation & routed drawers at /domains
✅
Pagination ✅
Sorting ✅
Navigation & drawers at /domains/{id}
✅
⚠️ note: domain details (adding records) drawers also should be routed [...]
Another thing to include in the next ticket is having the routing update when "Delete Domain" is clicked from the domain detail page (clicking "Delete" on the domain landing page updates the route)
@@ -127,9 +126,12 @@ export const CreateDomain = () => { | |||
const isCreatingPrimaryDomain = values.type === 'master'; | |||
const isCreatingSecondaryDomain = values.type === 'slave'; | |||
|
|||
const redirect = (id: '' | number, state?: Record<string, string>) => { | |||
const redirect = (id: '' | number, _state?: Record<string, string>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_state
doesn't get used in the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out: I handled this more clearly in e784402
bit of a weird edge case but worth keeping parity over indeed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Navigation to the different routes, ordering, and pagination generally worked as expected. ✅
I left a couple of observations.
@@ -15,7 +15,7 @@ import { useCreateAccountBetaMutation } from 'src/queries/account/betas'; | |||
import { useBetaQuery } from 'src/queries/betas'; | |||
|
|||
export const BetaSignup = () => { | |||
const betaAgreement = `# Early Adopter Testing Program | |||
const betaAgreement = `### Early Adopter Testing Program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, solid test!
f726f3b
to
808364b
Compare
Solid review @mjac0bs - thanks for the fix and pointers. Fixed the clone issue, created ticket for others! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Cloud Manager UI test results🎉 470 passing tests on test run #12 ↗︎
|
Cloud Manager E2E Run #6995
Run Properties:
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
Passed #6995
|
Run duration | 26m 58s |
Commit |
26adcaca8f: tech-story: [M3-8784] - Tanstack routing for Domains (#11418)
|
Committer | Alban Bailly |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
2
|
Pending |
2
|
Skipped |
0
|
Passing |
470
|
View all changes introduced in this branch ↗︎ |
* save progress * SURGERY * Implement basic routing * Wrap up routing * fix unit * routes test update * better handling in test * fix smoke test * Added changeset: Refactor Domains Feature Routing * MSW fix * edit changeset * mock path consistency * feedback @dwiley-akamai * feedback @mjac0bs * fix e2e
Description 📝
Pretty simple PR (relative to the complex work that needed to be done for the
/volume
routing refactoring) to handle the Tanstack router migration for /domainsNothing out of the ordinary for this one, just follows the now established routing patterns (soon to be documented)
Changes 🔄
-/domains routing setup
useOrderV2
&usePaginationV2
DomainRecords
is a very large class component I decided to come back and do it once it's been broken down and converted to a functional component (M3-9015
&M3-9016
)Preview 📷
No visual difference to be expected (except for loading state in drawers)
How to test 🧪
Verification steps
/domains
/domains/{id}
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅