-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ember-can for visibility rules
- Loading branch information
Showing
8 changed files
with
91 additions
and
53 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Ability } from "ember-can"; | ||
|
||
export default class CategoryAbility extends Ability { | ||
get can() { | ||
return true; | ||
} | ||
} |
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,7 @@ | ||
import { Ability } from "ember-can"; | ||
|
||
export default class DocumentAbility extends Ability { | ||
get can() { | ||
return true; | ||
} | ||
} |
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,7 @@ | ||
import { Ability } from "ember-can"; | ||
|
||
export default class TagAbility extends Ability { | ||
get can() { | ||
return true; | ||
} | ||
} |
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,8 +1,4 @@ | ||
<div | ||
class="uk-height-1-1" | ||
uk-form-custom | ||
...attributes | ||
> | ||
<div class="uk-height-1-1" uk-form-custom ...attributes> | ||
<UkButton | ||
@color="primary" | ||
@size="small" | ||
|
@@ -15,55 +11,65 @@ | |
</UkButton> | ||
|
||
{{#if @category}} | ||
<input | ||
type="file" | ||
multiple="multiple" | ||
data-test-input | ||
aria-label="Category name" | ||
{{on "change" (perform this.upload @category)}} | ||
/> | ||
{{#if can "upload document" @category}} | ||
Check failure on line 14 in addon/components/document-upload-button.hbs GitHub Actions / Lint (hbs)
|
||
<input | ||
type="file" | ||
multiple="multiple" | ||
data-test-input | ||
aria-label="Category name" | ||
{{on "change" (perform this.upload @category)}} | ||
/> | ||
{{/if}} | ||
{{else}} | ||
<Drop @width="uk-with-medium" as |Item|> | ||
{{#each this.categories.records as |category|}} | ||
<Item uk-form-custom data-test-upload-category> | ||
<input | ||
type="file" | ||
multiple="multiple" | ||
data-test-input | ||
aria-label="file input" | ||
{{on "change" (perform this.upload category)}} | ||
/> | ||
<FaIcon | ||
@prefix="far" | ||
@icon="folder" | ||
@size="2x" | ||
class="uk-margin-small-right" | ||
data-test-folder-icon | ||
{{set-style color=category.color}} | ||
/> | ||
{{category.name}} | ||
</Item> | ||
{{#if category.children.length}} | ||
{{#each category.children as |child|}} | ||
<Item class="item--indent" uk-form-custom data-test-upload-category> | ||
<input | ||
type="file" | ||
multiple="multiple" | ||
data-test-input | ||
aria-label="file input" | ||
{{on "change" (perform this.upload child)}} | ||
/> | ||
<FaIcon | ||
@prefix="far" | ||
@icon="folder" | ||
@size="2x" | ||
class="uk-margin-small-right" | ||
data-test-folder-icon | ||
{{set-style color=child.color}} | ||
/> | ||
{{child.name}} | ||
</Item> | ||
{{/each}} | ||
{{#if can "upload to category" @category}} | ||
Check failure on line 26 in addon/components/document-upload-button.hbs GitHub Actions / Lint (hbs)
|
||
<Item uk-form-custom data-test-upload-category> | ||
<input | ||
type="file" | ||
multiple="multiple" | ||
data-test-input | ||
aria-label="file input" | ||
{{on "change" (perform this.upload category)}} | ||
/> | ||
<FaIcon | ||
@prefix="far" | ||
@icon="folder" | ||
@size="2x" | ||
class="uk-margin-small-right" | ||
data-test-folder-icon | ||
{{set-style color=category.color}} | ||
/> | ||
{{category.name}} | ||
</Item> | ||
{{#if category.children.length}} | ||
{{#each category.children as |child|}} | ||
{{#if can "upload to category" @category}} | ||
Check failure on line 47 in addon/components/document-upload-button.hbs GitHub Actions / Lint (hbs)
|
||
<Item | ||
class="item--indent" | ||
uk-form-custom | ||
data-test-upload-category | ||
> | ||
<input | ||
type="file" | ||
multiple="multiple" | ||
data-test-input | ||
aria-label="file input" | ||
{{on "change" (perform this.upload child)}} | ||
/> | ||
<FaIcon | ||
@prefix="far" | ||
@icon="folder" | ||
@size="2x" | ||
class="uk-margin-small-right" | ||
data-test-folder-icon | ||
{{set-style color=child.color}} | ||
/> | ||
{{child.name}} | ||
</Item> | ||
{{/if}} | ||
{{/each}} | ||
{{/if}} | ||
{{/if}} | ||
{{else}} | ||
<span data-test-no-categories> | ||
|
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