Skip to content

Commit d74e672

Browse files
authored
Merge pull request DSpace#3056 from alexandrevryghem/minor-ui-improvements_contribute-main
Fixed item-edit.cy.ts regularly failing & minor UI improvements
2 parents 02e91dd + 56c786d commit d74e672

20 files changed

Lines changed: 46 additions & 70 deletions

File tree

cypress/e2e/item-edit.cy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ describe('Edit Item > Edit Metadata tab', () => {
1818
// <ds-edit-item-page> tag must be loaded
1919
cy.get('ds-edit-item-page').should('be.visible');
2020

21+
// wait for all the ds-dso-edit-metadata-value components to be rendered
22+
cy.get('ds-dso-edit-metadata-value div[role="row"]').each(($row: HTMLDivElement) => {
23+
cy.wrap($row).find('div[role="cell"]').should('be.visible');
24+
});
25+
2126
// Analyze <ds-edit-item-page> for accessibility issues
2227
testA11y('ds-edit-item-page');
2328
});

cypress/e2e/submission.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('New Submission page', () => {
137137

138138
// Upload our DSpace logo via drag & drop onto submission form
139139
// cy.get('div#section_upload')
140-
cy.get('div.ds-document-drop-zone').selectFile('src/assets/images/dspace-logo.png', {
140+
cy.get('div.ds-document-drop-zone').selectFile('src/assets/images/dspace-logo.svg', {
141141
action: 'drag-drop',
142142
});
143143

src/app/footer/footer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h5 class="text-uppercase">Footer Content</h5>
8484
</div>
8585
<div *ngIf="coarLdnEnabled$ | async" class="notify-enabled text-white">
8686
<a class="coar-notify-support-route" routerLink="info/coar-notify-support">
87-
<img class="n-coar" src="assets/images/n-coar.png" [attr.alt]="'menu.header.image.logo' | translate" />
87+
<img class="n-coar" src="assets/images/n-coar.svg" [attr.alt]="'menu.header.image.logo' | translate" />
8888
{{ 'footer.link.coar-notify-support' | translate }}
8989
</a>
9090
</div>
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<div class="container">
2-
<head>
3-
<title>{{ 'coar-notify-support.title' | translate }}</title>
4-
</head>
5-
<body>
6-
<h1>{{ 'coar-notify-support.title' | translate }}</h1>
7-
<p [innerHTML]="('coar-notify-support-title.content' | translate)"></p>
2+
<h1>{{ 'coar-notify-support.title' | translate }}</h1>
3+
<p [innerHTML]="'coar-notify-support-title.content' | translate"></p>
84

9-
<h2>{{ 'coar-notify-support.ldn-inbox.title' | translate }}</h2>
10-
<p [innerHTML]="('coar-notify-support.ldn-inbox.content' | translate).replace('{ldnInboxUrl}', generateCoarRestApiLinksHTML() | async)"></p>
5+
<h2>{{ 'coar-notify-support.ldn-inbox.title' | translate }}</h2>
6+
<p [innerHTML]="'coar-notify-support.ldn-inbox.content' | translate:{ ldnInboxUrl: coarRestApiUrls$ | async }"></p>
117

12-
<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
13-
<p>
14-
{{ 'coar-notify-support.message-moderation.content' | translate }}
15-
<a routerLink="/info/feedback" >{{ 'coar-notify-support.message-moderation.feedback-form' | translate }}</a>
16-
</p>
17-
</body>
8+
<h2>{{ 'coar-notify-support.message-moderation.title' | translate }}</h2>
9+
<p>
10+
{{ 'coar-notify-support.message-moderation.content' | translate }}
11+
<a routerLink="/info/feedback">{{ 'coar-notify-support.message-moderation.feedback-form' | translate }}</a>
12+
</p>
1813
</div>

src/app/info/notify-info/notify-info.component.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ describe('NotifyInfoComponent', () => {
1616
let notifyInfoServiceSpy: any;
1717

1818
beforeEach(async () => {
19-
notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', ['getCoarLdnLocalInboxUrls']);
19+
notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', {
20+
getCoarLdnLocalInboxUrls: of([]),
21+
});
2022

2123
await TestBed.configureTestingModule({
2224
imports: [TranslateModule.forRoot(), NotifyInfoComponent],
@@ -31,8 +33,7 @@ describe('NotifyInfoComponent', () => {
3133
beforeEach(() => {
3234
fixture = TestBed.createComponent(NotifyInfoComponent);
3335
component = fixture.componentInstance;
34-
component.coarRestApiUrl = of([]);
35-
spyOn(component, 'generateCoarRestApiLinksHTML').and.returnValue(of(''));
36+
component.coarRestApiUrls$ = of('');
3637
fixture.detectChanges();
3738
});
3839

src/app/info/notify-info/notify-info.component.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { TranslateModule } from '@ngx-translate/core';
88
import {
99
map,
1010
Observable,
11-
of,
1211
} from 'rxjs';
1312

1413
import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service';
@@ -31,26 +30,17 @@ export class NotifyInfoComponent implements OnInit {
3130
/**
3231
* Observable containing the COAR REST INBOX API URLs.
3332
*/
34-
coarRestApiUrl: Observable<string[]> = of([]);
33+
coarRestApiUrls$: Observable<string>;
3534

36-
constructor(private notifyInfoService: NotifyInfoService) {}
37-
38-
ngOnInit() {
39-
this.coarRestApiUrl = this.notifyInfoService.getCoarLdnLocalInboxUrls();
35+
constructor(
36+
protected notifyInfoService: NotifyInfoService,
37+
) {
4038
}
4139

42-
/**
43-
* Generates HTML code for COAR REST API links.
44-
* @returns An Observable that emits the generated HTML code.
45-
*/
46-
generateCoarRestApiLinksHTML() {
47-
return this.coarRestApiUrl.pipe(
48-
// transform the data into HTML
49-
map((urls) => {
50-
return urls.map(url => `
51-
<code><a href="${url}" target="_blank"><span class="api-url">${url}</span></a></code>
52-
`).join(',');
53-
}),
40+
ngOnInit() {
41+
this.coarRestApiUrls$ = this.notifyInfoService.getCoarLdnLocalInboxUrls().pipe(
42+
map((urls: string[]) => urls.map((url: string) => `<a href="${url}" target="_blank">${url}</a>`).join(', ')),
5443
);
5544
}
45+
5646
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container w-100 h-100">
22
<div class="text-center mt-5 row justify-content-center">
33
<div>
4-
<img class="mb-4 login-logo" src="assets/images/dspace-logo.png" alt="{{'repository.image.logo' | translate}}">
4+
<img class="mb-4 login-logo" src="assets/images/dspace-logo.svg" [alt]="'repository.image.logo' | translate">
55
<h1 class="h3 mb-0 font-weight-normal">{{"login.form.header" | translate}}</h1>
66
<ds-log-in
77
[isStandalonePage]="true"></ds-log-in>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container w-100 h-100">
22
<div class="text-center mt-5 row justify-content-md-center">
33
<div class="mx-auto">
4-
<img class="mb-4 login-logo" src="assets/images/dspace-logo.png">
4+
<img class="mb-4 login-logo" src="assets/images/dspace-logo.svg" [alt]="'repository.image.logo' | translate">
55
<h1 class="h3 mb-0 font-weight-normal">{{"logout.form.header" | translate}}</h1>
66
<ds-log-out></ds-log-out>
77
</div>

src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.source-logo {
22
max-height: var(--ds-header-logo-height);
3+
max-width: 100%;
4+
margin: auto;
35
}
46

57
.source-logo-container {

src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ <h1>{{ type + '.edit.head' | translate }}</h1>
1111
</div>
1212
</div>
1313
<div class="pt-2">
14-
<ul class="nav nav-tabs justify-content-start mb-2">
15-
<li *ngFor="let page of pages" class="nav-item">
16-
<a class="nav-link"
14+
<ul class="nav nav-tabs justify-content-start mb-2" role="tablist">
15+
<li *ngFor="let page of pages" class="nav-item" role="presentation">
16+
<a class="nav-link" role="tab"
17+
[attr.aria-selected]="page === currentPage"
1718
[ngClass]="{'active' : page === currentPage}"
1819
[routerLink]="['./' + page]"
1920
[attr.data-test]="page">

0 commit comments

Comments
 (0)