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

fix: Busola is flickering when ObjectPage is opened #3498

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { useAfterInitHook } from 'state/useAfterInitHook';
import useSidebarCondensed from 'sidebar/useSidebarCondensed';
import { useGetValidationEnabledSchemas } from 'state/validationEnabledSchemasAtom';
import { useGetKymaResources } from 'state/kymaResourcesAtom';
import { Spinner } from 'shared/components/Spinner/Spinner';

export default function App() {
const language = useRecoilValue(languageAtom);
Expand All @@ -59,7 +60,7 @@ export default function App() {
useResourceSchemas();
useSidebarCondensed();

useAuthHandler();
const { isLoading } = useAuthHandler();
useGetConfiguration();
useGetExtensions();
useGetExtensibilitySchemas();
Expand All @@ -75,6 +76,10 @@ export default function App() {
useAfterInitHook(kubeconfigIdState);
useGetKymaResources();

if (isLoading) {
return <Spinner />;
}

return (
<div id="html-wrap">
<Header />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { PluginStack, useUIStore } from '@ui-schema/ui-schema';
import { Button } from '@ui5/webcomponents-react';
import { useTranslation } from 'react-i18next';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
margin-left: 0.25rem !important;
margin-right: 0.25rem !important;
}

.banner-carousel {
height: fit-content;
}

.feature-card {
position: relative;
display: flex;
Expand Down
58 changes: 28 additions & 30 deletions src/components/HelmReleases/HelmReleasesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,34 @@ function HelmReleasesList() {
];

return (
<>
<ResourcesList
resources={entries}
customColumns={customColumns}
serverDataLoading={loading}
serverDataError={error}
allowSlashShortcut
hasDetailsView
enableColumnLayout
customUrl={resourceUrl}
resourceUrl={dataUrl}
resourceType="HelmReleases"
sortBy={{
name: (a, b) => a.releaseName.localeCompare(b.releaseName),
}}
searchSettings={{
textSearchProperties: [
'recentRelease.chart.metadata.name',
'releaseName',
],
}}
emptyListProps={{
subtitleText: ResourceDescription,
url: docsURL,
showButton: false,
}}
readOnly
description={ResourceDescription}
/>
</>
<ResourcesList
resources={entries}
customColumns={customColumns}
serverDataLoading={loading}
serverDataError={error}
allowSlashShortcut
hasDetailsView
enableColumnLayout
customUrl={resourceUrl}
resourceUrl={dataUrl}
resourceType="HelmReleases"
sortBy={{
name: (a, b) => a.releaseName.localeCompare(b.releaseName),
}}
searchSettings={{
textSearchProperties: [
'recentRelease.chart.metadata.name',
'releaseName',
],
}}
emptyListProps={{
subtitleText: ResourceDescription,
url: docsURL,
showButton: false,
}}
readOnly
description={ResourceDescription}
/>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/KymaModules/KymaModulesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export default function KymaModulesList({
layoutNumber="StartColumn"
windowTitle={t('kyma-modules.title')}
headerContent={
<DynamicPageHeader>
<DynamicPageHeader className="no-shadow">
<FlexBox alignItems="Center">
<Label showColon>{t('kyma-modules.release-channel')}</Label>
<Text renderWhitespace={true}> </Text>
Expand Down
4 changes: 2 additions & 2 deletions src/header/NamespaceDropdown/NamespaceDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function NamespaceDropdown() {

let namespaces = [];

if (allNamespaces.length > 0) {
if (allNamespaces && allNamespaces.length > 0) {
namespaces.push(
<ComboBoxItem
text={t('navigation.all-namespaces')}
Expand All @@ -21,7 +21,7 @@ export function NamespaceDropdown() {
);
}

allNamespaces.map(ns =>
allNamespaces?.map(ns =>
namespaces.push(<ComboBoxItem text={ns} key={ns} data-key={ns} />),
);

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAvailableNamespaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useAvailableNamespaces() {

useEffect(() => {
if (error) {
setNamespaces([]);
setNamespaces(null);
return;
}
const filteredNamespaces = allNamespaces
Expand Down
27 changes: 19 additions & 8 deletions src/resources/createResourceRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,31 @@ const ColumnWrapper = ({
});

const elementListProps = usePrepareListProps({
...props,
resourceCustomType: props.resourceCustomType,
resourceType: props.resourceType,
resourceI18Key: props.resourceI18Key,
apiGroup: props.apiGroup,
apiVersion: props.apiVersion,
hasDetailsView: props.hasDetailsView,
});

const elementDetailsProps = usePrepareDetailsProps({
...props,
resourceCustomType: props.resourceCustomType,
resourceType: props.resourceType,
resourceI18Key: props.resourceI18Key,
apiGroup: props.apiGroup,
apiVersion: props.apiVersion,
resourceName: layoutState?.midColumn?.resourceName ?? resourceName,
namespaceId: layoutState?.midColumn?.namespaceId ?? namespaceId,
showYamlTab: props.showYamlTab,
});

const elementCreateProps = usePrepareCreateProps({
...props,
resourceCustomType: props.resourceCustomType,
resourceType: props.resourceType,
resourceTypeForTitle: props.resourceType,
apiGroup: props.apiGroup,
apiVersion: props.apiVersion,
});

const listComponent = React.cloneElement(list, {
Expand Down Expand Up @@ -122,16 +136,13 @@ const ColumnWrapper = ({
detailsMidColumn = detailsComponent;
}

const { schema, loading } = useGetSchema({
const { schema } = useGetSchema({
resource: {
group: props?.apiGroup,
version: props.apiVersion,
kind: props?.resourceType.slice(0, -1),
},
});
if (loading) {
return null;
}

const createMidColumn = (
<ResourceCreate
Expand All @@ -156,7 +167,7 @@ const ColumnWrapper = ({
);

return (
<SchemaContext.Provider value={schema}>
<SchemaContext.Provider value={schema || null}>
<FlexibleColumnLayout
style={{ height: '100%' }}
layout={layoutState?.layout || 'OneColumn'}
Expand Down
Loading
Loading