Skip to content

Commit f40a68f

Browse files
Merge remote-tracking branch 'upstream/main' into use-applied-filter-to-display-label-on-search_contribute-main
# Conflicts: # src/app/shared/search/search-labels/search-label/search-label.component.html # src/app/shared/search/search.component.html
2 parents fb99347 + a8f65ce commit f40a68f

33 files changed

Lines changed: 133 additions & 83 deletions

File tree

cypress/e2e/item-template.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const ADD_TEMPLATE_ITEM_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/itemtemplate');
2+
3+
describe('Item Template', () => {
4+
beforeEach(() => {
5+
cy.visit(ADD_TEMPLATE_ITEM_PAGE);
6+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
7+
});
8+
9+
it('should load properly', () => {
10+
cy.contains('.ds-header-row .lbl-cell', 'Field', { timeout: 10000 }).should('exist').should('be.visible');
11+
cy.contains('.ds-header-row b', 'Value', { timeout: 10000 }).should('exist').should('be.visible');
12+
cy.contains('.ds-header-row b', 'Lang', { timeout: 10000 }).should('exist').should('be.visible');
13+
cy.contains('.ds-header-row b', 'Edit', { timeout: 10000 }).should('exist').should('be.visible');
14+
});
15+
});

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import {
2424
import {
2525
BehaviorSubject,
2626
combineLatest as observableCombineLatest,
27-
EMPTY,
2827
Observable,
28+
of,
2929
Subscription,
3030
} from 'rxjs';
3131
import {
@@ -188,7 +188,7 @@ export class DsoEditMetadataComponent implements OnInit, OnDestroy {
188188
const lazyProvider$: Observable<UpdateDataService<DSpaceObject>> = lazyDataService(this.dataServiceMap, this.dsoType, this.parentInjector);
189189
return lazyProvider$;
190190
} else {
191-
return EMPTY;
191+
return of(this.updateDataService);
192192
}
193193
}
194194

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<a *ngIf="min !== '*'"
2+
[attr.aria-label]="'search.filters.remove' | translate:{ type: ('search.filters.applied.f.' + appliedFilter.filter + '.min') | translate, value: min }"
23
[routerLink]="searchLink"
34
[queryParams]="(removeParametersMin$ | async)"
4-
class="badge badge-primary mr-1 mb-1 text-capitalize">
5-
{{('search.filters.applied.f.' + appliedFilter.filter + '.min') | translate}}: {{ min }}
6-
<span> ×</span>
5+
class="badge badge-primary">
6+
<span class="d-flex">
7+
<span class="flex-grow-1 text-left">{{('search.filters.applied.f.' + appliedFilter.filter + '.min') | translate}}: {{ min }}</span>
8+
<span class="pl-1" aria-hidden="true">×</span>
9+
</span>
710
</a>
811
<a *ngIf="max !== '*'"
12+
[attr.aria-label]="'search.filters.remove' | translate:{ type: ('search.filters.applied.f.' + appliedFilter.filter + '.max') | translate, value: max }"
913
[routerLink]="searchLink"
1014
[queryParams]="(removeParametersMax$ | async)"
11-
class="badge badge-primary mr-1 mb-1 text-capitalize">
12-
{{('search.filters.applied.f.' + appliedFilter.filter + '.max') | translate}}: {{ max }}
13-
<span> ×</span>
15+
class="badge badge-primary">
16+
<span class="d-flex">
17+
<span class="flex-grow-1 text-left">{{('search.filters.applied.f.' + appliedFilter.filter + '.max') | translate}}: {{ max }}</span>
18+
<span class="pl-1" aria-hidden="true">×</span>
19+
</span>
1420
</a>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:host {
2+
display: flex;
3+
flex-wrap: wrap;
4+
gap: calc(var(--bs-spacer) / 4);
5+
}
6+
7+
.badge {
8+
white-space: inherit;
9+
}

src/app/shared/search/search-labels/search-label-range/search-label-range.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { renderSearchLabelFor } from '../search-label-loader/search-label-loader
2929
@Component({
3030
selector: 'ds-search-label-range',
3131
templateUrl: './search-label-range.component.html',
32+
styleUrls: ['./search-label-range.component.scss'],
3233
standalone: true,
3334
imports: [
3435
AsyncPipe,
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<a class="badge badge-primary mr-1 mb-1"
2-
[attr.aria-label]="'search.filters.remove' | translate:{ type: ('search.filters.applied.' + appliedFilter.filter) | translate, value: appliedFilter.label }"
1+
<a class="badge badge-primary"
2+
[attr.aria-label]="'search.filters.remove' | translate:{ type: ('search.filters.applied.f.' + appliedFilter.filter) | translate, value: appliedFilter.label }"
33
[routerLink]="searchLink"
44
[queryParams]="(removeParameters$ | async)">
5-
{{('search.filters.applied.f.' + appliedFilter.filter) | translate}}: {{'search.filters.' + appliedFilter.filter + '.' + appliedFilter.label | translate: {default: appliedFilter.label} }}
6-
<span aria-hidden="true"> ×</span>
5+
<span class="d-flex">
6+
<span class="flex-grow-1 text-left">{{ ('search.filters.applied.f.' + appliedFilter.filter) | translate}}: {{'search.filters.' + appliedFilter.filter + '.' + appliedFilter.label | translate: { default: appliedFilter.label } }}</span>
7+
<span class="pl-1" aria-hidden="true">×</span>
8+
</span>
79
</a>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.badge {
2+
white-space: inherit;
3+
}

src/app/shared/search/search-labels/search-label/search-label.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { renderSearchLabelFor } from '../search-label-loader/search-label-loader
2626
@Component({
2727
selector: 'ds-search-label',
2828
templateUrl: './search-label.component.html',
29+
styleUrls: ['./search-label.component.scss'],
2930
standalone: true,
3031
imports: [RouterLink, AsyncPipe, TranslateModule],
3132
})
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
:host {
2-
line-height: 1;
3-
}
2+
line-height: 1;
3+
4+
.labels {
5+
display: flex;
6+
flex-wrap: wrap;
7+
gap: calc(var(--bs-spacer) / 4);
8+
}
9+
}

src/app/shared/search/search.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
[searchPlaceholder]="searchFormPlaceholder | translate">
100100
</ds-themed-search-form>
101101
<div class="row mb-3 mb-md-1">
102-
<div class="labels col-sm-9">
103-
<ds-search-labels *ngIf="searchEnabled" [appliedFilters]="appliedFilters" [inPlaceSearch]="inPlaceSearch">
102+
<div class="labels col-12">
103+
<ds-search-labels [appliedFilters]="appliedFilters" [inPlaceSearch]="inPlaceSearch">
104104
</ds-search-labels>
105105
</div>
106106
</div>

0 commit comments

Comments
 (0)