frontend-roles-ux
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user