Skip to content

Commit

Permalink
add permissions to tables description
Browse files Browse the repository at this point in the history
Signed-off-by: grnd-alt <salimbelakkaf@outlook.de>
  • Loading branch information
grnd-alt committed Mar 15, 2024
1 parent 052da12 commit a2e4fe8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/modules/main/sections/Table.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<div>
<ElementDescription :active-element="table" :view-setting.sync="localViewSetting" />
<div id="description-editor" ref="textDiv" />
<div class="description__editor">
<div id="description-editor" ref="textEditor" />
</div>
<Dashboard v-if="hasViews"
:table="table"
@create-column="$emit('create-column')"
Expand All @@ -21,6 +23,7 @@

<script>
import ElementDescription from './ElementDescription.vue'
import permissionsMixin from '../../../shared/components/ncTable/mixins/permissionsMixin.js'
import Dashboard from './Dashboard.vue'
import DataTable from './DataTable.vue'
import { mapState } from 'vuex'
Expand All @@ -33,6 +36,7 @@ export default {
Dashboard,
DataTable,
},
mixins: [permissionsMixin],
props: {
table: {
Expand Down Expand Up @@ -88,8 +92,9 @@ export default {
this.descriptionLastEdited = 0
this.description = this.table.description
this.editor = await window.OCA.Text.createEditor({
el: this.$refs.textDiv,
el: this.$refs.textEditor,
content: this.table.description,
readOnly: !this.canManageElement(this.table),
onUpdate: ({ markdown }) => {
if (this.description === markdown) {
this.descriptionLastEdit = 0
Expand Down Expand Up @@ -121,3 +126,8 @@ export default {
},
}
</script>
<style lang="scss" scoped>
.description__editor :deep(.ProseMirror) {
padding-bottom: 0;
}
</style>

0 comments on commit a2e4fe8

Please sign in to comment.