-
Notifications
You must be signed in to change notification settings - Fork 10
feat(conversation): #COCO-4642 add clean messages modal #971
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
base: develop-b2school
Are you sure you want to change the base?
Changes from all commits
2a38f59
b5c6745
e1024ec
df1890f
408f552
e76ad80
50458a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,4 +72,4 @@ | |
| "typescript": "~4.6.4", | ||
| "webpack": "^5.70.0" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -216,6 +216,8 @@ | |||||
| "onboarding.modal.screen4.text": "La refonte de la Messagerie ne fait que commencer ! D'autres améliorations vous attendent dans quelques mois : l'envoi différé, la demande d'accusé de lecture, l'amélioration du signalement... Restez connectés !", | ||||||
| "onboarding.modal.screen4.title": "Les nouveautés à venir", | ||||||
| "onboarding.modal.title": "La Messagerie fait peau neuve !", | ||||||
| "onboarding.modal.clean.title": "Du tri dans vos messages", | ||||||
| "onboarding.modal.clean.text": "<strong>L’application Messagerie intégrera bientôt une automatisation de suppression des anciens messages.</strong><br />Afin de limiter l'utilisation d'espace de stockage, les messages de plus de 2 ans seront supprimés s’ils ne sont classés dans aucun dossier.Cette action se fera automatiquement et régulièrement tout au long de l'année. <br />Cela libérera de l'espace sur votre quota de stockage. Cette mesure permettra de libérer jusqu’à 8 tonnes d’équivalent CO2 par an sur toutes nos plateformes. Un bon geste pour la planète ! <br />Cette automatisation sera appliquée à partir du xxx 2026. Pensez à faire du tri dès que possible !", | ||||||
|
||||||
| "onboarding.modal.clean.text": "<strong>L’application Messagerie intégrera bientôt une automatisation de suppression des anciens messages.</strong><br />Afin de limiter l'utilisation d'espace de stockage, les messages de plus de 2 ans seront supprimés s’ils ne sont classés dans aucun dossier.Cette action se fera automatiquement et régulièrement tout au long de l'année. <br />Cela libérera de l'espace sur votre quota de stockage. Cette mesure permettra de libérer jusqu’à 8 tonnes d’équivalent CO2 par an sur toutes nos plateformes. Un bon geste pour la planète ! <br />Cette automatisation sera appliquée à partir du xxx 2026. Pensez à faire du tri dès que possible !", | |
| "onboarding.modal.clean.text": "<strong>L’application Messagerie intégrera bientôt une automatisation de suppression des anciens messages.</strong><br />Afin de limiter l'utilisation d'espace de stockage, les messages de plus de 2 ans seront supprimés s’ils ne sont classés dans aucun dossier. Cette action se fera automatiquement et régulièrement tout au long de l'année. <br />Cela libérera de l'espace sur votre quota de stockage. Cette mesure permettra de libérer jusqu’à 8 tonnes d’équivalent CO2 par an sur toutes nos plateformes. Un bon geste pour la planète ! <br />Cette automatisation sera appliquée à partir du xxx 2026. Pensez à faire du tri dès que possible !", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on peut faire commencer la clé de trad par conversation.onboarding...
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,54 @@ | ||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||
| DisplayRuleCheckResult, | ||||||||||||||||||||||||||||||||||||||||
| OnboardingModal, | ||||||||||||||||||||||||||||||||||||||||
| } from '@edifice.io/react/modals'; | ||||||||||||||||||||||||||||||||||||||||
| import illuOnboardingClean from '~/assets/illu-onboarding-clean.svg'; | ||||||||||||||||||||||||||||||||||||||||
| import { useI18n } from '~/hooks/useI18n'; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| type OnboardingModalCustomState = { type: 'Date'; value: string }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export default function MessageOnboardingCleanModal() { | ||||||||||||||||||||||||||||||||||||||||
| const { t } = useI18n(); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| function onDisplayRuleCheck( | ||||||||||||||||||||||||||||||||||||||||
| previousState?: OnboardingModalCustomState, | ||||||||||||||||||||||||||||||||||||||||
| ): DisplayRuleCheckResult<OnboardingModalCustomState> { | ||||||||||||||||||||||||||||||||||||||||
| const nowUTC = new Date(); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| const lastDisplayDate = previousState | ||||||||||||||||||||||||||||||||||||||||
| ? new Date(previousState.value) | ||||||||||||||||||||||||||||||||||||||||
| : undefined; | ||||||||||||||||||||||||||||||||||||||||
| const dateToCompare = new Date(); | ||||||||||||||||||||||||||||||||||||||||
| dateToCompare.setMonth(5, 1); // June 1st, of the year | ||||||||||||||||||||||||||||||||||||||||
| let shouldDisplay = false; | ||||||||||||||||||||||||||||||||||||||||
| if (nowUTC.getTime() > dateToCompare.getTime()) { | ||||||||||||||||||||||||||||||||||||||||
| // If we're after the 1st of June of the year, we want to show the modal if it has never been shown or if it was last shown last year. | ||||||||||||||||||||||||||||||||||||||||
| shouldDisplay = | ||||||||||||||||||||||||||||||||||||||||
| !lastDisplayDate || | ||||||||||||||||||||||||||||||||||||||||
| lastDisplayDate.getFullYear() < dateToCompare.getFullYear(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||
| display: shouldDisplay, | ||||||||||||||||||||||||||||||||||||||||
| nextState: { | ||||||||||||||||||||||||||||||||||||||||
| type: 'Date', | ||||||||||||||||||||||||||||||||||||||||
| value: nowUTC.toISOString(), | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+36
|
||||||||||||||||||||||||||||||||||||||||
| return { | |
| display: shouldDisplay, | |
| nextState: { | |
| type: 'Date', | |
| value: nowUTC.toISOString(), | |
| }, | |
| if (shouldDisplay) { | |
| return { | |
| display: true, | |
| nextState: { | |
| type: 'Date', | |
| value: nowUTC.toISOString(), | |
| }, | |
| }; | |
| } | |
| return { | |
| display: false, | |
| nextState: previousState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le nextState est persisté uniquement si toutes les étapes de l'onboarding sont validés.
La proposition de copilot est une sécurité supplémentaire, mais n'apparait pas indispensable.
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text property is hardcoded in French directly in the component instead of using the i18n translation function t('onboarding.modal.clean.text'). The i18n key onboarding.modal.clean.text is already defined in fr.json, so this should use t('onboarding.modal.clean.text') for consistency and to support potential future localization.
| text: t('onboarding.modal.clean.text'), | |
| text: t('onboarding.modal.clean.text'), |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
|
|
||
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.LinkedHashSet; | ||
| import java.util.List; | ||
| import java.util.concurrent.atomic.AtomicInteger; | ||
| import java.util.stream.Collector; | ||
|
|
@@ -484,7 +485,7 @@ | |
| } | ||
|
|
||
| @Override | ||
| public void searchCriteria(List<String> structures, boolean getClassesForMonoEtabOnly, Handler<Either<String, JsonObject>> handler) { | ||
|
Check failure on line 488 in directory/src/main/java/org/entcore/directory/services/impl/DefaultSchoolService.java
|
||
| final StringBuilder query = new StringBuilder(); | ||
| query.append("MATCH (s:Structure) WHERE s.id IN {structures} "); | ||
|
|
||
|
|
@@ -517,7 +518,43 @@ | |
| query.append("['ManualGroup','FunctionalGroup','CommunityGroup'] as groupTypes"); | ||
|
|
||
| JsonObject params = new JsonObject().put("structures", new JsonArray(structures)).put("1d", firstLevel).put("defLoe", defaultStructureLevelsOfEducation); | ||
| neo.execute(query.toString(), params, validUniqueResultHandler(handler)); | ||
| neo.execute(query.toString(), params, validUniqueResultHandler(result -> { | ||
| if (result.isRight()) { | ||
| JsonObject data = result.right().getValue(); | ||
| JsonArray functions = data.getJsonArray("functions"); | ||
|
|
||
| // Deduplicate functions by function name only, ignoring establishment code | ||
| // Format: "ESTABLISHMENT_CODE$FUNCTION_CODE$FUNCTION_NAME$JOB_CODE$DISCIPLINE" | ||
| if (functions != null && functions.size() > 0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tout ce code modifié ne fait pas partie de ta PR, je suppose ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mince, verifier si le code n'a pas été changé en rebasant |
||
| java.util.Map<String, String> functionMap = new java.util.TreeMap<>(); | ||
| List<String> malformedFunctions = new java.util.ArrayList<>(); | ||
|
|
||
| for (int i = 0; i < functions.size(); i++) { | ||
| String functionStr = functions.getString(i); | ||
| if (functionStr != null && !functionStr.isEmpty()) { | ||
| // Extract function name (3rd part after 2nd $) | ||
| String[] parts = functionStr.split("\\$", 4); | ||
| if (parts.length >= 3) { | ||
| String functionName = parts[2]; | ||
| // TreeMap keeps alphabetical order and prevents duplicates | ||
| if (!functionMap.containsKey(functionName)) { | ||
| functionMap.put(functionName, functionStr); | ||
| } | ||
| } else { | ||
| // Keep malformed entries as-is | ||
| malformedFunctions.add(functionStr); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Build final list: sorted functions + malformed entries | ||
| List<Object> sortedFunctions = new java.util.ArrayList<>(functionMap.values()); | ||
| sortedFunctions.addAll(malformedFunctions); | ||
| data.put("functions", new JsonArray(sortedFunctions)); | ||
| } | ||
| } | ||
| handler.handle(result); | ||
| })); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,8 +76,8 @@ | |
| "karma-jasmine": "~1.1.0", | ||
| "karma-jasmine-html-reporter": "^0.2.2", | ||
| "merge2": "^1.0.3", | ||
| "ode-ngjs-front": "dev", | ||
| "ode-ts-client": "dev", | ||
| "ode-ngjs-front": "develop-b2school", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem, aucune raison de modifier les versions dans une PR de feature |
||
| "ode-ts-client": "develop-b2school", | ||
| "rxjs": "5.4.2", | ||
| "sass-loader": "^13.0.2", | ||
| "source-map-loader": "^0.1.5", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text contains "xxx 2026" which appears to be a placeholder for an actual date. This should be replaced with the actual planned date before merging, otherwise users will see "xxx 2026" in the modal.