04be659d6b
Add routes for modules, users, notes import, recap, and islands edit. Update middleware to filter pages based on user role. feat(admin): add modal for assigning teaching, replace delete icon with SVG refactor(server): rename port variable to uppercase and add env support feat(admin): add enseignants, users, filtering and role colors refactor(AdminRoles): improve role UI and add permission mapping feat(admin-users): add role colors, role filter, and modal for creating users feat(admin): add EditModule component for module editing feat(admin): add EditUser page for editing users and managing enseignements feat(promo-select): display id and name in options for promo dropdown feat: add edit module/user routes, inline coeff editing, UI tweaks refactor: UI – icons, modal overlay, grid, subtitles, import margin
69 lines
1.5 KiB
TypeScript
69 lines
1.5 KiB
TypeScript
import { type RegularTagNode, type TextNode } from "@melvdouc/xml-parser";
|
|
import { AsyncRoute } from "$fresh/src/server/types.ts";
|
|
|
|
export interface AuthenticatedState {
|
|
isAuthenticated: true;
|
|
session: CasContent;
|
|
availablePages: Record<string, string>;
|
|
}
|
|
|
|
interface UnauthenticatedState {
|
|
isAuthenticated: false;
|
|
session: undefined;
|
|
}
|
|
|
|
export type State = AuthenticatedState | UnauthenticatedState;
|
|
|
|
export interface AppProperties {
|
|
name: string;
|
|
icon: string;
|
|
pages: Record<string, string>;
|
|
adminOnly: string[];
|
|
studentOnly?: string[];
|
|
hint: string;
|
|
}
|
|
|
|
export interface CasTagNode extends RegularTagNode {
|
|
children: [TextNode];
|
|
}
|
|
|
|
export interface CasGroupNode extends RegularTagNode {
|
|
children: CasTagNode[];
|
|
}
|
|
|
|
export interface CasResponse extends RegularTagNode {
|
|
children: [TextNode, CasGroupNode];
|
|
}
|
|
|
|
export interface CasContent {
|
|
amuCampus: string;
|
|
amuComposante: string;
|
|
amuDateValidation: string;
|
|
coGroup: string;
|
|
eduPersonPrimaryAffiliation: string;
|
|
eduPersonPrincipalName: string;
|
|
mail: string;
|
|
displayName: string;
|
|
givenName: string;
|
|
memberOf: string[];
|
|
sn: string;
|
|
supannCivilite: string;
|
|
supannEntiteAffectation: string;
|
|
supannEtuAnneeInscription: string;
|
|
supannEtuEtape: string;
|
|
uid: string;
|
|
}
|
|
|
|
export interface LoginJWT {
|
|
iss: "PolyMPR";
|
|
iat: number;
|
|
exp: number;
|
|
aud: "PolyMPR";
|
|
user: CasContent;
|
|
}
|
|
|
|
export type EmptyObject = Record<string | number | symbol, never>;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
export type Route = AsyncRoute<any, State>;
|