fix menu with parent data and remove action google sheet not available feature

This commit is contained in:
arifal
2025-03-21 14:54:18 +07:00
parent f36f250700
commit d7bff86741
6 changed files with 54 additions and 34 deletions

View File

@@ -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>`