Skip to content

Commit

Permalink
Main rails7 (#672)
Browse files Browse the repository at this point in the history
* feat: add the introspect token policie to auth system

* feat: card can have multiple user

* fix: adapt usersForGuests filter to use multiple users

* feat: update pia line to have multiple user in fields

* feat: refactor attribution function + add dump_field checking

* fix: fix user not found condition

* refactor: rename var

* refactor: refactor for users for guests method

* feat: report main logic from pia card to line

* feat: update remove and add method

* feat: send string in stead id for deleted user

* fix: adapt modal system to create user from entries

* fix: add fix for removing tag

* refactor: remove useless method

* feat: upgrade pia new form with multi user system

* refactor: refactor: init form with normalize method + fix validators for guests

* feat: prevent save Pia if user is required in the field

* docs: add comments, tslintage

* fix: fix for pia new  validator_name field

* fix: fix for pia new  validator_name field + no authentificate mode

* feat: add circle loader to section list

* feat: hide part during loading to prevent change content before ending

* fix: loading evaluation on changing section

* feat: remove too mutch loading effect + add loading in measures component

* feat: remove update object before send a update

* feat: same update for pia line

* feat: same update for answers

* feat: detect change and show modal with conflict text

* feat: moove logic into concerned composant + add logic for user choice

* feat: add some type to answer conflict dialog + add pia conflict logic

* feat: add conflict logic to pia_line

* feat: update separator for pia merge

* feat: add conflic dialog to measure

* fix: fix closing modal

* fix: fix for error object

* fix: fix for merging data on measure

* fix: fix for keep new value

* feat: remove cross btn on conflict dialog

* feat: prepare knowledge to be  conflict checked

* feat: add conflict dialog to knowledge

* feat: update conflict dialog in entries + add conflict test on knowledge base

* fix: fix breakable pia structure on keep new + fix no check lock_file on the first kb upd

* docs: fix some typescript issues + remove useless code

* feat: add conflict checking on knowledgebase line + remove useless code

* fix: auto fix knowledeges checkbox conflict

* docs: add comment

* fix: fix for conflict on checkbox + updating other data + update form

* fix: prevent empty gray tag

* fix: fix for title translation

* refactor: remove useless code

* feat: add auto correct userAssignment conflict

* feat: add auto correct userAssignment conflict on pia line

* fix: fix for display tags on pia line + refacto

* feat: add loading on find Entry when Edit

* fix: update electron to latest version + fix path to dist/pia

* fix: use pia-angular directory

* fix: for redirect to home from url settings page

* fix: reload on merge/fusion pia, questions

* docs: update version number

* fix: add filter usersForGuests

* feat: add author info on comments item

* fix: change key for translation

* build: update version number

* fix: fix auto logout and reset authservice on url change

* fix: fix reset authservice on new url

* fix: rewrite logic to saveall roles

* docs: change callback params name

* fix: prevent incompatibility error

* chore(deps): update package.json, *.lock

* fix: show revision on local mode (bug with is_archive)

* fix: fix for revision conflict + show role with user_pia

* refactor: refactoring for assign users role to pia

* fix: fix lock version + refactoring on dpo assignment

* refactor: set user role on the construct

* refactor: refactoring for dpo people opinions section

* refactor: continue refactoring on dpo

* feat: add better focus fallback action

* refactor: remove useless code

* fix: fix typescript on dpo for build

* fix: fix test with the real ending refuse process

* fix: fix for terms with back data attributes

* fix: fix complete wysiwyg in cypress test

* fix: fix have to double click on text to edit

* fix: remove useless wait and add global wait on .get

* fix: remove calcul status before archive pia

* fix: fix for uget object in update indexdb

* fix: use forof instead forEach, remove resolve into loop statement

* refactor: remove useless console log

* fix: re abilit the previous commit but with try catch

* fix: change textarea and fix bugs

* fix: add delay on valid test

* fix: add delay

* test: change focus_out and and modifi writing textarea

* test: remove video recording and add retries

* test: add delay

* test: reincrement commande.js

* test: reincrement code

* test: remove unused vars

* test: rm assets before runs to delete last file downloaded by tests & set defaul timeout to max(10s)

* test: remove unused code

* fix: fix for update user on entries

* fix: code error for promise

* feat: let other role see state of evaluation

* fix: fix on delete measure

* fix: fix cypress test and ux for user roles

* fix: change role for validate evaluation

* style: update delete btn designé

* fix: fix on measures section, restart validation

* fix: fix roles disabling form on dpo

* fix: fix for pia name role disabled

* fix: fix for neutral dpo form settings

* fix: fix for user list on preview component

* fix: fix for reseting Wysiwyg on focus out

* fix: fix measure gauge background + role with disable ux

* fix: add click force true to cypress test

* fix: apply a timeout for initialize the wysiwyg

Co-authored-by: Kevin Beyrand <kevin@atnos.com>
Co-authored-by: Timothee-Picard <timothee@atnos.com>
  • Loading branch information
3 people authored Jan 25, 2023
1 parent a5df6c4 commit 9287f54
Show file tree
Hide file tree
Showing 79 changed files with 6,789 additions and 6,244 deletions.
6 changes: 5 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"viewportHeight": 660,
"baseUrl": "http://localhost:4200",
"experimentalSourceRewriting": false,
"trashAssetsBeforeRuns": true,
"download.default_directory": "./cypress/download",
"profile.default_content_settings.popups": 0
"profile.default_content_settings.popups": 0,
"defaultCommandTimeout": 10000,
"video": false,
"retries": 5
}
31 changes: 23 additions & 8 deletions cypress/fixtures/pia.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
{
"pia": {
"id": 3,
"status": 0,
"is_example": 0,
"is_archive": 0,
"created_at": "2021-01-07T09:22:30.542Z",
"name": "(IMPORT) Nom du PIa",
"category": "Test",
"name": "Nom du Pia",
"author_name": "Prénom Nom",
"evaluator_name": "Prénom Nom",
"validator_name": "Prénom Nom",
"updated_at": "2021-02-15T14:30:23.108Z",
"progress": 67.5,
"structure_id": ""
"dpo_status": 1,
"dpo_opinion": "test",
"dpos_names": "test",
"people_names": "test",
"concerned_people_opinion": "test",
"concerned_people_status": 1,
"rejection_reason": "",
"applied_adjustments": "",
"is_example": 0,
"created_at": "2022-12-12T10:30:38.411Z",
"updated_at": "2022-12-12T10:34:42.552Z",
"concerned_people_searched_opinion": true,
"concerned_people_searched_content": "test",
"structure_id": null,
"structure_name": "",
"structure_sector_name": "",
"structure_data": null,
"category": "Test",
"progress": 96,
"lock_version": 6,
"is_archive": 0
},
"answers": [
{
Expand Down
4 changes: 1 addition & 3 deletions cypress/integration/pia-angular/client_serveur.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ describe("Client-Server", () => {
it("Click on save", () => {
cy.get(".btn-green").click();
cy.wait(5000);
cy.get("button[type=button]")
.eq(1)
.click();
cy.get("button[type=button]").click();

cy.url().should("include", "/");
});
Expand Down
5 changes: 4 additions & 1 deletion cypress/integration/pia-angular/context/edit_eval.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export function context_edit_eval() {

context("Données, processus et supports", () => {
it("should complete textareas", () => {
cy.test_writing_on_textarea();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 2);
cy.test_writing_on_textarea();
});
});

it("should valid evaluation", () => {
Expand Down
36 changes: 16 additions & 20 deletions cypress/integration/pia-angular/context/validation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,39 @@ export function context_validation() {
context("Validation for 'Vue d'ensemble'", () => {
it("should acept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 1).then(() => {
cy.acceptEval();
cy.closeValidationEvaluationModal();
});
cy.go_edited_pia(id, 1, 1);
cy.acceptEval();
cy.closeValidationEvaluationModal();
});
});

it("check accepted btn is blocked", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 1).then(() => {
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
cy.go_edited_pia(id, 1, 1);
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
});
});

context("Validation for 'Données, processus et supports'", () => {
it("should acept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 2).then(() => {
cy.acceptEval();
cy.closeValidationEvaluationModal();
});
cy.go_edited_pia(id, 1, 2);
cy.acceptEval();
cy.closeValidationEvaluationModal();
});
});

