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

CB-4469 tabs reshadow refactor #2448

Merged
merged 86 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
df4a2cf
CB-4469 adds fundaments for refactor: baseTabStyles, baseTabActionSty…
Mar 5, 2024
ab974a5
CB-4469 adds license for new styles
Mar 5, 2024
c967c5f
CB-4469 tabs-box reshadowless
Mar 5, 2024
f539cb3
CB-4469 updated references
Mar 5, 2024
f61fa16
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
Mar 5, 2024
39fb78f
CB-4469 adds license + fix build
Mar 5, 2024
0a049cb
CB-4469 adds license
Mar 5, 2024
715d360
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
Mar 5, 2024
f98e5c4
CB-4469 fix tab icon position
Mar 6, 2024
b56753d
CB-4469 object folders reshadowless
Mar 6, 2024
421bbba
CB-4469 makes vertical side tabs for sql editor and table reshadowless
Mar 6, 2024
867f5b1
CB-4469 adds TabPanelListNew + ValuePanel tabs reshadowless
Mar 6, 2024
5510e2b
CB-4469 adds reshadowless tabs in admin settings + object viewer tabs…
Mar 6, 2024
24a02d8
СB-4479 fix: removed deprecated styles from some vertical tabs
Mar 6, 2024
e7fd584
CB-4469 chore: removed unused borderTabStyles
Mar 6, 2024
ad866a9
CB-4469 adds reshadowless tabs for side bars
Mar 6, 2024
bed6b7c
CB-4469 fix: reshadowless tabs has no redundant styles
Mar 6, 2024
b108df8
CB-4469 makes auth dialog reshadowless
Mar 6, 2024
dc400e3
CB-4469 make reshadowless admin user settings
Mar 6, 2024
2857b7b
CB-4469 makes TeamForm reshadowless
Mar 6, 2024
261d88d
CB-4469 makes UserForm reshadowless
Mar 6, 2024
fdce368
CB-4469 makes ConnectionForm reshadowless + removes deprecated styles…
Mar 6, 2024
01eaa30
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
Mar 7, 2024
0ecc173
CB-4469 makes reshadowless TextValuePresentation in ValuePanel
Mar 7, 2024
d0b7503
CB-4469 makes reshadowless user info form
Mar 7, 2024
780f085
CB-4469 removed redundant styles from user info form
Mar 7, 2024
0c8a3ec
CB-4469 makes sql result tabs reshadowless
Mar 7, 2024
9f2f2e4
CB-4469 makes export data tabs reshadowless
Mar 7, 2024
3ca58f6
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
Mar 7, 2024
0cf23b0
CB-4469 makes create connection for templates reshadowless
Mar 7, 2024
e7931fb
CB-4469 deletes deprecated tabs files
Mar 7, 2024
856c55e
CB-4469 update ts references
Mar 7, 2024
b15249e
CB-4469 adds missing licenses
Mar 7, 2024
42977db
CB-4469 removes deprecated styles
Mar 7, 2024
4499497
CB-4469 removes background for tabs in value panel
Mar 7, 2024
dfea05c
CB-4469 removes done to do
Mar 7, 2024
a7f3810
CB-4469 removes done to do
Mar 7, 2024
493348e
CB-4469 removes css duplication from ValuePanelEditorTabs
Mar 7, 2024
a276eca
CB-4469 correct styles context for table viewer
Mar 7, 2024
b5d478f
CB-4469 adds scontext outer of tabstate component
Mar 8, 2024
4321e6e
CB-4469 navigation tabs bar tabsBox has outline: none
Mar 8, 2024
4153b35
CB-4469 fix: object viewer has correct background colors
Mar 10, 2024
98affc9
CB-4469 removed unneened comment
Mar 10, 2024
031cb71
CB-4469 chore: admin page context spreaded correctly in layout
Mar 10, 2024
5585c3f
CB-4469 refactor cleanup
Mar 10, 2024
67cbf64
CB-4469: adds tabList style for registry
Mar 10, 2024
06b41a0
CB-4469 fix: correct tabs underline for create connection/template
Mar 10, 2024
b4aebfc
CB-4469 remove nested styles from useS() hooks in components
Mar 10, 2024
e8f3ffc
CB-4469 removes redundant styles from ObjectFolders useS() hook
Mar 10, 2024
9c223bf
CB-4469 fix: correct imports for core-ui tabs elements
Mar 11, 2024
8c4c9ab
CB-4469 chore: TabMenu keeps old name
Mar 11, 2024
a644bf2
CB-4469 refactor: isolate module styles from tab registry ones
Mar 11, 2024
ce79633
CB-4469 refactor: isolate module styles from tab registry ones [2]
Mar 11, 2024
91733e7
CB-4469 refactor: isolate module styles from tab registry ones [3]
Mar 11, 2024
35de229
CB-4469 refactor: isolate module styles from tab registry ones [4]
Mar 12, 2024
b53f206
CB-4469 refactor: isolate module styles from tab registry ones [5]
Mar 12, 2024
6dd2670
CB-4469 fix: users administration tabs has correct size
Mar 12, 2024
d512ab2
CB-4469 marks tabsBox as deprecated component
Mar 12, 2024
eae35ca
CB-4469 tabPanel refactor
Mar 12, 2024
25e453f
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
Mar 12, 2024
1656ea8
CB-4469 refactor: Tab styles decomposed to smaller extendable parts
Mar 13, 2024
fc73082
CB-4469 refactor: component directory - styles -> shared
Mar 13, 2024
8ac4584
CB-4469 refactor: adds TabList styles for underline, vertical and ver…
Mar 13, 2024
2e0fa58
CB-4469 refactor: adds to vertical rotated tabs module styles for ico…
Mar 13, 2024
985faf9
CB-4469 refactor: rename baseTab to just tab
Mar 13, 2024
ecc9e98
CB-4469 refactor: adds TabList styles for SqlResultTabs registry
Mar 13, 2024
c27b91f
CB-4469 chore: use fill component for createConntection
Mar 13, 2024
96c70dc
CB-4469 fix: saves file history for SqlEditor and UsersAdministration
Mar 13, 2024
6033e67
CB-4469 fix: saves file history for SqlEditorTabs
Mar 13, 2024
bb1c8fc
СB-4469 chore: code cleanup
Mar 13, 2024
4436939
СB-4469 chore: code cleanup
Mar 13, 2024
1ffead7
CB-4469: removed style dependency from tab component
Mar 14, 2024
db3bcfc
CB-4469 uses fill component instead of css styles in CreateConnection
Mar 14, 2024
9de45d4
CB-4469 always show tabOuter class for autotests
Mar 14, 2024
9ffdcc2
CB-4469 code cleanup
Mar 14, 2024
d979db5
CB-4469 fix: revert tab component to get back close icon for scripts/…
Mar 14, 2024
b173085
CB-4469 chore: rename administration files
Mar 14, 2024
bdf47aa
CB-4469 adds tab actions component
Mar 14, 2024
f73a6c0
CB-4469 refactor: removes tab actions style dep from Tab component
Mar 14, 2024
5b5c6d3
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
mr-anton-t Mar 14, 2024
ebb9408
CB-4469 removes duplication of menu logic in tabs
Mar 14, 2024
ac02530
CB-4469 adds predefined tab and tabList registries all over the app
Mar 14, 2024
1c2a4af
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
mr-anton-t Mar 15, 2024
7138ebb
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
mr-anton-t Mar 16, 2024
474425e
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
mr-anton-t Mar 17, 2024
c8658de
Merge branch 'devel' into CB-4469-migrate-tabs-components-to-css-modules
mr-anton-t Mar 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import type { ComponentStyle } from '@cloudbeaver/core-theming';

