-
Notifications
You must be signed in to change notification settings - Fork 13
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
DEVPROD-13581 bump @leafygreen-ui/tabs from 11.2.0 to 13.1.1 and refactor tab logic #521
DEVPROD-13581 bump @leafygreen-ui/tabs from 11.2.0 to 13.1.1 and refactor tab logic #521
Conversation
Bumps [@leafygreen-ui/tabs](https://github.com/mongodb/leafygreen-ui) from 11.2.0 to 13.1.1. - [Release notes](https://github.com/mongodb/leafygreen-ui/releases) - [Commits](https://github.com/mongodb/leafygreen-ui/compare/@leafygreen-ui/tabs@11.2.0...@leafygreen-ui/tabs@13.1.1) --- updated-dependencies: - dependency-name: "@leafygreen-ui/tabs" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
This is delayed on https://jira.mongodb.org/browse/LG-4696 I'll get to it once they release a fix |
if (!urlTab || !tabToIndexMap[urlTab]) { | ||
setSelectedTab(ConfigurePatchPageTabs.Tasks); | ||
} | ||
}, []); |
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.
nit. fix eslint warning either by adding comment or dependencies
useTabShortcut({ | ||
currentTab: selectedTab, | ||
currentTab: tabToIndexMap[state.selectedTab], | ||
numTabs: indexToTabMap.length, | ||
setSelectedTab, | ||
setSelectedTab: (i: number) => setSelectedTab(indexToTabMap[i]), | ||
}); | ||
|
||
// Handle redirecting to the correct tab if the tab is not active | ||
useEffect(() => { | ||
if (!urlTab || !tabToIndexMap[urlTab]) { | ||
setSelectedTab(ConfigurePatchPageTabs.Tasks); |
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.
could we group these hooks all together just for organizational purposes? (i.e. put the hooks first, then put the set
functions after)
if (!validateObjectId(patchId)) { | ||
// @ts-expect-error: FIXME. This comment was added by an automated script. | ||
return <Navigate to={getVersionRoute(patchId)} />; | ||
if (!validateObjectId(patchId || "")) { |
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.
can we extract this function call and use it both here and on L26 i.e.
const isMainlineVersion = !validateObjectId(patchId || "")
if (sendAnalytics) { | ||
sendEvent({ name: "Changed tab", tab: newTab }); |
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.
does this ever get called? It seems like whenever we're calling the handleTabChange
function in this file, sendAnalytics
is false
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 fixed!
} | ||
`; | ||
` as ComponentType<TabsProps>; |
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.
is the as ComponentType<TabsProps>
necessary?
I think we may also want to respond on LG-4696. I think the typing of setSelected
seems to be funky, not sure why they prescribe using Dispatch<SetStateAction<number>>
and not a more flexible implementation
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.
Yes it is to get it to work well with Emotion. I left a comment on the slack thread irt the weird Dispatch<SetState...
typing but I also followed up on the ticket
navigate(getVersionRoute(versionId), { replace: true }); | ||
const handleTabChange = ( | ||
newTab: VersionPageTabs, | ||
sendAnalytics: boolean = false, |
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.
I think it makes sense to make it a required parameter since the argument is always being provided
sendAnalytics: boolean = false, | |
sendAnalytics: boolean, |
Bumps @leafygreen-ui/tabs from 11.2.0 to 13.1.1.
Release notes
Sourced from
@leafygreen-ui/tabs
's releases.... (truncated)
Commits
e77667e
Version Packages (#2556)2033292
Version Packages (#2554)ba51267
LG-4620:ChartCard
andHeader
components (#2550)5626b54
LG-4682: Update icon build script path (#2552)89ada4b
Version Packages (#2553)22d5b2d
Lg 4664: Add revert icon (#2551)bca3969
LG-4680:Tabs
removessetSelectedd
prop (#2548)172df2d
Version Packages (#2544)65c6f32
LG-4507: bump packages to@leafygreen-ui/form-field
v1.2.5 (#2543)eb914eb
Version Packages (#2542)You can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)