@alliance-droid/status-feedback-system 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts
CHANGED
|
@@ -70,6 +70,8 @@ export interface BoardTransitions {
|
|
|
70
70
|
publicStatus: PublicStatus;
|
|
71
71
|
};
|
|
72
72
|
targets: BoardTransition[];
|
|
73
|
+
/** Whether this user may manage status on this project (drives the UI affordance). */
|
|
74
|
+
canManage: boolean;
|
|
73
75
|
}
|
|
74
76
|
/** Result of applying a status change from the board. */
|
|
75
77
|
export interface BoardStatusUpdate {
|
|
@@ -184,11 +184,13 @@ export function createFeedbackBoard(options) {
|
|
|
184
184
|
try {
|
|
185
185
|
const result = await client.getBoardTransitions(itemId, token);
|
|
186
186
|
transitions = { ...transitions, [itemId]: result };
|
|
187
|
-
|
|
187
|
+
// The backend tells us whether this user may manage status (200 either
|
|
188
|
+
// way — no 403 console noise for ordinary signed-in users).
|
|
189
|
+
statusPrivilege = result.canManage;
|
|
188
190
|
return result;
|
|
189
191
|
}
|
|
190
192
|
catch {
|
|
191
|
-
// 401/
|
|
193
|
+
// 401 (no/invalid token) or network error → no control.
|
|
192
194
|
return null;
|
|
193
195
|
}
|
|
194
196
|
}
|
|
@@ -205,7 +207,8 @@ export function createFeedbackBoard(options) {
|
|
|
205
207
|
if (!sample)
|
|
206
208
|
return;
|
|
207
209
|
privilegeProbed = true;
|
|
208
|
-
statusPrivilege
|
|
210
|
+
// loadTransitions sets statusPrivilege from the result's canManage flag.
|
|
211
|
+
await loadTransitions(sample.id);
|
|
209
212
|
}
|
|
210
213
|
async function setStatus(itemId, status, reason) {
|
|
211
214
|
const token = await resolveToken();
|
package/package.json
CHANGED