Skip to content

Commit

Permalink
111103: Added SearchComponent to custom theme in order to easily team…
Browse files Browse the repository at this point in the history
… it & added missing provider to themed wrapper
  • Loading branch information
alexandrevryghem committed Jan 17, 2024
1 parent 404ccd9 commit ecf67cb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/shared/search/themed-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { ViewMode } from '../../core/shared/view-mode.model';
import { SearchObjects } from './models/search-objects.model';
import { DSpaceObject } from '../../core/shared/dspace-object.model';
import { ListableObject } from '../object-collection/shared/listable-object.model';
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';

/**
* Themed wrapper for {@link SearchComponent}
Expand All @@ -17,6 +19,12 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode
selector: 'ds-themed-search',
styleUrls: [],
templateUrl: '../theme-support/themed.component.html',
providers: [
{
provide: SEARCH_CONFIG_SERVICE,
useClass: SearchConfigurationService
}
]
})
export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showCsvExport', 'showSidebar', 'showThumbnails', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics', 'query'];
Expand Down
Empty file.
Empty file.
13 changes: 13 additions & 0 deletions src/themes/custom/app/shared/search/search.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { pushInOut } from '../../../../../app/shared/animations/push';
import { SearchComponent as BaseComponent } from '../../../../../app/shared/search/search.component';

@Component({
selector: 'ds-search',
styleUrls: ['./search.component.scss'],
templateUrl: './search.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [pushInOut],
})
export class SearchComponent extends BaseComponent {
}
2 changes: 2 additions & 0 deletions src/themes/custom/lazy-theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/
import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component';
import { FormModule } from '../../app/shared/form/form.module';
import { RequestCopyModule } from 'src/app/request-copy/request-copy.module';
import { SearchComponent } from './app/shared/search/search.component';

const DECLARATIONS = [
FileSectionComponent,
Expand Down Expand Up @@ -239,6 +240,7 @@ const DECLARATIONS = [
SubmissionSectionUploadFileComponent,
ItemStatusComponent,
EditBitstreamPageComponent,
SearchComponent,
];

@NgModule({
Expand Down

0 comments on commit ecf67cb

Please sign in to comment.