Skip to content

Commit 91bc3a4

Browse files
authored
fix: adjust page-specific styles for globalheader (#5620)
1 parent 1f3de57 commit 91bc3a4

File tree

6 files changed

+59
-9
lines changed

6 files changed

+59
-9
lines changed

src/MultiOrgOverrideStyles.scss

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
@use 'src/identity/components/GlobalHeader/GlobalHeaderStyle.scss' as gh;
2+
3+
// Reduce size of page headers
14
.multi-org .cf-page-header {
2-
height: 45px !important;
3-
flex: 0 0 45px !important;
4-
margin-bottom: 12px !important;
5+
height: 46px !important;
6+
flex: 0 0 46px !important;
7+
margin-bottom: 14px !important;
8+
}
9+
10+
// Adjust most pages for multi-org by changing the size of the Dapper Scroll Bar wrapper.
11+
.multi-org .cf-page-contents > .ScrollbarsCustom-Wrapper {
12+
height: calc(100% - gh.$globalheader-height);
13+
}
14+
15+
// Page-specific fix for Data Explorer - Classic
16+
.multi-org .data-explorer > .time-machine > .cf-draggable-resizer {
17+
height: calc(100% - gh.$globalheader-height);
18+
}
19+
20+
// Page-specific fix for Data Explorer - New
21+
.multi-org .flux-query-builder--container {
22+
height: calc(100% - gh.$globalheader-height);
523
}

src/authorizations/components/TokensTab.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ import './TokensTabStyles.scss'
4141
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
4242
import {event} from 'src/cloud/utils/reporting'
4343

44+
// Constants
45+
import {GLOBAL_HEADER_HEIGHT} from 'src/identity/components/GlobalHeader/constants'
46+
4447
enum AuthSearchKeys {
4548
Description = 'description',
4649
Status = 'status',
@@ -209,7 +212,11 @@ class TokensTab extends PureComponent<Props, State> {
209212
DEFAULT_TAB_NAVIGATION_HEIGHT +
210213
DEFAULT_ALERT_HEIGHT
211214

212-
const adjustedHeight = height - heightWithPagination
215+
const adjustedHeight =
216+
height -
217+
heightWithPagination -
218+
(isFlagEnabled('multiOrg') ? GLOBAL_HEADER_HEIGHT : 0)
219+
213220
return (
214221
<>
215222
<div style={{margin: '10px 0px'}}>

src/buckets/components/BucketsTab.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ import {checkBucketLimits as checkBucketLimitsAction} from 'src/cloud/actions/li
3838
import {getBucketLimitStatus} from 'src/cloud/utils/limits'
3939
import {getAll} from 'src/resources/selectors'
4040
import {SortTypes} from 'src/shared/utils/sort'
41+
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
4142

4243
// Types
4344
import {AppState, Bucket, OwnBucket, ResourceType} from 'src/types'
4445
import {BucketSortKey} from 'src/shared/components/resource_sort_dropdown/generateSortItems'
4546

47+
// Constants
48+
import {GLOBAL_HEADER_HEIGHT} from 'src/identity/components/GlobalHeader/constants'
49+
4650
interface State {
4751
searchTerm: string
4852
sortKey: BucketSortKey
@@ -138,7 +142,11 @@ class BucketsTab extends PureComponent<Props, State> {
138142
DEFAULT_TAB_NAVIGATION_HEIGHT ||
139143
DEFAULT_PAGINATION_CONTROL_HEIGHT + DEFAULT_TAB_NAVIGATION_HEIGHT
140144

141-
const adjustedHeight = height - heightWithPagination
145+
const adjustedHeight =
146+
height -
147+
heightWithPagination -
148+
(isFlagEnabled('multiOrg') ? GLOBAL_HEADER_HEIGHT : 0)
149+
142150
return (
143151
<>
144152
<TabbedPageHeader

src/flows/components/FlowPage.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import {PopupDrawer, PopupProvider} from 'src/flows/context/popup'
1111
import {ResultsProvider} from 'src/flows/context/results'
1212
import {SidebarProvider} from 'src/flows/context/sidebar'
1313

14+
// Utils
15+
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
16+
17+
// Constants
18+
import {GLOBAL_HEADER_HEIGHT} from 'src/identity/components/GlobalHeader/constants'
19+
1420
// Components
1521
import PipeList from 'src/flows/components/PipeList'
1622
import {SubSideBar} from 'src/flows/components/Sidebar'
@@ -32,13 +38,19 @@ const RunOnMount = () => {
3238
return null
3339
}
3440

41+
const flowPageHeight = {
42+
height: isFlagEnabled('multiOrg')
43+
? `calc(100% - ${GLOBAL_HEADER_HEIGHT}px)`
44+
: '100%',
45+
}
46+
3547
export const FlowPage: FC = () => (
3648
<ResultsProvider>
3749
<FlowQueryProvider>
3850
<RunOnMount />
3951
<FlowKeyboardPreview />
4052
<SidebarProvider>
41-
<Page>
53+
<Page style={flowPageHeight}>
4254
<FlowHeader />
4355
<Page.Contents
4456
fullWidth={true}

src/identity/components/GlobalHeader/GlobalHeaderStyle.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
// If this height is changed also change GLOBAL_HEADER_HEIGHT constant.
2+
$globalheader-height: 60px;
3+
14
.multiaccountorg--header {
2-
height: 60px;
3-
padding-top: 0px;
5+
height: $globalheader-height;
6+
padding-top: 12px;
47
padding-right: 32px;
58
padding-bottom: 12px;
69
padding-left: 22px;
7-
margin-top: 12px;
10+
margin-top: 0px;
811
margin-right: 0px;
912
margin-bottom: 0px;
1013
margin-left: 0px;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// If this height is changed, also change $globalheader-height sass variable.
2+
export const GLOBAL_HEADER_HEIGHT = 60

0 commit comments

Comments
 (0)