Skip to content

Commit

Permalink
108588: Renamed components, because now these aren't page components …
Browse files Browse the repository at this point in the history
…anymore
  • Loading branch information
alexandrevryghem committed Dec 13, 2023
1 parent 444b699 commit 243179e
Show file tree
Hide file tree
Showing 31 changed files with 128 additions and 129 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BrowseByDatePageComponent } from './browse-by-date-page.component';
import { BrowseByDateComponent } from './browse-by-date.component';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { CommonModule } from '@angular/common';
import { RouterTestingModule } from '@angular/router/testing';
Expand All @@ -15,7 +15,7 @@ import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
import { Community } from '../../core/shared/community.model';
import { Item } from '../../core/shared/item.model';
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
import { toRemoteData } from '../browse-by-metadata-page/browse-by-metadata-page.component.spec';
import { toRemoteData } from '../browse-by-metadata/browse-by-metadata.component.spec';
import { VarDirective } from '../../shared/utils/var.directive';
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
import { PaginationService } from '../../core/pagination/pagination.service';
Expand All @@ -24,9 +24,9 @@ import { APP_CONFIG } from '../../../config/app-config.interface';
import { environment } from '../../../environments/environment';
import { SortDirection } from '../../core/cache/models/sort-options.model';

describe('BrowseByDatePageComponent', () => {
let comp: BrowseByDatePageComponent;
let fixture: ComponentFixture<BrowseByDatePageComponent>;
describe('BrowseByDateComponent', () => {
let comp: BrowseByDateComponent;
let fixture: ComponentFixture<BrowseByDateComponent>;
let route: ActivatedRoute;
let paginationService;

Expand Down Expand Up @@ -86,7 +86,7 @@ describe('BrowseByDatePageComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
declarations: [BrowseByDatePageComponent, EnumKeysPipe, VarDirective],
declarations: [BrowseByDateComponent, EnumKeysPipe, VarDirective],
providers: [
{ provide: ActivatedRoute, useValue: activatedRouteStub },
{ provide: BrowseService, useValue: mockBrowseService },
Expand All @@ -101,7 +101,7 @@ describe('BrowseByDatePageComponent', () => {
}));

beforeEach(() => {
fixture = TestBed.createComponent(BrowseByDatePageComponent);
fixture = TestBed.createComponent(BrowseByDateComponent);
const browseService = fixture.debugElement.injector.get(BrowseService);
spyOn(browseService, 'getFirstItemFor')
// ok to expect the default browse as first param since we just need the mock items obtained via sort direction.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core';
import {
BrowseByMetadataPageComponent,
BrowseByMetadataComponent,
browseParamsToOptions,
getBrowseSearchOptions
} from '../browse-by-metadata-page/browse-by-metadata-page.component';
} from '../browse-by-metadata/browse-by-metadata.component';
import { combineLatest as observableCombineLatest } from 'rxjs';
import { hasValue, isNotEmpty } from '../../shared/empty.util';
import { ActivatedRoute, Params, Router } from '@angular/router';
Expand All @@ -23,17 +23,17 @@ import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator';
import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type';

@Component({
selector: 'ds-browse-by-date-page',
styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'],
templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html'
selector: 'ds-browse-by-date',
styleUrls: ['../browse-by-metadata/browse-by-metadata.component.scss'],
templateUrl: '../browse-by-metadata/browse-by-metadata.component.html',
})
/**
* Component for browsing items by metadata definition of type 'date'
* A metadata definition (a.k.a. browse id) is a short term used to describe one or multiple metadata fields.
* An example would be 'dateissued' for 'dc.date.issued'
*/
@rendersBrowseBy(BrowseByDataType.Date)
export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent implements OnInit {
export class BrowseByDateComponent extends BrowseByMetadataComponent implements OnInit {

/**
* The default metadata keys to use for determining the lower limit of the StartsWith dropdown options
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
BrowseByMetadataPageComponent,
BrowseByMetadataComponent,
browseParamsToOptions,
getBrowseSearchOptions
} from './browse-by-metadata-page.component';
} from './browse-by-metadata.component';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BrowseService } from '../../core/browse/browse.service';
import { CommonModule } from '@angular/common';
Expand Down Expand Up @@ -31,9 +31,9 @@ import { PaginationComponentOptions } from '../../shared/pagination/pagination-c
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
import { APP_CONFIG } from '../../../config/app-config.interface';

describe('BrowseByMetadataPageComponent', () => {
let comp: BrowseByMetadataPageComponent;
let fixture: ComponentFixture<BrowseByMetadataPageComponent>;
describe('BrowseByMetadataComponent', () => {
let comp: BrowseByMetadataComponent;
let fixture: ComponentFixture<BrowseByMetadataComponent>;
let browseService: BrowseService;
let route: ActivatedRoute;
let paginationService;
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('BrowseByMetadataPageComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
declarations: [BrowseByMetadataPageComponent, EnumKeysPipe, VarDirective],
declarations: [BrowseByMetadataComponent, EnumKeysPipe, VarDirective],
providers: [
{ provide: ActivatedRoute, useValue: activatedRouteStub },
{ provide: BrowseService, useValue: mockBrowseService },
Expand All @@ -117,7 +117,7 @@ describe('BrowseByMetadataPageComponent', () => {
}));

beforeEach(() => {
fixture = TestBed.createComponent(BrowseByMetadataPageComponent);
fixture = TestBed.createComponent(BrowseByMetadataComponent);
comp = fixture.componentInstance;
fixture.detectChanges();
browseService = (comp as any).browseService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type';
export const BBM_PAGINATION_ID = 'bbm';

@Component({
selector: 'ds-browse-by-metadata-page',
styleUrls: ['./browse-by-metadata-page.component.scss'],
templateUrl: './browse-by-metadata-page.component.html'
selector: 'ds-browse-by-metadata',
styleUrls: ['./browse-by-metadata.component.scss'],
templateUrl: './browse-by-metadata.component.html',
})
/**
* Component for browsing (items) by metadata definition.
Expand All @@ -35,7 +35,7 @@ export const BBM_PAGINATION_ID = 'bbm';
* 'dc.contributor.*'
*/
@rendersBrowseBy(BrowseByDataType.Metadata)
export class BrowseByMetadataPageComponent extends AbstractBrowseByTypeComponent implements OnInit, OnDestroy {
export class BrowseByMetadataComponent extends AbstractBrowseByTypeComponent implements OnInit, OnDestroy {

/**
* The list of browse-entries to display
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BrowseByTaxonomyPageComponent } from './browse-by-taxonomy-page.component';
import { BrowseByTaxonomyComponent } from './browse-by-taxonomy.component';
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
import { TranslateModule } from '@ngx-translate/core';
import { NO_ERRORS_SCHEMA } from '@angular/core';
Expand All @@ -10,9 +9,9 @@ import { createDataWithBrowseDefinition } from '../browse-by-switcher/browse-by-
import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model';
import { ThemeService } from '../../shared/theme-support/theme.service';

describe('BrowseByTaxonomyPageComponent', () => {
let component: BrowseByTaxonomyPageComponent;
let fixture: ComponentFixture<BrowseByTaxonomyPageComponent>;
describe('BrowseByTaxonomyComponent', () => {
let component: BrowseByTaxonomyComponent;
let fixture: ComponentFixture<BrowseByTaxonomyComponent>;
let themeService: ThemeService;
let detail1: VocabularyEntryDetail;
let detail2: VocabularyEntryDetail;
Expand All @@ -29,7 +28,7 @@ describe('BrowseByTaxonomyPageComponent', () => {

await TestBed.configureTestingModule({
imports: [ TranslateModule.forRoot() ],
declarations: [ BrowseByTaxonomyPageComponent ],
declarations: [ BrowseByTaxonomyComponent ],
providers: [
{ provide: ActivatedRoute, useValue: activatedRouteStub },
{ provide: ThemeService, useValue: themeService },
Expand All @@ -40,7 +39,7 @@ describe('BrowseByTaxonomyPageComponent', () => {
});

beforeEach(() => {
fixture = TestBed.createComponent(BrowseByTaxonomyPageComponent);
fixture = TestBed.createComponent(BrowseByTaxonomyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
detail1 = new VocabularyEntryDetail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import { AbstractBrowseByTypeComponent } from '../abstract-browse-by-type.compon
import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type';

@Component({
selector: 'ds-browse-by-taxonomy-page',
templateUrl: './browse-by-taxonomy-page.component.html',
styleUrls: ['./browse-by-taxonomy-page.component.scss']
selector: 'ds-browse-by-taxonomy',
templateUrl: './browse-by-taxonomy.component.html',
styleUrls: ['./browse-by-taxonomy.component.scss'],
})
/**
* Component for browsing items by metadata in a hierarchical controlled vocabulary
*/
@rendersBrowseBy(BrowseByDataType.Hierarchy)
export class BrowseByTaxonomyPageComponent extends AbstractBrowseByTypeComponent implements OnInit, OnDestroy {
export class BrowseByTaxonomyComponent extends AbstractBrowseByTypeComponent implements OnInit, OnDestroy {

/**
* The {@link VocabularyOptions} object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { TranslateModule } from '@ngx-translate/core';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { toRemoteData } from '../browse-by-metadata-page/browse-by-metadata-page.component.spec';
import { BrowseByTitlePageComponent } from './browse-by-title-page.component';
import { toRemoteData } from '../browse-by-metadata/browse-by-metadata.component.spec';
import { BrowseByTitleComponent } from './browse-by-title.component';
import { ItemDataService } from '../../core/data/item-data.service';
import { Community } from '../../core/shared/community.model';
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
Expand All @@ -24,9 +24,9 @@ import { APP_CONFIG } from '../../../config/app-config.interface';
import { environment } from '../../../environments/environment';


describe('BrowseByTitlePageComponent', () => {
let comp: BrowseByTitlePageComponent;
let fixture: ComponentFixture<BrowseByTitlePageComponent>;
describe('BrowseByTitleComponent', () => {
let comp: BrowseByTitleComponent;
let fixture: ComponentFixture<BrowseByTitleComponent>;
let itemDataService: ItemDataService;
let route: ActivatedRoute;

Expand Down Expand Up @@ -71,7 +71,7 @@ describe('BrowseByTitlePageComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
declarations: [BrowseByTitlePageComponent, EnumKeysPipe, VarDirective],
declarations: [BrowseByTitleComponent, EnumKeysPipe, VarDirective],
providers: [
{ provide: ActivatedRoute, useValue: activatedRouteStub },
{ provide: BrowseService, useValue: mockBrowseService },
Expand All @@ -85,7 +85,7 @@ describe('BrowseByTitlePageComponent', () => {
}));

beforeEach(() => {
fixture = TestBed.createComponent(BrowseByTitlePageComponent);
fixture = TestBed.createComponent(BrowseByTitleComponent);
comp = fixture.componentInstance;
fixture.detectChanges();
itemDataService = (comp as any).itemDataService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import { combineLatest as observableCombineLatest } from 'rxjs';
import { Component, OnInit } from '@angular/core';
import { Params } from '@angular/router';
import {
BrowseByMetadataPageComponent,
BrowseByMetadataComponent,
browseParamsToOptions, getBrowseSearchOptions
} from '../browse-by-metadata-page/browse-by-metadata-page.component';
} from '../browse-by-metadata/browse-by-metadata.component';
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
import { map } from 'rxjs/operators';
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator';
import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type';

@Component({
selector: 'ds-browse-by-title-page',
styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'],
templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html'
selector: 'ds-browse-by-title',
styleUrls: ['../browse-by-metadata/browse-by-metadata.component.scss'],
templateUrl: '../browse-by-metadata/browse-by-metadata.component.html'
})
/**
* Component for browsing items by title (dc.title)
*/
@rendersBrowseBy(BrowseByDataType.Title)
export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent implements OnInit {
export class BrowseByTitleComponent extends BrowseByMetadataComponent implements OnInit {

ngOnInit(): void {
const sortConfig = new SortOptions('dc.title', SortDirection.ASC);
Expand Down
16 changes: 8 additions & 8 deletions src/app/browse-by/browse-by.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BrowseByTitlePageComponent } from './browse-by-title-page/browse-by-title-page.component';
import { BrowseByMetadataPageComponent } from './browse-by-metadata-page/browse-by-metadata-page.component';
import { BrowseByDatePageComponent } from './browse-by-date-page/browse-by-date-page.component';
import { BrowseByTitleComponent } from './browse-by-title/browse-by-title.component';
import { BrowseByMetadataComponent } from './browse-by-metadata/browse-by-metadata.component';
import { BrowseByDateComponent } from './browse-by-date/browse-by-date.component';
import { BrowseBySwitcherComponent } from './browse-by-switcher/browse-by-switcher.component';
import { BrowseByTaxonomyPageComponent } from './browse-by-taxonomy-page/browse-by-taxonomy-page.component';
import { BrowseByTaxonomyComponent } from './browse-by-taxonomy/browse-by-taxonomy.component';
import { SharedBrowseByModule } from '../shared/browse-by/shared-browse-by.module';
import { DsoPageModule } from '../shared/dso-page/dso-page.module';
import { FormModule } from '../shared/form/form.module';
Expand All @@ -15,10 +15,10 @@ const DECLARATIONS = [

const ENTRY_COMPONENTS = [
// put only entry components that use custom decorator
BrowseByTitlePageComponent,
BrowseByMetadataPageComponent,
BrowseByDatePageComponent,
BrowseByTaxonomyPageComponent,
BrowseByTitleComponent,
BrowseByMetadataComponent,
BrowseByDateComponent,
BrowseByTaxonomyComponent,
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ViewMode } from '../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator';
import { PaginationService } from '../../../core/pagination/pagination.service';
import { Params } from '@angular/router';
import { BBM_PAGINATION_ID } from '../../../browse-by/browse-by-metadata-page/browse-by-metadata-page.component';
import { BBM_PAGINATION_ID } from '../../../browse-by/browse-by-metadata/browse-by-metadata.component';
import { RouteService } from 'src/app/core/services/route.service';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component } from '@angular/core';
import { BrowseByDateComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-date/browse-by-date.component';
import { BrowseByDataType } from '../../../../../app/browse-by/browse-by-switcher/browse-by-data-type';
import { rendersBrowseBy } from '../../../../../app/browse-by/browse-by-switcher/browse-by-decorator';
import { Context } from '../../../../../app/core/shared/context.model';

@Component({
selector: 'ds-browse-by-date',
// styleUrls: ['./browse-by-date.component.scss'],
styleUrls: ['../../../../../app/browse-by/browse-by-metadata/browse-by-metadata.component.scss'],
// templateUrl: './browse-by-date.component.html',
templateUrl: '../../../../../app/browse-by/browse-by-metadata/browse-by-metadata.component.html',
})
@rendersBrowseBy(BrowseByDataType.Date, Context.Any, 'custom')
export class BrowseByDateComponent extends BaseComponent {
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component } from '@angular/core';
import { BrowseByMetadataComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-metadata/browse-by-metadata.component';
import { BrowseByDataType } from '../../../../../app/browse-by/browse-by-switcher/browse-by-data-type';
import { rendersBrowseBy } from '../../../../../app/browse-by/browse-by-switcher/browse-by-decorator';
import { Context } from '../../../../../app/core/shared/context.model';

@Component({
selector: 'ds-browse-by-metadata',
// styleUrls: ['./browse-by-metadata.component.scss'],
styleUrls: ['../../../../../app/browse-by/browse-by-metadata/browse-by-metadata.component.scss'],
// templateUrl: './browse-by-metadata.component.html',
templateUrl: '../../../../../app/browse-by/browse-by-metadata/browse-by-metadata.component.html',
})
@rendersBrowseBy(BrowseByDataType.Metadata, Context.Any, 'custom')
export class BrowseByMetadataComponent extends BaseComponent {
}
Loading

0 comments on commit 243179e

Please sign in to comment.