Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions frontend/public/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,77 @@
"danish": "Dansk",
"management": "Administration"
},
"infosysNav": {
"overview": "Oversigt",
"participantSearch": "Deltagersøgning",
"gameMasters": "Spilledere",
"createAndCheckIn": "Opret og check-in",
"checkIn": "Check-in-registrering",
"doubleBookings": "Dobbeltbookinger",
"refunds": "Tilbagebetalinger",
"outstandingPayments": "Manglende betalinger",
"missingIdPhotos": "Arrangører med manglende ID-foto",
"downloadIdPhotos": "Hent billeder til ID",
"nameBadgeList": "Liste til navneskilte",
"registerPayments": "Registrer betalinger",
"allActivities": "Alle aktiviteter",
"graphicalOverview": "Grafisk oversigt",
"importExportActivities": "Importér/eksportér aktiviteter",
"activitySignupStatistics": "Tilmeldingsstatistik",
"gameMasterBriefings": "Spillederbriefings",
"exportGameMasters": "Eksportér GM-liste",
"runs": "Hold",
"createRun": "Opret hold",
"boardgameRuns": "Brætspilshold",
"roleplayingVoting": "Afstemning for rollespil",
"boardgameVoting": "Afstemning for brætspil",
"downloadBallots": "Hent stemmesedler",
"rooms": "Lokaler",
"allRooms": "Alle lokaler",
"roomUsage": "Lokalebrug",
"createRoom": "Opret lokale",
"sleepingStatistics": "Sovestatistik",
"wear": "Wear",
"wearOrderOverview": "Bestillingsoversigt",
"allWearOrders": "Alle bestillinger",
"pendingWearOrders": "Ikke-udleverede",
"wearTypes": "Wear-typer",
"createWearType": "Opret wear-type",
"editWearProperties": "Redigér egenskaber",
"uploadWearImage": "Upload billede",
"wearPickup": "Wear-udlevering",
"food": "Mad",
"foodTypes": "Madtyper",
"createFoodType": "Opret madtype",
"statistics": "Statistik",
"foodPickup": "Madudlevering",
"foodExchange": "Madbørs",
"resetMealTimes": "Nulstil madtidsfordeling",
"economy": "Økonomi",
"budgetOverview": "Budgetoversigt",
"accountingOverview": "Regnskabsoversigt",
"participantOverview": "Deltageroversigt",
"onlinePayments": "Onlinebetalinger",
"heroForce": "Heltestyrke",
"shiftOverview": "Vagtoversigt",
"shiftCategories": "Vagtkategorier",
"admission": "Indgang",
"admissionTypes": "Alle indgangstyper",
"createAdmissionType": "Opret indgangstype",
"shop": "Kiosk",
"boardgames": "Brætspil",
"loans": "Udlån",
"log": "Log",
"admin": "Admin",
"roles": "Roller",
"privileges": "Rettigheder",
"generateNameBadges": "Generér navneskilte",
"evaluationEmail": "Evalueringsmail",
"resetSignup": "Nulstil tilmelding",
"customizeSignupPages": "Tilpas sider",
"signupSettings": "Indstillinger",
"tasks": "Opgaver"
},
"common": {
"id": "ID",
"name": "Navn",
Expand Down
71 changes: 71 additions & 0 deletions frontend/public/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,77 @@
"danish": "Dansk",
"management": "Management"
},
"infosysNav": {
"overview": "Overview",
"participantSearch": "Participant search",
"gameMasters": "Game masters",
"createAndCheckIn": "Create and check in",
"checkIn": "Check-in registration",
"doubleBookings": "Double bookings",
"refunds": "Refunds",
"outstandingPayments": "Outstanding payments",
"missingIdPhotos": "Organizers missing ID photos",
"downloadIdPhotos": "Download ID photos",
"nameBadgeList": "Name badge list",
"registerPayments": "Record payments",
"allActivities": "All activities",
"graphicalOverview": "Graphical overview",
"importExportActivities": "Import/export activities",
"activitySignupStatistics": "Activity signup statistics",
"gameMasterBriefings": "Game master briefings",
"exportGameMasters": "Export game master list",
"runs": "Runs",
"createRun": "Create run",
"boardgameRuns": "Boardgame runs",
"roleplayingVoting": "Roleplaying voting",
"boardgameVoting": "Boardgame voting",
"downloadBallots": "Download ballots",
"rooms": "Rooms",
"allRooms": "All rooms",
"roomUsage": "Room usage",
"createRoom": "Create room",
"sleepingStatistics": "Sleeping statistics",
"wear": "Merchandise",
"wearOrderOverview": "Order overview",
"allWearOrders": "All orders",
"pendingWearOrders": "Pending pickups",
"wearTypes": "Merchandise types",
"createWearType": "Create merchandise type",
"editWearProperties": "Edit merchandise properties",
"uploadWearImage": "Upload merchandise image",
"wearPickup": "Merchandise pickup",
"food": "Food",
"foodTypes": "Food types",
"createFoodType": "Create food type",
"statistics": "Statistics",
"foodPickup": "Food pickup",
"foodExchange": "Food exchange",
"resetMealTimes": "Reset meal time allocations",
"economy": "Finances",
"budgetOverview": "Budget overview",
"accountingOverview": "Accounting overview",
"participantOverview": "Participant overview",
"onlinePayments": "Online payments",
"heroForce": "Hero Force",
"shiftOverview": "Shift overview",
"shiftCategories": "Shift categories",
"admission": "Admission",
"admissionTypes": "All admission types",
"createAdmissionType": "Create admission type",
"shop": "Shop",
"boardgames": "Boardgames",
"loans": "Loans",
"log": "Log",
"admin": "Admin",
"roles": "Roles",
"privileges": "Privileges",
"generateNameBadges": "Generate name badges",
"evaluationEmail": "Evaluation email",
"resetSignup": "Reset signup",
"customizeSignupPages": "Customize pages",
"signupSettings": "Settings",
"tasks": "Tasks"
},
"common": {
"id": "ID",
"name": "Name",
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/app/features/participants/participants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ describe('ParticipantsComponent (Infosys deltager/visalle and search_result)', (
expect(element.querySelector('tbody tr')?.textContent).toContain('Aarhus');
});

it('opens the search form from the navigation link', async () => {
const { harness, element, component } = await open('/participants?showSearch=true');
httpMock.expectOne('/api/participants/options').flush({ categories: [], organizerAreas: [] });
await answer(harness, search());

expect(element.querySelector('app-participant-search-form')).not.toBeNull();
component.toggleSearch();
await settle(harness);
expect(TestBed.inject(Router).url).toBe('/participants');
expect(element.querySelector('app-participant-search-form')).toBeNull();
});

it('filters the rows on the full name (fixed)', async () => {
const { harness, element } = await open('/participants?filter=anna%20hansen');
await answer(harness, search());
Expand Down
19 changes: 15 additions & 4 deletions frontend/src/app/features/participants/participants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class ParticipantsComponent {
public readonly sortKey = this.query.oneOf('sort', SORT_KEYS);
public readonly sortDirection = this.query.oneOf('dir', SORT_DIRECTIONS);
public readonly filter = this.query.text('filter');
private readonly showSearchParam = this.query.oneOf('showSearch', ['true']);

public readonly flash = inject(ParticipantFlashService).take();
public readonly pageSizes = PAGE_SIZES;
Expand All @@ -83,7 +84,7 @@ export class ParticipantsComponent {
public readonly pageSize = signal<number>(25);
public readonly page = signal(0);
public readonly showColumns = signal(false);
public readonly showSearch = signal(false);
public readonly showSearch = computed(() => this.showSearchParam() === 'true');
public readonly categories = signal<ParticipantCategory[]>([]);
public readonly organizerAreas = signal<OrganizerArea[]>([]);

Expand Down Expand Up @@ -150,6 +151,10 @@ export class ParticipantsComponent {
);

constructor() {
effect(() => {
if (this.showSearch()) untracked(() => this.loadSearchOptions());
});

toObservable(this.request)
.pipe(
switchMap(request => {
Expand Down Expand Up @@ -211,7 +216,10 @@ export class ParticipantsComponent {
}

public toggleSearch(): void {
this.showSearch.update(open => !open);
this.query.update({ showSearch: this.showSearch() ? null : 'true' });
}

private loadSearchOptions(): void {
if (this.categories().length > 0) return;
this.http.get<ParticipantOptions>('/api/participants/options').subscribe({
next: options => {
Expand All @@ -228,8 +236,11 @@ export class ParticipantsComponent {
const current = this.steps() ?? [];
const steps = step.combination === 'New' || current.length === 0 ? [step] : [...current, step];
const columns = [...new Set([...this.columns(), ...columnsUsedBy(step.criteria)])];
this.showSearch.set(false);
this.query.update({ search: serializeSearch(steps), columns: columns.length ? columns.join(',') : null });
this.query.update({
search: serializeSearch(steps),
columns: columns.length ? columns.join(',') : null,
showSearch: null,
});
}

public setFilter(filter: string): void {
Expand Down
167 changes: 167 additions & 0 deletions frontend/src/app/shared/components/toolbar/toolbar-navigation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
export interface NavigationLink {
label: string;
path?: string;
queryParams?: Record<string, string>;
privileges?: readonly string[];
adminOnly?: boolean;
}

export interface NavigationGroup {
label: string;
activePaths?: readonly string[];
links: readonly NavigationLink[];
}

type NavigationItem = (NavigationLink | NavigationGroup) & { icon: string };

const participantView = ['participant_view', 'participant_edit'] as const;
const participantEdit = ['participant_edit'] as const;
const activityView = ['activity_view', 'activity_edit'] as const;
const activityEdit = ['activity_edit'] as const;

export const toolbarNavigation: readonly NavigationItem[] = [
{
label: 'nav.participants',
icon: 'people',
activePaths: ['/participants', '/id-card-templates'],
links: [
{ label: 'infosysNav.overview', path: '/participants', privileges: participantView },
{ label: 'participants.allParticipants', path: '/participants', privileges: participantView },
{
label: 'infosysNav.participantSearch',
path: '/participants',
queryParams: { showSearch: 'true' },
privileges: participantView,
},
{ label: 'infosysNav.gameMasters' },
{ label: 'participants.createTitle', path: '/participants/new', privileges: participantEdit },
{ label: 'infosysNav.createAndCheckIn' },
{ label: 'infosysNav.checkIn' },
{ label: 'infosysNav.doubleBookings' },
{ label: 'infosysNav.refunds' },
{ label: 'infosysNav.outstandingPayments' },
{ label: 'idCardTemplates.title', path: '/id-card-templates', privileges: participantEdit },
{ label: 'infosysNav.missingIdPhotos' },
{ label: 'infosysNav.downloadIdPhotos' },
{ label: 'infosysNav.nameBadgeList' },
{ label: 'infosysNav.registerPayments' },
],
},
{
label: 'nav.activities',
icon: 'casino',
activePaths: ['/activities', '/runs', '/management/activity-settings'],
links: [
{ label: 'infosysNav.overview', path: '/activities', privileges: activityView },
{ label: 'infosysNav.allActivities', path: '/activities', privileges: activityView },
{ label: 'infosysNav.graphicalOverview' },
{ label: 'activities.create', path: '/activities/new', privileges: activityEdit },
{ label: 'infosysNav.importExportActivities' },
{ label: 'infosysNav.activitySignupStatistics' },
{ label: 'infosysNav.gameMasterBriefings' },
{ label: 'infosysNav.exportGameMasters' },
{ label: 'infosysNav.runs', path: '/runs', privileges: activityView },
{ label: 'runs.allRuns', path: '/runs', privileges: activityView },
{ label: 'infosysNav.createRun' },
{
label: 'infosysNav.boardgameRuns',
path: '/runs',
queryParams: { type: 'BoardGame' },
privileges: activityView,
},
{ label: 'infosysNav.roleplayingVoting' },
{ label: 'infosysNav.boardgameVoting' },
{ label: 'infosysNav.downloadBallots' },
{ label: 'activitySettings.title', path: '/management/activity-settings', privileges: activityEdit },
],
},
{
label: 'infosysNav.rooms',
icon: 'meeting_room',
activePaths: ['/resources/rooms'],
links: [
{ label: 'infosysNav.allRooms', path: '/resources/rooms' },
{ label: 'infosysNav.roomUsage' },
{ label: 'infosysNav.createRoom' },
{ label: 'infosysNav.sleepingStatistics' },
],
},
{
label: 'infosysNav.wear',
icon: 'checkroom',
activePaths: ['/resources/wear'],
links: [
{ label: 'infosysNav.overview', path: '/resources/wear' },
{ label: 'infosysNav.wearOrderOverview' },
{ label: 'infosysNav.allWearOrders' },
{ label: 'infosysNav.pendingWearOrders' },
{ label: 'infosysNav.wearTypes', path: '/resources/wear' },
{ label: 'infosysNav.createWearType' },
{ label: 'infosysNav.editWearProperties' },
{ label: 'infosysNav.uploadWearImage' },
{ label: 'infosysNav.wearPickup' },
],
},
{
label: 'infosysNav.food',
icon: 'restaurant',
activePaths: ['/resources/food'],
links: [
{ label: 'infosysNav.overview', path: '/resources/food' },
{ label: 'infosysNav.foodTypes', path: '/resources/food' },
{ label: 'infosysNav.createFoodType' },
{ label: 'infosysNav.statistics' },
{ label: 'infosysNav.foodPickup' },
{ label: 'infosysNav.foodExchange' },
{ label: 'infosysNav.resetMealTimes' },
],
},
{
label: 'infosysNav.economy',
icon: 'payments',
links: [
{ label: 'infosysNav.budgetOverview' },
{ label: 'infosysNav.accountingOverview' },
{ label: 'infosysNav.participantOverview' },
{ label: 'infosysNav.onlinePayments' },
],
},
{
label: 'infosysNav.heroForce',
icon: 'calendar_today',
activePaths: ['/hero-force'],
links: [{ label: 'infosysNav.shiftOverview', path: '/hero-force' }, { label: 'infosysNav.shiftCategories' }],
},
{
label: 'infosysNav.admission',
icon: 'confirmation_number',
links: [
{ label: 'infosysNav.admissionTypes' },
{ label: 'infosysNav.createAdmissionType' },
{ label: 'infosysNav.statistics' },
],
},
{ label: 'infosysNav.shop', icon: 'shopping_cart', path: '/shop' },
{ label: 'infosysNav.boardgames', icon: 'sports_esports', path: '/boardgames' },
{ label: 'infosysNav.loans', icon: 'assignment_return' },
{ label: 'infosysNav.log', icon: 'receipt_long' },
{
label: 'infosysNav.admin',
icon: 'manage_accounts',
activePaths: ['/user-management'],
links: [
{ label: 'nav.users', path: '/user-management/users', adminOnly: true },
{ label: 'infosysNav.roles', path: '/user-management/roles', adminOnly: true },
{ label: 'infosysNav.privileges', path: '/user-management/roles', adminOnly: true },
{ label: 'infosysNav.generateNameBadges' },
{ label: 'infosysNav.evaluationEmail' },
{ label: 'infosysNav.resetSignup' },
],
},
{
label: 'nav.signup',
icon: 'how_to_reg',
links: [{ label: 'infosysNav.customizeSignupPages' }, { label: 'infosysNav.signupSettings' }],
},
{ label: 'infosysNav.tasks', icon: 'assignment', path: '/communications' },
];
Loading