Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(contribs): publish contributions in the new format #1025

Merged
merged 26 commits into from
Oct 24, 2023

Conversation

carolineBda
Copy link
Contributor

shared/types/index.ts Outdated Show resolved Hide resolved
# Conflicts:
#	targets/alert-cli/package.json
#	targets/ingester/src/lib/fetchContributions/__tests__/expected.json
#	yarn.lock
}

private toText = (answer: AnswerRaw): string =>
(answer.content || "").replace(HTML_TAGS, "").replace(/ /gm, " ");

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization

This string may still contain [<script](1), which may cause an HTML element injection vulnerability.
@socket-security
Copy link

socket-security bot commented Sep 27, 2023

@carolineBda carolineBda requested review from maxgfr, m-maillot and Viczei and removed request for maxgfr September 28, 2023 21:07
@carolineBda carolineBda marked this pull request as ready for review October 3, 2023 09:01
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top le refacto ! le code est beaucoup plus simple

Copy link
Contributor

@m-maillot m-maillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top !

shared/elasticsearch-document-adapter/package.json Outdated Show resolved Hide resolved
@@ -1,6 +1,7 @@
import type {
AgreementDoc,
ContributionCompleteDoc,
ContributionGenericDoc,
ContributionWithCCDoc,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ContributionWithCCDoc,
ContributionWithAgreementDoc,

Pour une meilleur lecture et homogénéisation des termes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Après si on a générique, on peut utiliser le terme Personnalisé que le métier utilise pas mal -> ContributionCustomizedDoc ou j'aurais mis plutôt CustomizedContributionDoc et GenericContributionDoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah oui les 2 sont bien

description: string;
answers: CCMultipleAnswers;
answer: Answer;
agreementsWithAnswer: string[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peut-être customizedAgreements pour être raccord ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pour le coup c'est bizarre non ? Pour le métier "personnalisé" c'est quand on a une CC.
La je liste juste les CC qui ont une réponse pour cette contrib

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ou alors supportedAgreements pour être raccord avec nos outils ?

title: string;
url?: string;
};

export type BaseRef = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je trouve BaseRef pas adapté. Ce sont nos contenus et ce ne sont pas des références mais des contenus liés. On pourrait le renommer CdtnRelatedContent ?

shared/types/index.ts Show resolved Hide resolved
text: string;
content?: string | FicheServicePublicDoc;
};
type AnswerWithCC = Answer & { idcc: string; shortName: string };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem ici, on peut nommer CustomizedAnswer

if (!genericAnswer) {
return null;
throw new Error("No generic answer found");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça pourrait être bien d'ajouter la question liée pour le debug.

is_searchable: false,
slug: slugify(`${parseInt(idcc, 10)}-${title}`),
source: SOURCES.CONTRIBUTIONS,
text: `${idcc} ${title}`, // actuellement c'est comme ça mais si la CC a son propre contenu est-ce que ça ne devrait pas être dans text aussi ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A voir après l'intervention de rémi si ce champ sera encore nécessaire.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok je vire le comment faudra qu'on retravail ça

# Conflicts:
#	shared/types/package.json
#	yarn.lock
description: string;
answers: CCMultipleAnswers;
answer: Answer;
agreementsWithAnswer: string[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ou alors supportedAgreements pour être raccord avec nos outils ?

* fix: merge

* fix: merge

* fix: build

* fix: build

* fix: build

* fix: url

* fix: types

* fix: expected by snapshot

* fix: test

* fix: test

* fix: test

---------

Co-authored-by: carolineBda <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Oct 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@maxgfr maxgfr merged commit bfa0ac4 into deploy-new-contribs Oct 24, 2023
22 of 25 checks passed
@maxgfr maxgfr deleted the carolineBda/publish-contrib branch October 24, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants