ember-emeis
Version:
The frontend for the emeis user management service
45 lines (36 loc) • 888 B
JavaScript
import { action } from "@ember/object";
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
const DEFAULT_SORT = {
scope: "full_name",
};
export default class AclWizzardComponent extends Component {
modelToSelect;
user;
role;
scope;
fields = {
user: ["username", "fullName", "email"],
scope: ["fullName", "description"],
role: ["name", "description"],
};
get isValidAcl() {
return this.user && this.role && this.scope;
}
constructor(owner, args) {
super(owner, args);
this.user = args.user;
this.role = args.role;
this.scope = args.scope;
}
selectModel(model) {
this[this.modelToSelect] = model;
this.modelToSelect = null;
}
openModel(model) {
this.modelToSelect = model;
this.sort = DEFAULT_SORT[model];
}
}