Skip to content

Commit a49c8ca

Browse files
Merge remote-tracking branch 'upstream/main' into fix-enabling-video-mediaviewer-without-image-mediaviewer-main
# Conflicts: # src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts # src/app/item-page/media-viewer/media-viewer.component.html # src/app/item-page/simple/item-types/publication/publication.component.html # src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html
2 parents 83444fc + d0ccec9 commit a49c8ca

51 files changed

Lines changed: 6545 additions & 2678 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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
"sass-resources-loader": "^2.1.1",
199199
"ts-node": "^8.10.2",
200200
"typescript": "~4.5.5",
201-
"webpack": "^5.69.1",
201+
"webpack": "^5.76.0",
202202
"webpack-bundle-analyzer": "^4.4.0",
203203
"webpack-cli": "^4.2.0",
204204
"webpack-dev-server": "^4.5.0"

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ <h4>{{messagePrefix + '.edit' | translate}}</h4>
1313
[formGroup]="formGroup"
1414
[formLayout]="formLayout"
1515
[displayCancel]="false"
16+
[submitLabel]="submitLabel"
1617
(submitForm)="onSubmit()">
1718
<div before class="btn-group">
1819
<button (click)="onCancel()"
1920
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
2021
</div>
21-
<div between class="btn-group">
22+
<div *ngIf="displayResetPassword" between class="btn-group">
2223
<button class="btn btn-primary" [disabled]="!(canReset$ | async)" (click)="resetPassword()">
2324
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
2425
</button>

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
165165
*/
166166
isImpersonated = false;
167167

168+
/**
169+
* A boolean that indicate if to display EPersonForm's Rest password button
170+
*/
171+
displayResetPassword = false;
172+
173+
/**
174+
* A string that indicate the label of Submit button
175+
*/
176+
submitLabel = 'form.create';
168177
/**
169178
* Subscription to email field value change
170179
*/
@@ -188,6 +197,8 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
188197
this.epersonInitial = eperson;
189198
if (hasValue(eperson)) {
190199
this.isImpersonated = this.authService.isImpersonatingUser(eperson.id);
200+
this.displayResetPassword = true;
201+
this.submitLabel = 'form.submit';
191202
}
192203
}));
193204
}

src/app/app-routing.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
218218
{
219219
path: 'statistics',
220220
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
221-
.then((m) => m.StatisticsPageRoutingModule)
221+
.then((m) => m.StatisticsPageRoutingModule),
222+
canActivate: [EndUserAgreementCurrentUserGuard],
222223
},
223224
{
224225
path: HEALTH_PAGE_PATH,
@@ -228,7 +229,7 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
228229
{
229230
path: ACCESS_CONTROL_MODULE_PATH,
230231
loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule),
231-
canActivate: [GroupAdministratorGuard],
232+
canActivate: [GroupAdministratorGuard, EndUserAgreementCurrentUserGuard],
232233
},
233234
{
234235
path: 'subscriptions',

src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,15 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
151151
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
152152
this.browseId = params.id || this.defaultBrowseId;
153153
this.authority = params.authority;
154-
this.value = +params.value || params.value || '';
155-
this.startsWith = +params.startsWith || params.startsWith;
154+
155+
if (typeof params.value === 'string'){
156+
this.value = params.value.trim();
157+
}
158+
159+
if (typeof params.startsWith === 'string'){
160+
this.startsWith = params.startsWith.trim();
161+
}
162+
156163
if (isNotEmpty(this.value)) {
157164
this.updatePageWithItems(
158165
browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails), this.value, this.authority);
@@ -305,7 +312,7 @@ export function browseParamsToOptions(params: any,
305312
metadata,
306313
paginationConfig,
307314
sortConfig,
308-
+params.startsWith || params.startsWith,
315+
params.startsWith,
309316
params.scope,
310317
fetchThumbnail
311318
);

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

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,33 @@ describe('LocaleService test suite', () => {
6262
});
6363

6464
describe('getCurrentLanguageCode', () => {
65-
it('should return language saved on cookie', () => {
65+
beforeEach(() => {
66+
spyOn(translateService, 'getLangs').and.returnValue(langList);
67+
});
68+
69+
it('should return the language saved on cookie if it\'s a valid & active language', () => {
6670
spyOnGet.and.returnValue('de');
6771
expect(service.getCurrentLanguageCode()).toBe('de');
6872
});
6973

70-
describe('', () => {
71-
beforeEach(() => {
72-
spyOn(translateService, 'getLangs').and.returnValue(langList);
73-
});
74+
it('should return the default language if the cookie language is disabled', () => {
75+
spyOnGet.and.returnValue('disabled');
76+
expect(service.getCurrentLanguageCode()).toBe('en');
77+
});
7478

75-
it('should return language from browser setting', () => {
76-
spyOn(translateService, 'getBrowserLang').and.returnValue('it');
77-
expect(service.getCurrentLanguageCode()).toBe('it');
78-
});
79+
it('should return the default language if the cookie language does not exist', () => {
80+
spyOnGet.and.returnValue('does-not-exist');
81+
expect(service.getCurrentLanguageCode()).toBe('en');
82+
});
83+
84+
it('should return language from browser setting', () => {
85+
spyOn(translateService, 'getBrowserLang').and.returnValue('it');
86+
expect(service.getCurrentLanguageCode()).toBe('it');
87+
});
7988

80-
it('should return default language from config', () => {
81-
spyOn(translateService, 'getBrowserLang').and.returnValue('fr');
82-
expect(service.getCurrentLanguageCode()).toBe('en');
83-
});
89+
it('should return default language from config', () => {
90+
spyOn(translateService, 'getBrowserLang').and.returnValue('fr');
91+
expect(service.getCurrentLanguageCode()).toBe('en');
8492
});
8593
});
8694

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { map, mergeMap, take } from 'rxjs/operators';
1111
import { NativeWindowRef, NativeWindowService } from '../services/window.service';
1212
import { RouteService } from '../services/route.service';
1313
import { DOCUMENT } from '@angular/common';
14+
import { LangConfig } from '../../../config/lang-config.interface';
1415

1516
export const LANG_COOKIE = 'dsLanguage';
1617

@@ -52,8 +53,7 @@ export class LocaleService {
5253
getCurrentLanguageCode(): string {
5354
// Attempt to get the language from a cookie
5455
let lang = this.getLanguageCodeFromCookie();
55-
if (isEmpty(lang)) {
56-
// Cookie not found
56+
if (isEmpty(lang) || environment.languages.find((langConfig: LangConfig) => langConfig.code === lang && langConfig.active) === undefined) {
5757
// Attempt to get the browser language from the user
5858
if (this.translate.getLangs().includes(this.translate.getBrowserLang())) {
5959
lang = this.translate.getBrowserLang();

src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ds-themed-results-back-button *ngIf="showBackButton | async" [back]="back"></ds-themed-results-back-button>
22
<div class="d-flex flex-row">
3-
<ds-item-page-title-field [item]="object" class="mr-auto">
4-
</ds-item-page-title-field>
3+
<ds-themed-item-page-title-field [item]="object" class="mr-auto">
4+
</ds-themed-item-page-title-field>
55
<ds-dso-edit-menu></ds-dso-edit-menu>
66
</div>
77
<div class="row">

src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ds-themed-results-back-button *ngIf="showBackButton | async" [back]="back"></ds-themed-results-back-button>
22
<div class="d-flex flex-row">
3-
<ds-item-page-title-field [item]="object" class="mr-auto">
4-
</ds-item-page-title-field>
3+
<ds-themed-item-page-title-field [item]="object" class="mr-auto">
4+
</ds-themed-item-page-title-field>
55
<ds-dso-edit-menu></ds-dso-edit-menu>
66
</div>
77
<div class="row">

src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ds-themed-results-back-button *ngIf="showBackButton | async" [back]="back"></ds-themed-results-back-button>
22
<div class="d-flex flex-row">
3-
<ds-item-page-title-field [item]="object" class="mr-auto">
4-
</ds-item-page-title-field>
3+
<ds-themed-item-page-title-field [item]="object" class="mr-auto">
4+
</ds-themed-item-page-title-field>
55
<ds-dso-edit-menu></ds-dso-edit-menu>
66
</div>
77
<div class="row">

0 commit comments

Comments
 (0)