From ebbe503cd56e16723c2a7abb4bedc8145b55ad76 Mon Sep 17 00:00:00 2001 From: Vafeiadis Nikos Date: Wed, 3 Jul 2024 11:49:56 +0300 Subject: [PATCH] Added table of contents, overview section and 'How to run' section --- README.md | 36 +++++++++++++++---- .../services/mso-mdoc-presentation.service.ts | 4 +-- .../selectable-presentation-form.component.ts | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7decd48..73db7e2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,20 @@ the [EUDI Wallet Reference Implementation project description](https://github.co [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.5. +## Table of contents + +* [Overview](#overview) +* [Development server](#development-server) +* [Code scaffolding](#code-scaffolding) +* [Build](#build) +* [How to run](#how-to-run) +* [Running tests](#running-tests) +* [License](#license) + +## Overview + +This is a WEB UI that provides functionality to interact with the Verifier/RP trusted end-point implemented [here](https://github.com/eu-digital-identity-wallet/eudi-srv-web-verifier-endpoint-23220-4-kt). +The project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.5. ## Development server @@ -19,15 +32,26 @@ Run `ng generate component component-name` to generate a new component. You can Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. -## Running unit tests +## How to run -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). +You need npm (node version 18.15.0) and [Angular CLI](https://github.com/angular/angular-cli) installed on your machine. -## Running end-to-end tests +In order to run Verifier UI run the following commands: -Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. +``` +npm install +ng start +``` +The above command utilizes [proxy.conf.json](src/proxy.conf.json) that proxies the calls to the expected verifier backend service. +Update this file if you want your Verifier UI to point to a locally running verifier backend service. -## Further help +You can access the application at [http://localhost:4200](http://localhost:4200) + +## Running tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/src/app/core/services/mso-mdoc-presentation.service.ts b/src/app/core/services/mso-mdoc-presentation.service.ts index 3c7b421..fe98eb9 100644 --- a/src/app/core/services/mso-mdoc-presentation.service.ts +++ b/src/app/core/services/mso-mdoc-presentation.service.ts @@ -10,7 +10,7 @@ import {uuidv4} from "@core/utils/uuid"; export class MsoMdocPresentationService { fieldConstraint(document: MsoMdoc, attribute: string, intentToRetainOptional?: boolean): FieldConstraint { - var intentToRetain = false + let intentToRetain = false; if (typeof intentToRetainOptional !== 'undefined' && intentToRetainOptional) { intentToRetain = true } @@ -21,7 +21,7 @@ export class MsoMdocPresentationService { } fieldConstraints(document: MsoMdoc, includeAttributes?: string[]): FieldConstraint[] { - var fieldConstraints: FieldConstraint[] = [] + const fieldConstraints: FieldConstraint[] = []; document.attributes.forEach((attribute: Attribute) => { if (typeof includeAttributes == 'undefined' || includeAttributes.includes(attribute.value)) { fieldConstraints.push(this.fieldConstraint(document, attribute.value)); diff --git a/src/app/features/selectable-presentation/components/selectable-presentation-form/selectable-presentation-form.component.ts b/src/app/features/selectable-presentation/components/selectable-presentation-form/selectable-presentation-form.component.ts index 2450551..ff53dbd 100644 --- a/src/app/features/selectable-presentation/components/selectable-presentation-form/selectable-presentation-form.component.ts +++ b/src/app/features/selectable-presentation/components/selectable-presentation-form/selectable-presentation-form.component.ts @@ -63,7 +63,7 @@ export class SelectablePresentationFormComponent implements OnInit { initPresentationModel() { this.attestationModel = this.attestationSelectableModelService.getModel(); - var presentationPurpose = this.attestationSelectableModelService.getPresentationPurpose(); + const presentationPurpose = this.attestationSelectableModelService.getPresentationPurpose(); this.draftPresentation = this.msoMdocPresentationService.presentationOf(this.attestationModel, presentationPurpose, []) }