Skip to content

Commit ca5908e

Browse files
committed
fix after merge
1 parent d4df6b3 commit ca5908e

12 files changed

Lines changed: 108 additions & 144 deletions

File tree

src/app/menu.resolver.ts

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ import { MenuItemType } from './shared/menu/menu-item-type.model';
77
import { LinkMenuItemModel } from './shared/menu/menu-item/models/link.model';
88
import { getFirstCompletedRemoteData } from './core/shared/operators';
99
import { PaginatedList } from './core/data/paginated-list.model';
10-
import { BrowseDefinition } from './core/shared/browse-definition.model';
1110
import { RemoteData } from './core/data/remote-data';
1211
import { TextMenuItemModel } from './shared/menu/menu-item/models/text.model';
13-
import { BrowseService } from './core/browse/browse.service';
1412
import { MenuService } from './shared/menu/menu.service';
1513
import { filter, find, map, switchMap, take } from 'rxjs/operators';
1614
import { hasValue } from './shared/empty.util';
@@ -45,6 +43,8 @@ import {
4543
ScriptDataService
4644
} from './core/data/processes/script-data.service';
4745
import { environment } from '../environments/environment';
46+
import { SectionDataService } from './core/layout/section-data.service';
47+
import { Section } from './core/layout/models/section.model';
4848

4949
/**
5050
* Creates all of the app's menus
@@ -59,10 +59,10 @@ export class MenuResolver implements Resolve<boolean> {
5959
constructor(
6060
protected route: ActivatedRoute,
6161
protected menuService: MenuService,
62-
protected browseService: BrowseService,
6362
protected authorizationService: AuthorizationDataService,
6463
protected modalService: NgbModal,
6564
protected scriptDataService: ScriptDataService,
65+
protected sectionDataService: SectionDataService,
6666
) {
6767
}
6868

@@ -114,41 +114,28 @@ export class MenuResolver implements Resolve<boolean> {
114114
}
115115

116116
// Read the different Browse-By types from config and add them to the browse menu
117-
this.browseService.getBrowseDefinitions()
118-
.pipe(getFirstCompletedRemoteData<PaginatedList<BrowseDefinition>>())
119-
.subscribe((browseDefListRD: RemoteData<PaginatedList<BrowseDefinition>>) => {
120-
if (browseDefListRD.hasSucceeded) {
121-
browseDefListRD.payload.page.forEach((browseDef: BrowseDefinition) => {
122-
menuList.push({
123-
id: `browse_global_by_${browseDef.id}`,
124-
parentID: 'browse_global',
125-
active: false,
126-
visible: true,
127-
model: {
128-
type: MenuItemType.LINK,
129-
text: `menu.section.browse_global_by_${browseDef.id}`,
130-
link: `/browse/${browseDef.id}`
131-
} as LinkMenuItemModel
132-
});
117+
this.sectionDataService.findVisibleSections().pipe(
118+
getFirstCompletedRemoteData()
119+
).subscribe( (sectionDefListRD: RemoteData<PaginatedList<Section>>) => {
120+
if (sectionDefListRD.hasSucceeded) {
121+
sectionDefListRD.payload.page.forEach((section) => {
122+
menuList.push({
123+
id: `explore_${section.id}`,
124+
active: false,
125+
visible: true,
126+
model: {
127+
type: MenuItemType.LINK,
128+
text: `menu.section.explore_${section.id}`,
129+
link: `/explore/${section.id}`
130+
} as LinkMenuItemModel
133131
});
134-
menuList.push(
135-
/* Browse */
136-
{
137-
id: 'browse_global',
138-
active: false,
139-
visible: true,
140-
index: 1,
141-
model: {
142-
type: MenuItemType.TEXT,
143-
text: 'menu.section.browse_global'
144-
} as TextMenuItemModel,
145-
}
146-
);
147-
}
148-
menuList.forEach((menuSection) => this.menuService.addSection(MenuID.PUBLIC, Object.assign(menuSection, {
149-
shouldPersistOnRouteChange: true
150-
})));
151-
});
132+
133+
});
134+
}
135+
menuList.forEach((menuSection) => this.menuService.addSection(MenuID.PUBLIC, Object.assign(menuSection, {
136+
shouldPersistOnRouteChange: true
137+
})));
138+
});
152139

