frontend-roles-ux

This commit is contained in:
VPN SaaS Dev
2026-05-16 19:35:04 +09:00
parent b03b63a5cc
commit 8efac3a844
3 changed files with 5 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ dp = Dispatcher()
api = ApiClient() api = ApiClient()
APPROVED_SERVICE_STATUSES = {"approved", "verified"} APPROVED_SERVICE_STATUSES = {"approved", "verified"}
STO_WORKPLACE_ROLES = {"owner", "mechanic"} STO_WORKPLACE_ROLES = {"owner", "manager", "receptionist", "mechanic"}
def webapp_url(path: str = "") -> str: def webapp_url(path: str = "") -> str:

View File

@@ -602,7 +602,7 @@ function hideAuthOverlay() {
} }
const APPROVED_SERVICE_STATUSES = new Set(["approved", "verified"]); const APPROVED_SERVICE_STATUSES = new Set(["approved", "verified"]);
const STO_WORKPLACE_ROLES = new Set(["owner", "mechanic"]); const STO_WORKPLACE_ROLES = new Set(["owner", "manager", "receptionist", "mechanic"]);
const STO_CALENDAR_ROLES = new Set(["owner", "manager", "receptionist"]); const STO_CALENDAR_ROLES = new Set(["owner", "manager", "receptionist"]);
function isPlatformAdmin() { function isPlatformAdmin() {

View File

@@ -3,7 +3,7 @@ tg?.ready();
tg?.expand(); tg?.expand();
const APPROVED_SERVICE_STATUSES = new Set(["approved", "verified"]); const APPROVED_SERVICE_STATUSES = new Set(["approved", "verified"]);
const STO_WORKPLACE_ROLES = new Set(["owner", "mechanic"]); const STO_WORKPLACE_ROLES = new Set(["owner", "manager", "receptionist", "mechanic"]);
const state = { const state = {
user: null, user: null,
@@ -250,7 +250,8 @@ function renderDashboard(dashboard) {
} }
function renderAppointments() { function renderAppointments() {
const canManage = (activeCenter()?.employee_role || "owner") === "owner"; const role = activeCenter()?.employee_role || "owner";
const canManage = ["owner", "manager", "receptionist"].includes(role);
document.querySelector("#appointmentsList").innerHTML = state.appointments.length document.querySelector("#appointmentsList").innerHTML = state.appointments.length
? state.appointments.map((item) => ` ? state.appointments.map((item) => `
<div class="stack-item work-order-card"> <div class="stack-item work-order-card">