-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scopes): introduce meta fields (#272)
Meta fields can contain additional information on scopes and can be passed by the `emeisOptions` service. The fields are customizable in terms of readability and visibility.
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
import Controller from "@ember/controller"; | ||
import { action } from "@ember/object"; | ||
import { inject as service } from "@ember/service"; | ||
|
||
export default class ScopesEditController extends Controller { | ||
@service emeisOptions; | ||
@service intl; | ||
|
||
get metaFields() { | ||
return this.emeisOptions.metaFields.scope; | ||
} | ||
|
||
@action | ||
updateModel(model, formElements) { | ||
model.name = formElements.name.value; | ||
model.description = formElements.description.value; | ||
|
||
return model; | ||
} | ||
|
||
@action | ||
updateMetaField(field, model, optionOrEvent) { | ||
const value = optionOrEvent.target?.value ?? optionOrEvent.value; | ||
model.meta = { ...model.meta, [field.slug]: value }; | ||
model.notifyPropertyChange("meta"); | ||
} | ||
} |
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