it("check accepted btn is blocked", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 2).then(() => {
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
cy.go_edited_pia(id, 1, 2);
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ describe("Validation", () => {
context("Refuse or ask pia signature", () => {
it("should refuse pia", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 4, 3).then(() => {
cy.validateDPO();
cy.refusePia();
});
cy.go_edited_pia(id, 4, 3);
cy.validateDPO();
cy.refusePia();
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe("Validation", () => {

it("should valid pia", () => {
cy.validatePia();
// cy.closeValidationEvaluationModal();
});

it("should show report", () => {
Expand Down
40 changes: 23 additions & 17 deletions cypress/integration/pia-angular/entries/entries_card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,39 @@ describe("Entries_card", () => {
* Create new pia
*/
it("should add new pia", () => {
cy.create_new_pia().then(() => {
cy.wait(500);
});
cy.create_new_pia();
});

/**
* Edit pia
*/
it("should edit pia", () => {
//cy.wait(500);
// Redirect into entries
cy.visit(`/#/entries`);
cy.wait(3000);
cy.get("#pia-edit-2-name")
cy.wait(1000);
cy.get(".pia-cardsBlock-item-form input[formcontrolname='name']")
.eq(1)
.clear()
.type("pia edited");
cy.get("#pia-edit-2-author-name")
.type("name edited");
cy.get(".pia-cardsBlock-item-form input[formcontrolname='author_name']")
.eq(1)
.clear()
.type("author edited");
cy.get("#pia-edit-2-evaluator-name")
.type("author_name edited");
cy.get(
".pia-cardsBlock-item-form input[formcontrolname='evaluator_name']"
)
.eq(1)
.clear()
.type("evaluator edited");
cy.get("#pia-edit-2-validator-name")
.type("evaluator_name edited");
cy.get(
".pia-cardsBlock-item-form input[formcontrolname='validator_name']"
)
.eq(1)
.clear()
.type("validator edited");
.type("validator_name edited");
cy.get(".pia-cardsBlock-item-form input[formcontrolname='category']")
.eq(1)
.click();
});

/**
Expand All @@ -59,12 +67,10 @@ describe("Entries_card", () => {
it("should duplicate pia", () => {
// Redirect into entries
cy.visit(`/#/entries`);
cy.wait(3000);
cy.get(".pia-cardsBlock.pia").should("have.length", 1);
cy.get(".pia-cardsBlock-toolbar-export a:eq(0)")
.click()
.then(() => {
cy.wait(10000);
cy.get(".pia-cardsBlock.pia").should("have.length", 2);
});
});
Expand All @@ -75,8 +81,8 @@ describe("Entries_card", () => {
it("should export pia", () => {
// Redirect into entries
cy.visit(`/#/entries`);
cy.get(".pia-cardsBlock-toolbar-export a")
.eq(2)
cy.get(".pia-cardsBlock-toolbar-export .fa-download")
.eq(0)
.click();
});
});
Expand Down
15 changes: 4 additions & 11 deletions cypress/integration/pia-angular/entries/entries_table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ describe("Entries_table", () => {
// Redirect into entries
cy.visit(`/#/entries`);
cy.get(".pia-filtersBlock-switch").click();
cy.wait(3000);
//Edit Title
cy.wait(500);
cy.get(".pia-list-table tbody tr td:eq(1) div")
.click()
.clear()
Expand Down Expand Up @@ -81,16 +81,9 @@ describe("Entries_table", () => {
*/
it("should duplicate pia", () => {
cy.get(".pia-list-table tbody tr").should("have.length", 1);
// cy.get(".pia-list-table tbody tr) td:eq(0) .fa-files-o")
// .click()
// .then(() => {
// cy.get(".pia-list-table tbody tr").should("have.length", 2);
// });
cy.get(".app-list-item:eq(0) td:eq(0) a:eq(1)")
.click()
.then(() => {
cy.get(".pia-list-table tbody tr").should("have.length", 2);
});
cy.get(".pia-list-table tbody tr:eq(0) td:eq(0) .fa-files-o").click();
cy.get(".pia-list-table tbody tr:eq(1)");
cy.get(".pia-list-table tbody tr").should("have.length", 2);
});

/**
Expand Down
1 change: 0 additions & 1 deletion cypress/integration/pia-angular/extra_tests_spec.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe("Test Search KnowledgeBase", () => {
it("should search an element", () => {
cy.create_new_pia().then(() => {
cy.visit("/#/pia/2/section/2/item/2");
cy.wait(3000);
cy.get(".pia-knowledgeBaseBlock-searchForm")
.find("input")
.type("Transf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ export function fundamental_principle_edit_eval() {

context("prepare data", () => {
it("prepare pia for test", () => {
cy.create_new_pia().then(() => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 1);
});
});
cy.create_new_pia();
});
});

Expand All @@ -28,7 +24,10 @@ export function fundamental_principle_edit_eval() {
* Complete textareas
*/
it("create pia and should complete textareas", () => {
cy.test_writing_on_textarea();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 1);
cy.test_writing_on_textarea();
});
});

/**
Expand All @@ -52,9 +51,8 @@ export function fundamental_principle_edit_eval() {
*/
it("should complete textareas", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 2).then(() => {
cy.test_writing_on_textarea();
});
cy.go_edited_pia(id, 2, 2);
cy.test_writing_on_textarea();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,39 @@ export function fundamental_principle_validation() {
context("Validation for 'Proportionnalité et nécessité'", () => {
it("should acept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 1).then(() => {
cy.acceptMultipleEval();
cy.closeValidationEvaluationModal();
});
cy.go_edited_pia(id, 2, 1);
cy.acceptMultipleEval();
cy.closeValidationEvaluationModal();
});
});

it("check accepted btn is blocked", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 1).then(() => {
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
cy.go_edited_pia(id, 2, 1);
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
});
});

context("Validation for 'Mesures protectrices des droits'", () => {
it("should acept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 2).then(() => {
cy.wait(3000);
cy.acceptMultipleEval();
cy.closeValidationEvaluationModal();
});
cy.go_edited_pia(id, 2, 2);
cy.acceptMultipleEval();
cy.closeValidationEvaluationModal();
});
});

it("check accepted btn is blocked", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 2).then(() => {
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
cy.go_edited_pia(id, 2, 2);
cy.get(".pia-evaluationBlock-buttons:eq(0) .btn-green").should(
"have.attr",
"disabled"
);
});
});
});
Expand Down
Loading

0 comments on commit 9287f54

Please sign in to comment.