-
Notifications
You must be signed in to change notification settings - Fork 0
feat(events): add visa letter and travel fund application dialogs #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
emlimlf
wants to merge
15
commits into
main
Choose a base branch
from
feat/visa-tf-request-ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9afac54
feat: partial work on visa request view
emlimlf 5ce8e26
feat: added endpoint and ui for visa and travel fund requests list
emlimlf b9bb9da
chore: partial work on the travel funding application dialog
emlimlf c361957
chore: added all the steps ui for the travel fund application
emlimlf d530927
feat: added stub travel fund application submission endpoint
emlimlf 0fc4478
feat: added the ui for the visa request application dialog
emlimlf 3d5913f
feat: added stub endpoint for submitting visa request application
emlimlf cad8c69
Merge branch 'main' into feat/visa-tf-request-ui
emlimlf a3d62c3
fix(review): address PR #415 review feedback
emlimlf 5d5c6a9
fix: address pr issue
emlimlf e032655
Merge branch 'main' into feat/visa-tf-request-ui
emlimlf 7df661f
chore: remove the me prefix on the events routes
emlimlf ee67e08
fix: coderabbit comments
emlimlf be6758a
Merge branch 'main' into feat/visa-tf-request-ui
emlimlf e29db49
fix: error caused by incorrect merge
emlimlf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 155 additions & 0 deletions
155
.../modules/events/my-events-dashboard/components/about-me-form/about-me-form.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| <!-- Copyright The Linux Foundation and each contributor to LFX. --> | ||
| <!-- SPDX-License-Identifier: MIT --> | ||
|
|
||
| <form [formGroup]="form" class="flex flex-col gap-4" data-testid="about-me-form"> | ||
| <!-- Row 1: First Name | Last Name --> | ||
| <div class="grid grid-cols-2 gap-4"> | ||
| <div class="flex flex-col gap-1"> | ||
| <label for="about-me-first-name" class="text-sm font-medium text-gray-700"> First Name <span class="text-red-500">*</span> </label> | ||
| <lfx-input-text | ||
| [form]="form" | ||
| control="firstName" | ||
| id="about-me-first-name" | ||
| size="small" | ||
| placeholder="Jane" | ||
| styleClass="w-full" | ||
| dataTest="about-me-first-name" /> | ||
| </div> | ||
| <div class="flex flex-col gap-1"> | ||
| <label for="about-me-last-name" class="text-sm font-medium text-gray-700"> Last Name <span class="text-red-500">*</span> </label> | ||
| <lfx-input-text | ||
| [form]="form" | ||
| control="lastName" | ||
| id="about-me-last-name" | ||
| size="small" | ||
| placeholder="Smith" | ||
| styleClass="w-full" | ||
| dataTest="about-me-last-name" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Row 2: Email | Citizenship Country --> | ||
| <div class="grid grid-cols-2 gap-4"> | ||
| <div class="flex flex-col gap-1"> | ||
| <label for="about-me-email" class="text-sm font-medium text-gray-700">Email</label> | ||
| <lfx-input-text [form]="form" control="email" id="about-me-email" type="email" size="small" styleClass="w-full" dataTest="about-me-email" /> | ||
| </div> | ||
| <div class="flex flex-col gap-1"> | ||
| <label for="about-me-citizenship-country" class="text-sm font-medium text-gray-700"> | ||
| What country are you a citizen of? <span class="text-red-500">*</span> | ||
| </label> | ||
| <lfx-select | ||
| [form]="form" | ||
| control="citizenshipCountry" | ||
| [options]="countryOptions" | ||
| placeholder="Select country" | ||
| [filter]="true" | ||
| styleClass="w-full" | ||
| dataTest="about-me-citizenship-country" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Row 3: Profile Link | Company --> | ||
| <div class="grid grid-cols-2 gap-4"> | ||
| <div class="flex flex-col gap-1"> | ||
| <label for="about-me-profile-link" class="text-sm font-medium text-gray-700"> | ||
| Link to your LinkedIn, personal website or GitHub page <span class="text-red-500">*</span> | ||
| </label> | ||
| <lfx-input-text | ||
| [form]="form" | ||
| control="profileLink" | ||
| id="about-me-profile-link" | ||
| size="small" | ||
| placeholder="https://" | ||
| styleClass="w-full" | ||
| dataTest="about-me-profile-link" /> | ||
| </div> | ||
| <div class="flex flex-col gap-1"> | ||
| <label for="about-me-company" class="text-sm font-medium text-gray-700"> Company <span class="text-red-500">*</span> </label> | ||
| <lfx-input-text | ||
| [form]="form" | ||
| control="company" | ||
| placeholder="Company Name" | ||
| id="about-me-company" | ||
| size="small" | ||
| styleClass="w-full" | ||
| dataTest="about-me-company" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Row 4: Can Receive Funds | Travel From Country --> | ||
| <div class="grid grid-cols-2 gap-4"> | ||
| <div class="flex flex-col gap-1"> | ||
| <label class="text-sm font-medium text-gray-700"> Can you receive funds from your organization? <span class="text-red-500">*</span> </label> | ||
| <lfx-select | ||
| [form]="form" | ||
| control="canReceiveFunds" | ||
| [options]="yesNoOptions" | ||
| placeholder="- Select -" | ||
| styleClass="w-full" | ||
| dataTest="about-me-can-receive-funds" /> | ||
| </div> | ||
| <div class="flex flex-col gap-1"> | ||
| <label class="text-sm font-medium text-gray-700"> What country would you be travelling from? <span class="text-red-500">*</span> </label> | ||
| <lfx-select | ||
| [form]="form" | ||
| control="travelFromCountry" | ||
| [options]="countryOptions" | ||
| placeholder="Select country" | ||
| [filter]="true" | ||
| styleClass="w-full" | ||
| dataTest="about-me-travel-from-country" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Row 5: Open Source Involvement (full width) --> | ||
| <div class="flex flex-col gap-1"> | ||
| <label class="text-sm font-medium text-gray-700"> | ||
| Briefly describe your involvement in open source communities and why you'd like to attend | ||
| <span class="text-red-500">*</span> | ||
| </label> | ||
| <lfx-textarea | ||
| [form]="form" | ||
| control="openSourceInvolvement" | ||
| [rows]="4" | ||
| placeholder="Tell us about your contributions and motivation..." | ||
| styleClass="w-full" | ||
| dataTest="about-me-open-source-involvement" /> | ||
| </div> | ||
|
|
||
| <!-- Row 6: Underrepresented Groups --> | ||
| <div class="flex flex-col gap-2" data-testid="about-me-underrepresented-groups"> | ||
| <label class="text-sm font-medium text-gray-700"> Do you belong to an underrepresented and/or marginalized group? Check all that apply: </label> | ||
| <div class="flex flex-wrap items-center gap-x-6 gap-y-2"> | ||
| <lfx-checkbox [form]="form" control="isLgbtqia" label="LGBTQIA+" /> | ||
| <lfx-checkbox [form]="form" control="isWoman" label="Woman" /> | ||
| <lfx-checkbox [form]="form" control="isPersonWithDisability" label="Person with Disability" /> | ||
| <lfx-checkbox [form]="form" control="isDiversityOther" label="Other" /> | ||
| <lfx-checkbox [form]="form" control="preferNotToAnswer" label="Prefer not to answer" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Row 7: Attending for Company | Willing to Blog --> | ||
| <div class="grid grid-cols-2 gap-4"> | ||
| <div class="flex flex-col gap-1"> | ||
| <label class="text-sm font-medium text-gray-700"> Are you attending on behalf of a company? <span class="text-red-500">*</span> </label> | ||
| <lfx-select | ||
| [form]="form" | ||
| control="attendingForCompany" | ||
| [options]="yesNoOptions" | ||
| placeholder="- Select -" | ||
| styleClass="w-full" | ||
| dataTest="about-me-attending-for-company" /> | ||
| </div> | ||
| <div class="flex flex-col gap-1"> | ||
| <label class="text-sm font-medium text-gray-700"> Are you willing to write a blog about the event? <span class="text-red-500">*</span> </label> | ||
| <lfx-select | ||
| [form]="form" | ||
| control="willingToBlog" | ||
| [options]="yesNoOptions" | ||
| placeholder="- Select -" | ||
| styleClass="w-full" | ||
| dataTest="about-me-willing-to-blog" /> | ||
| </div> | ||
| </div> | ||
| </form> | ||
2 changes: 2 additions & 0 deletions
2
.../modules/events/my-events-dashboard/components/about-me-form/about-me-form.component.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| // Copyright The Linux Foundation and each contributor to LFX. | ||
| // SPDX-License-Identifier: MIT |
98 changes: 98 additions & 0 deletions
98
...pp/modules/events/my-events-dashboard/components/about-me-form/about-me-form.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| // Copyright The Linux Foundation and each contributor to LFX. | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| import { ChangeDetectionStrategy, Component, inject, output } from '@angular/core'; | ||
| import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; | ||
| import { NonNullableFormBuilder, ReactiveFormsModule, Validators } from '@angular/forms'; | ||
| import { UserService } from '@app/shared/services/user.service'; | ||
| import { CheckboxComponent } from '@components/checkbox/checkbox.component'; | ||
| import { InputTextComponent } from '@components/input-text/input-text.component'; | ||
| import { SelectComponent } from '@components/select/select.component'; | ||
| import { TextareaComponent } from '@components/textarea/textarea.component'; | ||
| import { COUNTRIES } from '@lfx-one/shared/constants'; | ||
| import { TravelFundAboutMe } from '@lfx-one/shared/interfaces'; | ||
|
|
||
| const YES_NO_OPTIONS = [ | ||
| { label: 'Yes', value: 'yes' }, | ||
| { label: 'No', value: 'no' }, | ||
| ]; | ||
|
|
||
| @Component({ | ||
| selector: 'lfx-about-me-form', | ||
| imports: [ReactiveFormsModule, InputTextComponent, SelectComponent, TextareaComponent, CheckboxComponent], | ||
| templateUrl: './about-me-form.component.html', | ||
| styleUrl: './about-me-form.component.scss', | ||
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| }) | ||
| export class AboutMeFormComponent { | ||
| private readonly userService = inject(UserService); | ||
| private readonly fb = inject(NonNullableFormBuilder); | ||
|
|
||
| public readonly formValidityChange = output<boolean>(); | ||
| public readonly formChange = output<TravelFundAboutMe>(); | ||
|
|
||
| public readonly form = this.fb.group({ | ||
| firstName: ['', Validators.required], | ||
| lastName: ['', Validators.required], | ||
| email: [''], | ||
| citizenshipCountry: ['', Validators.required], | ||
| profileLink: ['', Validators.required], | ||
| company: ['', Validators.required], | ||
| canReceiveFunds: ['', Validators.required], | ||
| travelFromCountry: ['', Validators.required], | ||
| openSourceInvolvement: ['', Validators.required], | ||
| isLgbtqia: [false], | ||
| isWoman: [false], | ||
| isPersonWithDisability: [false], | ||
| isDiversityOther: [false], | ||
| preferNotToAnswer: [false], | ||
| attendingForCompany: ['', Validators.required], | ||
| willingToBlog: ['', Validators.required], | ||
| }); | ||
|
|
||
| public readonly countryOptions = [...COUNTRIES]; | ||
| public readonly yesNoOptions = YES_NO_OPTIONS; | ||
|
|
||
| public constructor() { | ||
| this.form.get('email')?.disable(); | ||
|
|
||
| const user = this.userService.user(); | ||
| if (user) { | ||
| this.form.patchValue({ | ||
| firstName: user.given_name ?? '', | ||
| lastName: user.family_name ?? '', | ||
| email: user.email ?? '', | ||
| }); | ||
| } | ||
|
|
||
| this.form.statusChanges.pipe(takeUntilDestroyed()).subscribe(() => { | ||
| this.formValidityChange.emit(this.form.valid); | ||
| }); | ||
|
|
||
| this.form.valueChanges.pipe(takeUntilDestroyed()).subscribe(() => { | ||
| this.formChange.emit(this.buildFormValue()); | ||
| }); | ||
| } | ||
emlimlf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| private buildFormValue(): TravelFundAboutMe { | ||
| const raw = this.form.getRawValue(); | ||
| return { | ||
| firstName: raw.firstName, | ||
| lastName: raw.lastName, | ||
| email: raw.email, | ||
| citizenshipCountry: raw.citizenshipCountry, | ||
| profileLink: raw.profileLink, | ||
| company: raw.company, | ||
| canReceiveFunds: raw.canReceiveFunds, | ||
| travelFromCountry: raw.travelFromCountry, | ||
| openSourceInvolvement: raw.openSourceInvolvement, | ||
| isLgbtqia: raw.isLgbtqia, | ||
| isWoman: raw.isWoman, | ||
| isPersonWithDisability: raw.isPersonWithDisability, | ||
| isDiversityOther: raw.isDiversityOther, | ||
| preferNotToAnswer: raw.preferNotToAnswer, | ||
| attendingForCompany: raw.attendingForCompany, | ||
| willingToBlog: raw.willingToBlog, | ||
| }; | ||
| } | ||
| } | ||
92 changes: 92 additions & 0 deletions
92
...ules/events/my-events-dashboard/components/event-selection/event-selection.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <!-- Copyright The Linux Foundation and each contributor to LFX. --> | ||
| <!-- SPDX-License-Identifier: MIT --> | ||
|
|
||
| <div class="flex flex-col gap-4" data-testid="event-selection"> | ||
| <!-- Filters --> | ||
| <div class="flex items-center gap-3" data-testid="event-selection-filters"> | ||
| <!-- Search --> | ||
| <p-iconfield class="flex-1"> | ||
| <p-inputicon styleClass="fa-light fa-magnifying-glass text-gray-400" /> | ||
| <input | ||
| pInputText | ||
| type="text" | ||
| class="w-full text-sm" | ||
| placeholder="Filter by Name" | ||
| [value]="searchQuery()" | ||
| (input)="searchQuery.set($any($event.target).value)" | ||
emlimlf marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| data-testid="event-selection-search" /> | ||
| </p-iconfield> | ||
|
|
||
| <!-- Time filter --> | ||
| <lfx-select [form]="filtersForm" control="timeFilter" [options]="timeFilterOptions" data-testid="event-selection-time-filter" /> | ||
|
|
||
| <!-- Location filter --> | ||
| <lfx-select [form]="filtersForm" control="locationFilter" [options]="availableLocations()" data-testid="event-selection-location-filter" /> | ||
| </div> | ||
|
|
||
| <!-- Events grid --> | ||
| <div class="events-scroll-area overflow-y-auto" data-testid="event-selection-grid"> | ||
| @if (loading()) { | ||
| <div class="flex items-center justify-center py-16"> | ||
| <i class="fa-light fa-spinner-third fa-spin text-2xl text-gray-400"></i> | ||
| </div> | ||
| } @else if (allEvents().length === 0) { | ||
| <div class="flex flex-col items-center justify-center gap-2 py-16 text-center"> | ||
| <i class="fa-light fa-calendar-xmark text-3xl text-gray-300"></i> | ||
| <p class="text-sm text-gray-500">No registered events found</p> | ||
| <p class="text-xs text-gray-400">Register for an event to apply for a visa letter</p> | ||
emlimlf marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </div> | ||
| } @else { | ||
| <div class="grid grid-cols-3 gap-3"> | ||
| @for (event of allEvents(); track event.id) { | ||
| <div | ||
| class="event-card registered flex flex-col gap-2 rounded-lg border border-gray-200 p-3 transition-colors" | ||
| [class.selected]="selectedEvent()?.id === event.id" | ||
| (click)="onSelectEvent(event)" | ||
| [attr.data-testid]="'event-selection-card-' + event.id"> | ||
| <!-- Event name --> | ||
| <p class="text-sm font-semibold leading-snug text-gray-900" [attr.data-testid]="'event-selection-name-' + event.id"> | ||
| {{ event.name }} | ||
| </p> | ||
| <!-- Date --> | ||
| <div class="flex items-center gap-1.5 text-xs text-gray-500" [attr.data-testid]="'event-selection-date-' + event.id"> | ||
| <i class="fa-light fa-calendar-days shrink-0"></i> | ||
| <span>{{ event.date }}</span> | ||
| </div> | ||
| <!-- Location --> | ||
| <div class="flex items-center gap-1.5 text-xs text-gray-500" [attr.data-testid]="'event-selection-location-' + event.id"> | ||
| <i class="fa-light fa-location-dot shrink-0"></i> | ||
| <span>{{ event.location }}</span> | ||
| </div> | ||
| <!-- Button: Selected | Select --> | ||
| @if (selectedEvent()?.id === event.id) { | ||
| <lfx-button label="Selected" severity="primary" size="small" [fluid]="true" [attr.data-testid]="'event-selection-selected-' + event.id" /> | ||
| } @else { | ||
| <lfx-button | ||
| label="Select" | ||
| [text]="true" | ||
| size="small" | ||
| [fluid]="true" | ||
| (onClick)="onSelectEvent(event); $event.stopPropagation()" | ||
| [attr.data-testid]="'event-selection-select-' + event.id" /> | ||
| } | ||
| </div> | ||
| } | ||
| </div> | ||
|
|
||
| <!-- Load more --> | ||
| @if (hasMore()) { | ||
| <div class="flex justify-center pt-4" data-testid="event-selection-load-more"> | ||
| <lfx-button | ||
| label="Load More" | ||
| severity="secondary" | ||
| [outlined]="true" | ||
| size="small" | ||
| [loading]="loadingMore()" | ||
| [disabled]="loadingMore()" | ||
| (onClick)="onLoadMore()" /> | ||
| </div> | ||
| } | ||
| } | ||
| </div> | ||
| </div> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.