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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : badgeribbon with preset color #791

Merged
merged 7 commits into from
Nov 17, 2020
Merged

fix : badgeribbon with preset color #791

merged 7 commits into from
Nov 17, 2020

Conversation

boulix3
Copy link
Contributor

@boulix3 boulix3 commented Nov 16, 2020

馃 This is a ...

  • New feature
  • [ x ] Bug fix
  • Site / documentation update
  • [ x ] Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃敆 Related issue link

When using BadgeRibbon with a preset color, text color is the same as background color.

馃挕 Background and solution

Here is a snapshot of the bug

<BadgeRibbon Text="Pushes open the window" Color="orange">
    <Card Bordered>And raises the spyglass.</Card>
</BadgeRibbon>
<br />
<BadgeRibbon Text="Pushes open the window" Color="#832">
    <Card Bordered>And raises the spyglass.</Card>
</BadgeRibbon>

image

Solution : Fix less file.

馃摑 Changelog

Updated ribbon less file.
Added two ribbon examples with color set (preset and custom)

Language Changelog
馃嚭馃嚫 English
馃嚚馃嚦 Chinese

鈽戯笍 Self Check before Merge

鈿狅笍 Please check all items below before review. 鈿狅笍

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

Text color was same as background color.
Added two ribbon examples with color set (preset and custom)
@ElderJames
Copy link
Member

Thank you for contribution @boulix3 .

Can you reproduce it in ant design react? We will not directly modify the less file. If there is a style issues, we will first go to ant design to submit the fixes.

@boulix3
Copy link
Contributor Author

boulix3 commented Nov 16, 2020

Ok, I didn't know the less files came from that repository.

I cannot reproduce in react.
Here is an example :
https://stackblitz.com/edit/react-4uhci9?file=index.js

It seems we are missing a span in the blazor version.
react version :

<div class="ant-ribbon ant-ribbon-placement-end ant-ribbon-color-orange"><span class="ant-ribbon-text">Pushes open the window</span><div class="ant-ribbon-corner"></div></div>

blazor version :

<div class="ant-ribbon ant-ribbon-placement-end ant-ribbon-color-orange">Pushes open the window<div class="ant-ribbon-corner"></div></div>

I'll try to implement this.

@ElderJames
Copy link
Member

Ok thanks!

@ElderJames
Copy link
Member

cc @Epictek

Html content must be the same as in the react version
We don't change less files. They are copied from react version.
@boulix3
Copy link
Contributor Author

boulix3 commented Nov 16, 2020

The less file is now unmodified.
I updated the razor file. The generated html is now the same as in the react version.

@ElderJames
Copy link
Member

Thank you @boulix3 , please feel free to fix the test.

Modified expected html to match markup from react version.
@codecov-io
Copy link

Codecov Report

Merging #791 (3b05c7d) into master (f01ee92) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #791   +/-   ##
======================================
  Coverage    3.67%   3.67%           
======================================
  Files         395     395           
  Lines       17481   17481           
======================================
  Hits          642     642           
  Misses      16839   16839           
Impacted Files Coverage 螖
components/badge/BadgeRibbon.razor 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 f01ee92...3b05c7d. Read the comment docs.

ElderJames
ElderJames previously approved these changes Nov 17, 2020
Copy link
Member

@ElderJames ElderJames left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@ElderJames ElderJames merged commit 3e8fd85 into ant-design-blazor:master Nov 17, 2020
ElderJames added a commit that referenced this pull request Apr 23, 2022
* Fix ribbon syle

Text color was same as background color.

* Ribbon documentation

Added two ribbon examples with color set (preset and custom)

* fix : badgeribbon html content

Html content must be the same as in the react version

* revert changes

We don't change less files. They are copied from react version.

* revert

* tests: fix badgeribbon unit tests

Modified expected html to match markup from react version.

* Update tests/badge/RibbonTests.cs

Co-authored-by: James Yeung <shunjiey@hotmail.com>
ElderJames added a commit that referenced this pull request Apr 30, 2022
* Fix ribbon syle

Text color was same as background color.

* Ribbon documentation

Added two ribbon examples with color set (preset and custom)

* fix : badgeribbon html content

Html content must be the same as in the react version

* revert changes

We don't change less files. They are copied from react version.

* revert

* tests: fix badgeribbon unit tests

Modified expected html to match markup from react version.

* Update tests/badge/RibbonTests.cs

Co-authored-by: James Yeung <shunjiey@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants