-
Notifications
You must be signed in to change notification settings - Fork 707
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 UI deps #3163
Upgrade UI deps #3163
Conversation
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com> Conflicts: dashboard/yarn.lock
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
"@types/diff": "^5.0.1", | ||
"@types/google-protobuf": "^3.15.3", | ||
"@types/js-yaml": "^4.0.2", | ||
"@types/json-schema": "^7.0.8", | ||
"@types/jsonwebtoken": "^8.5.4", | ||
"@types/lodash": "^4.14.171", | ||
"@types/moxios": "^0.4.12", | ||
"@types/pako": "^1.0.2", | ||
"@types/qs": "^6.9.7", | ||
"@types/react": "^17.0.15", | ||
"@types/react-copy-to-clipboard": "^5.0.1", | ||
"@types/react-jsonschema-form": "^1.7.6", | ||
"@types/react-router-dom": "^5.1.8", | ||
"@types/react-router-hash-link": "^2.4.1", | ||
"@types/react-tabs": "^2.3.3", | ||
"@types/react-transition-group": "^4.4.2", | ||
"@types/semver": "^7.3.8", | ||
"@types/ws": "^7.4.7", |
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.
Moved to dev deps. Also, I removed all of them and just installed those ones Typescript was complaining (this way we reduce the types dependencies (as many of them are including also the definition of the types)
<MemoryRouter initialEntries={["/foo?q=foo"]}> | ||
<AppList /> | ||
</MemoryRouter>, |
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.
The main change here is replacing the jest.spyOn with the approach suggested in the official website: https://reactrouter.com/web/guides/testing
state: "", | ||
} as any); | ||
const wrapper = mountWrapper(defaultStore, <ContextSelector />); | ||
const history = createMemoryHistory({ initialEntries: ["/c/default-cluster/ns/ns-bar/catalog"] }); |
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.
An alternative way to the which allows using the variable to perform the checks
@@ -3,6 +3,7 @@ import { shallow } from "enzyme"; | |||
import Checkbox from "."; | |||
|
|||
const defaultProps = { | |||
id: "test", |
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.
A test that was generating an annoying warning for long time ago :P
import configureMockStore from "redux-mock-store"; | ||
import thunk from "redux-thunk"; | ||
import AppUpgrade from "../../components/AppUpgrade"; | ||
import Upgrade from "./AppUpgradeContainer"; | ||
|
||
const mockStore = configureMockStore([thunk]); | ||
|
||
const emptyLocation = { | ||
const emptyLocation: Location = { |
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 the type here (as in other files) and adding the required fields we were missing.
return ( | ||
<Redirect | ||
to={{ pathname: app.apps.list(this.props.cluster, this.props.currentNamespace) }} | ||
/> | ||
); | ||
} | ||
// There is not a default namespace, redirect to login page | ||
return <Redirect to={"/login"} />; | ||
return <Redirect to={{ pathname: "/login" }} />; |
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 upgrading the types, to
has a required pathname
property we were missing. I've updated the tests accordingly.
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.
Great - one small comment about the new dep (which may not be required soon).
dashboard/package.json
Outdated
@@ -37,6 +19,7 @@ | |||
"google-protobuf": "^3.17.3", | |||
"history": "^4.10.1", | |||
"immutable": "^4.0.0-rc.14", | |||
"isomorphic-form-data": "^2.0.0", |
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.
So it sounds from @dlaloue-vmware 's comments that this dependency is required by swagger-ui-react but wasn't declared as a dependency by them? Or something similar: swagger-api/swagger-ui#7436
Hah, although they mention there that: "On Thursday 29.7.2021 there will a new release of swagger-ui-react that will fix this issue automatically by updating to it.". Not sure if we wait, but if not, let's at least include a #TODO to remove it refering to the swagger-ui issue ?
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.
While writing this message, they have just bumped up the version: https://github.com/swagger-api/swagger-ui/releases/tag/v3.51.2, so I have updated it and removed the unnecessary dep straight away. Thanks for the pointer!
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com> Conflicts: dashboard/package.json dashboard/yarn.lock
Description of the change
This PR simply upgrades the UI deps, moves (and cleans up) the types deps to devOnly ones and performs minor changes related to the types (ie adding missing fields)
Benefits
We will be able to safely upgrade our UI deps again.
Possible drawbacks
Like in any other upgrade, perhaps we are missing something hidden behind the unit, e2e and manual tests.
Applicable issues
Additional information
Thanks @dlaloue-vmware for jumping in and suggesting the isomorphic-form-data dep.