import type { IRouteParams } from './IRouteParams';

export enum AdministrationItemType {
Expand All @@ -24,7 +22,6 @@ export interface AdministrationItemDrawerProps {
item: IAdministrationItem;
configurationWizard: boolean;
onSelect: (id: string) => void;
style: ComponentStyle;
disabled?: boolean;
}
export type AdministrationItemDrawerComponent = React.FunctionComponent<AdministrationItemDrawerProps>;
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-ui/src/ContextMenu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface IContextMenuProps extends Omit<ButtonHTMLAttributes<any>, 'children'>
onVisibleSwitch?: (visible: boolean) => void;
}

// TODO the click doesn't work for React components as children
export const ContextMenu = observer<IContextMenuProps, HTMLButtonElement>(
forwardRef(function ContextMenu(
{ mouseContextMenu, menu: menuData, disclosure, children, placement, visible, onVisibleSwitch, modal, rtl, ...props },
Expand Down
88 changes: 37 additions & 51 deletions webapp/packages/core-ui/src/SideBarPanel/SideBarPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,55 @@
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';
import styled, { css } from 'reshadow';

import { useStyles } from '@cloudbeaver/core-blocks';
import { s, SContext, type StyleRegistry, useS } from '@cloudbeaver/core-blocks';

import { BASE_TAB_STYLES } from '../Tabs/Tab/BASE_TAB_STYLES';
import { UNDERLINE_TAB_STYLES } from '../Tabs/Tab/UnderlineTabStyles';
import TabStyles from '../Tabs/Tab/Tab.m.css';
import { TabUnderlineStyleRegistry } from '../Tabs/Tab/TabStyleRegistries';
import { TabList } from '../Tabs/TabList';
import TabPanelStyles from '../Tabs/TabPanel.m.css';
import { TabPanelList } from '../Tabs/TabPanelList';
import type { TabsContainer } from '../Tabs/TabsContainer/TabsContainer';
import { TabsState } from '../Tabs/TabsState';

const tabsStyles = css`
TabList {
display: flex;
position: relative;
flex-shrink: 0;
align-items: center;
overflow: auto;
}
TabPanel {
display: flex;
flex-direction: column;
}
tab-outer:only-child {
display: none;
}
`;

const formStyles = css`
box {
composes: theme-background-surface theme-text-on-surface from global;
width: 100%;
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
overflow: auto;
}
content-box {
composes: theme-border-color-background from global;
position: relative;
display: flex;
flex: 1;
flex-direction: column;
overflow: auto;
}
`;
import styles from './shared/SideBarPanel.m.css';
import SideBarPanelTab from './shared/SideBarPanelTab.m.css';
import SideBarPanelTabPanel from './shared/SideBarPanelTabPanel.m.css';

interface Props {
container: TabsContainer;
}

const sideBarPanelRegistry: StyleRegistry = [
...TabUnderlineStyleRegistry,
[
TabStyles,
{
mode: 'append',
styles: [SideBarPanelTab],
},
],
[
TabPanelStyles,
{
mode: 'append',
styles: [SideBarPanelTabPanel],
},
],
];

export const SideBarPanel = observer<Props>(function SideBarPanel({ container }) {
const tabStyle = [BASE_TAB_STYLES, tabsStyles, UNDERLINE_TAB_STYLES];
const style = useS(styles);

return styled(useStyles(tabStyle, formStyles))(
<TabsState container={container} lazy>
<box>
<TabList style={tabStyle} />
<content-box>
<TabPanelList style={tabStyle} />
</content-box>
</box>
</TabsState>,
return (
<SContext registry={sideBarPanelRegistry}>
<TabsState container={container} lazy>
<div className={s(style, { box: true })}>
<TabList className={s(style, { tabList: true })} />
<div className={s(style, { contentBox: true })}>
<TabPanelList />
</div>
</div>
</TabsState>
</SContext>
);
});
33 changes: 33 additions & 0 deletions webapp/packages/core-ui/src/SideBarPanel/shared/SideBarPanel.m.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/

.tabList {
display: flex;
position: relative;
flex-shrink: 0;
align-items: center;
overflow: auto;
}

.box {
composes: theme-background-surface theme-text-on-surface from global;
width: 100%;
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
overflow: auto;
}
.contentBox {
composes: theme-border-color-background from global;
position: relative;
display: flex;
flex: 1;
flex-direction: column;
overflow: auto;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/

.tabOuter:only-child {
display: none;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/

.tabPanel {
display: flex;
flex-direction: column;
}
164 changes: 0 additions & 164 deletions webapp/packages/core-ui/src/Tabs/Tab/BASE_TAB_STYLES.ts

This file was deleted.

37 changes: 0 additions & 37 deletions webapp/packages/core-ui/src/Tabs/Tab/BorderTabStyles.ts

This file was deleted.

Loading
Loading