Skip to content

Commit 9a60f56

Browse files
Scroll button + texts (#127)
* update version * fix and enhance translations to en, ca and es * home: remove outdated texts * home: make the "scroll" button go down to the login button, and change its text to "Scroll to see more and sign in" * add comments * home: align-text * i18n: small enhancements * update changelog * i18n: simplify sentence
1 parent c91bea6 commit 9a60f56

File tree

9 files changed

+84
-78
lines changed

9 files changed

+84
-78
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.1.5](https://github.com/in2workspace/in2-issuer-ui/releases/tag/v2.1.5)
8+
### Fixed
9+
- English grammar and clarity firxes in home and credential offer stepper pages.
10+
11+
### Removed
12+
- Outdated text in home page.
13+
714
## [2.1.4](https://github.com/in2workspace/in2-issuer-ui/releases/tag/v2.1.4)
815
### Changed
916
- Removed hardcoded "DOME" references.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eudistack-issuer-ui",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

src/app/features/home/home.component.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<div class="landing-page">
22
<div class="container-nav">
3+
<!-- HEADER BANNER -->
4+
<!-- HEADER INTEGRATED NAVBAR -->
35
<header class="main-header">
46
<nav class="navbar">
57
<div class="navbar-brand" href="/">
@@ -19,16 +21,18 @@
1921
</nav>
2022
</header>
2123

24+
<!-- HEADER TITLE AND SCROLL BUTTON SECTION -->
2225
<section class="cover" id="cover">
2326
<div class="cover-content">
2427
<h1>{{ "home.title" | translate }}</h1>
28+
<!-- SCROLL BUTTON -->
2529
<div class="scroll-indicator">
2630
<a class="btn btn-primary" [href]="knowledge_base_url" target="_blank" rel="noopener noreferrer" tabindex="0">
2731
{{ "home.learn-more" | translate }}
2832
<img src="../../../assets/icons/arrow-right.png" alt="arrow">
2933
</a>
3034
<p class="scroller">{{ "home.scroll" | translate }}</p>
31-
<a class="btn btn-link" (click)="navigateToSection('about-section')">
35+
<a class="btn btn-link" (click)="scrollToLoginSection()">
3236
<svg
3337
xmlns="http://www.w3.org/2000/svg"
3438
width="64"
@@ -64,38 +68,33 @@ <h1>{{ "home.title" | translate }}</h1>
6468
</div>
6569
</section>
6670
</div>
71+
<!-- END HEADER BANNER -->
6772

68-
<section id="about-section" class="content-section">
73+
<!-- CONTENT SECTION -->
74+
<section class="content-section">
6975
<div class="content-wrapper">
7076
<p>
7177
{{ "home.intro-main" | translate }}
7278
</p>
7379
<ul>
74-
<li [innerHTML]="'home.intro-first' | translate">
75-
76-
</li>
77-
<li [innerHTML]="'home.intro-second' | translate">
78-
</li>
80+
<!-- we need 'innerHTML' because we are using <b> for styles -->
81+
<li [innerHTML]="'home.intro-first' | translate"></li>
82+
<li [innerHTML]="'home.intro-second' | translate"></li>
7983
</ul>
8084
</div>
8185
</section>
8286

83-
<section class="content-section">
87+
<!-- LOGIN SECTION -->
88+
<section id="login-section" #loginSection class="content-section">
8489
<div class="legal-representative">
85-
<p>
90+
<p class="legal-first-text">
8691
{{ "home.legal-first" | translate }}
8792
</p>
88-
<p>
89-
{{ "home.legal-second" | translate }}
90-
</p>
91-
<p>
92-
{{ "home.legal-third" | translate }}
93-
</p>
9493
<a class="btn-secondary" tabindex="0" (click)="login()">{{ "home.login-btn" | translate}}</a>
95-
9694
</div>
9795
</section>
9896

97+
<!-- "GO TO WALLET" SECTION -->
9998
<section class="content-section wallet-section">
10099
<div class="wallet-info-container">
101100
<div class="wallet-info-qr">
@@ -112,6 +111,7 @@ <h2>{{ "home.obtain-wallet-title" | translate }}</h2>
112111
</div>
113112
</section>
114113

114+
<!-- FOOTER -->
115115
<footer class="main-footer">
116116
<span>
117117
<p>

src/app/features/home/home.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@
161161
margin-left: auto;
162162
margin-right: auto;
163163

164+
p.legal-first-text{
165+
text-align: center;
166+
}
167+
164168
.btn-secondary {
165169
width: 100%;
166170
max-width: 16rem;
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
22
import { HomeComponent } from './home.component';
33
import { Router } from '@angular/router';
44
import { AuthService } from 'src/app/core/services/auth.service';
55
import { environment } from 'src/environments/environment';
6-
import { QRCodeModule } from 'angularx-qrcode';
76
import { TranslateModule, TranslateService } from '@ngx-translate/core';
87

98
describe('HomeComponent', () => {
109
let component: HomeComponent;
10+
let fixture: ComponentFixture<HomeComponent>;
1111
let router: jest.Mocked<Router>;
1212
let authService: jest.Mocked<AuthService>;
1313

@@ -22,15 +22,19 @@ describe('HomeComponent', () => {
2222
} as unknown as jest.Mocked<AuthService>;
2323

2424
TestBed.configureTestingModule({
25-
imports: [QRCodeModule, TranslateModule.forRoot({})],
25+
imports: [
26+
HomeComponent,
27+
TranslateModule.forRoot({}),
28+
],
2629
providers: [
2730
TranslateService,
2831
{ provide: Router, useValue: routerMock },
2932
{ provide: AuthService, useValue: authServiceMock },
3033
],
3134
});
3235

33-
component = TestBed.createComponent(HomeComponent).componentInstance;
36+
fixture = TestBed.createComponent(HomeComponent);
37+
component = fixture.componentInstance;
3438
router = TestBed.inject(Router) as jest.Mocked<Router>;
3539
authService = TestBed.inject(AuthService) as jest.Mocked<AuthService>;
3640
});
@@ -40,11 +44,13 @@ describe('HomeComponent', () => {
4044
});
4145

4246
it('should get logo source', () => {
43-
expect(component.logoSrc).toBe("../../../assets/logos/" + environment.customizations.logo_src);
47+
expect(component.logoSrc).toBe(
48+
'../../../assets/logos/' + environment.customizations.logo_src,
49+
);
4450
});
4551

4652
it('should set walletUrl and knowledge_base_url from environment', () => {
47-
expect(component.walletUrl).toBe(environment.wallet_url);
53+
expect(component.walletUrl).toBe(environment.wallet_url ?? '');
4854
expect(component.knowledge_base_url).toBe(environment.knowledge_base_url);
4955
});
5056

@@ -59,23 +65,17 @@ describe('HomeComponent', () => {
5965
expect(router.navigate).toHaveBeenCalledWith(['/login']);
6066
});
6167

62-
it('should scroll to the specified section when navigateToSection is called', () => {
68+
it('should scroll to login section when scrollToLoginSection() is called', () => {
6369
const scrollIntoViewMock = jest.fn();
64-
jest.spyOn(document, 'getElementById').mockReturnValue({
65-
scrollIntoView: scrollIntoViewMock,
66-
} as unknown as HTMLElement);
6770

68-
const sectionId = 'section1';
69-
component.navigateToSection(sectionId);
70-
expect(document.getElementById).toHaveBeenCalledWith(sectionId);
71-
expect(scrollIntoViewMock).toHaveBeenCalledWith({ behavior: 'smooth' });
72-
});
71+
component.loginSection = {
72+
nativeElement: {
73+
scrollIntoView: scrollIntoViewMock,
74+
} as unknown as HTMLElement,
75+
} as any;
7376

74-
it('should do nothing if the section ID is not found', () => {
75-
jest.spyOn(document, 'getElementById').mockReturnValue(null);
77+
component.scrollToLoginSection();
7678

77-
const sectionId = 'nonexistent-section';
78-
component.navigateToSection(sectionId);
79-
expect(document.getElementById).toHaveBeenCalledWith(sectionId);
79+
expect(scrollIntoViewMock).toHaveBeenCalledWith({ behavior: 'smooth' });
8080
});
8181
});

src/app/features/home/home.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, inject } from '@angular/core';
1+
import { Component, ElementRef, inject, ViewChild } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { AuthService } from 'src/app/core/services/auth.service';
44
import { environment } from 'src/environments/environment';
@@ -13,6 +13,7 @@ import { TranslatePipe } from '@ngx-translate/core';
1313
imports: [QRCodeModule, TranslatePipe],
1414
})
1515
export class HomeComponent{
16+
@ViewChild('loginSection') loginSection!: ElementRef<HTMLElement>;
1617
public walletUrl = environment.wallet_url ?? '';
1718
public knowledge_base_url = environment.knowledge_base_url;
1819
public readonly logoSrc = "../../../assets/logos/" + environment.customizations.logo_src;
@@ -29,8 +30,8 @@ export class HomeComponent{
2930
this.router.navigate(['/login']);
3031
}
3132

32-
public navigateToSection(sectionId: string): void {
33-
document.getElementById(sectionId)?.scrollIntoView({ behavior: 'smooth' });
33+
public scrollToLoginSection(): void {
34+
this.loginSection.nativeElement.scrollIntoView({ behavior: 'smooth' });
3435
}
3536

3637
}

src/assets/i18n/ca.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
"home": {
77
"title": "Benvingut a l'Issuer de LEAR Credentials ",
88
"learn-more": "Més informació",
9-
"scroll": "Desplaça't per veure més",
10-
"intro-main": "Aquest lloc està destinat als Representants Legals d'empreses que vulguin emetre una o més LEAR Credentials per a un o més empleats de l'empresa. Una LEAR Credential és un tipus de Credencial Verificable que permet a un empleat, designat per un representant legal, actuar en nom d'una organització amb un poder restringit envers tercers.",
11-
"intro-first": "L'emissor de la LEAR Credential <strong>ha de ser un representant legal</strong> de l'empresa. El representant legal signarà la LEAR Credential amb un certificat digital eIDAS, que pot ser personal o un certificat de representació.",
12-
"intro-second": "El receptor de la LEAR Credential (tant el subjecte com el titular de la credencial) <strong>pot ser qualsevol empleat (o contractista)</strong> de l'empresa. El representant legal delegarà un conjunt restringit de poders a aquesta persona. Aquests poders restringits estan inclosos dins la credencial i poden ser verificats per qualsevol tercera part que el titular presenti la LEAR Credential.",
9+
"scroll": "Desplaça't per saber-ne més i iniciar sessió",
10+
"intro-main": "Aquest lloc està destinat als Representants Legals d'empreses que vulguin emetre una o més LEAR Credentials per als seus empleats. Una LEAR Credential és un tipus de Credencial Verificable que permet a un empleat, designat per un representant legal, actuar en nom d'una organització amb poders restringits envers tercers.",
11+
"intro-first": "L'emissor de la LEAR Credential <strong>ha de ser un representant legal</strong> de l'empresa.",
12+
"intro-second": "El receptor de la LEAR Credential (tant el subjecte com el titular de la credencial) <strong>pot ser qualsevol empleat (o contractista)</strong> de l'empresa. El representant legal delegarà un conjunt restringit de poders a aquesta persona. Aquests poders restringits estan inclosos dins la credencial i poden ser verificats per qualsevol tercera part a qui el titular presenti la LEAR Credential.",
1313
"legal-first": "Has de ser un representant legal de l'empresa per poder delegar poders.",
14-
"legal-second": "Necessites un certificat eIDAS per poder utilitzar el sistema. A més, hauràs de registrar el correu electrònic de la teva empresa.",
15-
"legal-third": "Nota: si estàs llegint això al teu mòbil, probablement el botó no funcionarà, a menys que tinguis instal·lat el teu certificat eIDAS al mòbil. Normalment cal utilitzar un ordinador amb el certificat instal·lat al navegador.",
1614
"login-btn": "Inicia sessió com a Representant Legal",
17-
"obtain-wallet-title": "Obté la teva cartera",
18-
"obtain-wallet-intro": "Necessites un Wallet per emmagatzemar les teves LEAR Credentials i presentar-les a tercers.",
19-
"obtain-wallet-detail": "Proporcionem una cartera senzilla suficient per autenticar-se i dur a terme tots els processos necessaris.",
20-
"wallet-instructions": "Escaneja aquest codi QR o ves al teu mòbil a",
15+
"obtain-wallet-title": "Obtingues el teu wallet",
16+
"obtain-wallet-intro": "Necessites un wallet digital per emmagatzemar les teves LEAR Credentials i presentar-les a tercers.",
17+
"obtain-wallet-detail": "Proporcionem un wallet senzill, suficient per autenticar-te als nostres serveis i dur a terme tots els processos necessaris.",
18+
"wallet-instructions": "Escaneja aquest codi QR o, des del teu mòbil, ves a",
2119
"footer-license": "CC BY 4.0",
2220
"footer-privacy": "Política de Privacitat"
2321
},
@@ -154,7 +152,7 @@
154152
"environment-wallet": "Wallet de l'entorn",
155153
"first-assistance": "Consulta la ",
156154
"second-assistance": " per a més assistència.",
157-
"wallet-guide": "Guia d'Usuaris del Wallet",
155+
"wallet-guide": "Guia d'Usuari del Wallet",
158156
"expired-title": "Expiració d'oferta de credencial",
159157
"ask-refresh": "L'oferta de credencial està a punt d'expirar. Vols refrescar-la o sortir? Si expira, n'hauràs de demanar una altra al teu representant legal.",
160158
"remaining-time": "Temps restant:",
@@ -166,7 +164,7 @@
166164
"title": "Escaneja el codi QR per obtenir la credencial.",
167165
"directly": "directament",
168166
"test-purposes": "Per a propòsits de prova, obtén la Credencial Verificable amb la ",
169-
"refresh-text": "Tens problemes per obtenir la credencial amb la Wallet?",
167+
"refresh-text": "Tens problemes per obtenir la credencial amb el Wallet?",
170168
"refresh-link": "Obtingues una nova oferta de credencial"
171169
}
172170
},

