-
Notifications
You must be signed in to change notification settings - Fork 37
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
Make HostsTable more generic #601
Make HostsTable more generic #601
Conversation
816d741
to
2049e4d
Compare
5a6ca31
to
8bbb58d
Compare
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.
Verified that the Assisted-UI still works.
setDiscoveryHintModalOpen?: HostsNotShowingLinkProps['setDiscoveryHintModalOpen']; | ||
}; | ||
|
||
const HostsTableCluster: React.FC<HostsTableClusterProps & WithTestID> = ({ |
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: ClusterHostsTable
might be a bit better.
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.
sounds good!
I also wonder - dont we want to move these generic components to some specific folder so we can have easier time identifying if its being reused in ACM/OCP or not ?
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 would not organize that for ACM/OCP. We are a library which is used in other contexts as well (+3).
We have already "naming contexts" on the top-level export. We can put some effort to better identify what to export/hide, recently we blindly reexport almost everything.
8bbb58d
to
99f9bed
Compare
This PR changes HostsTable to make it reusable for other environments.
The table now accepts callbacks for all actions so the consumer can use its own way of opening modals.
If no callback for the action is provided, then its not shown (the table becomes read-only)
Example of consuming the table is here https://github.com/rawagner/dynamic-cim/blob/infra_hosts/src/components/Agent/AgentTable.tsx#L24
The
AgentTable
fetches Agent CR from k8s, maps the fields of the CR to format expected byHostsTable
(we will need some util method to do this in the future). And passes the mapped hosts toHostsTable
. Since no callbacks for the actions are provided, the table is in read-only mode.HostsTable
in OpenShift ConsoleExpanded state
![Screenshot from 2021-05-13 11-29-27](https://user-images.githubusercontent.com/2078045/118107015-8fb44600-b3de-11eb-80e9-3d77bad8385a.png)