fix menu with parent data and remove action google sheet not available feature
This commit is contained in:
@@ -41,8 +41,8 @@ class GoogleSheets {
|
||||
tableContainer.innerHTML = "";
|
||||
|
||||
// Get user permissions from data attributes
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
// let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
// let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
@@ -65,25 +65,25 @@ class GoogleSheets {
|
||||
</a>
|
||||
`;
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="#" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
// if (canUpdate) {
|
||||
// buttons += `
|
||||
// <a href="#" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
// <i class='bx bx-edit'></i>
|
||||
// </a>
|
||||
// `;
|
||||
// }
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-google-sheet d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
// if (canDelete) {
|
||||
// buttons += `
|
||||
// <button data-id="${cell}" class="btn btn-sm btn-red btn-delete-google-sheet d-inline-flex align-items-center justify-content-center">
|
||||
// <i class='bx bxs-trash'></i>
|
||||
// </button>
|
||||
// `;
|
||||
// }
|
||||
|
||||
if (!canUpdate && !canDelete) {
|
||||
buttons = `<span class="text-muted">No Privilege</span>`;
|
||||
}
|
||||
// if (!canUpdate && !canDelete) {
|
||||
// buttons = `<span class="text-muted">No Privilege</span>`;
|
||||
// }
|
||||
|
||||
return gridjs.html(
|
||||
`<div class="d-flex justify-content-center gap-2">${buttons}</div>`
|
||||
|
||||
Reference in New Issue
Block a user