Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d54fcdd
fix(global-search): Fixed bugs
rrromchIk Sep 18, 2025
2ebf957
fix(global-search): Fixed error when no search results
rrromchIk Sep 18, 2025
2977059
fix(submissions-sort): Fixed sorting for registration submissions
rrromchIk Sep 18, 2025
5173880
fix(institution-dashboard): Added overflow ellipsis for long column c…
rrromchIk Sep 18, 2025
8ebd14f
fix(merge): Merge conflict
rrromchIk Sep 18, 2025
9ae51f6
fix(global-search): Fixed order of applying filters
rrromchIk Sep 18, 2025
6cfcab6
Merge branch 'refs/heads/main' into fix/search-bugs
rrromchIk Sep 20, 2025
77a48de
fix(registry-provider): Fixed branding colors
rrromchIk Sep 21, 2025
eca916e
fix(registry-provider): Fixed branding colors
rrromchIk Sep 21, 2025
013f207
fix(resource-card): Fixed label text wrapping
rrromchIk Sep 21, 2025
7503275
fix(scroll-to-top): Improved scrollToTop directive
rrromchIk Sep 21, 2025
ad25f8a
fix(provider-description): Simplified hover color styling for links
rrromchIk Sep 22, 2025
b9f3d50
Merge branch 'refs/heads/main' into fix/search-bugs
rrromchIk Sep 26, 2025
4cb81bb
fix(institution-search): Fixed filters for institutions to see files
rrromchIk Sep 26, 2025
a027260
fix(global-search): Fixed bug related to filter option counts
rrromchIk Sep 26, 2025
1d319e4
fix(global-search): Fixed data structure for storing filter options, …
rrromchIk Sep 26, 2025
6959d61
fix(global-search): Refactored code, removed unused models and logic
rrromchIk Sep 26, 2025
de01618
Merge branch 'refs/heads/main' into fix/search-bugs
rrromchIk Sep 26, 2025
e3afd12
fix(global-search): Fixed updating url
rrromchIk Sep 26, 2025
8436e07
fix(filters-section): Enhance filter scrolling behavior and improve c…
rrromchIk Sep 29, 2025
7a3eeab
Merge branch 'refs/heads/main' into fix/search-bugs
rrromchIk Sep 29, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2>{{ 'adminInstitutions.common.filterBy' | translate }}</h2>
(selectedOptionRemoved)="onFilterChipRemoved($event)"
/>

<div class="overflow-auto px-4">
<div class="filters-section overflow-auto px-4">
<osf-reusable-filters
[plainStyle]="true"
[filters]="filters()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ import { Accordion, AccordionContent, AccordionHeader, AccordionPanel } from 'pr
import { AutoCompleteModule } from 'primeng/autocomplete';
import { Checkbox, CheckboxChangeEvent } from 'primeng/checkbox';

import { delay, of } from 'rxjs';

import { NgClass } from '@angular/common';
import { ChangeDetectionStrategy, Component, computed, input, output, signal } from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
computed,
DestroyRef,
ElementRef,
inject,
input,
output,
signal,
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { FILTER_PLACEHOLDERS } from '@osf/shared/constants';
Expand Down Expand Up @@ -50,7 +63,7 @@ export class ReusableFilterComponent {
loadMoreFilterOptions = output<DiscoverableFilter>();

private readonly expandedFilters = signal<Set<string>>(new Set());

private destroyRef = inject(DestroyRef);
readonly FILTER_PLACEHOLDERS = FILTER_PLACEHOLDERS;

readonly hasFilters = computed(() => {
Expand Down Expand Up @@ -98,6 +111,10 @@ export class ReusableFilterComponent {
};
});

constructor(private el: ElementRef) {}

private readonly SCROLL_DELAY_MS = 100;

shouldShowFilter(filter: DiscoverableFilter): boolean {
if (!filter || !filter.key) return false;

Expand All @@ -112,6 +129,9 @@ export class ReusableFilterComponent {
if (!filterKey) return;

const key = Array.isArray(filterKey) ? filterKey[0]?.toString() : filterKey.toString();

this.scrollPanelIntoView(key);

const selectedFilter = this.filters().find((filter) => filter.key === key);

if (selectedFilter) {
Expand All @@ -135,6 +155,31 @@ export class ReusableFilterComponent {
this.filterOptionChanged.emit({ filter, filterOption });
}

private scrollPanelIntoView(key: string) {
of(key)
.pipe(delay(this.SCROLL_DELAY_MS), takeUntilDestroyed(this.destroyRef))
.subscribe({
next: (key) => {
const panelContent = this.el.nativeElement.querySelector(
`p-accordion-panel[ng-reflect-value="${key}"] p-accordion-content`
);

const scrollContainer = document.querySelector('.filters-section');

if (panelContent && scrollContainer) {
const contentRect = panelContent.getBoundingClientRect();
const containerRect = scrollContainer.getBoundingClientRect();
const newScrollTop = scrollContainer.scrollTop + (contentRect.top - containerRect.top);

scrollContainer.scrollTo({
top: newScrollTop,
behavior: 'smooth',
});
}
},
});
}

onFilterSearch(filter: DiscoverableFilter, searchText: string): void {
if (filter) {
this.filterSearchChanged.emit({ filter, searchText });
Expand Down
Loading