Skip to content

Commit 059016c

Browse files
authored
fix: remove the warning in console (#529)
* fix: remove the warning in console * test: update snapshots
1 parent 486182b commit 059016c

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

src/provider/__tests__/__snapshots__/molecule.test.tsx.snap

+1-18
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ exports[`Test MoleculeProvider Match The MoleculeProvider snapshot 1`] = `
9898
data-type="SplitPane"
9999
>
100100
<div
101-
className={false}
101+
className=""
102102
style={
103103
Object {
104104
"WebkitBoxFlex": 0,
@@ -672,7 +672,6 @@ exports[`Test MoleculeProvider Match The MoleculeProvider snapshot 1`] = `
672672
<div
673673
className="mo-statusBar__item"
674674
id="statusbar.problems.title"
675-
sortIndex={1}
676675
>
677676
<a
678677
onClick={[Function]}
@@ -698,23 +697,8 @@ exports[`Test MoleculeProvider Match The MoleculeProvider snapshot 1`] = `
698697
className="mo-statusBar__right-items"
699698
>
700699
<div
701-
actionBar={
702-
Array [
703-
Object {
704-
"icon": "clear-all",
705-
"id": "ClearAll",
706-
"title": "Clear All Notifications",
707-
},
708-
Object {
709-
"icon": "chevron-down",
710-
"id": "HideNotifications",
711-
"title": "Hide Notifications",
712-
},
713-
]
714-
}
715700
className="mo-statusBar__item"
716701
id="MO_NOTIFICATION"
717-
sortIndex={1}
718702
>
719703
<a
720704
onClick={[Function]}
@@ -779,7 +763,6 @@ exports[`Test MoleculeProvider Match The MoleculeProvider snapshot 1`] = `
779763
<div
780764
className="mo-statusBar__item"
781765
id="MoEditorInfo"
782-
sortIndex={2}
783766
>
784767
<a
785768
onClick={[Function]}

src/workbench/__tests__/__snapshots__/workbench.test.tsx.snap

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ exports[`Test Workbench Component Match The WorkbenchView snapshot 1`] = `
4747
data-type="SplitPane"
4848
>
4949
<div
50+
class=""
5051
style="display: -webkit-box,-moz-box,-ms-flexbox,-webkit-flex,flex; outline: none; min-width: 170px; max-width: calc(80% - 1px*0.8); flex-grow: 0; width: 300px;"
5152
>
5253
<div

src/workbench/statusBar/__tests__/__snapshots__/status.test.tsx.snap

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ exports[`The StatusBar Component Match Snapshot 1`] = `
1111
<div
1212
className="mo-statusBar__item"
1313
id="MoEditorInfo"
14-
sortIndex={2}
1514
>
1615
<a
1716
onClick={[Function]}
@@ -28,7 +27,6 @@ exports[`The StatusBar Component Match Snapshot 1`] = `
2827
<div
2928
className="mo-statusBar__item"
3029
id="MoEditorInfo"
31-
sortIndex={2}
3230
>
3331
<a
3432
onClick={[Function]}

src/workbench/statusBar/item.tsx

+23-2
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,39 @@ import { classNames } from 'mo/common/className';
33
import { IStatusBarItem } from 'mo/model/workbench/statusBar';
44
import { IStatusBarController } from 'mo/controller/statusBar';
55
import { itemClassName } from './base';
6+
import { getDataAttributionsFromProps } from 'mo/common/dom';
67

78
export function StatusItem(props: IStatusBarItem & IStatusBarController) {
8-
const { className, onClick, id, name, data, render, ...extra } = props;
9+
const {
10+
className,
11+
onClick,
12+
id,
13+
name,
14+
data,
15+
render,
16+
style,
17+
role,
18+
title,
19+
...restProps
20+
} = props;
921
const clsName = classNames(itemClassName, className);
1022
const events = {
1123
onClick: function (e: React.MouseEvent) {
1224
onClick?.(e, props);
1325
},
1426
};
1527

28+
const attrProps = getDataAttributionsFromProps(restProps);
29+
1630
return (
17-
<div className={clsName} id={id.toString()} {...extra}>
31+
<div
32+
className={clsName}
33+
style={style}
34+
role={role}
35+
title={title}
36+
id={id.toString()}
37+
{...attrProps}
38+
>
1839
<a tabIndex={-1} title={name} {...events}>
1940
{render ? render(props) : name}
2041
</a>

src/workbench/workbench.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function WorkbenchView(props: IWorkbench & ILayout & ILayoutController) {
8989
minSize="170px"
9090
initialSize={splitPanePos[0]}
9191
maxSize="80%"
92-
className={sidebar.hidden && 'hidden'}
92+
className={sidebar.hidden ? 'hidden' : ''}
9393
>
9494
<SidebarView />
9595
</Pane>

0 commit comments

Comments
 (0)