Browse Source

feat(gui-v2): improved UI ACL table role handling

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/2841/head
mertmit 2 years ago
parent
commit
ce93117f89
  1. 53
      packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue

53
packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue

@ -10,6 +10,7 @@ const { $api, $e } = useNuxtApp()
const { project } = useProject() const { project } = useProject()
const toast = useToast() const toast = useToast()
const roles = $ref<Array<string>>(['editor', 'commenter', 'viewer'])
let isLoading = $ref(false) let isLoading = $ref(false)
let tables = $ref<Array<any>>([]) let tables = $ref<Array<any>>([])
let searchInput = $ref<string>('') let searchInput = $ref<string>('')
@ -123,44 +124,20 @@ const columns = [
{{ record.title }} {{ record.title }}
</div> </div>
</div> </div>
<div v-if="column.name === 'editor'"> <div v-for="role in roles" :key="role">
<a-tooltip> <div v-if="column.name === role">
<template #title>Click to hide '{{ record.title }}' for role:Editor in UI dashboard</template> <a-tooltip>
<a-checkbox <template #title>Click to hide '{{ record.title }}' for role:{{ role }} in UI dashboard</template>
:checked="!record.disabled.editor" <a-checkbox
@change=" :checked="!record.disabled[role]"
// eslint-disable-next-line prettier/prettier @change="
record.disabled.editor = !record.disabled.editor; // eslint-disable-next-line prettier/prettier
record.edited = true record.disabled[role] = !record.disabled[role];
" record.edited = true
></a-checkbox> "
</a-tooltip> ></a-checkbox>
</div> </a-tooltip>
<div v-if="column.name === 'commenter'"> </div>
<a-tooltip>
<template #title>Click to hide '{{ record.title }}' for role:Commenter in UI dashboard</template>
<a-checkbox
:checked="!record.disabled.commenter"
@change="
// eslint-disable-next-line prettier/prettier
record.disabled.commenter = !record.disabled.commenter;
record.edited = true
"
></a-checkbox>
</a-tooltip>
</div>
<div v-if="column.name === 'viewer'">
<a-tooltip>
<template #title>Click to hide '{{ record.title }}' for role:Viewer in UI dashboard</template>
<a-checkbox
:checked="!record.disabled.viewer"
@change="
// eslint-disable-next-line prettier/prettier
record.disabled.viewer = !record.disabled.viewer;
record.edited = true
"
></a-checkbox>
</a-tooltip>
</div> </div>
</template> </template>
</a-table> </a-table>

Loading…
Cancel
Save