Skip to content

Commit

Permalink
fix: tree-node selection in acl tab, tree scroll container
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke committed Dec 10, 2021
1 parent d38b6f0 commit 0b831b1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addon/components/tree.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div ...attributes>
<div ...attributes class="tree-wrapper">
<div class="uk-inline uk-margin-small-bottom uk-width-1-1">
<span class="uk-form-icon" uk-icon="icon: search"></span>
<Input
Expand Down
7 changes: 7 additions & 0 deletions addon/controllers/scopes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ export default class ScopesController extends Controller {
get rootScopes() {
return this.model?.filter((scope) => !scope.parent);
}

get itemRoute() {
if (this.router.currentRouteName.includes("acl")) {
return "scopes.edit.acl";
}
return "scopes.edit";
}
}
4 changes: 2 additions & 2 deletions addon/templates/scopes.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<SectionTitle @model="scopes" />

<div class="uk-grid">
<div class="uk-width-1-4 uk-first-column tree-wrapper">
<div class="uk-width-1-4 uk-first-column emeis-border-right">
<Tree
class="uk-margin-small-left"
@items={{this.rootScopes}}
@itemRoute="scopes.edit"
@itemRoute={{this.itemRoute}}
@activeItem={{this.activeScope}}
/>
</div>
Expand Down
16 changes: 14 additions & 2 deletions app/styles/ember-emeis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,24 @@ $ember-power-select-default-border-radius: 0;
$ember-power-select-border-color: $global-border;
@import "ember-power-select";

.emeis-border-right {
border-right: solid 1px $global-border;
}

$tree_indicator_width: 0.6em;
$tree_indicator_height: 0.6em;

.tree-wrapper {
border-right: solid 1px $global-border;
padding: 1em;
display: flex;
flex-direction: column;

padding-right: $tree_indicator_width;
position: relative;
max-height: 100%;

.tree {
overflow-y: auto;
}
}

ul.tree,
Expand Down

0 comments on commit 0b831b1

Please sign in to comment.