Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Papermerge.Js
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
Papermerge.Js
Commits
8a2cf7ba
Commit
8a2cf7ba
authored
3 years ago
by
Eugen Ciur
Browse files
Options
Downloads
Patches
Plain Diff
pretty advanced UI
parent
074fd26e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/components/permission.hbs
+0
-1
0 additions, 1 deletion
app/components/permission.hbs
app/components/permissions/index.hbs
+11
-3
11 additions, 3 deletions
app/components/permissions/index.hbs
app/components/permissions/index.js
+13
-5
13 additions, 5 deletions
app/components/permissions/index.js
with
24 additions
and
9 deletions
app/components/permission.hbs
+
0
−
1
View file @
8a2cf7ba
...
...
@@ -5,5 +5,4 @@
{{
on
"change"
(
fn
this
.
onChange
@permission
)
}}
/>
<span
class=
"mx-1"
>
{{
@permission
.
name
}}
</span>
<span
class=
"mx-1 text-danger"
>
{{
@permission
.
content_type
.
model
}}
</span>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/components/permissions/index.hbs
+
11
−
3
View file @
8a2cf7ba
{{#
each
this
.
permissions
as
|
perm
|
}}
<Permission
@
permission=
{{
perm
}}
@
onChange=
{{
@onChange
}}
/>
{{/
each
}}
<div
class=
"d-flex flex-wrap permissions"
>
{{#
each
this
.
permission_groups
as
|
perm_group
|
}}
<div
class=
"m-2 permission-group"
>
<Input
@
type=
"checkbox"
/>
<label>
{{
perm_group
.
model
}}
</label>
{{#
each
perm_group
.
perms
as
|
perm
|
}}
<Permission
@
permission=
{{
perm
}}
@
onChange=
{{
@onChange
}}
/>
{{/
each
}}
</div>
{{/
each
}}
</div>
This diff is collapsed.
Click to expand it.
app/components/permissions/index.js
+
13
−
5
View file @
8a2cf7ba
import
Component
from
'
@glimmer/component
'
;
import
{
tracked
}
from
'
@glimmer/tracking
'
;
import
{
inject
as
service
}
from
'
@ember/service
'
;
class
PermissionsComponent
extends
Component
{
@
service
store
;
get
permissions
()
{
return
this
.
args
.
permissions
;
get
permission_groups
()
{
let
groups
=
this
.
args
.
permissions
.
map
(
item
=>
item
.
content_type
.
get
(
'
model
'
)),
result
=
[];
groups
=
new
Set
(
groups
);
groups
.
forEach
(
model
=>
{
let
perms
=
this
.
args
.
permissions
.
filter
(
item
=>
item
.
content_type
.
get
(
'
model
'
)
===
model
);
result
.
push
({
model
,
perms
});
// same as result.push({mode: model, perms: perms})
});
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment