Skip to content

Commit b7e6850

Browse files
Mattia VianelliAndrea Barbasso
authored andcommitted
Merged in task/dspace-cris-2025_02_x/DSC-2650 (pull request DSpace#4299)
DSC-2650 Removed duplicated text and last updated date text, fixed repository name retrieval Approved-by: Andrea Barbasso
2 parents 2b43dc7 + 2e12735 commit b7e6850

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ <h2 class="mb-3">{{ 'info.end-user-agreement.head' | translate }}</h2>
55
<ds-markdown-viewer [value]="(userAgreementText$ | async)"></ds-markdown-viewer>
66
} @else {
77
<div class="default-agreement-content">
8-
<h1>{{ 'info.end-user-agreement.head' | translate }}</h1>
9-
<p><em>Last updated May 4, 2023</em></p>
108

119
<h2>Agreement to terms</h2>
12-
<p>These Terms of Use constitute a legally binding agreement made between you, whether personally or on behalf of an entity ("you") and {{ 'repository.title' | translate }} ("Company", "we", "us", or "our"), concerning your access to and use of this website as well as any other media form, media channel, mobile website or mobile application related, linked, or otherwise connected thereto (collectively, the "Site"). You agree that by accessing the Site, you have read, understood, and agreed to be bound by all of these Terms of Use and any future amendments thereof.</p>
10+
<p>These Terms of Use constitute a legally binding agreement made between you, whether personally or on behalf of an entity ("you") and {{ repositoryName$ | async }} ("Company", "we", "us", or "our"), concerning your access to and use of this website as well as any other media form, media channel, mobile website or mobile application related, linked, or otherwise connected thereto (collectively, the "Site"). You agree that by accessing the Site, you have read, understood, and agreed to be bound by all of these Terms of Use and any future amendments thereof.</p>
1311
<p>Supplemental terms and conditions or documents that may be posted on the Site from time to time are hereby expressly incorporated herein by reference. We reserve the right, in our sole discretion, to make changes or modifications to these Terms of Use at any time and for any reason. We will alert you about any changes by updating the "Last updated" date of these Terms of Use, and you waive any right to receive specific notice of each such change. Please ensure that you check the applicable Terms every time you use our Site so that you understand which Terms apply. You will be subject to, and will be deemed to have been made aware of and to have accepted, the changes in any revised Terms of Use by your continued use of the Site after the date such revised Terms of Use are posted.</p>
1412
<p>The information provided on the Site is not intended for distribution to or use by any person or entity in any jurisdiction or country where such distribution or use would be contrary to law or regulation or which would subject us to any registration requirement within such jurisdiction or country. Accordingly, those persons who choose to access the Site from other locations do so on their own initiative and are solely responsible for compliance with local laws, if and to the extent local laws are applicable.</p>
1513

src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ import {
1212
of,
1313
} from 'rxjs';
1414

15+
import { Root } from '../../../core/data/root.model';
16+
import { RootDataService } from '../../../core/data/root-data.service';
1517
import { SiteDataService } from '../../../core/data/site-data.service';
1618
import { LocaleService } from '../../../core/locale/locale.service';
1719
import { MathService } from '../../../core/shared/math.service';
1820
import { Site } from '../../../core/shared/site.model';
21+
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
1922
import { EndUserAgreementContentComponent } from './end-user-agreement-content.component';
2023

2124
describe('EndUserAgreementContentComponent', () => {
@@ -24,6 +27,7 @@ describe('EndUserAgreementContentComponent', () => {
2427

2528
let siteServiceStub: any;
2629
let localeServiceStub: any;
30+
let rootServiceStub: any;
2731

2832
const site: Site = Object.assign(new Site(), {
2933
metadata: {
@@ -38,6 +42,10 @@ describe('EndUserAgreementContentComponent', () => {
3842
},
3943
});
4044

45+
const root: Root = Object.assign(new Root(), {
46+
dspaceName: 'Test Repository',
47+
});
48+
4149
beforeEach(waitForAsync(() => {
4250

4351
localeServiceStub = {
@@ -50,11 +58,15 @@ describe('EndUserAgreementContentComponent', () => {
5058
return of(site);
5159
},
5260
};
61+
rootServiceStub = {
62+
findRoot: jasmine.createSpy('findRoot').and.returnValue(createSuccessfulRemoteDataObject$(root)),
63+
};
5364
TestBed.configureTestingModule({
5465
imports: [TranslateModule.forRoot(), EndUserAgreementContentComponent],
5566
providers: [{ provide: SiteDataService, useValue: siteServiceStub },
5667
{ provide: LocaleService, useValue: localeServiceStub },
5768
{ provide: MathService, useValue: {} },
69+
{ provide: RootDataService, useValue: rootServiceStub },
5870
],
5971
schemas: [NO_ERRORS_SCHEMA],
6072
})

src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,20 @@ import {
1212
import {
1313
BehaviorSubject,
1414
combineLatest,
15+
Observable,
1516
Subscription,
1617
} from 'rxjs';
17-
import { take } from 'rxjs/operators';
18+
import {
19+
map,
20+
take,
21+
} from 'rxjs/operators';
1822

23+
import { Root } from '../../../core/data/root.model';
24+
import { RootDataService } from '../../../core/data/root-data.service';
1925
import { SiteDataService } from '../../../core/data/site-data.service';
2026
import { LocaleService } from '../../../core/locale/locale.service';
2127
import { MetadatumViewModel } from '../../../core/shared/metadata.models';
28+
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
2229
import { isNotEmpty } from '../../../shared/empty.util';
2330
import { MarkdownViewerComponent } from '../../../shared/markdown-viewer/markdown-viewer.component';
2431

@@ -45,11 +52,14 @@ export class EndUserAgreementContentComponent implements OnInit, OnDestroy {
4552

4653
userAgreementText$: BehaviorSubject<string | null> = new BehaviorSubject(null);
4754

55+
repositoryName$: Observable<string>;
56+
4857
fallbackText = 'info.end-user-agreement.content.fallback';
4958

5059
constructor(private siteService: SiteDataService,
5160
private localeService: LocaleService,
5261
private translateService: TranslateService,
62+
private rootService: RootDataService,
5363
) {
5464
}
5565

@@ -58,6 +68,11 @@ export class EndUserAgreementContentComponent implements OnInit, OnDestroy {
5868
}
5969

6070
ngOnInit(): void {
71+
this.repositoryName$ = this.rootService.findRoot(true).pipe(
72+
getFirstSucceededRemoteDataPayload(),
73+
map((payload: Root) => payload.dspaceName),
74+
);
75+
6176
const site$ = this.siteService.find().pipe(take(1));
6277
this.subs.push(
6378
combineLatest([site$, this.localeService.getCurrentLanguageCode()]).subscribe(([site, langCode]) => {

0 commit comments

Comments
 (0)