Skip to content

Commit

Permalink
feat: remove all references of sidebar collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
YounixM committed Sep 27, 2024
1 parent 9b06170 commit 648744b
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 147 deletions.
1 change: 0 additions & 1 deletion frontend/src/constants/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const AUTH0_REDIRECT_PATH = '/redirect';

export const DEFAULT_AUTH0_APP_REDIRECTION_PATH = ROUTES.APPLICATION;

export const IS_SIDEBAR_COLLAPSED = 'isSideBarCollapsed';
export const INVITE_MEMBERS_HASH = '#invite-team-members';

export const SIGNOZ_UPGRADE_PLAN_URL =
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/constants/shortcuts/globalShortcuts.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { getUserOperatingSystem, UserOperatingSystem } from 'utils/getUserOS';

const userOS = getUserOperatingSystem();
export const GlobalShortcuts = {
SidebarCollapse: '\\+meta',
NavigateToServices: 's+shift',
NavigateToTraces: 't+shift',
NavigateToLogs: 'l+shift',
Expand All @@ -13,7 +9,6 @@ export const GlobalShortcuts = {
};

export const GlobalShortcutsName = {
SidebarCollapse: `${userOS === UserOperatingSystem.MACOS ? 'cmd' : 'ctrl'}+\\`,
NavigateToServices: 'shift+s',
NavigateToTraces: 'shift+t',
NavigateToLogs: 'shift+l',
Expand All @@ -24,7 +19,6 @@ export const GlobalShortcutsName = {
};

export const GlobalShortcutsDescription = {
SidebarCollapse: 'Collpase the sidebar',
NavigateToServices: 'Navigate to Services page',
NavigateToTraces: 'Navigate to Traces page',
NavigateToLogs: 'Navigate to logs page',
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/container/AppLayout/AppLayout.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
width: 100%;
}
}

&.docked {
.app-content {
width: calc(100% - 240px);
}
}
}

.chat-support-gateway {
Expand Down
28 changes: 3 additions & 25 deletions frontend/src/container/AppLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import './AppLayout.styles.scss';

import * as Sentry from '@sentry/react';
import { Flex } from 'antd';
import getLocalStorageKey from 'api/browser/localstorage/get';
import getUserLatestVersion from 'api/user/getLatestVersion';
import getUserVersion from 'api/user/getVersion';
import cx from 'classnames';
import ChatSupportGateway from 'components/ChatSupportGateway/ChatSupportGateway';
import OverlayScrollbar from 'components/OverlayScrollbar/OverlayScrollbar';
import { IS_SIDEBAR_COLLAPSED } from 'constants/app';
import { FeatureKeys } from 'constants/features';
import ROUTES from 'constants/routes';
import SideNav from 'container/SideNav';
Expand Down Expand Up @@ -50,10 +48,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
(state) => state.app,
);

const [collapsed] = useState<boolean>(
getLocalStorageKey(IS_SIDEBAR_COLLAPSED) === 'true',
);

const { notifications } = useNotifications();

const isDarkMode = useIsDarkMode();
Expand Down Expand Up @@ -262,15 +256,8 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
}
}, [isDarkMode]);

const isSideNavCollapsed = getLocalStorageKey(IS_SIDEBAR_COLLAPSED);

return (
<Layout
className={cx(
isDarkMode ? 'darkMode' : 'lightMode',
isSideNavCollapsed ? 'sidebarCollapsed' : '',
)}
>
<Layout className={cx(isDarkMode ? 'darkMode' : 'lightMode')}>
<Helmet>
<title>{pageTitle}</title>
</Helmet>
Expand All @@ -296,20 +283,11 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
</div>
)}

<Flex
className={cx(
'app-layout',
isDarkMode ? 'darkMode' : 'lightMode',
!collapsed && !renderFullScreen ? 'docked' : '',
)}
>
<Flex className={cx('app-layout', isDarkMode ? 'darkMode' : 'lightMode')}>
{isToDisplayLayout && !renderFullScreen && (
<SideNav licenseData={licenseData} isFetching={isFetching} />
)}
<div
className={cx('app-content', collapsed ? 'collapsed' : '')}
data-overlayscrollbars-initialize
>
<div className="app-content" data-overlayscrollbars-initialize>
<Sentry.ErrorBoundary fallback={<ErrorBoundaryFallback />}>
<LayoutContent data-overlayscrollbars-initialize>
<OverlayScrollbar>
Expand Down
37 changes: 0 additions & 37 deletions frontend/src/container/SideNav/SideNav.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
height: 100%;
position: relative;
z-index: 1;

