Skip to content

Commit bbccc53

Browse files
author
Andrea Barbasso
committed
[UXP-253] use skeletons in ssr, get glam components
# Conflicts: # src/app/core/layout/models/section.model.ts # src/app/core/services/bitstream-images.service.ts # src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/image/image.component.ts # src/app/cris-layout/cris-layout.module.ts # src/app/shared/browse-most-elements/abstract-browse-elements.component.ts # src/app/shared/browse-most-elements/browse-most-elements.component.html # src/app/shared/browse-most-elements/images-browse-elements/images-browse-elements.component.ts # src/app/shared/browse-most-elements/images-browse-elements/themed-images-browse-elements.component.ts # src/app/shared/browse-most-elements/slider-browse-elements/slider-browse-elements.component.html # src/app/shared/browse-most-elements/slider-browse-elements/slider-browse-elements.component.ts # src/app/shared/browse-most-elements/slider-browse-elements/themed-slider-browse-elements.component.ts # src/app/shared/browse-most-elements/themed-browse-most-elements.component.ts # src/app/shared/carousel-with-thumbnails/carousel-with-thumbnails.component.html # src/app/shared/carousel-with-thumbnails/carousel-with-thumbnails.component.spec.ts # src/app/shared/carousel-with-thumbnails/carousel-with-thumbnails.component.ts # src/app/shared/carousel-with-thumbnails/themed-carousel-with-thumbnails.component.ts # src/app/shared/carousel/carousel.component.html # src/app/shared/carousel/carousel.component.spec.ts # src/app/shared/carousel/carousel.component.ts # src/app/shared/carousel/carousel.module.ts # src/app/shared/carousel/themed-carousel.component.ts # src/app/shared/explore/explore.module.ts # src/app/shared/explore/section-component/advanced-top-section/advanced-top-section.component.html # src/app/shared/explore/section-component/advanced-top-section/advanced-top-section.component.spec.ts # src/app/shared/explore/section-component/advanced-top-section/advanced-top-section.component.ts # src/app/shared/explore/section-component/advanced-top-section/themed-advanced-top-section.component.ts # src/app/shared/explore/section-component/carousel-section/carousel-section.component.spec.ts # src/app/shared/explore/section-component/grid-section/grid-section.component.spec.ts # src/app/shared/explore/section-component/grid-section/grid-section.component.ts # src/app/shared/explore/section-component/slider-section/slider-section.component.ts # src/app/shared/explore/section-component/slider-section/themed-slider-section.component.ts # src/app/shared/shared.module.ts # src/app/shared/slider/link-slider/link-slider.component.html # src/app/shared/slider/link-slider/link-slider.component.ts # src/app/shared/slider/link-slider/themed-link-slider.component.ts # src/app/shared/slider/slider.component.ts # src/app/shared/slider/thumbnail-slider/thumbnail-slider.component.spec.ts # src/app/shared/slider/thumbnail-slider/thumbnail-slider.component.ts # src/app/shared/utils/background-image.directive.ts # src/app/thumbnail/thumbnail.component.spec.ts # src/config/default-app-config.ts # src/environments/environment.test.ts
1 parent 39515a3 commit bbccc53

10 files changed

Lines changed: 82 additions & 18 deletions

File tree

src/app/home-page/home-page.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
[sectionId]="sectionId"
6161
[advancedTopSection]="$any(sectionComponent)"></ds-advanced-top-section>
6262

63+
<ds-advanced-top-section *ngSwitchCase="'advanced-top-component'"
64+
[sectionId]="sectionId"
65+
[advancedTopSection]="$any(sectionComponent)"></ds-advanced-top-section>
66+
6367
</div>
6468
</div>
6569
</div>

