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

Sid linking from clusters #1715

Merged
merged 18 commits into from
Aug 22, 2023
Merged

Sid linking from clusters #1715

merged 18 commits into from
Aug 22, 2023

Conversation

rtorrero
Copy link
Contributor

Description

This PR adds a tooltip for the SapSystemLink component so that when the linked SapSystem is not registered, a warning is shown.

It also adjusts the ClusterList to use this new component.

How was this tested?

Automated tests added

@rtorrero rtorrero force-pushed the sid-linking-from-clusters branch 2 times, most recently from e5ffe57 to bace198 Compare August 16, 2023 14:42
@rtorrero rtorrero force-pushed the sid-linking-from-clusters branch from bace198 to e86d2bf Compare August 16, 2023 15:11
@rtorrero rtorrero marked this pull request as ready for review August 16, 2023 15:17
Comment on lines 108 to 109
systemType={linkData ? linkData.type : null}
sapSystemId={linkData ? linkData.sap_system_id : null}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use lodash's get function to get type and sap_system_id out of linkData

);

return (
<SapSystemLink
Copy link
Contributor

Choose a reason for hiding this comment

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

mapping and returning JSX elements should require a key prop to be passed, can you do that?

assets/js/components/ClustersList.test.jsx Show resolved Hide resolved
Comment on lines 43 to 45
return foundInstance
? { sap_system_id: foundInstance.sap_system_id, type: foundInstance.type }
: null;
Copy link
Contributor

Choose a reason for hiding this comment

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

You can directly return foundInstance without any fuss

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.

Hey @rtorrero ,
Some comments.
Besides that, I'm a bit surprised with the implementation, because as far as I see, it doesn't follow what our backlog ticket asks:

- Add link to SID colum in Cluster overview
- When SAP system or HANA Database is not registered, remove link from SID column in Cluster overview 

(Anyway, I personally like more the current implementation behaviour, being honest)

assets/js/components/ClustersList.jsx Outdated Show resolved Hide resolved
@@ -1,9 +1,11 @@
import React from 'react';
import { EOS_WARNING_OUTLINED } from 'eos-icons-react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we want to change this component?
In the past, for this exact feature (adding a not registered tooltip to the link) we have created a new component, to not change the behaviour of this one (ClusterNodeLink).
Maybe we should follow the same pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I was looking how to add this I noticed that we have already a bunch of of *Link components that to basically very similar things. I'm leaning more towards keeping less components and add more when we need them. Wdyt?

systemType={linkData ? linkData.type : null}
sapSystemId={linkData ? linkData.sap_system_id : null}
>
{singleSid}
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens on multiple sids here?
Are they separated by spaces?

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've used the tests to render how it would look like:

Captura desde 2023-08-21 13-40-38

Captura desde 2023-08-21 13-50-23

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After speaking with @dottorblaster we decided it might look better if we add the coma back. @jagabomb wdyt?
Captura desde 2023-08-21 15-37-22

@rtorrero rtorrero force-pushed the sid-linking-from-clusters branch from caeb902 to 205711b Compare August 21, 2023 15:12
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.

Some additional suggestions

assets/js/state/selectors/index.js Outdated Show resolved Hide resolved
assets/js/state/selectors/index.js Outdated Show resolved Hide resolved
assets/js/components/SapSystemLink.test.jsx Outdated Show resolved Hide resolved
assets/js/components/SapSystemLink.test.jsx Outdated Show resolved Hide resolved
assets/js/components/SapSystemLink.test.jsx Outdated Show resolved Hide resolved
assets/js/components/SapSystemLink.test.jsx Outdated Show resolved Hide resolved
assets/js/components/ClustersList.jsx Outdated Show resolved Hide resolved
assets/js/components/ClustersList.jsx Outdated Show resolved Hide resolved
@rtorrero rtorrero requested a review from arbulu89 August 22, 2023 10:02
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.

Just putting read for the userEvent thing XD

assets/js/components/ClustersList.jsx Outdated Show resolved Hide resolved
assets/js/components/ClustersList.jsx Outdated Show resolved Hide resolved
assets/js/components/HostsList.jsx Outdated Show resolved Hide resolved
assets/js/components/SapSystemLink.test.jsx Outdated Show resolved Hide resolved
assets/js/state/selectors/index.js Outdated Show resolved Hide resolved
@rtorrero rtorrero requested a review from arbulu89 August 22, 2023 12:11
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.

Thanks @rtorrero
All good from my side!
PD: I guess this needs to be extrapolated to the HANA and ASCS/ERS cluster views

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

Go go go!

@rtorrero rtorrero merged commit b89d42b into main Aug 22, 2023
@rtorrero rtorrero deleted the sid-linking-from-clusters branch August 22, 2023 13:01
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