Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
c94def2a
Commit
c94def2a
authored
Mar 12, 2020
by
LianaHus
Committed by
Liana Husikyan
Mar 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style fixes after review
parent
c2d7338a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
plugin-manager-settings.js
src/app/components/plugin-manager-settings.js
+8
-9
persmission-handler.js
src/app/ui/persmission-handler.js
+1
-1
No files found.
src/app/components/plugin-manager-settings.js
View file @
c94def2a
...
...
@@ -82,23 +82,22 @@ export class PluginManagerSettings {
settings
()
{
const
permissionByToPlugin
=
(
toPlugin
,
funcObj
)
=>
{
const
permissionBy
Functions
=
(
func
Name
,
fromPlugins
)
=>
{
function
updatePermission
(
plugin
)
{
self
.
permissions
[
toPlugin
][
funcName
][
plugin
].
allow
=
!
self
.
permissions
[
toPlugin
][
funcName
][
p
lugin
].
allow
const
permissionBy
Method
=
(
method
Name
,
fromPlugins
)
=>
{
const
togglePermission
=
(
fromPlugin
)
=>
{
this
.
permissions
[
toPlugin
][
methodName
][
fromPlugin
].
allow
=
!
this
.
permissions
[
toPlugin
][
methodName
][
fromP
lugin
].
allow
}
let
self
=
this
return
Object
.
keys
(
fromPlugins
).
map
(
fromName
=>
{
const
fromPluginPermission
=
fromPlugins
[
fromName
]
const
checkbox
=
fromPluginPermission
.
allow
?
yo
`<input onchange=
${()
=>
updatePermission
(
fromName
)}
class="mr-2" type="checkbox" checked id="permission-checkbox-
${
toPlugin
}
-
${
funcName
}
-
${
toPlugin
}
" aria-describedby="module
${
fromPluginPermission
}
ask permission for
${
func
Name
}
" />`
:
yo
`<input onchange=
${()
=>
updatePermission
(
fromName
)}
class="mr-2" type="checkbox" id="permission-checkbox-
${
toPlugin
}
-
${
funcName
}
-
${
toPlugin
}
" aria-describedby="module
${
fromPluginPermission
}
ask permission for
${
func
Name
}
" />`
?
yo
`<input onchange=
${()
=>
togglePermission
(
fromName
)}
class="mr-2" type="checkbox" checked id="permission-checkbox-
${
toPlugin
}
-
${
methodName
}
-
${
toPlugin
}
" aria-describedby="module
${
fromPluginPermission
}
asks permission for
${
method
Name
}
" />`
:
yo
`<input onchange=
${()
=>
togglePermission
(
fromName
)}
class="mr-2" type="checkbox" id="permission-checkbox-
${
toPlugin
}
-
${
methodName
}
-
${
toPlugin
}
" aria-describedby="module
${
fromPluginPermission
}
asks permission for
${
method
Name
}
" />`
return
yo
`
<div class="form-group
${
css
.
permissionKey
}
">
<div class="
${
css
.
checkbox
}
">
${
checkbox
}
<label for="permission-checkbox-
${
toPlugin
}
-
${
funcName
}
-
${
toPlugin
}
" data-id="permission-label-
${
toPlugin
}
-
${
funcName
}
-
${
toPlugin
}
">Allow <u>
${
fromName
}
</u> to call <u>
${
func
Name
}
</u></label>
<label for="permission-checkbox-
${
toPlugin
}
-
${
methodName
}
-
${
toPlugin
}
" data-id="permission-label-
${
toPlugin
}
-
${
methodName
}
-
${
toPlugin
}
">Allow <u>
${
fromName
}
</u> to call <u>
${
method
Name
}
</u></label>
</div>
<i onclick="
${()
=>
this
.
clearPersmission
(
fromName
,
toPlugin
,
funcName
)}
" class="fa fa-trash-alt" data-id="pluginManagerSettingsRemovePermission-
${
toPlugin
}
-
${
func
Name
}
-
${
toPlugin
}
"></i>
<i onclick="
${()
=>
this
.
clearPersmission
(
fromName
,
toPlugin
,
methodName
)}
" class="fa fa-trash-alt" data-id="pluginManagerSettingsRemovePermission-
${
toPlugin
}
-
${
method
Name
}
-
${
toPlugin
}
"></i>
</div>
`
})
...
...
@@ -106,7 +105,7 @@ export class PluginManagerSettings {
const
permissionsByFunctions
=
Object
.
keys
(
funcObj
)
.
map
(
funcName
=>
permissionByFunctions
(
funcName
,
funcObj
[
func
Name
]))
.
map
(
methodName
=>
permissionByMethod
(
methodName
,
funcObj
[
method
Name
]))
return
yo
`
<div border p-2>
...
...
src/app/ui/persmission-handler.js
View file @
c94def2a
...
...
@@ -150,7 +150,7 @@ export class PermissionHandler {
const
rememberSwitch
=
remember
?
yo
`<input type="checkbox" onchange="
${
switchMode
}
" checkbox class="form-check-input" id="remember" data-id="permissionHandlerRememberChecked">`
:
yo
`<input type="checkbox" onchange="
${
switchMode
}
" class="form-check-input" id="remember" data-id="permissionHandlerRememberUnchecked">`
const
text
=
`"
${
fromName
}
"
`
+
(
remember
?
`has changed and`
:
``
)
+
`
would like to access to "
${
method
}
" of "
${
toName
}
"`
const
text
=
`"
${
fromName
}
"
${(
remember
?
`has changed and`
:
``
)}
would like to access to "
${
method
}
" of "
${
toName
}
"`
const
imgFrom
=
yo
`<img id="permissionModalImagesFrom" src="
${
from
.
icon
}
" />`
const
imgTo
=
yo
`<img id="permissionModalImagesTo" src="
${
to
.
icon
}
" />`
const
pluginsImages
=
yo
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment