mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
94688: Added ThemedSearchFormComponent
This commit is contained in:
@@ -28,14 +28,14 @@
|
|||||||
<ng-template ngbNavContent>
|
<ng-template ngbNavContent>
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-6">
|
||||||
<ds-search-form id="search-form"
|
<ds-themed-search-form id="search-form"
|
||||||
[query]="(searchOptions$ | async)?.query"
|
[query]="(searchOptions$ | async)?.query"
|
||||||
[scope]="(searchOptions$ | async)?.scope"
|
[scope]="(searchOptions$ | async)?.scope"
|
||||||
[currentUrl]="'./'"
|
[currentUrl]="'./'"
|
||||||
[inPlaceSearch]="true"
|
[inPlaceSearch]="true"
|
||||||
[searchPlaceholder]="'collection.edit.item-mapper.search-form.placeholder' | translate"
|
[searchPlaceholder]="'collection.edit.item-mapper.search-form.placeholder' | translate"
|
||||||
(submitSearch)="performedSearch = true">
|
(submitSearch)="performedSearch = true">
|
||||||
</ds-search-form>
|
</ds-themed-search-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<ng-container *ngIf="(site$ | async) as site">
|
<ng-container *ngIf="(site$ | async) as site">
|
||||||
<ds-view-tracker [object]="site"></ds-view-tracker>
|
<ds-view-tracker [object]="site"></ds-view-tracker>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ds-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-search-form>
|
<ds-themed-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-themed-search-form>
|
||||||
<ds-top-level-community-list></ds-top-level-community-list>
|
<ds-top-level-community-list></ds-top-level-community-list>
|
||||||
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
|
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -27,13 +27,13 @@
|
|||||||
<ng-template ngbNavContent>
|
<ng-template ngbNavContent>
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-6">
|
||||||
<ds-search-form id="search-form"
|
<ds-themed-search-form id="search-form"
|
||||||
[query]="(searchOptions$ | async)?.query"
|
[query]="(searchOptions$ | async)?.query"
|
||||||
[currentUrl]="'./'"
|
[currentUrl]="'./'"
|
||||||
[inPlaceSearch]="true"
|
[inPlaceSearch]="true"
|
||||||
[searchPlaceholder]="'item.edit.item-mapper.search-form.placeholder' | translate"
|
[searchPlaceholder]="'item.edit.item-mapper.search-form.placeholder' | translate"
|
||||||
(submitSearch)="performedSearch = true">
|
(submitSearch)="performedSearch = true">
|
||||||
</ds-search-form>
|
</ds-themed-search-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -4,10 +4,10 @@
|
|||||||
<ds-page-size-selector></ds-page-size-selector>
|
<ds-page-size-selector></ds-page-size-selector>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<ds-search-form [query]="(searchConfigService.paginatedSearchOptions | async)?.query"
|
<ds-themed-search-form [query]="(searchConfigService.paginatedSearchOptions | async)?.query"
|
||||||
[inPlaceSearch]="true"
|
[inPlaceSearch]="true"
|
||||||
[searchPlaceholder]="'submission.sections.describe.relationship-lookup.selection-tab.search-form.placeholder' | translate">
|
[searchPlaceholder]="'submission.sections.describe.relationship-lookup.selection-tab.search-form.placeholder' | translate">
|
||||||
</ds-search-form>
|
</ds-themed-search-form>
|
||||||
<div>
|
<div>
|
||||||
<h3>{{ 'submission.sections.describe.relationship-lookup.selection-tab.title.' + externalSource.id | translate}}</h3>
|
<h3>{{ 'submission.sections.describe.relationship-lookup.selection-tab.title.' + externalSource.id | translate}}</h3>
|
||||||
<ng-container *ngVar="(entriesRD$ | async) as entriesRD">
|
<ng-container *ngVar="(entriesRD$ | async) as entriesRD">
|
||||||
|
50
src/app/shared/search-form/themed-search-form.component.ts
Normal file
50
src/app/shared/search-form/themed-search-form.component.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||||
|
import { ThemedComponent } from '../theme-support/themed.component';
|
||||||
|
import { SearchFormComponent } from './search-form.component';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for {@link SearchFormComponent}
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-search-form',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedSearchFormComponent extends ThemedComponent<SearchFormComponent> {
|
||||||
|
|
||||||
|
@Input() query: string;
|
||||||
|
|
||||||
|
@Input() inPlaceSearch;
|
||||||
|
|
||||||
|
@Input() scope = '';
|
||||||
|
|
||||||
|
@Input() currentUrl: string;
|
||||||
|
|
||||||
|
@Input() large = false;
|
||||||
|
|
||||||
|
@Input() brandColor = 'primary';
|
||||||
|
|
||||||
|
@Input() searchPlaceholder: string;
|
||||||
|
|
||||||
|
@Input() showScopeSelector = false;
|
||||||
|
|
||||||
|
@Output() submitSearch = new EventEmitter<any>();
|
||||||
|
|
||||||
|
protected inAndOutputNames: (keyof SearchFormComponent & keyof this)[] = [
|
||||||
|
'query', 'inPlaceSearch', 'scope', 'currentUrl', 'large', 'brandColor', 'searchPlaceholder', 'showScopeSelector',
|
||||||
|
'submitSearch',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'SearchFormComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../themes/${themeName}/app/shared/search-form/search-form.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import('./search-form.component');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -79,14 +79,14 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #searchForm>
|
<ng-template #searchForm>
|
||||||
<ds-search-form *ngIf="searchEnabled" id="search-form"
|
<ds-themed-search-form *ngIf="searchEnabled" id="search-form"
|
||||||
[query]="(searchOptions$ | async)?.query"
|
[query]="(searchOptions$ | async)?.query"
|
||||||
[scope]="(searchOptions$ | async)?.scope"
|
[scope]="(searchOptions$ | async)?.scope"
|
||||||
[currentUrl]="searchLink"
|
[currentUrl]="searchLink"
|
||||||
[showScopeSelector]="showScopeSelector"
|
[showScopeSelector]="showScopeSelector"
|
||||||
[inPlaceSearch]="inPlaceSearch"
|
[inPlaceSearch]="inPlaceSearch"
|
||||||
[searchPlaceholder]="searchFormPlaceholder | translate">
|
[searchPlaceholder]="searchFormPlaceholder | translate">
|
||||||
</ds-search-form>
|
</ds-themed-search-form>
|
||||||
<div class="row mb-3 mb-md-1">
|
<div class="row mb-3 mb-md-1">
|
||||||
<div class="labels col-sm-9">
|
<div class="labels col-sm-9">
|
||||||
<ds-search-labels *ngIf="searchEnabled" [inPlaceSearch]="inPlaceSearch"></ds-search-labels>
|
<ds-search-labels *ngIf="searchEnabled" [inPlaceSearch]="inPlaceSearch"></ds-search-labels>
|
||||||
|
@@ -60,6 +60,7 @@ import { LoadingComponent } from './loading/loading.component';
|
|||||||
import { PaginationComponent } from './pagination/pagination.component';
|
import { PaginationComponent } from './pagination/pagination.component';
|
||||||
import { ThumbnailComponent } from '../thumbnail/thumbnail.component';
|
import { ThumbnailComponent } from '../thumbnail/thumbnail.component';
|
||||||
import { SearchFormComponent } from './search-form/search-form.component';
|
import { SearchFormComponent } from './search-form/search-form.component';
|
||||||
|
import { ThemedSearchFormComponent } from './search-form/themed-search-form.component';
|
||||||
import {
|
import {
|
||||||
SearchResultGridElementComponent
|
SearchResultGridElementComponent
|
||||||
} from './object-grid/search-result-grid-element/search-result-grid-element.component';
|
} from './object-grid/search-result-grid-element/search-result-grid-element.component';
|
||||||
@@ -396,6 +397,7 @@ const COMPONENTS = [
|
|||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
RSSComponent,
|
RSSComponent,
|
||||||
SearchFormComponent,
|
SearchFormComponent,
|
||||||
|
ThemedSearchFormComponent,
|
||||||
PageWithSidebarComponent,
|
PageWithSidebarComponent,
|
||||||
SidebarDropdownComponent,
|
SidebarDropdownComponent,
|
||||||
SidebarFilterComponent,
|
SidebarFilterComponent,
|
||||||
|
Reference in New Issue
Block a user