src/app/shared/carousel-with-thumbnails/carousel-with-thumbnails.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('CarouselWithThumbnailsComponent', () => {
5454
CarouselWithThumbnailsComponent,
5555
MockComponent(ThumbnailSliderComponent),
5656
],
57+
declarations: [CarouselWithThumbnailsComponent],
5758
providers: [
5859
{ provide: HostWindowService, useValue: hostWindowServicve },
5960
{

src/app/shared/carousel-with-thumbnails/carousel-with-thumbnails.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { Item } from '../../core/shared/item.model';
3030
import { getItemPageRoute } from '../../item-page/item-page-routing-paths';
3131
import { CarouselOptions } from '../carousel/carousel-options.model';
3232
import { HostWindowService } from '../host-window.service';
33-
import { ThumbnailSliderComponent } from '../slider/thumbnail-slider/thumbnail-slider.component';
3433

3534
@Component({
3635
selector: 'ds-base-carousel-with-thumbnails',
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
import { NgbCarouselModule } from '@ng-bootstrap/ng-bootstrap';
4+
5+
import { SharedModule } from '../shared.module';
6+
import { SliderModule } from '../slider/slider.module';
7+
import { CarouselWithThumbnailsComponent } from './carousel-with-thumbnails.component';
8+
import { ThemedCarouselWithThumbnailsComponent } from './themed-carousel-with-thumbnails.component';
9+
10+
const COMPONENTS = [
11+
ThemedCarouselWithThumbnailsComponent,
12+
CarouselWithThumbnailsComponent,
13+
];
14+
15+
const MODULES = [
16+
NgbCarouselModule,
17+
CommonModule,
18+
SliderModule,
19+
];
20+
const PROVIDERS = [];
21+
22+
@NgModule({
23+
imports: [
24+
...MODULES,
25+
SharedModule,
26+
],
27+
declarations: [
28+
...COMPONENTS,
29+
],
30+
providers: [
31+
...PROVIDERS,
32+
],
33+
exports: [
34+
...COMPONENTS,
35+
],
36+
})
37+
38+
/**
39+
* This module handles all components, providers and modules that are needed for the menu
40+
*/
41+
export class CarouselWithThumbnailsModule {
42+
43+
}

src/app/shared/carousel/carousel.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
TranslateModule,
2424
} from '@ngx-translate/core';
2525
import { Observable } from 'rxjs';
26-
import { InternalLinkService } from 'src/app/core/services/internal-link.service';
2726

2827
import { toRemoteData } from '../../browse-by/browse-by-metadata/browse-by-metadata.component.spec';
2928
import { SearchManager } from '../../core/browse/search-manager';
@@ -36,6 +35,7 @@ import { DSOChangeAnalyzer } from '../../core/data/dso-change-analyzer.service';
3635
import { FindListOptions } from '../../core/data/find-list-options.model';
3736
import { PaginatedList } from '../../core/data/paginated-list.model';
3837
import { RemoteData } from '../../core/data/remote-data';
38+
import { InternalLinkService } from '../../core/services/internal-link.service';
3939
import {
4040
NativeWindowRef,
4141
NativeWindowService,

src/app/shared/carousel/carousel.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ import {
3939
switchMap,
4040
take,
4141
} from 'rxjs/operators';
42-
import { InternalLinkService } from 'src/app/core/services/internal-link.service';
4342

4443
import { SearchManager } from '../../core/browse/search-manager';
4544
import { SortOptions } from '../../core/cache/models/sort-options.model';
4645
import { BitstreamDataService } from '../../core/data/bitstream-data.service';
4746
import { PaginatedList } from '../../core/data/paginated-list.model';
4847
import { RemoteData } from '../../core/data/remote-data';
48+
import { InternalLinkService } from '../../core/services/internal-link.service';
4949
import {
5050
NativeWindowRef,
5151
NativeWindowService,

src/app/shared/explore/section-component/grid-section/grid-section.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service
3434
import { SearchService } from '../../../../core/shared/search/search.service';
3535
import { Site } from '../../../../core/shared/site.model';
3636
import { UUIDService } from '../../../../core/shared/uuid.service';
37-
import { getMockObjectCacheService } from '../../../../shared/mocks/object-cache.service.mock';
38-
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
39-
import { getMockUUIDService } from '../../../../shared/mocks/uuid.service.mock';
40-
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
4137
import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component';
38+
import { getMockObjectCacheService } from '../../../mocks/object-cache.service.mock';
39+
import { getMockRemoteDataBuildService } from '../../../mocks/remote-data-build.service.mock';
4240
import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock';
41+
import { getMockUUIDService } from '../../../mocks/uuid.service.mock';
42+
import { NotificationsService } from '../../../notifications/notifications.service';
4343
import { createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils';
4444
import { SearchResult } from '../../../search/models/search-result.model';
4545
import { GridSectionComponent } from './grid-section.component';

src/app/shared/explore/section-component/grid-section/grid-section.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ import {
2424
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
2525
import {
2626
BehaviorSubject,
27-
from,
28-
} from 'rxjs';
29-
import {
3027
filter,
28+
from,
3129
map,
3230
mergeMap,
3331
scan,
3432
switchMap,
3533
take,
36-
} from 'rxjs/operators';
34+
} from 'rxjs';
3735
import { getItemPageRoute } from 'src/app/item-page/item-page-routing-paths';
3836
import { BackgroundImageDirective } from 'src/app/shared/utils/background-image.directive';
3937

@@ -60,7 +58,6 @@ import { Site } from '../../../../core/shared/site.model';
6058
import { hasValue } from '../../../../shared/empty.util';
6159
import { SearchResult } from '../../../../shared/search/models/search-result.model';
6260
import { followLink } from '../../../../shared/utils/follow-link-config.model';
63-
import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component';
6461
import { PaginationComponentOptions } from '../../../pagination/pagination-component-options.model';
6562
import { PaginatedSearchOptions } from '../../../search/models/paginated-search-options.model';
6663

@@ -72,7 +69,6 @@ import { PaginatedSearchOptions } from '../../../search/models/paginated-search-
7269
templateUrl: './grid-section.component.html',
7370
styleUrls: ['./grid-section.component.scss'],
7471
imports: [
75-
ThemedThumbnailComponent,
7672
NgForOf,
7773
SlicePipe,
7874
AsyncPipe,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
4+
import { SharedModule } from '../shared.module';
5+
import { LinkSliderComponent } from './link-slider/link-slider.component';
6+
import { ThemedLinkSliderComponent } from './link-slider/themed-link-slider.component';
7+
import { ThumbnailSliderComponent } from './thumbnail-slider/thumbnail-slider.component';
8+
9+
const COMPONENTS = [
10+
ThemedLinkSliderComponent,
11+
LinkSliderComponent,
12+
ThumbnailSliderComponent,
13+
];
14+
15+
@NgModule({
16+
imports: [CommonModule, SharedModule],
17+
declarations: [
18+
...COMPONENTS,
19+
],
20+
exports: [...COMPONENTS],
21+
})
22+
/**
23+
* This module handles all components, providers and modules that are needed for the slider
24+
*/
25+
export class SliderModule {}

src/app/shared/slider/thumbnail-slider/thumbnail-slider.component.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ describe('ThumbnailSliderComponent', () => {
5454
{ provide: NativeWindowService, useValue: {} },
5555
{ provide: NativeWindowRef, useValue: {} },
5656
{ provide: SearchConfigurationService, useValue: { getConfigurationSearchConfig: () => of({ sortOptions: [] }) } },
57-
{
58-
provide: ActivatedRoute, useValue: {
59-
queryParamMap: of({}),
60-
},
61-
},
57+
{ provide: ActivatedRoute, useValue: {} },
6258
{ provide: RouteService, useValue: {} },
6359
{ provide: HALEndpointService, useValue: halService },
6460
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['generateRequestId', 'send']) },

0 commit comments

Comments
 (0)