2026-03-27 02:28:34 +01:00
|
|
|
|
import { For, Show, createSignal } from 'solid-js';
|
ui(step-1): match reference layout for dept/designation/employees/roles pages
- All pages: white sticky page header + tab bar with orange underline,
-mx-6 -mt-6 negative margin to stretch headers edge-to-edge
- department: full columns (ID, Name, Description, Created By, etc.),
icon-only action buttons, navy Add Department button
- designation: Designations List / Add Designation tabs, status filter
dropdown, inline create/edit form, full columns with status badge
- employees: View/Add tabs, icon-only action buttons, status badges
- roles/index: clean table with Name+code subtext, Description, actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:47:05 +01:00
|
|
|
|
import AdminShell from '~/components/AdminShell';
|
2026-03-27 02:28:34 +01:00
|
|
|
|
import { ChevronDown, SlidersHorizontal, Download, MoreVertical } from 'lucide-solid';
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
|
|
|
|
|
|
type Role = {
|
|
|
|
|
|
id: string;
|
|
|
|
|
|
name: string;
|
2026-03-27 02:28:34 +01:00
|
|
|
|
department: string;
|
|
|
|
|
|
usersAssigned: number;
|
|
|
|
|
|
permissionsCount: number;
|
|
|
|
|
|
status: 'ACTIVE' | 'INACTIVE';
|
|
|
|
|
|
createdDate: string;
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
const FALLBACK_ROLES: Role[] = [
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{ id: 'r1', name: 'Engineering Lead', department: 'Engineering', usersAssigned: 12, permissionsCount: 28, status: 'ACTIVE', createdDate: '2026-01-15' },
|
|
|
|
|
|
{ id: 'r2', name: 'Marketing Manager', department: 'Marketing', usersAssigned: 8, permissionsCount: 18, status: 'ACTIVE', createdDate: '2026-01-20' },
|
|
|
|
|
|
{ id: 'r3', name: 'Sales Director', department: 'Sales', usersAssigned: 15, permissionsCount: 32, status: 'ACTIVE', createdDate: '2026-02-01' },
|
|
|
|
|
|
{ id: 'r4', name: 'HR Admin', department: 'Human Resources', usersAssigned: 5, permissionsCount: 24, status: 'ACTIVE', createdDate: '2026-02-05' },
|
|
|
|
|
|
{ id: 'r5', name: 'Finance Controller', department: 'Finance', usersAssigned: 6, permissionsCount: 20, status: 'ACTIVE', createdDate: '2026-02-10' },
|
|
|
|
|
|
{ id: 'r6', name: 'Operations Head', department: 'Operations', usersAssigned: 4, permissionsCount: 16, status: 'INACTIVE', createdDate: '2026-03-01' },
|
|
|
|
|
|
{ id: 'r7', name: 'Support Lead', department: 'Customer Support', usersAssigned: 9, permissionsCount: 16, status: 'ACTIVE', createdDate: '2026-03-05' },
|
|
|
|
|
|
{ id: 'r8', name: 'Product Owner', department: 'Product', usersAssigned: 7, permissionsCount: 26, status: 'ACTIVE', createdDate: '2026-03-10' },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const MODULES = [
|
|
|
|
|
|
'Department Management',
|
|
|
|
|
|
'Designation Management',
|
|
|
|
|
|
'Internal Role Management',
|
|
|
|
|
|
'Employee Management',
|
|
|
|
|
|
'External Role Management',
|
|
|
|
|
|
'External Onboarding Management',
|
|
|
|
|
|
'Internal Dashboard Management',
|
|
|
|
|
|
'External Dashboard Management',
|
|
|
|
|
|
'Verification Management',
|
|
|
|
|
|
'Approval Management',
|
|
|
|
|
|
'Users Management',
|
|
|
|
|
|
'Company Management',
|
|
|
|
|
|
'Candidate Management',
|
|
|
|
|
|
'Customer Management',
|
|
|
|
|
|
'Jobs Management',
|
|
|
|
|
|
'Leads Management',
|
|
|
|
|
|
'Pricing Management',
|
|
|
|
|
|
'Credit Management',
|
|
|
|
|
|
'Coupon Management',
|
|
|
|
|
|
'Discount Management',
|
|
|
|
|
|
'Tax Management',
|
|
|
|
|
|
'Order Management',
|
|
|
|
|
|
'Invoice Management',
|
|
|
|
|
|
'Review Management',
|
|
|
|
|
|
'Support Management',
|
|
|
|
|
|
'Report Management',
|
|
|
|
|
|
'Ledger Management',
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
];
|
2026-03-25 22:15:06 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
type PermKey = 'view' | 'create' | 'update' | 'delete';
|
|
|
|
|
|
const PERM_KEYS: PermKey[] = ['view', 'create', 'update', 'delete'];
|
|
|
|
|
|
|
|
|
|
|
|
type ModulePerms = Record<PermKey, boolean>;
|
|
|
|
|
|
type PermissionsMap = Record<string, ModulePerms>;
|
|
|
|
|
|
|
|
|
|
|
|
function defaultPerms(): PermissionsMap {
|
|
|
|
|
|
const map: PermissionsMap = {};
|
|
|
|
|
|
for (const m of MODULES) {
|
|
|
|
|
|
map[m] = { view: false, create: false, update: false, delete: false };
|
2026-03-25 22:15:06 +01:00
|
|
|
|
}
|
2026-03-27 02:28:34 +01:00
|
|
|
|
return map;
|
2026-03-25 22:15:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
function StatusBadge(props: { status: string }) {
|
|
|
|
|
|
const active = () => props.status === 'ACTIVE';
|
|
|
|
|
|
return (
|
|
|
|
|
|
<span style={`display:inline-flex;align-items:center;border-radius:9999px;border:1px solid ${active() ? '#FFD8C2' : '#D1D5DB'};background:${active() ? '#FFF1EB' : '#F3F4F6'};color:${active() ? '#FF5E13' : '#4B5563'};padding:2px 10px;font-size:12px;font-weight:500`}>
|
|
|
|
|
|
<span style={`display:inline-block;width:6px;height:6px;border-radius:50%;background:${active() ? '#FF5E13' : '#9CA3AF'};margin-right:5px;flex-shrink:0`} />
|
|
|
|
|
|
{active() ? 'Active' : 'Inactive'}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
);
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
function Toggle(props: { on: boolean; onChange: (v: boolean) => void }) {
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
return (
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
onClick={() => props.onChange(!props.on)}
|
|
|
|
|
|
style={`width:40px;height:22px;border-radius:11px;background:${props.on ? '#FF5E13' : '#E5E7EB'};position:relative;cursor:pointer;border:none;padding:0;transition:background 0.2s`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<span style={`position:absolute;width:18px;height:18px;border-radius:50%;background:white;top:2px;transition:left 0.2s;left:${props.on ? '20px' : '2px'}`} />
|
|
|
|
|
|
</button>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
);
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
function FormInput(props: { label: string; required?: boolean; value: string; onInput: (v: string) => void; placeholder?: string }) {
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
return (
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<label style="display:block">
|
|
|
|
|
|
<span style="font-size:13px;font-weight:600;color:#374151">
|
|
|
|
|
|
{props.label}{props.required && <span style="color:#FF5E13;margin-left:2px">*</span>}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={props.value}
|
|
|
|
|
|
onInput={(e) => props.onInput(e.currentTarget.value)}
|
|
|
|
|
|
placeholder={props.placeholder}
|
|
|
|
|
|
style="display:block;margin-top:6px;height:40px;width:100%;border-radius:10px;border:1px solid #E5E7EB;padding:0 14px;font-size:13px;outline:none;box-sizing:border-box;color:#111827;background:white"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</label>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
export default function RolesPage() {
|
|
|
|
|
|
const [mainTab, setMainTab] = createSignal<'all' | 'create'>('all');
|
|
|
|
|
|
const [formTab, setFormTab] = createSignal<'general' | 'access' | 'settings'>('general');
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
// All Roles state
|
2026-03-25 22:15:06 +01:00
|
|
|
|
const [search, setSearch] = createSignal('');
|
|
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
// Create Role state
|
|
|
|
|
|
const [roleName, setRoleName] = createSignal('');
|
|
|
|
|
|
const [roleCode, setRoleCode] = createSignal('');
|
|
|
|
|
|
const [department, setDepartment] = createSignal('');
|
|
|
|
|
|
const [description, setDescription] = createSignal('');
|
|
|
|
|
|
const [status, setStatus] = createSignal<'ACTIVE' | 'INACTIVE'>('ACTIVE');
|
|
|
|
|
|
const [approveRequests, setApproveRequests] = createSignal(true);
|
|
|
|
|
|
const [manageSettings, setManageSettings] = createSignal(false);
|
|
|
|
|
|
const [permissions, setPermissions] = createSignal<PermissionsMap>(defaultPerms());
|
|
|
|
|
|
|
|
|
|
|
|
const filteredRoles = () => {
|
|
|
|
|
|
const q = search().toLowerCase();
|
|
|
|
|
|
if (!q) return FALLBACK_ROLES;
|
|
|
|
|
|
return FALLBACK_ROLES.filter(
|
|
|
|
|
|
(r) => r.name.toLowerCase().includes(q) || r.department.toLowerCase().includes(q)
|
|
|
|
|
|
);
|
2026-03-25 22:15:06 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
const togglePerm = (mod: string, key: PermKey) => {
|
|
|
|
|
|
setPermissions((prev) => ({
|
|
|
|
|
|
...prev,
|
|
|
|
|
|
[mod]: { ...prev[mod], [key]: !prev[mod][key] },
|
|
|
|
|
|
}));
|
|
|
|
|
|
};
|
2026-03-25 22:15:06 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
const toggleSelectAll = (mod: string) => {
|
|
|
|
|
|
const p = permissions()[mod];
|
|
|
|
|
|
const allOn = PERM_KEYS.every((k) => p[k]);
|
|
|
|
|
|
setPermissions((prev) => ({
|
|
|
|
|
|
...prev,
|
|
|
|
|
|
[mod]: { view: !allOn, create: !allOn, update: !allOn, delete: !allOn },
|
|
|
|
|
|
}));
|
2026-03-25 22:15:06 +01:00
|
|
|
|
};
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
const formatDate = (d: string) => {
|
|
|
|
|
|
if (!d) return '—';
|
|
|
|
|
|
const dt = new Date(d);
|
|
|
|
|
|
return dt.toLocaleDateString('en-IN', { day: '2-digit', month: 'short', year: 'numeric' });
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const shown = () => filteredRoles();
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<AdminShell>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<div style="padding:24px">
|
|
|
|
|
|
{/* Page Header */}
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
<div>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<h1 style="font-size:24px;font-weight:700;color:#111827;margin:0">Internal Role Management</h1>
|
|
|
|
|
|
<p style="font-size:13px;color:#6B7280;margin-top:4px;margin-bottom:0">Manage internal roles and permissions</p>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</div>
|
2026-03-25 22:15:06 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* Main Tabs */}
|
|
|
|
|
|
<div style="display:flex;align-items:center;gap:24px;border-bottom:1px solid #E5E7EB;margin-top:24px">
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
onClick={() => setMainTab('all')}
|
|
|
|
|
|
style={`padding-bottom:12px;font-size:14px;font-weight:500;background:none;border:none;cursor:pointer;${mainTab() === 'all' ? 'color:#FF5E13;border-bottom:2px solid #FF5E13;margin-bottom:-1px' : 'color:#6B7280;border-bottom:none'}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
All Roles
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
onClick={() => setMainTab('create')}
|
|
|
|
|
|
style={`padding-bottom:12px;font-size:14px;font-weight:500;background:none;border:none;cursor:pointer;${mainTab() === 'create' ? 'color:#FF5E13;border-bottom:2px solid #FF5E13;margin-bottom:-1px' : 'color:#6B7280;border-bottom:none'}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
Create Role
|
|
|
|
|
|
</button>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
</div>
|
2026-03-26 00:06:47 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* ── ALL ROLES TAB ── */}
|
|
|
|
|
|
<Show when={mainTab() === 'all'}>
|
|
|
|
|
|
{/* Edge-to-edge card */}
|
|
|
|
|
|
<div style="margin-top:20px;margin-left:-24px;margin-right:-24px;border-radius:0;overflow:hidden;border-top:1px solid #E5E7EB;border-bottom:1px solid #E5E7EB;background:white">
|
|
|
|
|
|
{/* Filter Bar */}
|
|
|
|
|
|
<div style="display:flex;align-items:center;gap:8px;padding:14px 20px;border-bottom:1px solid #F3F4F6">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
placeholder="Search roles..."
|
|
|
|
|
|
value={search()}
|
|
|
|
|
|
onInput={(e) => setSearch(e.currentTarget.value)}
|
|
|
|
|
|
style="height:34px;flex:1;max-width:240px;border-radius:8px;border:1px solid #E5E7EB;padding:0 12px;font-size:13px;outline:none;color:#111827"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<button type="button" style="height:34px;padding:0 12px;border-radius:8px;border:1px solid #E5E7EB;background:white;font-size:13px;color:#374151;cursor:pointer;display:inline-flex;align-items:center;gap:4px">
|
|
|
|
|
|
<ChevronDown size={14} />
|
|
|
|
|
|
Sort
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button type="button" style="height:34px;padding:0 12px;border-radius:8px;border:1px solid #E5E7EB;background:white;font-size:13px;color:#374151;cursor:pointer;display:inline-flex;align-items:center;gap:4px">
|
|
|
|
|
|
<SlidersHorizontal size={14} />
|
|
|
|
|
|
Filters
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button type="button" style="height:34px;padding:0 14px;border-radius:8px;background:#0D0D2A;color:white;font-size:13px;font-weight:500;border:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px">
|
|
|
|
|
|
<Download size={14} />
|
|
|
|
|
|
Export
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* Table */}
|
|
|
|
|
|
<div style="overflow-x:auto">
|
|
|
|
|
|
<table style="width:100%;border-collapse:collapse">
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
<tr style="background:#0D0D2A">
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap">Role Name</th>
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap">Department</th>
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap">Users Assigned</th>
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap">Permissions Count</th>
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap">Status</th>
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap">Created Date</th>
|
|
|
|
|
|
<th style="padding:10px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#FFFFFF;text-align:left;white-space:nowrap"></th>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</tr>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<For each={shown()}>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
{(role) => (
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<tr style="border-bottom:1px solid #F3F4F6">
|
|
|
|
|
|
<td style="padding:12px 20px">
|
|
|
|
|
|
<span style="font-size:14px;font-weight:600;color:#111827">{role.name}</span>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td style="padding:12px 20px">
|
|
|
|
|
|
<span style="font-size:14px;color:#374151">{role.department}</span>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</td>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<td style="padding:12px 20px">
|
|
|
|
|
|
<span style="font-size:14px;font-weight:600;color:#111827">{role.usersAssigned}</span>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</td>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<td style="padding:12px 20px">
|
|
|
|
|
|
<span style="display:inline-flex;border-radius:8px;background:#FFF1EB;border:1px solid #FFD8C2;color:#FF5E13;padding:2px 10px;font-size:12px;font-weight:600">
|
|
|
|
|
|
{role.permissionsCount} Permissions
|
|
|
|
|
|
</span>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</td>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<td style="padding:12px 20px">
|
|
|
|
|
|
<StatusBadge status={role.status} />
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</td>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<td style="padding:12px 20px">
|
|
|
|
|
|
<span style="font-size:13px;color:#6B7280">{formatDate(role.createdDate)}</span>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
</td>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<td style="padding:12px 20px;text-align:center">
|
|
|
|
|
|
<button type="button" style="background:none;border:none;cursor:pointer;color:#6B7280;display:inline-flex;align-items:center">
|
|
|
|
|
|
<MoreVertical size={16} />
|
|
|
|
|
|
</button>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
</td>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</tr>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</For>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
</tbody>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Pagination */}
|
|
|
|
|
|
<div style="display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-top:1px solid #F3F4F6">
|
|
|
|
|
|
<span style="font-size:13px;color:#6B7280">
|
|
|
|
|
|
Showing 1–{shown().length} of {shown().length} roles
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<div style="display:flex;align-items:center;gap:4px">
|
|
|
|
|
|
<button type="button" style="height:30px;min-width:30px;padding:0 10px;border-radius:6px;border:1px solid #E5E7EB;background:#FF5E13;color:white;font-size:13px;font-weight:600;cursor:pointer">1</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
</div>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
</Show>
|
2026-03-25 22:15:06 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* ── CREATE ROLE TAB ── */}
|
|
|
|
|
|
<Show when={mainTab() === 'create'}>
|
|
|
|
|
|
<div style="margin-top:20px;border-radius:16px;border:1px solid #E5E7EB;background:white;overflow:hidden">
|
|
|
|
|
|
{/* Form Sub-tabs */}
|
|
|
|
|
|
<div style="display:flex;align-items:center;gap:0;border-bottom:1px solid #E5E7EB;padding:0 24px">
|
|
|
|
|
|
{(
|
|
|
|
|
|
[
|
|
|
|
|
|
{ key: 'general', label: 'General Information' },
|
|
|
|
|
|
{ key: 'access', label: 'Module Access' },
|
|
|
|
|
|
{ key: 'settings', label: 'Role Settings' },
|
|
|
|
|
|
] as const
|
|
|
|
|
|
).map(({ key, label }) => (
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
2026-03-27 02:28:34 +01:00
|
|
|
|
onClick={() => setFormTab(key)}
|
|
|
|
|
|
style={`padding:14px 0;margin-right:24px;font-size:14px;background:none;border:none;cursor:pointer;${formTab() === key ? 'color:#0D0D2A;border-bottom:2px solid #0D0D2A;margin-bottom:-1px;font-weight:600' : 'color:#6B7280;font-weight:400'}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
{label}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
))}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* ── General Information ── */}
|
|
|
|
|
|
<Show when={formTab() === 'general'}>
|
|
|
|
|
|
<div style="padding:24px">
|
|
|
|
|
|
<div style="display:grid;grid-template-columns:1fr 1fr;gap:20px">
|
|
|
|
|
|
<FormInput
|
|
|
|
|
|
label="Role Name"
|
|
|
|
|
|
required
|
|
|
|
|
|
value={roleName()}
|
|
|
|
|
|
onInput={setRoleName}
|
|
|
|
|
|
placeholder="e.g. Engineering Lead"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<FormInput
|
|
|
|
|
|
label="Role Code"
|
|
|
|
|
|
required
|
|
|
|
|
|
value={roleCode()}
|
|
|
|
|
|
onInput={setRoleCode}
|
|
|
|
|
|
placeholder="e.g. ENG_LEAD"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="margin-top:20px">
|
|
|
|
|
|
<label style="display:block">
|
|
|
|
|
|
<span style="font-size:13px;font-weight:600;color:#374151">
|
|
|
|
|
|
Department<span style="color:#FF5E13;margin-left:2px">*</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={department()}
|
|
|
|
|
|
onInput={(e) => setDepartment(e.currentTarget.value)}
|
|
|
|
|
|
placeholder="e.g. Engineering"
|
|
|
|
|
|
style="display:block;margin-top:6px;height:40px;width:100%;border-radius:10px;border:1px solid #E5E7EB;padding:0 14px;font-size:13px;outline:none;box-sizing:border-box;color:#111827;background:white"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="margin-top:20px">
|
|
|
|
|
|
<label style="display:block">
|
|
|
|
|
|
<span style="font-size:13px;font-weight:600;color:#374151">Description</span>
|
|
|
|
|
|
<textarea
|
|
|
|
|
|
value={description()}
|
|
|
|
|
|
onInput={(e) => setDescription(e.currentTarget.value)}
|
|
|
|
|
|
placeholder="Describe this role's responsibilities..."
|
|
|
|
|
|
style="display:block;margin-top:6px;height:100px;width:100%;border-radius:10px;border:1px solid #E5E7EB;padding:10px 14px;font-size:13px;outline:none;box-sizing:border-box;color:#111827;background:white;resize:vertical;font-family:inherit"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Show>
|
|
|
|
|
|
|
|
|
|
|
|
{/* ── Module Access ── */}
|
|
|
|
|
|
<Show when={formTab() === 'access'}>
|
|
|
|
|
|
<div style="padding:24px">
|
|
|
|
|
|
<p style="font-size:13px;color:#6B7280;margin-top:0;margin-bottom:16px">
|
|
|
|
|
|
Configure module access permissions for this role.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<div style="overflow-x:auto">
|
|
|
|
|
|
<table style="width:100%;border-collapse:collapse;border-radius:12px;overflow:hidden;border:1px solid #E5E7EB">
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
<tr style="background:#0D0D2A">
|
|
|
|
|
|
<th style="padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;color:white;text-align:left">Module Name</th>
|
|
|
|
|
|
<th style="padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;color:white;text-align:center">View</th>
|
|
|
|
|
|
<th style="padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;color:white;text-align:center">Create</th>
|
|
|
|
|
|
<th style="padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;color:white;text-align:center">Update</th>
|
|
|
|
|
|
<th style="padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;color:white;text-align:center">Delete</th>
|
|
|
|
|
|
<th style="padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;color:white;text-align:center">Select All</th>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<For each={MODULES}>
|
|
|
|
|
|
{(mod) => {
|
|
|
|
|
|
const p = () => permissions()[mod];
|
|
|
|
|
|
const allOn = () => PERM_KEYS.every((k) => p()[k]);
|
|
|
|
|
|
return (
|
|
|
|
|
|
<tr style="border-bottom:1px solid #F3F4F6">
|
|
|
|
|
|
<td style="padding:12px 16px;font-size:13px;color:#111827;font-weight:500;text-align:left">{mod}</td>
|
|
|
|
|
|
<For each={PERM_KEYS}>
|
|
|
|
|
|
{(key) => (
|
|
|
|
|
|
<td style="text-align:center;padding:12px">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={p()[key]}
|
|
|
|
|
|
onChange={() => togglePerm(mod, key)}
|
|
|
|
|
|
style="width:16px;height:16px;accent-color:#FF5E13;cursor:pointer"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</For>
|
|
|
|
|
|
<td style="text-align:center;padding:12px">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={allOn()}
|
|
|
|
|
|
onChange={() => toggleSelectAll(mod)}
|
|
|
|
|
|
style="width:16px;height:16px;accent-color:#FF5E13;cursor:pointer"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
);
|
|
|
|
|
|
}}
|
|
|
|
|
|
</For>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Show>
|
|
|
|
|
|
|
|
|
|
|
|
{/* ── Role Settings ── */}
|
|
|
|
|
|
<Show when={formTab() === 'settings'}>
|
|
|
|
|
|
<div style="padding:24px;display:flex;flex-direction:column;gap:24px">
|
|
|
|
|
|
{/* Role Status */}
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<p style="font-size:13px;font-weight:600;color:#374151;margin:0 0 10px 0">Role Status</p>
|
|
|
|
|
|
<div style="display:flex;gap:8px">
|
2026-03-26 00:06:47 +01:00
|
|
|
|
<button
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
type="button"
|
2026-03-27 02:28:34 +01:00
|
|
|
|
onClick={() => setStatus('ACTIVE')}
|
|
|
|
|
|
style={`height:36px;padding:0 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;${status() === 'ACTIVE' ? 'border:1px solid #FF5E13;background:#FF5E13;color:white' : 'border:1px solid #E5E7EB;background:white;color:#6B7280'}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
Active
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
onClick={() => setStatus('INACTIVE')}
|
|
|
|
|
|
style={`height:36px;padding:0 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;${status() === 'INACTIVE' ? 'border:1px solid #6B7280;background:#6B7280;color:white' : 'border:1px solid #E5E7EB;background:white;color:#6B7280'}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
Inactive
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* Toggle: Approve Requests */}
|
|
|
|
|
|
<div style="border-radius:12px;border:1px solid #E5E7EB;padding:16px 20px;display:flex;align-items:center;justify-content:space-between">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<p style="font-size:14px;font-weight:600;color:#111827;margin:0">Allow Role to Approve Requests</p>
|
|
|
|
|
|
<p style="font-size:13px;color:#6B7280;margin:4px 0 0 0">Grant this role the ability to approve or reject submitted requests.</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<Toggle on={approveRequests()} onChange={setApproveRequests} />
|
|
|
|
|
|
</div>
|
feat(admin): redesign sidebar, dashboard, dept, designation & roles UI
- Sidebar: white bg, rounded pill nav items, orange left indicator for active
- Dashboard: remove Export/View All buttons, add Customise Dashboard + drag handles on widgets
- Department/Designation/Roles: new design system with orange label header, stat cards, light table header, 3-dot action menus, status badges
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:01:23 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* Toggle: Manage Settings */}
|
|
|
|
|
|
<div style="border-radius:12px;border:1px solid #E5E7EB;padding:16px 20px;display:flex;align-items:center;justify-content:space-between">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<p style="font-size:14px;font-weight:600;color:#111827;margin:0">Allow Role to Manage System Settings</p>
|
|
|
|
|
|
<p style="font-size:13px;color:#6B7280;margin:4px 0 0 0">Grant this role access to configure and modify system-wide settings.</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<Toggle on={manageSettings()} onChange={setManageSettings} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Show>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
|
2026-03-27 02:28:34 +01:00
|
|
|
|
{/* Form Footer */}
|
|
|
|
|
|
<div style="display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid #E5E7EB">
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
onClick={() => setMainTab('all')}
|
|
|
|
|
|
style="height:38px;padding:0 20px;border-radius:8px;font-size:14px;font-weight:500;border:1px solid #E5E7EB;background:white;color:#374151;cursor:pointer"
|
|
|
|
|
|
>
|
|
|
|
|
|
Cancel
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
</button>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
style="background:#0D0D2A;color:white;height:38px;padding:0 20px;border-radius:8px;font-size:14px;font-weight:500;border:none;cursor:pointer"
|
|
|
|
|
|
>
|
|
|
|
|
|
Create Role
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-03-27 02:28:34 +01:00
|
|
|
|
</Show>
|
ui(step-1): match reference layout for dept/designation/employees/roles pages
- All pages: white sticky page header + tab bar with orange underline,
-mx-6 -mt-6 negative margin to stretch headers edge-to-edge
- department: full columns (ID, Name, Description, Created By, etc.),
icon-only action buttons, navy Add Department button
- designation: Designations List / Add Designation tabs, status filter
dropdown, inline create/edit form, full columns with status badge
- employees: View/Add tabs, icon-only action buttons, status badges
- roles/index: clean table with Name+code subtext, Description, actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:47:05 +01:00
|
|
|
|
</div>
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
</AdminShell>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|