mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 02:14:05 +00:00
feat(help): rewrite the help center for v5 with a Tours section, new pictures in every language, and fix the tour planner bugs it surfaced
Every help screen checked against the v5 redesign. Tours is documented for the first time, as a screen of its own with twelve screens under it, and notifications get help of their own. All pictures are taken again on a realistic demo trip, with short loops where a still cannot show the motion. The English is plain and every language is written naturally rather than word for word. The switcher shows two levels at most, a screen's overview lists its sub-screens as cards above its guides, each wiki page is linked once, and the help sidebar is wider. Fixes found along the way: Save to Collection keeps a tour's route, a track dropped on the places column opens the Tours import, tour Share on desktop, the unsaved tour draft lives on the account, a route click no longer adds an end point, Trip places leaves the trip's tours out, Escape closes a stage's day menu, confirms before destructive deletes, DWD warnings sharing one id kept apart, a booking's date moves with it, and smaller fixes across notifications, bookings, the day plan, stays, Atlas, Collections, Vacay and the admin screens.
This commit is contained in:
@@ -10,9 +10,10 @@ interface UserActionsHost {
|
||||
}
|
||||
|
||||
/**
|
||||
* The two irreversible user actions behind the admin dialogs and their phone sheets:
|
||||
* rotating the JWT secret, which signs everyone out including the admin, and removing a
|
||||
* user's passkeys. Each shell keeps its own confirm step and busy state around them.
|
||||
* The irreversible user actions behind the admin dialogs and their phone sheets:
|
||||
* rotating the JWT secret, which signs everyone out including the admin, removing a
|
||||
* user's passkeys and switching off a user's two-factor login. Each shell keeps its own
|
||||
* confirm step and busy state around them.
|
||||
*/
|
||||
export function useAdminUserActions(admin: UserActionsHost, t: TranslationFn) {
|
||||
const { toast, setRotatingJwt, setShowRotateJwtModal, logout, navigate } = admin;
|
||||
@@ -42,5 +43,17 @@ export function useAdminUserActions(admin: UserActionsHost, t: TranslationFn) {
|
||||
}
|
||||
};
|
||||
|
||||
return { rotateJwt, resetPasskeys };
|
||||
/** Switches off the user's 2FA (their sessions end with it) and toasts; true when it worked. */
|
||||
const resetMfa = async (user: { id: number }): Promise<boolean> => {
|
||||
try {
|
||||
await adminApi.resetUserMfa(user.id);
|
||||
toast.success(t('admin.mfa.resetDone'));
|
||||
return true;
|
||||
} catch {
|
||||
toast.error(t('common.error'));
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return { rotateJwt, resetPasskeys, resetMfa };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user