-
Notifications
You must be signed in to change notification settings - Fork 74
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
Upgrade Next version in Admin UI and Privacy Center #5111
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
15a9dd6
to
258adda
Compare
@@ -1,4 +1,3 @@ | |||
NEXT_PUBLIC_FIDESOPS_API=http://0.0.0.0:8080 | |||
NEXT_PUBLIC_FIDESCTL_API=/api/v1 | |||
NEXT_PUBLIC_FIDESCTL_API_SERVER=http://0.0.0.0:8080 |
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 never use NEXT_PUBLIC_FIDESCTL_API_SERVER
in tests so I removed it.
@@ -8,7 +8,7 @@ describe("Nav Bar", () => { | |||
it("renders all navigation groups with links inside", () => { | |||
cy.visit("/"); | |||
|
|||
cy.get("nav button").should("have.length", 7); | |||
cy.get("[id^='accordion-button']").should("have.length", 4); |
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.
After updating uses of NextLink
s, some of the elements are an <a>
now depending on what they do. So this update is for testing for the actual group headings instead, as the test name suggests.
// Export the static site for production. | ||
// Rewrites are not supported in static sites. | ||
if (process.env.PROD_EXPORT === "true") { | ||
delete nextConfig.rewrites; | ||
nextConfig.output = "export"; | ||
} |
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.
these changes are needed because next export
has been removed in favor of output: "export"
.
@@ -203,7 +203,7 @@ export const DefaultHeaderCell = <T,>({ | |||
</Text> | |||
); | |||
|
|||
interface EnableCellProps extends Omit<SwitchProps, "value"> { | |||
interface EnableCellProps extends Omit<SwitchProps, "value" | "onToggle"> { |
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.
updated type
definition means these onToggle
types are no longer compatible so we needed to omit here in favor of our own definition for this use case.
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 usage of Omit
! I'll keep this in mind for later
@@ -1,4 +1,5 @@ | |||
{ | |||
"private": true, |
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.
eliminates build warnings about missing "license"
{ | ||
"presets": ["next/babel"] | ||
} |
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.
next no longer uses babel
}, | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
] | ||
}, | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts"], | ||
"include": [ | ||
"next-env.d.ts", | ||
"**/*.ts", | ||
"**/*.tsx", | ||
"**/*.d.ts", | ||
".next/types/**/*.ts" | ||
], |
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.
these changes were added automatically after upgrading next
and I didn't argue.
Passing run #9097 ↗︎
Details:
Review all test suite changes for PR #5111 ↗︎ |
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 work with this migration, I know it wasn't as straightforward as it sounds! I just left a few comments, one for my understanding, and one for a minor label change. Otherwise, this worked as expected, I was able to build it locally and navigate around the app just fine
@@ -50,7 +50,7 @@ | |||
"lodash.snakecase": "^4.1.1", | |||
"msw": "^1.2.1", | |||
"narrow-minded": "^1.2.1", | |||
"next": "^12.3.4", | |||
"next": "^14.2.5", |
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.
🏅
@@ -203,7 +203,7 @@ export const DefaultHeaderCell = <T,>({ | |||
</Text> | |||
); | |||
|
|||
interface EnableCellProps extends Omit<SwitchProps, "value"> { | |||
interface EnableCellProps extends Omit<SwitchProps, "value" | "onToggle"> { |
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 usage of Omit
! I'll keep this in mind for later
ref={preview} | ||
ref={(element) => { | ||
preview(element); | ||
}} |
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 you explain this change?
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.
Resolving kind of a weird Type issue here.
React's ref
expects to be passed a React.ReactNode
object or to be undefined
. On the other hand, preview
is returning a React.ReactNode
object or null
. By explicitly creating an arrow function here, ref
no longer expects undefined
and the Types are compatible, since ref passes the element as React.ReactNode or null
.
I'm assuming this popped up because upgrading eslint-config-next
is slightly more strict than before.
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 the explanation!
clients/admin-ui/src/features/user-management/UserManagementTableActions.tsx
Outdated
Show resolved
Hide resolved
fc20e10
to
1806e72
Compare
1806e72
to
96e026f
Compare
7d3d01e
to
96e026f
Compare
96e026f
to
b043a90
Compare
Passing run #9099 ↗︎
Details:
Review all test suite changes for PR #5111 ↗︎ |
Closes PROD-2077
Description Of Changes
Upgrades our clients to NextJS version 14. We need to upgrade to a later version to be able to use server-side props.
Code Changes
NextLink
which had breaking changesnext export
is no longer available. Useoutput: "export"
on the config instead.next
andeslint-config-next
to latest version (currently 14.2.5)Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md