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

semantic-ui: Use getDisplayLabel to properly show labels for widgets #2225

Merged
merged 6 commits into from
Aug 12, 2021

Conversation

jacqueswho
Copy link
Contributor

Reasons for making this change

Features:

  • implement getDisplayLabel from core/utils

#1946

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@jacqueswho jacqueswho added the semantic-ui semantic-ui related theme issue label Feb 8, 2021
@jacqueswho jacqueswho mentioned this pull request Feb 8, 2021
7 tasks
packages/semantic-ui/package.json Outdated Show resolved Hide resolved
packages/core/src/utils.js Outdated Show resolved Hide resolved
@epicfaace epicfaace self-assigned this Feb 15, 2021
@ErQrYfkrju
Copy link

@agustin107 ping

@ErQrYfkrju
Copy link

Hello @agustin107 @epicfaace @jacqueswho any news on this pull request?

@jacqueswho
Copy link
Contributor Author

Hello @agustin107 @epicfaace @jacqueswho any news on this pull request?

sorry @ErQrYfkrju cant do anything. just waiting.

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

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

Hey @jacqueswho , just a few things that we need before getting this PR ready:

  • can you remove the extraneous changes that aren't really relevant for this change? That will ensure this PR is narrowly scoped to only include the get display util-related changes. For example, changes in props destructuring, extra blank lines deleted / added, etc.
  • let's add some tests with the different schemas / uischemas with labels to ensure that all the cases here are tested by these tests so that they don't regress in the future.

@jacqueswho
Copy link
Contributor Author

@epicfaace have made all the changes. except please keep the props approach, as the in other pull requests it is like this, and most of the other themes , use this approach to make it easier for applying validation and functions for all props

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

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

Thanks, can you update the snapshots so the tests pass @jacqueswho ?

@jacqueswho
Copy link
Contributor Author

jacqueswho commented Apr 21, 2021

Thanks, can you update the snapshots so the tests pass @jacqueswho ?

Hi @epicfaace if you look at the files changed I already did. and the tests pass for me, but my version is @rjsf/[email protected] but not sure why the tests are running 2.5.1? Do I need to merge with master and then try again?

@epicfaace
Copy link
Member

@jacqueswho hmm, I wonder if you actually need to revert the snapshot changes in this PR. If you run npm test -- -u then do the snapshots revert or do they still stay the same?

@jacqueswho
Copy link
Contributor Author

@epicfaace I ran that command and no changes to push?

feat: use core/util getDisplayLabel
Revert changes of other packages
Revert "feat: add button,email,date widgets"
This reverts commit 5c99def.
dep: @rjsf/core changed back
feat: remove getDisplayLabel checkbox and select widget
feat: removed core util changes
feat: update checkbox widget
feat: undo import order

chore: tests updated
@jacqueswho jacqueswho force-pushed the feature/use_get_display_label_util branch from 68ffdb3 to 3faee3e Compare June 23, 2021 13:51
@jacqueswho
Copy link
Contributor Author

@epicfaace please can this be merged

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

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

Sorry @jacqueswho for the delay, only now getting a better chance to look at this. In addition to the changes I mentioned, can you also add a simple snapshot test that checks that #1946 is working for a simple example?

return (
<Form.Dropdown
key={id}
name={name}
label={label || schema.title}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we use getDisplayLabel here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, as I have seen all other themes not do this? must be a reason why, unless you see otherwise I can do the same

Copy link
Member

Choose a reason for hiding this comment

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

It's probably a mistake, I think all widgets should be using getDisplayLabel even in other themes. For now, though, let's just leave it as is for consistency.

packages/semantic-ui/src/TextWidget/TextWidget.js Outdated Show resolved Hide resolved
@epicfaace epicfaace changed the title Feature/use get display label util semantic-ui: Use getDisplayLabel to properly show labels for widgets Aug 12, 2021
@epicfaace epicfaace merged commit 640cef4 into master Aug 12, 2021
@epicfaace epicfaace deleted the feature/use_get_display_label_util branch August 12, 2021 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semantic-ui semantic-ui related theme issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using the Semantic UI theme, labels disappear when specifying format or enum
4 participants