&.docked {
width: 240px;
}
}

.sideNav {
Expand Down Expand Up @@ -229,39 +225,6 @@
display: block;
}
}

&.docked {
flex: 0 0 240px;
max-width: 240px;
min-width: 240px;
width: 240px;

.secondary-nav-items {
width: 240px;
}

.brand {
justify-content: space-between;
}

.get-started-nav-items {
.get-started-btn {
justify-content: flex-start;
}
}

.collapse-expand-handlers {
display: block;
}

.nav-item-label {
display: block;
}

.nav-item-beta {
display: block;
}
}
}

.lightMode {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/container/SideNav/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ function SideNav({
);

return (): void => {
deregisterShortcut(GlobalShortcuts.SidebarCollapse);
deregisterShortcut(GlobalShortcuts.NavigateToServices);
deregisterShortcut(GlobalShortcuts.NavigateToTraces);
deregisterShortcut(GlobalShortcuts.NavigateToLogs);
Expand Down
1 change: 0 additions & 1 deletion frontend/src/store/actions/app/index.ts

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/src/store/actions/app/sideBarCollapse.ts

This file was deleted.

1 change: 0 additions & 1 deletion frontend/src/store/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './app';
export * from './global';
export * from './metrics';
export * from './serviceMap';
Expand Down
9 changes: 0 additions & 9 deletions frontend/src/store/reducers/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { getInitialUserTokenRefreshToken } from 'store/utils';
import {
AppAction,
LOGGED_IN,
SIDEBAR_COLLAPSE,
UPDATE_CONFIGS,
UPDATE_CURRENT_ERROR,
UPDATE_CURRENT_VERSION,
Expand Down Expand Up @@ -43,7 +42,6 @@ const getInitialUser = (): User | null => {

const InitialValue: InitialValueTypes = {
isLoggedIn: getLocalStorageKey(LOCALSTORAGE.IS_LOGGED_IN) === 'true',
isSideBarCollapsed: true,
currentVersion: '',
latestVersion: '',
featureResponse: {
Expand Down Expand Up @@ -75,13 +73,6 @@ const appReducer = (
};
}

case SIDEBAR_COLLAPSE: {
return {
...state,
isSideBarCollapsed: action.payload,
};
}

case UPDATE_FEATURE_FLAG_RESPONSE: {
return {
...state,
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/types/actions/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ export interface LoggedInUser {
};
}

export interface SideBarCollapse {
type: typeof SIDEBAR_COLLAPSE;
payload: boolean;
}

export interface UpdateAppVersion {
type: typeof UPDATE_CURRENT_VERSION;
payload: {
Expand Down Expand Up @@ -137,7 +132,6 @@ export interface UpdateFeatureFlag {

export type AppAction =
| LoggedInUser
| SideBarCollapse
| UpdateAppVersion
| UpdateLatestVersion
| UpdateVersionError
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types/reducer/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface User {

export default interface AppReducer {
isLoggedIn: boolean;
isSideBarCollapsed: boolean;
currentVersion: string;
latestVersion: string;
isCurrentVersionError: boolean;
Expand Down
70 changes: 33 additions & 37 deletions frontend/tests/auth.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
{
"cookies": [],
"origins": [
{
"origin": "http://localhost:3301",
"localStorage": [
{
"name": "isSideBarCollapsed",
"value": "false"
},
{
"name": "metricsTimeDurations",
"value": "{}"
},
{
"name": "i18nextLng",
"value": "en-US"
},
{
"name": "reactQueryDevtoolsSortFn",
"value": "\"Status > Last Updated\""
},
{
"name": "AUTH_TOKEN",
"value": "authtoken"
},
{
"name": "IS_LOGGED_IN",
"value": "true"
},
{
"name": "REFRESH_AUTH_TOKEN",
"value": "refreshJwt"
}
]
}
]
}
"cookies": [],
"origins": [
{
"origin": "http://localhost:3301",
"localStorage": [
{
"name": "metricsTimeDurations",
"value": "{}"
},
{
"name": "i18nextLng",
"value": "en-US"
},
{
"name": "reactQueryDevtoolsSortFn",
"value": "\"Status > Last Updated\""
},
{
"name": "AUTH_TOKEN",
"value": "authtoken"
},
{
"name": "IS_LOGGED_IN",
"value": "true"
},
{
"name": "REFRESH_AUTH_TOKEN",
"value": "refreshJwt"
}
]
}
]
}

0 comments on commit 648744b

Please sign in to comment.