Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
b7d695f
1
Parent(s): bc04ec1
fix: resolve typescript build errors in internal portal navigation
Browse files
api/v1/users.py
CHANGED
|
@@ -36,8 +36,12 @@ async def create_workspace_user(
|
|
| 36 |
allowed_roles = []
|
| 37 |
if current_user.role == UserRole.CUSTOMER_ADMIN:
|
| 38 |
allowed_roles = [UserRole.CUSTOMER_ADMIN, UserRole.CUSTOMER_USER]
|
| 39 |
-
elif current_user.role
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
if payload.role not in allowed_roles:
|
| 43 |
raise HTTPException(
|
|
@@ -267,8 +271,12 @@ async def update_user_admin(
|
|
| 267 |
allowed_roles = []
|
| 268 |
if current_user.role == UserRole.CUSTOMER_ADMIN:
|
| 269 |
allowed_roles = [UserRole.CUSTOMER_ADMIN, UserRole.CUSTOMER_USER]
|
| 270 |
-
elif current_user.role
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
if update_data["role"] not in allowed_roles:
|
| 274 |
raise HTTPException(status_code=403, detail=f"Permission denied for role: {update_data['role']}")
|
|
|
|
| 36 |
allowed_roles = []
|
| 37 |
if current_user.role == UserRole.CUSTOMER_ADMIN:
|
| 38 |
allowed_roles = [UserRole.CUSTOMER_ADMIN, UserRole.CUSTOMER_USER]
|
| 39 |
+
elif current_user.role in [UserRole.SC_ADMIN, UserRole.SC_LEAD]:
|
| 40 |
+
# Staff can manage Staff (Agents and Leads)
|
| 41 |
+
allowed_roles = [UserRole.SC_LEAD, UserRole.SC_AGENT]
|
| 42 |
+
# Only SC_ADMIN can create/promote to SC_ADMIN level
|
| 43 |
+
if current_user.role == UserRole.SC_ADMIN:
|
| 44 |
+
allowed_roles.append(UserRole.SC_ADMIN)
|
| 45 |
|
| 46 |
if payload.role not in allowed_roles:
|
| 47 |
raise HTTPException(
|
|
|
|
| 271 |
allowed_roles = []
|
| 272 |
if current_user.role == UserRole.CUSTOMER_ADMIN:
|
| 273 |
allowed_roles = [UserRole.CUSTOMER_ADMIN, UserRole.CUSTOMER_USER]
|
| 274 |
+
elif current_user.role in [UserRole.SC_ADMIN, UserRole.SC_LEAD]:
|
| 275 |
+
# Staff can manage Staff (Agents and Leads)
|
| 276 |
+
allowed_roles = [UserRole.SC_LEAD, UserRole.SC_AGENT]
|
| 277 |
+
# Only SC_ADMIN can create/promote to SC_ADMIN level
|
| 278 |
+
if current_user.role == UserRole.SC_ADMIN:
|
| 279 |
+
allowed_roles.append(UserRole.SC_ADMIN)
|
| 280 |
|
| 281 |
if update_data["role"] not in allowed_roles:
|
| 282 |
raise HTTPException(status_code=403, detail=f"Permission denied for role: {update_data['role']}")
|
frontend/apps/internal/src/components/NexusConsole.module.css
CHANGED
|
@@ -153,6 +153,12 @@
|
|
| 153 |
|
| 154 |
.bold { color: var(--text1); font-weight: 600; }
|
| 155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
.thinkingDots {
|
| 157 |
display: flex;
|
| 158 |
align-items: center;
|
|
@@ -161,6 +167,7 @@
|
|
| 161 |
background: var(--bg2);
|
| 162 |
border: 1px solid var(--border);
|
| 163 |
border-radius: 3px 10px 10px 10px;
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
.thinkingDots .dot {
|
|
@@ -175,6 +182,31 @@
|
|
| 175 |
.thinkingDots .dot:nth-child(2) { animation-delay: 0.3s; }
|
| 176 |
.thinkingDots .dot:nth-child(3) { animation-delay: 0.6s; }
|
| 177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
.approvalCard {
|
| 179 |
background: var(--amber-dim);
|
| 180 |
border: 1px solid rgba(251, 191, 36, 0.27);
|
|
|
|
| 153 |
|
| 154 |
.bold { color: var(--text1); font-weight: 600; }
|
| 155 |
|
| 156 |
+
.thinkingContainer {
|
| 157 |
+
display: flex;
|
| 158 |
+
flex-direction: column;
|
| 159 |
+
gap: 8px;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
.thinkingDots {
|
| 163 |
display: flex;
|
| 164 |
align-items: center;
|
|
|
|
| 167 |
background: var(--bg2);
|
| 168 |
border: 1px solid var(--border);
|
| 169 |
border-radius: 3px 10px 10px 10px;
|
| 170 |
+
width: fit-content;
|
| 171 |
}
|
| 172 |
|
| 173 |
.thinkingDots .dot {
|
|
|
|
| 182 |
.thinkingDots .dot:nth-child(2) { animation-delay: 0.3s; }
|
| 183 |
.thinkingDots .dot:nth-child(3) { animation-delay: 0.6s; }
|
| 184 |
|
| 185 |
+
.statusTelemetry {
|
| 186 |
+
display: flex;
|
| 187 |
+
align-items: center;
|
| 188 |
+
gap: 8px;
|
| 189 |
+
font-size: 11px;
|
| 190 |
+
color: var(--text3);
|
| 191 |
+
font-weight: 600;
|
| 192 |
+
padding-left: 4px;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.telemetryPulse {
|
| 196 |
+
width: 5px;
|
| 197 |
+
height: 5px;
|
| 198 |
+
border-radius: 50%;
|
| 199 |
+
background: var(--green);
|
| 200 |
+
box-shadow: 0 0 5px var(--green);
|
| 201 |
+
animation: heartbeat 2s infinite;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
@keyframes heartbeat {
|
| 205 |
+
0% { transform: scale(1); opacity: 0.7; }
|
| 206 |
+
50% { transform: scale(1.4); opacity: 1; }
|
| 207 |
+
100% { transform: scale(1); opacity: 0.7; }
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
.approvalCard {
|
| 211 |
background: var(--amber-dim);
|
| 212 |
border: 1px solid rgba(251, 191, 36, 0.27);
|
frontend/apps/internal/src/components/NexusConsole.tsx
CHANGED
|
@@ -16,7 +16,7 @@ const FORENSIC_STEPS = [
|
|
| 16 |
];
|
| 17 |
|
| 18 |
export const NexusConsole: React.FC<NexusConsoleProps> = ({ initialTicket }) => {
|
| 19 |
-
const { messages, loading, query } = useNexus(initialTicket?.id);
|
| 20 |
const [input, setInput] = useState("");
|
| 21 |
const bottomRef = useRef<HTMLDivElement>(null);
|
| 22 |
|
|
@@ -105,10 +105,18 @@ export const NexusConsole: React.FC<NexusConsoleProps> = ({ initialTicket }) =>
|
|
| 105 |
{loading && (
|
| 106 |
<div className={styles.messageWrapper_assistant}>
|
| 107 |
<div className={styles.aiAvatar}>N</div>
|
| 108 |
-
<div className={styles.
|
| 109 |
-
<
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
</div>
|
| 113 |
</div>
|
| 114 |
)}
|
|
|
|
| 16 |
];
|
| 17 |
|
| 18 |
export const NexusConsole: React.FC<NexusConsoleProps> = ({ initialTicket }) => {
|
| 19 |
+
const { messages, loading, query, statusMessage } = useNexus(initialTicket?.id);
|
| 20 |
const [input, setInput] = useState("");
|
| 21 |
const bottomRef = useRef<HTMLDivElement>(null);
|
| 22 |
|
|
|
|
| 105 |
{loading && (
|
| 106 |
<div className={styles.messageWrapper_assistant}>
|
| 107 |
<div className={styles.aiAvatar}>N</div>
|
| 108 |
+
<div className={styles.thinkingContainer}>
|
| 109 |
+
<div className={styles.thinkingDots}>
|
| 110 |
+
<span className={styles.dot} />
|
| 111 |
+
<span className={styles.dot} />
|
| 112 |
+
<span className={styles.dot} />
|
| 113 |
+
</div>
|
| 114 |
+
{statusMessage && (
|
| 115 |
+
<div className={styles.statusTelemetry}>
|
| 116 |
+
<span className={styles.telemetryPulse} />
|
| 117 |
+
{statusMessage}
|
| 118 |
+
</div>
|
| 119 |
+
)}
|
| 120 |
</div>
|
| 121 |
</div>
|
| 122 |
)}
|