Skip to content

Commit 7d3bfde

Browse files
authored
fix(ui): early join time parse int value (#88)
* fix(ui): early join time parse int value Signed-off-by: Asitha de Silva <asithade@gmail.com> * fix(ui): parseInt radix and fallback logic Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat(ui): add copy meeting url to clipboard Signed-off-by: Asitha de Silva <asithade@gmail.com> --------- Signed-off-by: Asitha de Silva <asithade@gmail.com>
1 parent 3f789eb commit 7d3bfde

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

apps/lfx-one/src/app/modules/project/meetings/components/meeting-card/meeting-card.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
size="small"
4646
severity="secondary"
4747
data-testid="copy-meeting-button"
48+
(click)="copyMeetingLink()"
4849
pTooltip="Copy Meeting"></lfx-button>
4950
@if (meeting().visibility === 'public') {
5051
<lfx-button

apps/lfx-one/src/app/modules/project/meetings/components/meeting-card/meeting-card.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4+
import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard';
45
import { CommonModule } from '@angular/common';
56
import { Component, computed, effect, inject, Injector, input, OnInit, output, runInInjectionContext, signal, Signal, WritableSignal } from '@angular/core';
67
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
@@ -13,6 +14,7 @@ import { AvatarComponent } from '@components/avatar/avatar.component';
1314
import { ButtonComponent } from '@components/button/button.component';
1415
import { ExpandableTextComponent } from '@components/expandable-text/expandable-text.component';
1516
import { MenuComponent } from '@components/menu/menu.component';
17+
import { environment } from '@environments/environment';
1618
import { extractUrlsWithDomains, Meeting, MeetingAttachment, MeetingOccurrence, MeetingRegistrant } from '@lfx-one/shared';
1719
import { MeetingTimePipe } from '@pipes/meeting-time.pipe';
1820
import { MeetingService } from '@services/meeting.service';
@@ -46,6 +48,7 @@ import { RegistrantModalComponent } from '../registrant-modal/registrant-modal.c
4648
LinkifyPipe,
4749
FileTypeIconPipe,
4850
FileSizePipe,
51+
ClipboardModule,
4952
],
5053
providers: [ConfirmationService],
5154
templateUrl: './meeting-card.component.html',
@@ -56,6 +59,7 @@ export class MeetingCardComponent implements OnInit {
5659
private readonly dialogService = inject(DialogService);
5760
private readonly messageService = inject(MessageService);
5861
private readonly injector = inject(Injector);
62+
private readonly clipboard = inject(Clipboard);
5963

6064
public readonly meetingInput = input.required<Meeting>();
6165
public readonly occurrenceInput = input<MeetingOccurrence | null>(null);
@@ -197,6 +201,17 @@ export class MeetingCardComponent implements OnInit {
197201
}
198202
});
199203
}
204+
205+
public copyMeetingLink(): void {
206+
const meetingLink = environment.urls.home + '/meetings/' + this.meeting().uid;
207+
this.clipboard.copy(meetingLink);
208+
this.messageService.add({
209+
severity: 'success',
210+
summary: 'Meeting Link Copied',
211+
detail: 'The meeting link has been copied to your clipboard',
212+
});
213+
}
214+
200215
private initMeetingRegistrantCount(): Signal<number> {
201216
return computed(
202217
() => (this.meeting()?.individual_registrants_count || 0) + (this.meeting()?.committee_members_count || 0) + (this.additionalRegistrantsCount() || 0)

apps/lfx-one/src/app/modules/project/meetings/components/meeting-manage/meeting-manage.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ export class MeetingManageComponent {
316316
duration: duration,
317317
timezone: formValue.timezone,
318318
meeting_type: formValue.meeting_type || DEFAULT_MEETING_TYPE,
319-
early_join_time_minutes: formValue.early_join_time_minutes || DEFAULT_EARLY_JOIN_TIME,
319+
early_join_time_minutes: (() => {
320+
const parsed = parseInt(formValue.early_join_time_minutes, 10);
321+
return isNaN(parsed) ? DEFAULT_EARLY_JOIN_TIME : parsed;
322+
})(),
320323
visibility: formValue.visibility || MeetingVisibility.PRIVATE,
321324
restricted: formValue.restricted || false,
322325
recording_enabled: formValue.recording_enabled || false,

0 commit comments

Comments
 (0)