Skip to content

Configurable domain page details#3294

Merged
havetisyan merged 6 commits intoAthenZ:masterfrom
MartinTrojans:configurable-domain-page-details
Apr 9, 2026
Merged

Configurable domain page details#3294
havetisyan merged 6 commits intoAthenZ:masterfrom
MartinTrojans:configurable-domain-page-details

Conversation

@MartinTrojans
Copy link
Copy Markdown
Contributor

@MartinTrojans MartinTrojans commented Apr 9, 2026

Description

  • Fix showMicrosegmentation
  • Add a feature flag to show cloud account details

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Attach Screenshots (Optional)

dma added 4 commits April 9, 2026 00:57
Add two new config flags (both default true for backward compatibility):
- showCloudAccountDetails: controls visibility of AWS Account ID,
  GCP Project ID, and Onboard to AWS button in domain details header
- useSignedDomainsForAdminDomains: when false, admin-domains service
  skips the getSignedDomains call and returns domain names only from
  getDomainList, useful when the UI service identity lacks permission
  to call getSignedDomains

Signed-off-by: dma <dma@yahooinc.com>
Made-with: Cursor
The admin-domains service should always use getSignedDomains. The
previous authorization issue that prompted this flag has been resolved
by configuring the ZMS authorized_services and Okta authority.

Made-with: Cursor
Signed-off-by: dma <dma@yahooinc.com>
showMicrosegmentation and showCloudAccountDetails were missing from
the appConfig initialization in module.exports.load, causing them to
always be undefined. Since the feature-flag service checks
`appConfig.showMicrosegmentation !== false`, undefined !== false
evaluated to true, making the flags impossible to disable via config.

Made-with: Cursor
Signed-off-by: dma <dma@yahooinc.com>
Add selector tests for selectShowCloudAccountDetails covering default,
disabled, and unset cases. Add DomainDetails component tests verifying
cloud account info is hidden when the flag is false and shown when true.

Made-with: Cursor
Signed-off-by: dma <dma@yahooinc.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new feature flag, showCloudAccountDetails, to conditionally render cloud account information and onboarding options within the DomainDetails component. The changes include adding a new Redux selector, updating the default configuration, and modifying the server-side API handlers to support this flag. Feedback was provided to improve the readability of the conditional rendering in the UI by grouping adjacent sections with a React.Fragment and using more idiomatic React patterns.

Comment on lines +552 to +571
{this.props.showCloudAccountDetails ? (
<SectionDiv>
<ValueDiv>
{this.props.domainDetails.account
? this.props.domainDetails.account
: 'N/A'}
</ValueDiv>
<LabelDiv>AWS ACCOUNT ID</LabelDiv>
</SectionDiv>
) : null}
{this.props.showCloudAccountDetails ? (
<SectionDiv>
<ValueDiv>
{this.props.domainDetails.gcpProject
? this.props.domainDetails.gcpProject
: 'N/A'}
</ValueDiv>
<LabelDiv>GCP PROJECT ID</LabelDiv>
</SectionDiv>
) : null}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The showCloudAccountDetails check is repeated for two adjacent sections. These can be grouped together using a React.Fragment to improve readability and reduce redundancy. Additionally, using the logical AND (&&) operator is more idiomatic in React for conditional rendering when no fallback is needed.

Suggested change
{this.props.showCloudAccountDetails ? (
<SectionDiv>
<ValueDiv>
{this.props.domainDetails.account
? this.props.domainDetails.account
: 'N/A'}
</ValueDiv>
<LabelDiv>AWS ACCOUNT ID</LabelDiv>
</SectionDiv>
) : null}
{this.props.showCloudAccountDetails ? (
<SectionDiv>
<ValueDiv>
{this.props.domainDetails.gcpProject
? this.props.domainDetails.gcpProject
: 'N/A'}
</ValueDiv>
<LabelDiv>GCP PROJECT ID</LabelDiv>
</SectionDiv>
) : null}
{this.props.showCloudAccountDetails && (
<React.Fragment>
<SectionDiv>
<ValueDiv>
{this.props.domainDetails.account
? this.props.domainDetails.account
: 'N/A'}
</ValueDiv>
<LabelDiv>AWS ACCOUNT ID</LabelDiv>
</SectionDiv>
<SectionDiv>
<ValueDiv>
{this.props.domainDetails.gcpProject
? this.props.domainDetails.gcpProject
: 'N/A'}
</ValueDiv>
<LabelDiv>GCP PROJECT ID</LabelDiv>
</SectionDiv>
</React.Fragment>
)}

dma added 2 commits April 9, 2026 10:49
Made-with: Cursor
Signed-off-by: dma <dma@yahooinc.com>
Group adjacent showCloudAccountDetails conditionals into a single
check using React.Fragment and the && operator for idiomatic React
conditional rendering.

Made-with: Cursor
Signed-off-by: dma <dma@yahooinc.com>
@havetisyan havetisyan merged commit 51fda18 into AthenZ:master Apr 9, 2026
4 of 5 checks passed
@MartinTrojans MartinTrojans deleted the configurable-domain-page-details branch April 9, 2026 23:07
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.

2 participants