153140
this.createStatisticsMenu();
154141
return this.waitForMenu$(MenuID.PUBLIC);

src/app/openaire/reciter-suggestions/suggestions-popup/suggestions-popup.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-
44
import { NotificationsService } from '../../../shared/notifications/notifications.service';
55
import { SuggestionsService } from '../suggestions.service';
66
import { takeUntil } from 'rxjs/operators';
7-
import { OpenaireSuggestionTarget } from '../../../core/openaire/reciter-suggestions/models/openaire-suggestion-target.model';
7+
import {
8+
OpenaireSuggestionTarget
9+
} from '../../../core/openaire/reciter-suggestions/models/openaire-suggestion-target.model';
810
import { isNotEmpty } from '../../../shared/empty.util';
911
import { combineLatest, Subject } from 'rxjs';
1012

@@ -40,7 +42,7 @@ export class SuggestionsPopupComponent implements OnInit, OnDestroy {
4042
if (!visited) {
4143
suggestions.forEach((suggestionTarget: OpenaireSuggestionTarget) => this.showNotificationForNewSuggestions(suggestionTarget));
4244
this.reciterSuggestionStateService.dispatchMarkUserSuggestionsAsVisitedAction();
43-
notifier.next();
45+
notifier.next(null);
4446
notifier.complete();
4547
}
4648
}

src/app/root.module.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ import { HeaderComponent } from './header/header.component';
1616
import { NavbarModule } from './navbar/navbar.module';
1717
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
1818
import { NotificationComponent } from './shared/notifications/notification/notification.component';
19-
import {
20-
NotificationsBoardComponent
21-
} from './shared/notifications/notifications-board/notifications-board.component';
19+
import { NotificationsBoardComponent } from './shared/notifications/notifications-board/notifications-board.component';
2220
import { SharedModule } from './shared/shared.module';
2321
import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component';
2422
import { ForbiddenComponent } from './forbidden/forbidden.component';
@@ -28,29 +26,29 @@ import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.
2826
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
2927
import { ThemedHeaderComponent } from './header/themed-header.component';
3028
import { ThemedBreadcrumbsComponent } from './breadcrumbs/themed-breadcrumbs.component';
31-
import {
32-
ThemedHeaderNavbarWrapperComponent
33-
} from './header-nav-wrapper/themed-header-navbar-wrapper.component';
29+
import { ThemedHeaderNavbarWrapperComponent } from './header-nav-wrapper/themed-header-navbar-wrapper.component';
3430
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
3531
import {
3632
ThemedPageInternalServerErrorComponent
3733
} from './page-internal-server-error/themed-page-internal-server-error.component';
38-
import {
39-
PageInternalServerErrorComponent
40-
} from './page-internal-server-error/page-internal-server-error.component';
34+
import { PageInternalServerErrorComponent } from './page-internal-server-error/page-internal-server-error.component';
4135
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';
4236
import { PageErrorComponent } from './page-error/page-error.component';
4337
import {
4438
ProcessNotificationComponent
4539
} from './shared/notifications/process-notification/process-notification.component';
4640
import { FooterModule } from './footer/footer.module';
4741
import { SocialModule } from './social/social.module';
42+
import { ExploreModule } from './shared/explore/explore.module';
4843

4944
const IMPORTS = [
5045
CommonModule,
5146
SharedModule.withEntryComponents(),
5247
NavbarModule,
5348
NgbModule,
49+
ExploreModule,
50+
FooterModule,
51+
SocialModule
5452
];
5553

