Skip to content

Commit

Permalink
fix: use full-name in parent scope selection (#389)
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Zosel <[email protected]>
  • Loading branch information
derrabauke and czosel authored Jan 27, 2022
1 parent b407b5e commit f54d27a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
1 change: 1 addition & 0 deletions addon/models/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import LocalizedModel from "ember-emeis/models/localized";

export default class ScopeModel extends LocalizedModel {
@localizedAttr name;
@localizedAttr fullName;
@localizedAttr description;
@attr level;
@attr meta;
Expand Down
17 changes: 1 addition & 16 deletions addon/templates/scopes/edit.hbs
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
{{!-- <ul uk-tab class="uk-child-width-1-2">
<li>
<LinkTo @route="scopes.edit.index" @model={{this.model}} data-test-scopes-edit-index-link>
{{t "emeis.scopes.edit.edit-scope"}}
</LinkTo>
</li>
<li>
<LinkTo @route="scopes.edit.acl" @model={{this.model}} data-test-scopes-edit-acl-link>
{{t "emeis.scopes.edit.acl.title"}}
</LinkTo>
</li>
</ul>
{{outlet}} --}}

<div uk-grid class="uk-grid-divider">
<div class="uk-width-1-2@xl">
<h3>{{t "emeis.scopes.edit.edit-scope"}}</h3>
Expand Down Expand Up @@ -49,7 +34,7 @@
@placeholder="{{t "emeis.scopes.headings.parent"}}..."
@onChange={{this.setParent}} as |scope|
>
{{scope.name}}
{{scope.fullName}}
</RelationshipSelect>
</EditForm::Element>

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/scopes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module("Acceptance | scopes", function (hooks) {
await fillIn('[name="name"]', name);
await fillIn('[name="description"]', description);

await selectChoose(".ember-power-select-trigger", futureParent.name.en);
await selectChoose(".ember-power-select-trigger", futureParent.fullName.en);

this.assertRequest("PATCH", `/api/v1/scopes/${scope.id}`, (request) => {
const { attributes, relationships } = JSON.parse(
Expand Down
4 changes: 4 additions & 0 deletions tests/dummy/mirage/factories/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import localize from "./localize";

export default Factory.extend({
name: () => localize(faker.company.companyName()),
fullName: () =>
localize(
`${faker.company.companyName()} \u00bb ${faker.company.companyName()}`
),
description: () => localize(faker.lorem.paragraph()),
level: () => 0,
meta: () => {},
Expand Down

0 comments on commit f54d27a

Please sign in to comment.