Skip to content

Commit 7d3d080

Browse files
authored
refactor(meetings): simplify header and fix past meeting access checks (#162)
LFXV2-763 - Simplified header component by removing search, persona selector, and user profile display - Added header component to meeting join page for consistent navigation - Added type safety to getMeetings() method with 'meeting' | 'past_meeting' union type - Fixed access check service to properly handle past meeting resource type - Added 'past_meeting' to AccessCheckResourceType in shared interfaces Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com>
1 parent 928ab37 commit 7d3d080

File tree

5 files changed

+12
-81
lines changed

5 files changed

+12
-81
lines changed

apps/lfx-one/src/app/modules/meetings/meeting-join/meeting-join.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!-- Copyright The Linux Foundation and each contributor to LFX. -->
22
<!-- SPDX-License-Identifier: MIT -->
3+
<lfx-header></lfx-header>
34

45
@if (meeting()) {
56
<div class="bg-gray-50 min-h-screen">

apps/lfx-one/src/app/modules/meetings/meeting-join/meeting-join.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Component, computed, inject, signal, Signal, WritableSignal } from '@an
88
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
99
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
1010
import { ActivatedRoute, Router } from '@angular/router';
11+
import { HeaderComponent } from '@app/shared/components/header/header.component';
1112
import { LinkifyPipe } from '@app/shared/pipes/linkify.pipe';
1213
import { RecurrenceSummaryPipe } from '@app/shared/pipes/recurrence-summary.pipe';
1314
import { ButtonComponent } from '@components/button/button.component';
@@ -48,6 +49,7 @@ import { catchError, combineLatest, debounceTime, filter, map, Observable, of, s
4849
LinkifyPipe,
4950
FileTypeIconPipe,
5051
ExpandableTextComponent,
52+
HeaderComponent,
5153
],
5254
providers: [],
5355
templateUrl: './meeting-join.component.html',

apps/lfx-one/src/app/shared/components/header/header.component.html

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- SPDX-License-Identifier: MIT -->
33

44
<div class="sticky top-0 z-50 bg-white border-b border-gray-100">
5-
<div class="mx-auto">
5+
<div class="mx-auto max-w-6xl">
66
<lfx-menubar styleClass="border-none">
77
<ng-template #start>
88
<div class="flex items-center lg:gap-32">
@@ -19,31 +19,11 @@
1919
<button type="button" class="flex items-center space-x-2 hover:opacity-80 transition-opacity p-2" routerLink="/" aria-label="Go to home page">
2020
<img src="/images/lfx-one-logo.svg" alt="LFX Logo" class="w-auto h-5" />
2121
</button>
22-
23-
@if (userService.authenticated()) {
24-
<div class="items-center gap-3 hidden lg:flex">
25-
<lfx-avatar
26-
[label]="initials()"
27-
[size]="'large'"
28-
[shape]="'circle'"
29-
styleClass="bg-blue-50 border border-gray-200"
30-
[ariaLabel]="fullName() + ' avatar'">
31-
</lfx-avatar>
32-
33-
<div class="flex flex-col gap-1">
34-
<span class="text-sm font-semibold">{{ userProfile()?.user?.first_name }} {{ userProfile()?.user?.last_name }}</span>
35-
<span class="text-xs text-gray-500"
36-
>{{ userProfile()?.profile?.job_title }} at <span class="text-primary">{{ userProfile()?.profile?.organization }}</span></span
37-
>
38-
</div>
39-
</div>
40-
}
4122
</div>
4223
</ng-template>
4324

4425
<ng-template #end>
4526
<div class="flex items-center gap-4">
46-
<lfx-persona-selector></lfx-persona-selector>
4727
<div class="flex items-center gap-6">
4828
<!-- Mobile Search Toggle -->
4929
<button
@@ -58,24 +38,6 @@
5838
<!-- Search Input -->
5939
<div>
6040
<div class="relative flex items-center gap-4">
61-
<div class="items-center gap-2 hidden md:flex">
62-
<lfx-autocomplete
63-
[form]="searchForm"
64-
control="search"
65-
[suggestions]="suggestions()"
66-
optionLabel="name"
67-
placeholder="Search projects..."
68-
styleClass="w-80"
69-
inputStyleClass="pl-10 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-full focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 focus:bg-white text-sm placeholder-gray-400 transition-all w-full"
70-
panelStyleClass="mt-2 max-w-[280px]"
71-
dataTestId="header-search-autocomplete"
72-
(completeMethod)="onSearchComplete($event)"
73-
(onSelect)="onProjectSelect($event)"
74-
(onClear)="onSearchClear()"
75-
[autoHighlight]="true">
76-
</lfx-autocomplete>
77-
<i class="fa-light fa-magnifying-glass absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></i>
78-
</div>
7941
@if (userService.authenticated()) {
8042
<div class="flex items-center gap-4">
8143
<lfx-avatar
@@ -97,43 +59,4 @@
9759
</ng-template>
9860
</lfx-menubar>
9961
</div>
100-
101-
<!-- Mobile Search Drawer -->
102-
@if (showMobileSearch()) {
103-
<div class="md:hidden fixed inset-0 z-50 bg-black bg-opacity-50" data-testid="mobile-search-overlay" (click)="closeMobileSearch()">
104-
<div class="absolute top-0 left-0 right-0 bg-white shadow-lg" (click)="$event.stopPropagation()">
105-
<div class="container mx-auto p-4">
106-
<div class="flex items-center gap-4">
107-
<button
108-
type="button"
109-
class="hover:opacity-80 transition-opacity p-2"
110-
(click)="closeMobileSearch()"
111-
aria-label="Close search"
112-
data-testid="mobile-search-close">
113-
<i class="fa-light fa-times text-gray-600"></i>
114-
</button>
115-
<div class="flex-1 relative">
116-
<lfx-autocomplete
117-
#mobileSearchInput
118-
[form]="searchForm"
119-
control="search"
120-
[suggestions]="suggestions()"
121-
optionLabel="name"
122-
placeholder="Search projects..."
123-
styleClass="w-full"
124-
inputStyleClass="pl-10 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-full focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 focus:bg-white text-sm placeholder-gray-400 transition-all w-full"
125-
panelStyleClass="mt-2"
126-
dataTestId="mobile-search-autocomplete"
127-
(completeMethod)="onSearchComplete($event)"
128-
(onSelect)="onProjectSelect($event)"
129-
(onClear)="onSearchClear()"
130-
[autoHighlight]="true">
131-
</lfx-autocomplete>
132-
<i class="fa-light fa-magnifying-glass absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></i>
133-
</div>
134-
</div>
135-
</div>
136-
</div>
137-
</div>
138-
}
13962
</div>

apps/lfx-one/src/server/services/meeting.service.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ export class MeetingService {
5151
/**
5252
* Fetches all meetings based on query parameters
5353
*/
54-
public async getMeetings(req: Request, query: Record<string, any> = {}, meetingType: string = 'meeting', access: boolean = true): Promise<Meeting[]> {
54+
public async getMeetings(
55+
req: Request,
56+
query: Record<string, any> = {},
57+
meetingType: 'meeting' | 'past_meeting' = 'meeting',
58+
access: boolean = true
59+
): Promise<Meeting[]> {
5560
const params = {
5661
...query,
5762
type: meetingType,
@@ -71,7 +76,7 @@ export class MeetingService {
7176

7277
if (access) {
7378
// Add writer access field to all meetings
74-
return await this.accessCheckService.addAccessToResources(req, meetings, 'meeting', 'organizer');
79+
return await this.accessCheckService.addAccessToResources(req, meetings, meetingType, 'organizer');
7580
}
7681

7782
return meetings;

packages/shared/src/interfaces/access-check.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ export interface AccessCheckApiResponse {
3232
/**
3333
* Resource types
3434
*/
35-
export type AccessCheckResourceType = 'project' | 'meeting' | 'committee';
35+
export type AccessCheckResourceType = 'project' | 'meeting' | 'committee' | 'past_meeting';
3636
export type AccessCheckAccessType = 'writer' | 'viewer' | 'organizer';

0 commit comments

Comments
 (0)