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

feat: support the horizontal layout of MenuBar #553

Merged
merged 5 commits into from
Dec 20, 2021
Merged

feat: support the horizontal layout of MenuBar #553

merged 5 commits into from
Dec 20, 2021

Conversation

kiwiwong
Copy link
Collaborator

@kiwiwong kiwiwong commented Dec 16, 2021

Description

MenuBar 支持 horizontal 布局

Fixes #457

Changes

  • Menu 组件改为使用 forwardRef 进行包装
  • 修改 MenuBarController 使其支持修改 MenuBar 的布局模式
  • layout.ts 中新增 IMenuBarViewState 接口,给menuBar增加了 mode 属性
  • const.ts 中增加 menuBar mode 相关常量
  • layoutService.ts 中增加 menuBar mode 的 get/set 方法
  • 修改 workbench.tsx 布局以支持 horizontal 模式下的 menuBar
  • 修改 menuBar 组件以支持 horizontal 模式
  • 增加 menuBar horizontal 模式下样式代码

@kiwiwong kiwiwong added the enhancement New feature or request label Dec 16, 2021
@kiwiwong kiwiwong self-assigned this Dec 16, 2021
@wewoor wewoor requested a review from mortalYoung December 16, 2021 08:41
@wewoor wewoor added this to the 0.9.0-beta.2 milestone Dec 16, 2021
Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单元测试需要补一下

src/workbench/menuBar/style.scss Outdated Show resolved Hide resolved
src/workbench/menuBar/menuBar.tsx Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 16, 2021

Codecov Report

Merging #553 (b03a5bf) into main (f75ece9) will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #553      +/-   ##
==========================================
+ Coverage   86.56%   86.74%   +0.18%     
==========================================
  Files         188      189       +1     
  Lines        5499     5562      +63     
  Branches     1226     1243      +17     
==========================================
+ Hits         4760     4825      +65     
+ Misses        729      727       -2     
  Partials       10       10              
Impacted Files Coverage Δ
src/model/workbench/menuBar.ts 100.00% <ø> (ø)
src/services/builtinService/const.ts 100.00% <ø> (ø)
src/components/menu/menu.tsx 86.40% <100.00%> (+0.54%) ⬆️
src/controller/menuBar.ts 100.00% <100.00%> (ø)
src/model/workbench/layout.ts 100.00% <100.00%> (ø)
src/services/workbench/layoutService.ts 100.00% <100.00%> (ø)
src/workbench/menuBar/logo.tsx 100.00% <100.00%> (ø)
src/workbench/menuBar/menuBar.tsx 97.61% <100.00%> (+7.61%) ⬆️
src/workbench/workbench.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f75ece9...b03a5bf. Read the comment docs.

src/controller/menuBar.ts Outdated Show resolved Hide resolved
src/controller/menuBar.ts Outdated Show resolved Hide resolved
src/services/workbench/layoutService.ts Outdated Show resolved Hide resolved
src/services/workbench/layoutService.ts Outdated Show resolved Hide resolved
src/workbench/menuBar/menuBar.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@wewoor wewoor merged commit 2cf2abb into main Dec 20, 2021
@wewoor wewoor deleted the feat/menuBar branch December 20, 2021 06:41
wewoor pushed a commit that referenced this pull request Dec 20, 2021
* feat: support the horizontal layout of MenuBar 

* feat: update menuBar unit test

* feat: menubar supports custom icon

* feat: supplement the unit test code of menuBar

* feat: optimize code and supplement unit tests

Co-authored-by: jiming <jiming@dtstack.com>
wewoor added a commit that referenced this pull request Dec 20, 2021
* docs: update the images url

* docs: update the images url

* build: remove package-lock.json

* build: remove package-lock.json

* build: update the yarn.lock

* build: update yarn.lock

* docs: update the introduction in README (#552)

* feat: support the horizontal layout of MenuBar (#553)

* feat: support the horizontal layout of MenuBar 

* feat: update menuBar unit test

* feat: menubar supports custom icon

* feat: supplement the unit test code of menuBar

* feat: optimize code and supplement unit tests

Co-authored-by: jiming <jiming@dtstack.com>

* build: upgrade node-sass-alias-importer

Co-authored-by: 野迂迂 <yangwei1@outlook.com>
Co-authored-by: Shawn <1322397827@qq.com>
Co-authored-by: jiming <jiming@dtstack.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the horizontal layout of MenuBar
3 participants