5654
const PROVIDERS = [
@@ -88,9 +86,7 @@ const EXPORTS = [
8886

8987
@NgModule({
9088
imports: [
91-
...IMPORTS,
92-
FooterModule,
93-
SocialModule
89+
...IMPORTS
9490
],
9591
providers: [
9692
...PROVIDERS

src/app/shared/explore/section-component/text-section/text-section.component.scss

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,6 @@
22
display: block;
33
margin-top: calc(var(--ds-content-spacing) * -1);
44

5-
.background-image {
6-
color: white;
7-
background-color: var(--bs-info);
8-
position: relative;
9-
background-image: url('/assets/dspace/images/banner.jpg');
10-
background-size: cover;
11-
margin-left: calc(50% - 50vw);
12-
margin-right: calc(50% - 50vw);
13-
14-
.container {
15-
position: relative;
16-
text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
17-
18-
&:before, &:after {
19-
content: '';
20-
display: block;
21-
width: var(--ds-banner-background-gradient-width);
22-
height: 100%;
23-
top: 0;
24-
position: absolute;
25-
}
26-
27-
&:before {
28-
background: linear-gradient(to left, var(--ds-banner-text-background), transparent);
29-
left: calc(-1 * var(--ds-banner-background-gradient-width));
30-
31-
}
32-
33-
&:after {
34-
background: linear-gradient(to right, var(--ds-banner-text-background), transparent);
35-
right: calc(-1 * var(--ds-banner-background-gradient-width));
36-
}
37-
38-
background-color: var(--ds-banner-text-background);
39-
}
40-
41-
42-
small.credits {
43-
a {
44-
color: inherit;
45-
}
46-
47-
opacity: 0.3;
48-
position: absolute;
49-
right: var(--bs-spacer);
50-
bottom: 0;
51-
}
52-
}
53-
545
.jumbotron {
556
background-color: transparent;
567
}

src/app/shared/metric/metric-loader/base-embedded-metric.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export abstract class BaseEmbeddedMetricComponent extends BaseMetricComponent im
7474
try {
7575
this.applyScript();
7676
this.success = true;
77-
notifier.next();
77+
notifier.next(null);
7878
notifier.complete();
7979
} catch (error) {
8080
console.log('Error applying script for ' + this.metric.metricType + '. Retry');

src/app/social/social.module.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
import { SocialComponent } from './social.component';
5+
6+
@NgModule({
7+
declarations: [
8+
SocialComponent
9+
],
10+
imports: [
11+
CommonModule
12+
],
13+
exports: [
14+
SocialComponent
15+
]
16+
})
17+
export class SocialModule { }

src/themes/custom/eager-theme.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import { NavbarModule } from '../../app/navbar/navbar.module';
1212
import { PublicationComponent } from './app/item-page/simple/item-types/publication/publication.component';
1313
import { ItemPageModule } from '../../app/item-page/item-page.module';
1414
import { FooterComponent } from './app/footer/footer.component';
15+
import { FooterModule } from '../../app/footer/footer.module';
16+
import { ExploreModule } from '../../app/shared/explore/explore.module';
17+
import { ContextMenuModule } from '../../app/shared/context-menu/context-menu.module';
18+
import { MiradorViewerModule } from '../../app/item-page/mirador-viewer/mirador-viewer.module';
1519

1620
/**
1721
* Add components that use a custom decorator to ENTRY_COMPONENTS as well as DECLARATIONS.
@@ -39,6 +43,10 @@ const DECLARATIONS = [
3943
RootModule,
4044
NavbarModule,
4145
ItemPageModule,
46+
ContextMenuModule,
47+
FooterModule,
48+
ExploreModule,
49+
MiradorViewerModule,
4250
],
4351
declarations: DECLARATIONS,
4452
providers: [

src/themes/custom/lazy-theme.module.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ import { PageNotFoundComponent } from './app/pagenotfound/pagenotfound.component
5757
import { ObjectNotFoundComponent } from './app/lookup-by-id/objectnotfound/objectnotfound.component';
5858
import { ForbiddenComponent } from './app/forbidden/forbidden.component';
5959
import { PrivacyComponent } from './app/info/privacy/privacy.component';
60-
import { CollectionStatisticsPageComponent } from './app/statistics-page/collection-statistics-page/collection-statistics-page.component';
61-
import { CommunityStatisticsPageComponent } from './app/statistics-page/community-statistics-page/community-statistics-page.component';
60+
import {
61+
CollectionStatisticsPageComponent
62+
} from './app/statistics-page/collection-statistics-page/collection-statistics-page.component';
63+
import {
64+
CommunityStatisticsPageComponent
65+
} from './app/statistics-page/community-statistics-page/community-statistics-page.component';
6266
import { ItemStatisticsPageComponent } from './app/statistics-page/item-statistics-page/item-statistics-page.component';
6367
import { SiteStatisticsPageComponent } from './app/statistics-page/site-statistics-page/site-statistics-page.component';
6468
import { CommunityPageComponent } from './app/community-page/community-page.component';
@@ -74,10 +78,16 @@ import { ProfilePageComponent } from './app/profile-page/profile-page.component'
7478
import { RegisterEmailComponent } from './app/register-page/register-email/register-email.component';
7579
import { MyDSpacePageComponent } from './app/my-dspace-page/my-dspace-page.component';
7680
import { SubmissionEditComponent } from './app/submission/edit/submission-edit.component';
77-
import { SubmissionImportExternalComponent } from './app/submission/import-external/submission-import-external.component';
81+
import {
82+
SubmissionImportExternalComponent
83+
} from './app/submission/import-external/submission-import-external.component';
7884
import { SubmissionSubmitComponent } from './app/submission/submit/submission-submit.component';
79-
import { WorkflowItemDeleteComponent } from './app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component';
80-
import { WorkflowItemSendBackComponent } from './app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component';
85+
import {
86+
WorkflowItemDeleteComponent
87+
} from './app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component';
88+
import {
89+
WorkflowItemSendBackComponent
90+
} from './app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component';
8191
import { BreadcrumbsComponent } from './app/breadcrumbs/breadcrumbs.component';
8292
import { FeedbackComponent } from './app/info/feedback/feedback.component';
8393
import { CommunityListComponent } from './app/community-list-page/community-list/community-list.component';
@@ -87,6 +97,7 @@ import { BrowseMostElementsComponent } from './app/browse-most-elements/browse-m
8797
import { MiradorViewerModule } from '../../app/item-page/mirador-viewer/mirador-viewer.module';
8898
import { ExploreModule } from '../../app/shared/explore/explore.module';
8999
import { FooterModule } from '../../app/footer/footer.module';
100+
import { SocialModule } from '../../app/social/social.module';
90101

91102

92103
const DECLARATIONS = [
@@ -183,7 +194,8 @@ const DECLARATIONS = [
183194
CrisStatisticsPageModule,
184195
MiradorViewerModule,
185196
FooterModule,
186-
ExploreModule
197+
ExploreModule,
198+
SocialModule
187199
],
188200
declarations: DECLARATIONS,
189201
})

src/themes/dspace/app/home-page/home-news/home-news.component.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
<div class="background-image">
1+
<div class="background-image-container">
22
<div class="container">
33
<div class="jumbotron jumbotron-fluid">
44
<ds-themed-text-section *ngIf="hasHomeNewsMetadata; else dsDefaultHomeNews" [sectionId]="'site'" [textRowSection]="homeNewsSection"
5-
[site]="(site$ | async)"></ds-themed-text-section>
5+
[site]="(site$ | async)"></ds-themed-text-section>
66
</div>
77
</div>
8-
<small class="credits">Photo by
9-
<a href="https://www.pexels.com/@inspiredimages">@inspiredimages</a>
10-
</small>
8+
<picture class="background-image">
9+
<source type="image/webp" srcset="assets/dspace/images/banner.webp 2000w, assets/dspace/images/banner-half.webp 1200w, assets/dspace/images/banner-tall.webp 768w">
10+
<source type="image/jpg" srcset="assets/dspace/images/banner.jpg 2000w, assets/dspace/images/banner-half.jpg 1200w, assets/dspace/images/banner-tall.jpg 768w">
11+
<img alt="" [src]="'assets/dspace/images/banner.jpg'"/><!-- without the []="''" Firefox downloads both the fallback and the resolved image -->
12+
</picture>
13+
<small class="credits">Photo by <a href="https://www.pexels.com/@inspiredimages">@inspiredimages</a></small>
1114
</div>
1215

1316
<ng-template #dsDefaultHomeNews>
@@ -41,4 +44,4 @@ <h1 class="display-3">DSpace-CRIS 7</h1>
4144
<p>Join the international community of
4245
<a href="https://wiki.lyrasis.org/display/DSPACECRIS/DSpace-CRIS+Users" target="_blank">leading institutions using DSpace-CRIS</a>.</p>
4346

44-
</ng-template>
47+
</ng-template>

src/themes/dspace/app/home-page/home-news/home-news.component.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,3 @@
7171
}
7272
}
7373

74-

0 commit comments

Comments
 (0)