Skip to content

Commit

Permalink
feat: add no result for selected filters label
Browse files Browse the repository at this point in the history
  • Loading branch information
ilirbeqirii committed May 11, 2024
1 parent b8b4da0 commit 6b96fba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
11 changes: 9 additions & 2 deletions angular-hub/src/app/pages/communities/index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export const routeMeta: RouteMeta = {
[style]="{ width: '230px' }"
[showClear]="true"
placeholder="Select a country"
[ngModel]="selectedCountry()"
(ngModelChange)="selectedCountry.set($event)"
[(ngModel)]="selectedCountry"
/>
</form>
Expand All @@ -50,6 +49,14 @@ export const routeMeta: RouteMeta = {
<li>
<app-community-card [community]="community"></app-community-card>
</li>
} @empty {
<p class="col-span-2">
No event matching the filter
@if (selectedCountry()) {
{{ selectedCountry() }}
}
</p>
}
</ul>
`,
Expand Down
22 changes: 16 additions & 6 deletions angular-hub/src/app/pages/index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { DropdownModule } from 'primeng/dropdown';
import { InputSwitchModule } from 'primeng/inputswitch';
import { Title } from '@angular/platform-browser';
import { JsonLdService } from '../services/json-ld.service';
import { DatePipe } from '@angular/common';

export const routeMeta: RouteMeta = {
meta: [
Expand Down Expand Up @@ -42,8 +43,7 @@ export const routeMeta: RouteMeta = {
ariaLabel="Select a date"
name="date"
[style]="{ width: '230px' }"
[ngModel]="date()"
(ngModelChange)="date.set($event)"
[(ngModel)]="date"
placeholder="Select a date"
[showClear]="true"
/>
Expand All @@ -53,17 +53,15 @@ export const routeMeta: RouteMeta = {
[style]="{ width: '230px' }"
[options]="languages()"
[showClear]="true"
[ngModel]="selectedLanguage()"
(ngModelChange)="selectedLanguage.set($event)"
[(ngModel)]="selectedLanguage"
placeholder="Select a language"
/>
<div class="flex items-center gap-2">
<p-inputSwitch
ariaLabel="Display remote events only"
id="remote"
name="remote"
[ngModel]="isRemote()"
(ngModelChange)="isRemote.set($event)"
[(ngModel)]="isRemote"
/>
<label class="mb-2" for="remote">remote only</label>
</div>
Expand All @@ -76,6 +74,17 @@ export const routeMeta: RouteMeta = {
<li>
<app-event-card [event]="event"></app-event-card>
</li>
} @empty {
<p class="col-span-2">
No event matching the filter
@if (date()) {
{{ date() | date: 'MM/DD/YYYY' }}
}
@if (selectedLanguage()) {
{{ selectedLanguage() }}
}
</p>
}
</ul>
`,
Expand All @@ -97,6 +106,7 @@ export const routeMeta: RouteMeta = {
RouterLinkActive,
DropdownModule,
InputSwitchModule,
DatePipe,
],
})
export default class EventsComponent {
Expand Down

0 comments on commit 6b96fba

Please sign in to comment.