Commit b815dae7 authored by Grandschtroumpf's avatar Grandschtroumpf

Add title if no permission exist

parent 6382e855
...@@ -17,6 +17,7 @@ const css = csjs` ...@@ -17,6 +17,7 @@ const css = csjs`
} }
.permissionForm h4 { .permissionForm h4 {
font-size: 1.3rem; font-size: 1.3rem;
text-align: center;
} }
.permissionForm h6 { .permissionForm h6 {
font-size: 1.1rem; font-size: 1.1rem;
...@@ -36,7 +37,8 @@ const css = csjs` ...@@ -36,7 +37,8 @@ const css = csjs`
export class PluginManagerSettings { export class PluginManagerSettings {
openDialog () { openDialog () {
this.permissions = JSON.parse(window.localStorage.getItem('plugins/permissions')) const fromLocal = window.localStorage.getItem('plugins/permissions')
this.permissions = JSON.parse(fromLocal || '{}')
modalDialog('Plugin Manager Settings', this.settings(), modalDialog('Plugin Manager Settings', this.settings(),
{ fn: () => this.onValidation() }, { fn: () => this.onValidation() },
) )
...@@ -64,22 +66,27 @@ export class PluginManagerSettings { ...@@ -64,22 +66,27 @@ export class PluginManagerSettings {
</div>` </div>`
} }
const byPlugin = Object const byModule = Object
.keys(permission) .keys(permission)
.map(name => permissionByPlugin(name, permission[name])) .map(name => permissionByPlugin(name, permission[name]))
return yo` return yo`
<div> <div>
<h6>${key} :</h6> <h6>${key} :</h6>
${byPlugin} ${byModule}
</div>` </div>`
} }
const permissions = Object const permissions = Object
.keys(this.permissions) .keys(this.permissions)
.map(key => permissionByModule(key, this.permissions[key])) .map(key => permissionByModule(key, this.permissions[key]))
const title = permissions.length === 0
? yo`<h4>No Permission requested yet.</h4>`
: yo`<h4>Current Permission settings</h4>`
return yo`<form class="${css.permissionForm}"> return yo`<form class="${css.permissionForm}">
<h4>Current Permission settings</h4> ${title}
<hr/> <hr/>
${permissions} ${permissions}
</form>` </form>`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment