Skip to content

Commit dc14277

Browse files
authored
fix: Do not display Global account and Subaccount id if not present (kyma-project#4357)
* fix: do not display global account and subaccount id if not present * refactor: simplify cluster values rendering conditions * fix: global account id and subaccount id undefined error * fix: fix typing errors in tests * test: fix click timeout error
1 parent a946d07 commit dc14277

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

src/components/Clusters/views/ClusterOverview/ClusterDetails.jsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { DynamicPageComponent } from 'shared/components/DynamicPageComponent/Dyn
1111
import ResourceDetailsCard from 'shared/components/ResourceDetails/ResourceDetailsCard';
1212
import ClusterModulesCard from './ClusterModulesCard';
1313
import { ClusterStorageType } from '../ClusterStorageType';
14-
import { EMPTY_TEXT_PLACEHOLDER } from 'shared/constants';
1514
import { CommunityModuleContextProvider } from 'components/Modules/community/providers/CommunityModuleProvider';
1615
import { ModuleTemplatesContextProvider } from 'components/Modules/providers/ModuleTemplatesProvider';
1716
import { useGetEnvironmentParameters } from './useGetEnvironmentParameters';
@@ -85,21 +84,19 @@ export default function ClusterDetails({ currentCluster }) {
8584
</Text>
8685
</DynamicPageComponent.Column>
8786
<GardenerProvider />
88-
{kymaResourceLabels && (
89-
<>
90-
<DynamicPageComponent.Column
91-
title={t('clusters.overview.global-account-id')}
92-
>
93-
{kymaResourceLabels['kyma-project.io/global-account-id'] ??
94-
EMPTY_TEXT_PLACEHOLDER}
95-
</DynamicPageComponent.Column>
96-
<DynamicPageComponent.Column
97-
title={t('clusters.overview.subaccount-id')}
98-
>
99-
{kymaResourceLabels['kyma-project.io/subaccount-id'] ??
100-
EMPTY_TEXT_PLACEHOLDER}
101-
</DynamicPageComponent.Column>
102-
</>
87+
{!!kymaResourceLabels?.['kyma-project.io/global-account-id'] && (
88+
<DynamicPageComponent.Column
89+
title={t('clusters.overview.global-account-id')}
90+
>
91+
{kymaResourceLabels['kyma-project.io/global-account-id']}
92+
</DynamicPageComponent.Column>
93+
)}
94+
{!!kymaResourceLabels?.['kyma-project.io/subaccount-id'] && (
95+
<DynamicPageComponent.Column
96+
title={t('clusters.overview.subaccount-id')}
97+
>
98+
{kymaResourceLabels['kyma-project.io/subaccount-id']}
99+
</DynamicPageComponent.Column>
103100
)}
104101
{!environmentParametersLoading && !!natGatewayIps && (
105102
<DynamicPageComponent.Column

tests/integration/tests/kyma-cluster/test-kyma-modules.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ context('Test Kyma Modules views', () => {
2020
});
2121

2222
it('Check if edit is empty', () => {
23-
cy.wait(500);
23+
cy.wait(1000);
24+
2425
cy.inspectTab('Edit');
2526

2627
cy.contains('No modules installed').should('be.visible');
2728

29+
cy.wait(1000);
30+
2831
cy.inspectTab('View');
2932
});
3033

tests/integration/tests/namespace/test-reduced-permissions--configuration.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ context('Test reduced permissions 2', () => {
9595
.contains('Namespaces')
9696
.click();
9797

98-
cy.wait(500).typeInSearch('kube-public');
98+
cy.wait(1000);
99+
100+
cy.typeInSearch('kube-public');
99101

100102
cy.clickListLink('kube-public');
101103

0 commit comments

Comments
 (0)