-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/add mandatory asterisk (#2871)
* feat(form): add mandatory indicator for labels and provide configuration flag * feat(form): add cfField label.js for config handling of mandatory asterisk * feat(form): improved syntax & tests for mandatory asterisk * fix(form): fix eslint formatting in label-test.js * fix(form): css class naming, minor label-test improvements for mandatory asterisk * fix(form): lint fix
- Loading branch information
Showing
7 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { getOwner } from "@ember/application"; | ||
import Component from "@glimmer/component"; | ||
|
||
/** | ||
* Label component of the CfField | ||
* | ||
* @class CfFieldLabelComponent | ||
*/ | ||
export default class CfFieldLabelComponent extends Component { | ||
get config() { | ||
return getOwner(this).resolveRegistration("config:environment"); | ||
} | ||
|
||
get useMandatoryAsterisk() { | ||
const { USE_MANDATORY_ASTERISK = false } = | ||
this.config["ember-caluma"] || {}; | ||
|
||
return this.args.useMandatoryAsterisk ?? USE_MANDATORY_ASTERISK; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters