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
8 changes: 4 additions & 4 deletions src/app/features/project/addons/addons.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<div class="col-12 md:col-6 lg:col-9">
<osf-search-input
class="w-full"
[searchValue]="searchValue()"
(searchValueChange)="searchValue.set($event || '')"
[control]="searchValue"
(triggerSearch)="searchValue.setValue($event)"
[placeholder]="'settings.addons.filters.search' | translate"
/>
</div>
Expand All @@ -62,8 +62,8 @@
<p-tabpanel [value]="AddonTabValue.CONNECTED_ADDONS" class="flex flex-column gap-5">
<osf-search-input
class="flex-1"
[searchValue]="searchValue()"
(searchValueChange)="searchValue.set($event || '')"
[control]="searchValue"
(triggerSearch)="searchValue.setValue($event)"
[placeholder]="'settings.addons.filters.search' | translate"
/>

Expand Down
9 changes: 5 additions & 4 deletions src/app/features/project/addons/addons.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Tab, TabList, TabPanel, TabPanels, Tabs } from 'primeng/tabs';

import { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';

import { UserSelectors } from '@core/store/user';
import {
Expand Down Expand Up @@ -38,6 +38,7 @@ import { ADDON_CATEGORY_OPTIONS, ADDON_TAB_OPTIONS, AddonCategoryValue, AddonTab
Tabs,
TranslatePipe,
FormsModule,
ReactiveFormsModule,
],
templateUrl: './addons.component.html',
styleUrl: './addons.component.scss',
Expand All @@ -48,7 +49,7 @@ export class AddonsComponent {
#store = inject(Store);
protected readonly defaultTabValue = AddonTabValue.ALL_ADDONS;
protected readonly isMobile = toSignal(inject(IS_XSMALL));
protected readonly searchValue = signal('');
protected readonly searchValue = new FormControl('');
protected readonly selectedCategory = signal<string>(AddonCategoryValue.EXTERNAL_STORAGE_SERVICES);
protected readonly selectedTab = signal<number>(this.defaultTabValue);
protected readonly currentUser = select(UserSelectors.getCurrentUser);
Expand All @@ -60,7 +61,7 @@ export class AddonsComponent {
protected readonly allAuthorizedAddons = computed(() => {
const authorizedAddons = [...this.authorizedStorageAddons(), ...this.authorizedCitationAddons()];

const searchValue = this.searchValue().toLowerCase();
const searchValue = this.searchValue.value?.toLowerCase() ?? '';
return authorizedAddons.filter((card) => card.displayName.includes(searchValue));
});

Expand All @@ -79,7 +80,7 @@ export class AddonsComponent {
);

protected readonly filteredAddonCards = computed(() => {
const searchValue = this.searchValue().toLowerCase();
const searchValue = this.searchValue.value?.toLowerCase() ?? '';
return this.currentAddonsState().filter((card) => card.externalServiceName.includes(searchValue));
});

Expand Down