Skip to content
Snippets Groups Projects
Commit bed35b13 authored by Hugo SUBTIL's avatar Hugo SUBTIL Committed by Etienne LOUPIAS
Browse files

V2.0

parent 4e94ee41
No related branches found
No related tags found
1 merge request!400V2.0
Showing with 520 additions and 761 deletions
......@@ -53,3 +53,10 @@ api/db.json
# Documentation generated with compodoc
documentation
CHANGELOG.md
package-lock.json
# External libs
/projects
stages:
- quality
- build
- quality
- deploy
default:
......@@ -127,7 +127,6 @@ sonarqube:
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_TOKEN}
-Dsonar.cpd.exclusions=tests/**,src/**/*.spec.ts*
-Dsonar.qualitygate.wait=true
sonarqube-mr:
......@@ -152,5 +151,4 @@ sonarqube-mr:
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_MR_TOKEN}
-Dsonar.cpd.exclusions=tests/**,src/**/*.spec.ts*
-Dsonar.qualitygate.wait=true
## Description du problème
_Donnez une briève description du problème_
## L'environnement
#### Utilisez vous l'application sur :
- [ ] Mobile
- [ ] Ordinateur
##### En cas de mobile
###### Quel type de mobile utilisez-vous?
- [ ] Android
- [ ] Iphone
###### Quel navigateur utilisez-vous?
- [ ] Chrome
- [ ] Safari
- [ ] Autre
##### En cas d'ordinateur
###### Quel navigateur utilisez-vous?
- [ ] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Autre
## Le bug
#### Quelles sont les étapes qui ont menées au problème?
_Donnez une description des étapes, il est fortemment conseillé de l'accompagner par des captures d'écran_
#### Quel est le comportement obtenu?
_Donnez une description du comportement obtenu, il est fortemment conseillé de l'accompagner par des captures d'écran_
#### Quel est le comportement attendu?
_Donnez une description du comportement attendu_
/title [Scope] Description
[[_TOC_]]
### Résumé du problème
## Contexte
_Donnez une description briève du problème._
## Objectif
### Les étapes pour reproduire le bug
## Ressources
_Listez les étapes qui vous permettent de reproduire ce bug, cette étape est très importante._
### Décrivez le comportement du bug ?
### Quel serez le comportement attendu ?
### Logs et/ou screenshots
### Possible fixes
/label ~"type::bug"
## Tâches
| :triangular_flag_on_post: Give your MR the same name that the desired squash commit. In doubt, check the conventional commit [doc](https://www.conventionalcommits.org/en/v1.0.0/).|
| --- |
## What does this MR do and why?
_Describe in detail what your merge request does and why._
| :warning: Keep an up to date checklist based on your icescrum tasks during all the draft phase to help any other developer who would take the job after you to finish it. |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| :warning: Keep an up to date checklist based on your icescrum tasks during all the draft phase of the MR to help any other developer who would take the job after you to finish it.|
| --- |
## Screenshots or screen recordings
_These are strongly recommended to assist reviewers and reduce the time to merge your change._
## How to set up and validate locally (or on alpha)
_List all steps to set up and validate the changes on local environment._
## MR acceptance checklist
_To be completed by the chosen reviewer._
<!---
......@@ -25,38 +27,32 @@ More reading on checklists can be found in the "Checklist Manifesto": http://atu
"It is common to misconceive how checklists function in complex lines of work. They are not comprehensive how-to guides, whether for building a skyscraper or getting a plane out of trouble. They are quick and simple tools aimed to buttress the skills of expert professionals." - Gawande, Atul. The Checklist Manifesto
--->
### Quality
- [ ] Confirmed
### Quality [![Bugs](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=bugs&token=36de9e39a5b4d878b9682146cdd3da5bf3777810)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client) - [![Code Smells](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=code_smells&token=36de9e39a5b4d878b9682146cdd3da5bf3777810)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
- For the code that this change impacts, I believe that the **automated tests validate functionality** that is **highly important to users**. If the existing automated tests do not cover this functionality, I have **added the necessary additional tests** or I have added an issue to describe the automation testing gap and linked it to this MR.
- I have made sure that the **sonar quality coverage is up to standards**.
- I have **considered the impact** of this change on the **front-end**, **back-end**, and **database** portions of the system where appropriate and applied.
- I have tested this MR in **all supported browsers** or determined that this testing is not needed.
- I have confirmed that this change is **backwards compatible** across updates (migrate up needs a migrate down), or I have decided that this does not apply.
1. For the code that this change impacts, I believe that the automated tests validate functionality that is highly important to users. If the existing automated tests do not cover this functionality, I have added the necessary additional tests or I have added an issue to describe the automation testing gap and linked it to this MR.
1. I have made sure that the sonar quality coverage is up to standards.
1. I have considered the impact of this change on the front-end, back-end, and database portions of the system where appropriate and applied.
1. I have tested this MR in all supported browsers or determined that this testing is not needed.
1. I have confirmed that this change is backwards compatible across updates (migrate up needs a migrate down), or I have decided that this does not apply.
### Performance, reliability and availability
- [ ] Confirmed
- I am confident that this MR **does not harm performance**, or I have asked a reviewer to help assess the performance impact.
- I have considered the **scalability risk** based on future predicted growth.
1. I am confident that this MR does not harm performance, or I have asked a reviewer to help assess the performance impact.
1. I have considered the scalability risk based on future predicted growth.
### Documentation
- [ ] Confirmed
1. I have prepared a squash commit to feed the changelog linked to the current milestone.
1. I have added/updated documentation (also updated if the changes feature a deprecation) or I have decided that documentation changes are not needed for this MR.
- The MR is named after the **desired squash commit** to feed the changelog linked to the current milestone.
- I have **added/updated documentation** (also updated if the changes feature a deprecation) or I have decided that documentation changes are not needed for this MR.
### Security
### Security [![Security Rating](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=security_rating&token=36de9e39a5b4d878b9682146cdd3da5bf3777810)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
- [ ] Confirmed
1. I have confirmed that if this MR does not contains any sensitive informations hidden in the changes.
- I have confirmed that if this MR **does not contains any sensitive informations** hidden in the changes.
### Deployment
- [ ] Confirmed
1. When featured on a self-data project release, i have made sure my app version in the manifest and package.json is incremented and any relative changes to the permissions are clearly written and transmitted to Cozy.
- When featured on a self-data project release, I have made sure my **app version** in the manifest and package.json is **incremented** and any relative **changes to the permissions are clearly written and transmitted to Cozy**.
# Disable exclusion of files from .gitignore for vscode search (cf. https://stackoverflow.com/a/72059075 )
# External libs
!/projects
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-french",
"angular.ng-template"
]
}
......@@ -2,7 +2,8 @@
"eslint.enable": true,
"javascript.format.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": true,
"source.organizeImports": true
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
......@@ -25,5 +26,24 @@
"i18n-ally.localesPaths": "client/src/assets/i18n",
"i18n-ally.keystyle": "nested",
"i18n-ally.enabledFrameworks": "ngx-translate",
"typescript.preferences.importModuleSpecifier": "relative"
"typescript.preferences.importModuleSpecifier": "relative",
"cSpell.language": "fr,en",
"cSpell.words": [
"covid",
"facebook",
"friday",
"instagram",
"linkedin",
"monday",
"onespace",
"personaloffer",
"Rés'in",
"saturday",
"sunday",
"thursday",
"toastr",
"tuesday",
"ultrawide",
"wednesday"
]
}
This diff is collapsed.
[![Quality Gate Status](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=alert_status)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
[![Bugs](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=bugs)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
[![Lines of Code](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=ncloc)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
[![Maintainability Rating](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=sqale_rating)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
[![Security Rating](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=security_rating)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
[![Vulnerabilities](https://sonarqube.forge.grandlyon.com/api/project_badges/measure?project=pamn_client&metric=vulnerabilities)](https://sonarqube.forge.grandlyon.com/dashboard?id=pamn_client)
# Res'In Client
# Pamn
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.3.
## Wikis
## [Wikis](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/-/wikis/home)
Find [here](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/-/wikis/home) wikis about useful informations like installation and gitflow.
......@@ -29,10 +20,6 @@ Run `npm run build:dev` to build the project. The build artifacts will be stored
Run `npm run test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `npm run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Contributing
Use conventional commit format. For more info please read this article on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
......
......@@ -138,21 +138,51 @@
"styles": ["src/styles.scss"],
"scripts": []
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
}
}
},
"@gouvfr-anct/mediation-numerique": {
"projectType": "library",
"root": "projects/gouvfr-anct/mediation-numerique",
"sourceRoot": "projects/gouvfr-anct/mediation-numerique/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "pamn:serve"
"project": "projects/gouvfr-anct/mediation-numerique/ng-package.json"
},
"configurations": {
"production": {
"devServerTarget": "pamn:serve:production"
"tsConfig": "projects/gouvfr-anct/mediation-numerique/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/gouvfr-anct/mediation-numerique/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-builders/jest:run",
"options": {
"configPath": "jest.config.js",
"tsConfig": "tsconfig.spec.json",
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/gouvfr-anct/mediation-numerique/src/**/*.ts",
"projects/gouvfr-anct/mediation-numerique/src/**/*.html"
]
}
}
}
}
},
"defaultProject": "pamn"
"cli": {
"analytics": false
}
}
# Based on Node.js
FROM node:12.16
WORKDIR /app
# Copy the package.json file first in order to cache the modules
COPY . .
# Install npm dependencies
RUN npm install
# expose port 3000
EXPOSE 3000
CMD ["npm", "start"]
{
"name": "pamn-mock-api",
"version": "0.1.0",
"scripts": {
"start": "node server.js"
},
"private": true,
"dependencies": {
"json-server": "^0.16.2"
}
}
const jsonServer = require('json-server');
const server = jsonServer.create();
const router = jsonServer.router('db.json');
const routes = {
'/api/*': '/$1',
};
const middlewares = [jsonServer.defaults(), jsonServer.rewriter(routes)];
// Set default middlewares (logger, static, cors and no-cache)
server.use(middlewares);
// Add custom routes before JSON Server router
server.get('/structures/count', (req, res) => {
let structureCountTab = [];
// Compétences de base
structureCountTab.push({ id: '260', count: 12 });
structureCountTab.push({ id: '259', count: 10 });
structureCountTab.push({ id: '261', count: 10 });
structureCountTab.push({ id: '249', count: 9 });
structureCountTab.push({ id: '222', count: 9 });
structureCountTab.push({ id: '212', count: 8 });
structureCountTab.push({ id: '186', count: 7 });
structureCountTab.push({ id: '183', count: 6 });
// Accès aux droits
structureCountTab.push({ id: '176', count: 6 });
structureCountTab.push({ id: '175', count: 1 });
structureCountTab.push({ id: '174', count: 2 });
structureCountTab.push({ id: '173', count: 2 });
structureCountTab.push({ id: '172', count: 2 });
structureCountTab.push({ id: '171', count: 4 });
structureCountTab.push({ id: '167', count: 3 });
structureCountTab.push({ id: '165', count: 2 });
// Insertion sociale et professionnelle
structureCountTab.push({ id: '254', count: 5 });
structureCountTab.push({ id: '240', count: 4 });
structureCountTab.push({ id: '194', count: 7 });
structureCountTab.push({ id: '193', count: 7 });
structureCountTab.push({ id: '192', count: 5 });
structureCountTab.push({ id: '191', count: 7 });
structureCountTab.push({ id: '262', count: 5 });
structureCountTab.push({ id: '263', count: 3 });
structureCountTab.push({ id: '3', count: 3 });
// Aide à la parentalité
structureCountTab.push({ id: '257', count: 4 });
structureCountTab.push({ id: '238', count: 1 });
structureCountTab.push({ id: '178', count: 4 });
structureCountTab.push({ id: '166', count: 2 });
// Culture et sécurité numérique
structureCountTab.push({ id: '264', count: 5 });
structureCountTab.push({ id: '255', count: 7 });
structureCountTab.push({ id: '265', count: 2 });
structureCountTab.push({ id: '232', count: 4 });
structureCountTab.push({ id: '225', count: 5 });
structureCountTab.push({ id: '221', count: 3 });
structureCountTab.push({ id: '218', count: 2 });
structureCountTab.push({ id: '209', count: 3 });
structureCountTab.push({ id: '208', count: 4 });
structureCountTab.push({ id: '206', count: 5 });
structureCountTab.push({ id: '195', count: 5 });
structureCountTab.push({ id: '164', count: 4 });
structureCountTab.push({ id: '163', count: 2 });
structureCountTab.push({ id: '162', count: 3 });
// Accompagnement des démarches
structureCountTab.push({ id: 'Accompagnant CAF', count: 7 });
structureCountTab.push({ id: 'Pôle Emploi', count: 9 });
structureCountTab.push({ id: 'CPAM', count: 7 });
structureCountTab.push({ id: 'Impôts', count: 6 });
structureCountTab.push({ id: 'Logement', count: 5 });
structureCountTab.push({ id: 'CARSAT', count: 5 });
structureCountTab.push({ id: 'Autres', count: 2 });
// Publics acceptés
structureCountTab.push({ id: 'Tout public', count: 7 });
structureCountTab.push({ id: 'Moins de 16 ans', count: 4 });
structureCountTab.push({ id: 'Jeunes (16-25 ans)', count: 6 });
structureCountTab.push({ id: 'Adultes', count: 9 });
structureCountTab.push({ id: 'Séniors (+ de 65 ans)', count: 1 });
// Labels et qualifications
structureCountTab.push({ id: 'Aidants Connect', count: 0 });
structureCountTab.push({ id: 'Espace public numérique (EPN)', count: 2 });
structureCountTab.push({ id: 'Fabrique de territoire', count: 3 });
structureCountTab.push({ id: 'Maison France Service', count: 0 });
structureCountTab.push({ id: 'Pass numérique', count: 4 });
// Modalités d'accès
structureCountTab.push({ id: 'Uniquement sur RDV', count: 13 });
structureCountTab.push({ id: 'Accès libre', count: 6 });
structureCountTab.push({ id: 'Téléphone / Visio', count: 6 });
// Accompagnement des publics
structureCountTab.push({ id: "Personnes en situation d'illetrisme", count: 0 });
structureCountTab.push({ id: 'Langue étrangère (anglais)', count: 0 });
structureCountTab.push({ id: 'Langues étrangères (autres)', count: 0 });
structureCountTab.push({ id: 'Surdité', count: 0 });
structureCountTab.push({ id: 'Déficience visuelle', count: 0 });
structureCountTab.push({ id: 'Handicap moteur', count: 0 });
// Équipements et services proposés
structureCountTab.push({ id: 'Wifi en accès libre', count: 6 });
structureCountTab.push({ id: 'Ordinateurs', count: 5 });
structureCountTab.push({ id: 'Tablettes', count: 1 });
structureCountTab.push({ id: 'Bornes numériques', count: 1 });
structureCountTab.push({ id: 'Imprimantes', count: 5 });
structureCountTab.push({ id: 'Prêt / don de matériels', count: 0 });
structureCountTab.push({ id: 'Reconditionnements de matériel', count: 0 });
structureCountTab.push({ id: 'Accès à des revues ou livres informatiques et numériques', count: 0 });
return res.status(200).jsonp(structureCountTab);
});
// Use default router
server.use(router);
server.listen(3000, () => {
console.log('JSON Server is running');
});
This diff is collapsed.
......@@ -4,7 +4,7 @@ services:
web-app:
restart: unless-stopped
build: .
image: registry.forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client:${TAG}
image: registry.forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client:${TAG}
volumes:
- ./dev.conf:/etc/nginx/conf.d/default.conf
ports:
......
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};
\ No newline at end of file
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('pamn app is running!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}
getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es2018",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment