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

Bug 1827291: Fix bad websocket url error due to fetching of resourcea when not required #5170

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,14 @@ interface DispatchProps {
type Props = ApplicationSelectorProps & StateProps & DispatchProps;

const ApplicationSelector: React.FC<Props> = ({ namespace, application, onChange, disabled }) => {
if (namespace === ALL_NAMESPACES_KEY) return null;

const allApplicationsTitle = 'all applications';
const title: string = application === ALL_APPLICATIONS_KEY ? allApplicationsTitle : application;

const onApplicationChange = (newApplication: string, key: string) => {
key === ALL_APPLICATIONS_KEY ? onChange(key) : onChange(newApplication);
};
const allApplicationsTitle = 'all applications';

const allNamespaces = namespace === ALL_NAMESPACES_KEY;

let title: string = application;
if (allNamespaces) {
title = 'No applications';
} else if (title === ALL_APPLICATIONS_KEY) {
title = allApplicationsTitle;
}

return (
<ApplicationDropdown
Expand All @@ -55,7 +50,7 @@ const ApplicationSelector: React.FC<Props> = ({ namespace, application, onChange
selectedKey={application || ALL_APPLICATIONS_KEY}
onChange={onApplicationChange}
storageKey={APPLICATION_LOCAL_STORAGE_KEY}
disabled={disabled || allNamespaces}
disabled={disabled}
/>
);
};
Expand Down