src/assets/i18n/en.json

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@
77
"home": {
88
"title": "Welcome to the Issuer for LEAR Credentials",
99
"learn-more": "Learn more",
10-
"scroll": "Scroll to see more",
11-
"intro-main": "This site is intended for Legal Representatives of companies who want to issue one or more LEAR Credentials to one or more employees of the company. A LEAR Credential is a type of Verifiable Credential which enables an employee, nominated by a legal representative, to act on behalf of an organisation with restricted power with respect to third-parties.",
12-
"intro-first": "The issuer of the LEAR Credential <strong>must be a legal representative</strong> of the company. The legal representative will sign the LEAR Credential with an eIDAS digital certificate, which can be either a personal one or a certificate of representation.",
13-
"intro-second": "The receiver of the LEARC redential (both the subject and holder of the credential) <strong>can be any employee (or contractor)</strong> of the company. The legal representative will delegate a restricted set of power to that person. Those restricted power are included inside the credential and can be verified by any Relying party to whom the holder presents the LEAR Credential.",
14-
"legal-first": "You must be a legal representative of the company to be able to delegate power.",
15-
"legal-second": "You need an eIDAS certificate to be able to use the system. In additionyou will have to register your company email.",
16-
"legal-third": "Note: if you are reading this in your mobile, most probably the button will not work, unless you have installed your eIDAS certificate in the mobile. You typically need to use a PC, with the certificate installed in the browser.",
10+
"scroll": "Scroll to see more and sign in",
11+
"intro-main": "This site is intended for Legal Representatives of companies who want to issue LEAR Credentials to their employees. A LEAR Credential is a type of Verifiable Credential that enables an employee, nominated by a legal representative, to act on behalf of an organisation with restricted powers towards third parties.",
12+
"intro-first": "The issuer of the LEAR Credential <strong>must be a legal representative</strong> of the company.",
13+
"intro-second": "The receiver of the LEAR Credential (both the subject and the holder of the credential) <strong>can be any employee (or contractor)</strong> of the company. The legal representative will delegate a restricted set of powers to that person. These restricted powers are included in the credential and can be verified by any relying party to whom the holder presents the LEAR Credential.",
14+
"legal-first": "You must be a legal representative of the company to be able to delegate powers.",
1715
"login-btn": "Login as Legal Representative",
18-
"obtain-wallet-title": "Obtain your wallet",
19-
"obtain-wallet-intro": "You need a wallet to store your LEAR Credentials and present them to Relying parties.",
20-
"obtain-wallet-detail": "We provide a simple wallet enough for authenticating across our services and performing all needed processes.",
21-
"wallet-instructions": "Scan this QR code or go in your mobile to",
16+
"obtain-wallet-title": "Get your wallet",
17+
"obtain-wallet-intro": "You need a digital wallet to store your LEAR Credentials and present them to relying parties.",
18+
"obtain-wallet-detail": "We provide a simple wallet sufficient for authenticating across our services and performing all necessary processes.",
19+
"wallet-instructions": "Scan this QR code or, on your mobile, go to",
2220
"footer-license": "CC BY 4.0",
2321
"footer-privacy": "Privacy Policy"
2422
},
@@ -144,7 +142,7 @@
144142
}
145143
},
146144
"credentialOffer": {
147-
"first-label": "Log in to Wallet",
145+
"first-label": "Log in to the Wallet",
148146
"second-label": "Get Credential",
149147
"no-data": "No credential offer data.",
150148
"getting": "Getting credential offer...",
@@ -153,19 +151,19 @@
153151
"environment-wallet": "environment Wallet",
154152
"first-assistance": "Check the ",
155153
"second-assistance": " for assistance.",
156-
"wallet-guide": "Wallet Users Guide",
154+
"wallet-guide": "Wallet User Guide",
157155
"expired-title": "Credential offer expiring",
158156
"ask-refresh": "Credential offer is about to expire. Would you like to refresh it or leave? If it expires, you will need to request a new one from your legal representative.",
159157
"remaining-time": "Time remaining:",
160158
"first-step": {
161159
"title": "Scan the QR code to log in and access the Digital Wallet.",
162-
"test-purposes": "For tests purposes, access the "
160+
"test-purposes": "For testing purposes, access the "
163161
},
164162
"second-step": {
165163
"title": "Scan the QR code to obtain the credential.",
166164
"directly": "directly",
167-
"test-purposes": "For tests purposes, get the Verifiable Credential with the ",
168-
"refresh-text": "Do you have problems when getting the credential with the Wallet?",
165+
"test-purposes": "For testing purposes, get the Verifiable Credential with the ",
166+
"refresh-text": "Do you have problems obtaining the credential with the Wallet?",
169167
"refresh-link": "Get a new credential offer"
170168
}
171169
},

0 commit comments

Comments
 (0)