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

Introduce new 'show' option for control labels #196

Merged
merged 1 commit into from
Apr 1, 2016

Conversation

sdirix
Copy link
Member

@sdirix sdirix commented Mar 22, 2016

Fixes #183

Introduces a new configuration option in ui schemas for labels of
controls. In particular a 'show' option is added which allows to hide labels.

Labels are now configured as blocks with a min-height of 20px (the current line-height) to avoid misalignments between inputs with and without labels. However when no label for any control is displayed there are seamingly meaningless 20px of whitespace present. This problem should probably be solved in a generic way in a future PR since labels are also used to display the required property.

Introduces a new configuration option in ui schemas for labels of
controls. In particular a 'show' option is added which allows to hide labels.

Instead of simply a string, a label for a control can now be defined as string,
boolean or {text:string, show:boolean} object. If not specified, 'true' for
show and the 'beautified schemapath' for text are assumed.

Includes testcases.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 91.905% when pulling 176dafc on sdirix:hide-labels into e4eb4f7 on eclipsesource:master.

@koegel koegel assigned koegel and edgarmueller and unassigned koegel Mar 31, 2016
@koegel koegel added this to the 0.0.20 milestone Mar 31, 2016
@koegel koegel added the P1 label Mar 31, 2016

it("should hide the label when text is defined but show is set to false", inject(($rootScope, $compile) => {
let scope = $rootScope.$new();
scope.schema = {
Copy link
Contributor

Choose a reason for hiding this comment

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

The schema seems to be the same in all cases, maybe we could extract it and declare it as a global var within the test

@edgarmueller edgarmueller merged commit d966103 into eclipsesource:master Apr 1, 2016
@edgarmueller
Copy link
Contributor

This looks good! The one comment I added I'll probably take care of myself. Thanks!

@sdirix sdirix deleted the hide-labels branch March 11, 2021 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants