-
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
Remove old js components: Card, Table #6560
Remove old js components: Card, Table #6560
Conversation
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]> Conflicts: dashboard/src/components/AppList/AppListItem.tsx dashboard/src/components/AppView/AccessURLTable/AccessURLTable.tsx dashboard/src/components/AppView/AppControls/RollbackButton/RollbackDialog.test.tsx dashboard/src/components/Config/PkgRepoList/PkgRepoList.tsx dashboard/src/components/SearchFilter/SearchFilter.tsx dashboard/src/components/hooks/useOutsideClick/useOutsideClick.test.tsx dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
✅ Deploy Preview for kubeapps-dev canceled.Built without sensitive environment variables
|
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]> Conflicts: dashboard/src/components/AppView/AppView.tsx dashboard/src/components/Catalog/Catalog.tsx dashboard/src/components/DeploymentForm/DeploymentForm.tsx dashboard/src/components/OperatorInstance/OperatorInstance.tsx dashboard/src/components/OperatorList/OperatorList.tsx dashboard/src/components/OperatorNew/OperatorNew.tsx dashboard/src/components/OperatorView/OperatorView.tsx dashboard/src/components/PackageHeader/PackageView.test.tsx dashboard/src/containers/ConfigLoaderContainer/ConfigLoaderContainer.ts dashboard/src/containers/RoutesContainer/Routes.test.tsx dashboard/src/containers/RoutesContainer/Routes.tsx
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]> Conflicts: dashboard/src/components/AppView/AppView.tsx dashboard/src/components/Catalog/Catalog.tsx dashboard/src/components/ConfigLoader/ConfigLoader.tsx dashboard/src/components/DeploymentForm/DeploymentForm.tsx dashboard/src/components/Header/ContextSelector.test.tsx dashboard/src/components/OperatorInstance/OperatorInstance.tsx dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.tsx dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.test.tsx dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx dashboard/src/components/OperatorList/OperatorList.tsx dashboard/src/components/OperatorNew/OperatorNew.test.tsx dashboard/src/components/OperatorNew/OperatorNew.tsx dashboard/src/components/OperatorView/OperatorView.test.tsx dashboard/src/components/OperatorView/OperatorView.tsx dashboard/src/components/PackageHeader/PackageView.test.tsx dashboard/src/components/PackageHeader/PackageView.tsx dashboard/src/components/UpgradeForm/UpgradeForm.tsx dashboard/src/components/js/Button/Button.test.js dashboard/src/containers/ConfigLoaderContainer/ConfigLoaderContainer.ts
Signed-off-by: Antonio Gamez Diaz <[email protected]> Conflicts: dashboard/src/components/AppList/AppListGrid.tsx dashboard/src/components/AppUpgrade/AppUpgrade.test.tsx dashboard/src/components/AppUpgrade/AppUpgrade.tsx dashboard/src/components/AppView/AppControls/RollbackButton/RollbackDialog.tsx dashboard/src/components/AppView/AppView.tsx dashboard/src/components/Catalog/Catalog.tsx dashboard/src/components/ConfirmDialog/ConfirmDialog.tsx dashboard/src/components/DeploymentForm/DeploymentForm.tsx dashboard/src/components/Header/ContextSelector.tsx dashboard/src/components/OperatorInstance/OperatorInstance.tsx dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.tsx dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx dashboard/src/components/OperatorList/OperatorList.tsx dashboard/src/components/OperatorNew/OperatorNew.tsx dashboard/src/components/OperatorView/OperatorView.tsx dashboard/src/components/PackageHeader/PackageReadme.tsx dashboard/src/components/PackageHeader/PackageView.tsx dashboard/src/components/SelectRepoForm/SelectRepoForm.tsx dashboard/src/components/UpgradeForm/UpgradeForm.tsx dashboard/src/components/js/Button/Button.test.js
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]> Conflicts: dashboard/src/components/Config/PkgRepoList/PkgRepoList.tsx dashboard/src/components/FilterGroup/__snapshots__/FilterGroup.test.tsx.snap
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]> Conflicts: dashboard/src/components/Config/PkgRepoList/PkgRepoList.test.tsx dashboard/src/components/Config/PkgRepoList/PkgRepoList.tsx dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx
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.
Sorry, I'd missed that this one was still waiting for a review.
// Copyright 2020-2023 the Kubeapps contributors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export interface ICardImageProps { | ||
src: string; | ||
alt: string; | ||
} | ||
|
||
const CardImage = ({ src, alt }: ICardImageProps) => { | ||
return ( | ||
<div className="card-img"> | ||
<img src={src} alt={alt} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CardImage; |
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.
Almost doesn't seem worth a separate component?
// Copyright 2020-2023 the Kubeapps contributors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import React from "react"; | ||
|
||
export interface ICardTextProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
const CardText = ({ children }: ICardTextProps) => { | ||
return <div className="card-text">{children}</div>; | ||
}; | ||
|
||
export default CardText; |
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.
Same here. Is it a react thing to break the elements up like this? Seems like a /InfoCard/Card
could just have the text and image without splitting those out into separate components?
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.
100% agree, no actual benefits, especially if we ever plan to use the card from clarity at some point in the future. I thought the same while moving the code to tsx. I'll make a follow-up PR with the changes shortly.
### Description of the change As pointed out #6560 (comment), we were using plenty of sub-components with no clear motivation. This is to simplify the `InfoCard` component in a single one, as it is just `<div>` and CSS classes. ### Benefits No unused or with extra complexity code. ### Possible drawbacks N/A ### Applicable issues - related #6563 ### Additional information Before/after pics, they look exactly the same, which is what is intended here. ![image](https://github.com/vmware-tanzu/kubeapps/assets/11535726/03bc0a9d-256b-4a42-81fd-98159a181b63) Extra: I'm also squeezing two minor CSS changes: 1) I [ran a tool for detecting unused code](https://www.npmjs.com/package/webpack-deadcode-plugin), and noticed there were some CSS files being inconsistently imported; 2) the secrets view was badly positioned, see below: <details><summary>Secrets view</summary> ![image](https://github.com/vmware-tanzu/kubeapps/assets/11535726/c87e8689-ec1f-4454-91bb-fcfe1a2cdb04) </details> --------- Signed-off-by: Antonio Gamez Diaz <[email protected]>
Description of the change
This PR is following up #6554 (and requires it to get merged first). In this final one, the focus is on:
Card
and its sub-components to tsx.Table
to tsxBenefits
No cool before/after pics this time :P Here we have just migrated js-based code to typescript.
However, after this PR we will able to say we finally got rid of the legacy js-components!!
Possible drawbacks
N/A - hopefully.
Applicable issues
Related to #6563
Additional information
While transforming the
Card
to tsx I also had a look at theCdsCard
from Clarity. Unfortunately, there is no drop-in replacement; a migration would require plenty of style-related changes. Besides, the "native" style differs a bit from the general style we have in Kubeapps. Below are some examples:Example from the Clarity website
Quick/dirty replacement, it does not look good
Our current custom card