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
2 changes: 1 addition & 1 deletion src/app/core/store/user/user.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class UserState {
},
},
});
localStorage.setItem('currentUser', JSON.stringify(response))
localStorage.setItem('currentUser', JSON.stringify(response));
}
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,20 @@
} @else {
<tr>
@for (col of columns; track col.field) {
<td class="relative">
<div class="flex align-items-center hover-group">
@let currentColumnField = rowData[col.field];
@if (col.isLink && isLink(currentColumnField)) {
<a
[href]="currentColumnField.url"
[target]="col.linkTarget ?? '_self'"
class="font-bold no-underline hover:underline"
>
@if (col.dateFormat) {
{{ getCellValue(currentColumnField) | date: col.dateFormat }}
} @else {
{{ getCellValue(currentColumnField) }}
}
</a>
} @else if (col.isLink && col.isArray && isLinkArray(currentColumnField)) {
<div class="flex gap-1 align-items-center">
@for (link of currentColumnField; track $index) {
<td class="max-w-20rem hover-group">
@let currentColumnField = rowData[col.field];
@if (col.isLink && isLink(currentColumnField)) {
<a [href]="currentColumnField.url" [target]="col.linkTarget ?? '_self'" class="font-bold">
@if (col.dateFormat) {
{{ getCellValue(currentColumnField) | date: col.dateFormat }}
} @else {
{{ getCellValue(currentColumnField) }}
}
</a>
} @else if (col.isLink && col.isArray && isLinkArray(currentColumnField)) {
<div class="flex gap-1 align-items-center flex-wrap">
@for (link of currentColumnField; track $index) {
<div>
<a [href]="link.url" [target]="col.linkTarget ?? '_self'" class="font-bold">
{{ link.text }}<span>{{ $last ? '' : ',' }}</span>
</a>
Expand All @@ -140,30 +136,32 @@
(onClick)="onIconClick(rowData, col, $index)"
/>
}
}
</div>
} @else {
@if (col.dateFormat && currentColumnField) {
{{ getCellValue(currentColumnField) | date: col.dateFormat }}
} @else if (!col.dateFormat && currentColumnField) {
{{ getCellValue(currentColumnField) }}
} @else {
{{ currentColumnField ?? '-' }}
</div>
}
</div>
} @else {
@if (col.dateFormat && currentColumnField) {
<p>
{{ getCellValue(currentColumnField) | date: col.dateFormat }}
</p>
} @else if (!col.dateFormat && currentColumnField) {
<p class="overflow-hidden text-overflow-ellipsis">{{ getCellValue(currentColumnField) }}</p>
} @else {
<p class="overflow-hidden text-overflow-ellipsis text-center">{{ currentColumnField ?? '-' }}</p>
}
}

@if (col.showIcon && !col.isArray) {
<p-button
[pTooltip]="col.iconTooltip | translate"
class="icon-button"
[icon]="col.iconClass"
variant="text"
severity="info"
[ariaLabel]="'common.accessibility.tooltipBtn' | translate"
(onClick)="onIconClick(rowData, col, $index)"
/>
}
</div>
@if (col.showIcon && !col.isArray) {
<p-button
[pTooltip]="col.iconTooltip | translate"
class="icon-button"
[icon]="col.iconClass"
variant="text"
severity="info"
[ariaLabel]="'common.accessibility.tooltipBtn' | translate"
(onClick)="onIconClick(rowData, col, $index)"
/>
}
</td>
}
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe('TosConsentBannerComponent', () => {

it('should have the "Continue" button disabled by default', () => {
const continueButton = fixture.debugElement.query(By.css('p-button button')).nativeElement;
console.log('continueButton ' + continueButton )
expect(continueButton.disabled).toBe(true);
});

Expand All @@ -71,13 +70,12 @@ describe('TosConsentBannerComponent', () => {
expect(toastServiceMock.showError).not.toHaveBeenCalled();
});

it('should show toast banner if acceptedTermsOfService is false and "Continue" is clicked', () => {
it('should show toast banner if acceptedTermsOfService is false and "Continue" is clicked', () => {
component.acceptedTermsOfService.set(false);
const continueButton = fixture.debugElement.query(By.css('p-button button')).nativeElement;
continueButton.disabled = false;
continueButton.click();
fixture.detectChanges();
expect(component.errorMessage).toEqual('toast.tos-consent.error-message');
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export const REGISTRY_SORT_OPTIONS: CustomOption<string>[] = [
},
{
value: RegistrySort.RegisteredNewest,
label: 'moderation.sortOption.oldest',
label: 'moderation.sortOption.newest',
},
{
value: RegistrySort.RegisteredOldest,
label: 'moderation.sortOption.newest',
label: 'moderation.sortOption.oldest',
},
];
8 changes: 4 additions & 4 deletions src/app/shared/services/global-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export class GlobalSearchService {
} {
let nextUrl: string | undefined;

const searchResultItems = response.included!.filter(
(item): item is SearchResultJsonApi => item.type === 'search-result'
);
const filterOptionItems = response.included!.filter((item): item is FilterOptionItem => item.type === 'index-card');
const searchResultItems =
response.included?.filter((item): item is SearchResultJsonApi => item.type === 'search-result') ?? [];
const filterOptionItems =
response.included?.filter((item): item is FilterOptionItem => item.type === 'index-card') ?? [];

const options = mapFilterOptions(searchResultItems, filterOptionItems);
const searchResultPage = response?.data?.relationships?.['searchResultPage'] as {
Expand Down
7 changes: 3 additions & 4 deletions src/app/shared/stores/global-search/global-search.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ export class GlobalSearchState {

private buildParamsForIndexCardSearch(state: GlobalSearchStateModel): Record<string, string> {
const filtersParams: Record<string, string> = {};
Object.entries(state.defaultFilterValues).forEach(([key, value]) => {
filtersParams[`cardSearchFilter[${key}][]`] = value;
});
Object.entries(state.filterValues).forEach(([key, value]) => {
if (value) {
const filterDefinition = state.filters.find((f) => f.key === key);
Expand All @@ -322,10 +325,6 @@ export class GlobalSearchState {
const sortParam = sortBy.includes('count') && !sortBy.includes('relevance') ? 'sort[integer-value]' : 'sort';
filtersParams[sortParam] = sortBy;

Object.entries(state.defaultFilterValues).forEach(([key, value]) => {
filtersParams[`cardSearchFilter[${key}][]`] = value;
});

return filtersParams;
}
}
Loading