Skip to content
Open
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
8 changes: 7 additions & 1 deletion frontend/public/components/namespace-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { useDispatch, useSelector } from 'react-redux';

import { NamespaceBarProps, useActivePerspective } from '@console/dynamic-plugin-sdk';
import { ALL_NAMESPACES_KEY } from '@console/dynamic-plugin-sdk/src/constants';
import { FLAGS, KEYBOARD_SHORTCUTS } from '@console/shared/src/constants/common';
import {
ALL_APPLICATIONS_KEY,
FLAGS,
KEYBOARD_SHORTCUTS,
} from '@console/shared/src/constants/common';
import { NamespaceDropdown } from '@console/shared/src/components/namespace/NamespaceDropdown';
import { useActiveNamespace } from '@console/shared/src/hooks/useActiveNamespace';
import { useFlag } from '@console/dynamic-plugin-sdk/src/utils/flags';
Expand All @@ -18,6 +22,7 @@ import { FirehoseResult } from './utils/types';
import { removeQueryArgument } from './utils/router';
import { useCreateNamespaceOrProjectModal } from '@console/shared/src/hooks/useCreateNamespaceOrProjectModal';
import type { RootState } from '../redux';
import { setActiveApplication } from '../actions/ui';

export type NamespaceBarDropdownsProps = {
children: React.ReactNode;
Expand Down Expand Up @@ -77,6 +82,7 @@ export const NamespaceBarDropdowns: React.FC<NamespaceBarDropdownsProps> = ({
onNamespaceChange?.(newNamespace);
setActiveNamespace(newNamespace);
removeQueryArgument('project-name');
activeNamespace !== newNamespace && dispatch(setActiveApplication(ALL_APPLICATIONS_KEY));
}}
onCreateNew={() => {
createNamespaceOrProjectModal({
Expand Down
4 changes: 1 addition & 3 deletions frontend/public/reducers/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export default (state: UIState, action: UIAction): UIState => {
return state;
}

return state
.set('activeApplication', ALL_APPLICATIONS_KEY)
.set('activeNamespace', action.payload.namespace);
return state.set('activeNamespace', action.payload.namespace);

case ActionType.SetCurrentLocation: {
state = state.set('location', action.payload.location);
Expand Down