Skip to content

Commit

Permalink
fix(form): css class naming, minor label-test improvements for mandat…
Browse files Browse the repository at this point in the history
…ory asterisk
  • Loading branch information
tstoppe89 committed Jan 7, 2025
1 parent 7c76a2a commit f8bfde1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/form/addon/components/cf-field/label.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{else if (and (not @field.optional) this.useMandatoryAsterisk)}}
<span
title={{t "caluma.form.mandatory"}}
class="uk-text-muted uk-text-lowercase uk-text-normal mandatory-asterisk"
class="uk-text-muted uk-text-lowercase uk-text-normal cf-label__mandatory-asterisk"
>* </span>
{{/if}}
{{/unless}}
Expand Down
2 changes: 1 addition & 1 deletion packages/form/addon/components/cf-field/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export default class CfFieldLabelComponent extends Component {
const { USE_MANDATORY_ASTERISK = false } =
this.config["ember-caluma"] || {};

return this.args?.useMandatoryAsterisk ?? USE_MANDATORY_ASTERISK;
return this.args.useMandatoryAsterisk ?? USE_MANDATORY_ASTERISK;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ module("Integration | Component | cf-field/label", function (hooks) {

test("it marks mandatory fields as such if useMandatoryAsterisk is configured in attribute", async function (assert) {
assert.expect(2);
this.set("useMandatoryAsterisk", true);

await render(
hbs`<CfField::Label
@field={{this.field}}
@useMandatoryAsterisk={{this.useMandatoryAsterisk}}
@useMandatoryAsterisk={{true}}
/>`,
);

Expand Down

0 comments on commit f8bfde1

Please sign in to comment.