Browse Source

refactor: disable sortable table/view list option for non-admin user

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/863/head
Pranav C 3 years ago
parent
commit
a204760190
  1. 10
      packages/nc-gui/components/ProjectTreeView.vue
  2. 6
      packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

10
packages/nc-gui/components/ProjectTreeView.vue

@ -201,12 +201,11 @@
</template>
<v-list-item-group :value="selectedItem">
<draggable
v-model=" item.children"
<component
:is="_isUIAllowed('treeview-drag-n-drop') ? 'draggable' : 'div'"
v-model="item.children"
draggable="div"
v-bind="dragOptions"
@start="drag=true"
@end="drag=false"
@change="onMove($event, item.children)"
>
<transition-group type="transition" :name="!drag ? 'flip-list' : null">
@ -227,6 +226,7 @@
@contextmenu.prevent.stop="showCTXMenu($event, child, false, true)"
>
<v-icon
v-if="_isUIAllowed('treeview-drag-n-drop')"
small
:class="`nc-child-draggable-icon nc-child-draggable-icon-${child.name}`"
>
@ -319,7 +319,7 @@
</template>
</v-list-item>
</transition-group>
</draggable>
</component>
</v-list-item-group>
</v-list-group>
<v-list-item

6
packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

@ -17,11 +17,10 @@
</v-list-item>
<v-list-item-group v-model="selectedViewIdLocal" mandatory color="primary">
<draggable
:is="_isUIAllowed('viewlist-drag-n-drop') ? 'draggable' : 'div'"
v-model="viewsList"
draggable="div"
v-bind="dragOptions"
@start="drag=true"
@end="drag=false"
@change="onMove($event)"
>
<transition-group type="transition" :name="!drag ? 'flip-list' : null">
@ -36,8 +35,9 @@
@click="$emit('generateNewViewKey')"
>
<v-icon
v-if="_isUIAllowed('viewlist-drag-n-drop')"
small
:class="`nc-child-draggable-icon-${view.title}`"
:class="`nc-child-draggable-icon nc-child-draggable-icon-${view.title}`"
@click.stop
>
mdi-drag-vertical

Loading…
Cancel
Save