Skip to content
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

Merged
merged 1 commit into from
May 18, 2021

Conversation

rawagner
Copy link
Contributor

@rawagner rawagner commented May 13, 2021

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 by HostsTable (we will need some util method to do this in the future). And passes the mapped hosts to HostsTable. Since no callbacks for the actions are provided, the table is in read-only mode.

HostsTable in OpenShift Console
Screenshot from 2021-05-13 11-29-12

Expanded state
Screenshot from 2021-05-13 11-29-27

@rawagner rawagner force-pushed the generic_hoststable branch 11 times, most recently from 816d741 to 2049e4d Compare May 14, 2021 15:06
@rawagner rawagner changed the title [WIP] Make HostsTable more generic Make HostsTable more generic May 14, 2021
@rawagner rawagner force-pushed the generic_hoststable branch 7 times, most recently from 5a6ca31 to 8bbb58d Compare May 17, 2021 08:58
mareklibra
mareklibra previously approved these changes May 18, 2021
Copy link
Contributor

@mareklibra mareklibra left a 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.

jtomasek
jtomasek previously approved these changes May 18, 2021
setDiscoveryHintModalOpen?: HostsNotShowingLinkProps['setDiscoveryHintModalOpen'];
};

const HostsTableCluster: React.FC<HostsTableClusterProps & WithTestID> = ({

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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.

@rawagner rawagner dismissed stale reviews from jtomasek and mareklibra via 99f9bed May 18, 2021 11:16
@rawagner rawagner force-pushed the generic_hoststable branch from 8bbb58d to 99f9bed Compare May 18, 2021 11:16
@mareklibra mareklibra merged commit 6ba4c31 into openshift-assisted:master May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants