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

Add sap-system/databases linking from host overview #369

Merged
merged 2 commits into from
Apr 19, 2022

Conversation

rtorrero
Copy link
Contributor

@rtorrero rtorrero commented Apr 18, 2022

This PR adds linking to sap-systems and databases overview from the SID column. I've added it as draft as I'm not really sure there is a better way to do this. It gets a bit ugly when we need to apply some logic to find out if the SID should link to a DB or a sap-system.

Thanks to @arbulu89 for the help!

Peek 18-04-2022 16-53

@rtorrero rtorrero marked this pull request as ready for review April 19, 2022 07:25
@rtorrero rtorrero requested review from fabriziosestito, dottorblaster, nelsonkopliku and arbulu89 and removed request for dottorblaster April 19, 2022 07:25
return instance;
};

const getSapSystemsByHost = (sapSystems, hostId) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this can be a selector on the state, selecting all the instances on a host.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! nice, I see you used it in HostDetails, going to give it a try

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a ticket to figure out later how to use this. It seems to work on first load, but breaks after a refresh. I suspect that useSelector is not intended to be used each time we iterate on the hosts list to display each entry of the table. The warning itself after it breaks is:

Warning: React has detected a change in the order of Hooks called by HostsList. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

@nelsonkopliku
Copy link
Member

as a reminder for possible improvements.

I am not completely confident with the choice of how we show the sap systems on a host.
I see a list of sids, but I miss the information about whether it is an application instance or a database instance.

Then are we solely interested in instances or the aggregation SapSystem and Database?

As an alternative UI I'd consider having sort of a popover if the information needs to be more than the simple sid.

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rtorrero Nice! Happy to see that we don't need to have hacky things hehe
I added some comments so we can maybe simplify a bit the PR. We can discuss on them if you want

filter: (filter, key) => (element) =>
element[key].some((sid) => filter.includes(sid)),
render: (sids, { sap_systems }) => {
let sidsArray = sids.map((sid, index) => [
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 maybe just return this map instead of storing and returning later

assets/js/components/HostsList.jsx Outdated Show resolved Hide resolved
@rtorrero rtorrero force-pushed the add-cluster-details-links branch from f6e5b34 to 4a40135 Compare April 19, 2022 15:20
@rtorrero rtorrero merged commit a5b006f into main Apr 19, 2022
@rtorrero rtorrero deleted the add-cluster-details-links branch April 19, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants