Skip to content

Commit 2b3376d

Browse files
author
Andrea Barbasso
committed
Merged dspace-cris-2023_02_x into task/dspace-cris-2023_02_x/DSC-1794
2 parents af1bd74 + f81924c commit 2b3376d

85 files changed

Lines changed: 777 additions & 276 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/config.example.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ browseBy:
275275
fiveYearLimit: 30
276276
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
277277
defaultLowerLimit: 1900
278+
# Whether to add item badges to BOTH browse and search result lists.
279+
showLabels: true
278280
# If true, thumbnail images for items will be added to BOTH search and browse result lists.
279281
showThumbnails: true
282+
# Whether to add item thumbnail images to BOTH browse and search result lists.
283+
showMetrics: false
280284
# The number of entries in a paginated browse results list.
281285
# Rounded to the nearest size in the list of selectable sizes on the
282286
# settings menu.

src/app/app-routing.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
import { ServerCheckGuard } from './core/server-check/server-check.guard';
4444
import { MenuResolver } from './menu.resolver';
4545
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';
46+
import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard';
4647
import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths';
4748
import { RedirectService } from './redirect/redirect.service';
4849

@@ -99,7 +100,10 @@ import { RedirectService } from './redirect/redirect.service';
99100
path: FORGOT_PASSWORD_PATH,
100101
loadChildren: () => import('./forgot-password/forgot-password.module')
101102
.then((m) => m.ForgotPasswordModule),
102-
canActivate: [EndUserAgreementCurrentUserGuard]
103+
canActivate: [
104+
ForgotPasswordCheckGuard,
105+
EndUserAgreementCurrentUserGuard
106+
]
103107
},
104108
{
105109
path: COMMUNITY_MODULE_PATH,

src/app/core/data/feature-authorization/feature-id.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export enum FeatureID {
3636
CanEditItem = 'canEditItem',
3737
CanRegisterDOI = 'canRegisterDOI',
3838
CanSubscribe = 'canSubscribeDso',
39+
EPersonForgotPassword = 'epersonForgotPassword',
3940
ShowClaimItem = 'showClaimItem',
4041
CanCorrectItem = 'canCorrectItem',
4142
}

src/app/core/data/processes/process-data.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ export class ProcessDataService extends IdentifiableDataService<Process> impleme
123123
* @param processId The ID of the process
124124
*/
125125
getProcess(processId: string): Observable<RemoteData<Process>> {
126-
const href$ = this.getProcessEndpoint(processId);
127-
return this.findByHref(href$,false);
126+
return this.findById(processId, false);
128127
}
129128

130129
/**

src/app/core/layout/models/section.model.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export interface TopSection extends SectionComponent {
6060
componentType: 'top';
6161
numberOfItems: number;
6262
showThumbnails: boolean;
63+
template: TopSectionTemplateType;
6364
}
6465

6566
export interface SearchSection extends SectionComponent {
@@ -96,3 +97,10 @@ export interface TopSectionColumn {
9697
metadataField: string;
9798
titleKey: string;
9899
}
100+
101+
/**
102+
* Represents the type of template to use for the section
103+
*/
104+
export enum TopSectionTemplateType {
105+
DEFAULT = 'default', // CRIS default template
106+
}

src/app/core/locale/locale.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class LocaleService {
5353
this.routeService.getQueryParameterValue('lang').subscribe(lang => {
5454
if (lang && this.translate.getLangs().includes(lang)) {
5555
this.setCurrentLanguageCode(lang);
56+
this.routeService.removeQueryParam('lang');
5657
}
5758
});
5859
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Injectable } from '@angular/core';
2+
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
3+
import { Observable, of } from 'rxjs';
4+
import { AuthorizationDataService } from '../data/feature-authorization/authorization-data.service';
5+
import { FeatureID } from '../data/feature-authorization/feature-id';
6+
import {
7+
SingleFeatureAuthorizationGuard
8+
} from '../data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard';
9+
import { AuthService } from '../auth/auth.service';
10+
11+
@Injectable({
12+
providedIn: 'root'
13+
})
14+
/**
15+
* Guard that checks if the forgot-password feature is enabled
16+
*/
17+
export class ForgotPasswordCheckGuard extends SingleFeatureAuthorizationGuard {
18+
19+
constructor(
20+
protected readonly authorizationService: AuthorizationDataService,
21+
protected readonly router: Router,
22+
protected readonly authService: AuthService
23+
) {
24+
super(authorizationService, router, authService);
25+
}
26+
27+
getFeatureID(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<FeatureID> {
28+
return of(FeatureID.EPersonForgotPassword);
29+
}
30+
31+
}

src/app/core/services/route.service.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,23 @@ export class RouteService {
225225
}
226226
);
227227
}
228+
229+
/**
230+
* Remove a parameter from the current route
231+
* @param key The parameter name
232+
*/
233+
removeQueryParam(key: string) {
234+
let queryParams = { ...this.route.snapshot.queryParams };
235+
delete queryParams[key];
236+
237+
// Navigate to the same route with the updated queryParams
238+
this.router.navigate(
239+
[],
240+
{
241+
relativeTo: this.route,
242+
queryParams: queryParams,
243+
}
244+
);
245+
246+
}
228247
}

src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
<ds-themed-item-list-preview [item]="match"
4444
[object]="itemPreviewObject"
4545
[metadataList]="metadataList"
46+
[showLabel]="showLabel"
47+
[showMetrics]="showMetrics"
4648
[showThumbnails]="showThumbnails">
4749
</ds-themed-item-list-preview>
4850
<div class="offset-2">

src/app/explore-page/explore-page.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
1010
import { Observable, of } from 'rxjs';
1111
import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock';
1212
import { RemoteData } from '../core/data/remote-data';
13-
import { BrowseSection, FacetSection, SearchSection, Section, TopSection } from '../core/layout/models/section.model';
13+
import { BrowseSection, FacetSection, SearchSection, Section, TopSectionTemplateType, TopSection } from '../core/layout/models/section.model';
1414
import { SectionDataService } from '../core/layout/section-data.service';
1515
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
1616
import { ExplorePageComponent } from './explore-page.component';
@@ -37,6 +37,7 @@ describe('ExploreComponent', () => {
3737
numberOfItems: 5,
3838
titleKey: 'lastPublications',
3939
showThumbnails: false,
40+
template: TopSectionTemplateType.DEFAULT
4041
};
4142

4243
const searchComponent: SearchSection = {

0 commit comments

Comments
 (0)