Skip to content

Commit 6161d97

Browse files
NaiSideraIvan SamarinRaubzeug
authored
feat(Navigation): relocate tenant nav to main space (#936)
Co-authored-by: Ivan Samarin <[email protected]> Co-authored-by: Elena Makarova <[email protected]>
1 parent 0fb4a5c commit 6161d97

File tree

13 files changed

+140
-110
lines changed

13 files changed

+140
-110
lines changed

src/containers/AsideNavigation/Navigation.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {UserSettings} from '../UserSettings/UserSettings';
33
import type {YDBEmbeddedUISettings} from '../UserSettings/settings';
44

55
import {YdbInternalUser} from './YdbInternalUser/YdbInternalUser';
6-
import {useNavigationMenuItems} from './useNavigationMenuItems';
76

87
interface NavigationProps {
98
userSettings?: YDBEmbeddedUISettings;
@@ -12,12 +11,9 @@ interface NavigationProps {
1211
export function Navigation({children, userSettings}: NavigationProps) {
1312
const AsideNavigation = useComponent('AsideNavigation');
1413

15-
const menuItems = useNavigationMenuItems();
16-
1714
return (
1815
<AsideNavigation
1916
settings={<UserSettings settings={userSettings} />}
20-
menuItems={menuItems}
2117
ydbInternalUser={<YdbInternalUser />}
2218
content={children}
2319
/>

src/containers/AsideNavigation/i18n/en.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"pages.query": "Query",
3-
"pages.diagnostics": "Diagnostics",
4-
52
"navigation-item.documentation": "Documentation",
63
"navigation-item.settings": "Settings",
74
"navigation-item.account": "Account",
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import {registerKeysets} from '../../../utils/i18n';
22

33
import en from './en.json';
4-
import ru from './ru.json';
54

65
const COMPONENT = 'ydb-aside-navigation';
76

8-
export default registerKeysets(COMPONENT, {ru, en});
7+
export default registerKeysets(COMPONENT, {en});

src/containers/AsideNavigation/i18n/ru.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/containers/AsideNavigation/useNavigationMenuItems.ts

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/containers/Tenant/Diagnostics/Diagnostics.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
height: 100%;
77

88
&__header-wrapper {
9-
padding: 13px 20px 16px;
9+
padding: 0 20px 16px;
1010

1111
background-color: var(--g-color-base-background);
1212
}

src/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {cn} from '../../../utils/cn';
77
import {useTypedSelector} from '../../../utils/hooks';
88
import Diagnostics from '../Diagnostics/Diagnostics';
99
import {Query} from '../Query/Query';
10+
import {TenantNavigation} from '../TenantNavigation/TenantNavigation';
1011

1112
import './ObjectGeneral.scss';
1213

@@ -24,7 +25,7 @@ function ObjectGeneral(props: ObjectGeneralProps) {
2425

2526
const {tenantPage} = useTypedSelector((state) => state.tenant);
2627

27-
const renderTabContent = () => {
28+
const renderPageContent = () => {
2829
const {type, additionalTenantProps, additionalNodesProps, tenantName} = props;
2930
switch (tenantPage) {
3031
case TENANT_PAGES_IDS.query: {
@@ -47,7 +48,12 @@ function ObjectGeneral(props: ObjectGeneralProps) {
4748
if (!tenantName) {
4849
return null;
4950
}
50-
return <div className={b()}>{renderTabContent()}</div>;
51+
return (
52+
<div className={b()}>
53+
<TenantNavigation />
54+
{renderPageContent()}
55+
</div>
56+
);
5157
};
5258

5359
return renderContent();

src/containers/Tenant/Query/Query.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@include flex-container();
66

77
&__tabs {
8-
padding: 13px 20px 16px;
8+
padding: 0 20px 16px;
99
}
1010

1111
&__content {

src/containers/Tenant/Query/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"controls.query-mode-selector_type": "Query type:",
33

4-
"tabs.newQuery": "Query",
4+
"tabs.newQuery": "Editor",
55
"tabs.history": "History",
66
"tabs.saved": "Saved",
77

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.ydb-tenant-navigation {
2+
padding: 12px 16px 8px;
3+
4+
&__item {
5+
display: flex;
6+
align-items: center;
7+
gap: 5px;
8+
}
9+
10+
&__icon {
11+
flex-shrink: 0;
12+
}
13+
&__text {
14+
overflow: hidden;
15+
16+
text-overflow: ellipsis;
17+
}
18+
}

0 commit comments

Comments
 (0)