Skip to content

Commit

Permalink
style: review style du widget (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ST0R authored Nov 28, 2024
1 parent 65fa48e commit fcec2e9
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 12 deletions.
8 changes: 6 additions & 2 deletions server/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ cli
.command("computeContinuumStats")
.description("Calcule les données statistiques manquantes pour les anciens/nouveaux diplomes")
.argument("[stats]", "Le nom des stats à importer (formations,certifications,regionales)", asArray)
.action((stats) => {
runScript(() => computeContinuumStats({ stats }));
.option(
"--millesime [millesime]",
"Spécifie un millésime à importer (attention les millésimes nationales et formations/regionales sont différents"
)
.action((stats, options) => {
runScript(() => computeContinuumStats({ stats, millesime: options.millesime }));
});

cli
Expand Down
4 changes: 3 additions & 1 deletion server/src/jobs/stats/computeContinuumStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ export async function computeContinuumStats(options = {}) {
let stats = options.stats || ["certifications", "regionales", "formations"];
const result = { total: 0, created: 0, updated: 0, failed: 0 };

const millesime = options.millesime || null;

function handleError(e, context = {}) {
logger.error({ err: e, ...context }, `Impossible de calculer les données pour les anciens/nouveaux diplomes`);
result.failed++;
Expand All @@ -211,7 +213,7 @@ export async function computeContinuumStats(options = {}) {

await oleoduc(
mergeStreams(stats.map(streamStats)),
filterData(({ data }) => data.donnee_source.type === "self"),
filterData(({ data }) => data.donnee_source.type === "self" && (!millesime || data.millesime === millesime)),
transformData(async ({ data, statName }) => {
const query = { ...getQueryForStats({ data, statName, millesime: data.millesime }) };

Expand Down
1 change: 1 addition & 0 deletions server/src/jobs/stats/importFormationsSupStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export async function importFormationsSupStats(options = {}) {
code_certification: formationStats.diplome,
type: "self",
},
libelle_etablissement: formationStats.uo_lib,
"_meta.insersup": {
etablissement_libelle: formationStats.uo_lib,
etablissement_actuel_libelle: formationStats.uo_lib_actuel,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion server/src/services/widget/templates/common/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
.card {
margin-top: 10px;
padding: 10px;
margin-bottom: 15px;
margin-bottom: 2rem;
}
.card-footer {
Expand All @@ -171,6 +171,12 @@
margin-right: 0;
}
.external-small[target=_blank]:after {
--icon-size: 0.75rem;
height: var(--icon-size);
width: var(--icon-size);
}
@media screen and (min-width: <%=options.responsiveWidth %>) {}
Expand All @@ -188,5 +194,10 @@
.card-footer {
text-align: left;
}
.card {
padding-left: 0px;
padding-right: 0px;
}
}
</style>
41 changes: 37 additions & 4 deletions server/src/services/widget/templates/stats/default.1.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@
vertical-align: text-top;
}
.block-title .description {
font-size: 18px;
font-weight: 700;
line-height: 28px;
}
.body-description {
margin-bottom: 10px;
}
Expand Down Expand Up @@ -274,22 +281,28 @@
@media screen and (max-width: <%=options.responsiveWidth %>) {
:root {
--body-width: min(calc(var(--widget-width) * 0.8 / <%=maxEleves %>), 30px);
--body-width: 50px;
--body-height: calc(var(--body-width) * 1.8125);
--body-icon-width: calc(var(--body-width) * 0.4);
--body-icon-left: calc(var(--body-width) * 0.29);
--body-icon-top: calc(var(--body-width) * 0.5);
}
.body-group {
flex-wrap: wrap;
justify-content: normal;
}
.bodies {
display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: column;
gap: 2px;
margin-bottom: 10px;
margin-left: 10px;
margin-left: 0px;
;
}
Expand All @@ -314,7 +327,27 @@
@media screen and (max-width: 30em) {
.block-title {
font-size: 12px;
font-size: 16px;
}
.block-title .description {
font-size: 20px;
}
.block-title .icon {
width: 22px;
height: 22px;
}
}
@media screen and (max-width: 19em) {
:root {
--body-width: 45px;
--body-height: calc(var(--body-width) * 1.8125);
--body-icon-width: calc(var(--body-width) * 0.4);
--body-icon-left: calc(var(--body-width) * 0.29);
--body-icon-top: calc(var(--body-width) * 0.5);
}
}
</style>
Expand Down Expand Up @@ -427,7 +460,7 @@
<% } %>
<div class="card-footer">
Données issues du dispositif <a target="_blank" href="https://beta.gouv.fr/startups/exposition-ij.html"><%= data.filiere === "superieur" ? "InserSup" : "InserJeunes" %></a> promotions <%= millesimesDouble ? millesimes[0] + " et " + millesimes[1] : millesimes[0] %>. <a target="_blank" href="https://documentation.exposition.inserjeunes.beta.gouv.fr/"> D’où viennent ces données ?</a>
Données issues du dispositif <a target="_blank" class="external-small" href="https://beta.gouv.fr/startups/exposition-ij.html"><%= data.filiere === "superieur" ? "InserSup" : "InserJeunes" %></a> promotions <%= millesimesDouble ? millesimes[0] + " et " + millesimes[1] : millesimes[0] %>. <a target="_blank" class="external-small" href="https://documentation.exposition.inserjeunes.beta.gouv.fr/"> D’où viennent ces données ?</a>
</div>
</div>
</body>
Expand Down
12 changes: 8 additions & 4 deletions server/src/services/widget/templates/stats/personas.1.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
<div class="block modal-link plausible-event-name=Modal+Open+<%= key %> <%= taux[key].value == 0 ? "grey-variant" : infos[key].colorText %>" onClick="showModal('<%= key %>')">
<div class="block-title">
<div>
<div><%= taux[key].description %></div>
<div><%= infos[key].title %></div>
<div class="description"><%= taux[key].description %></div>
<div><%= infos[key].title %> <svg class="remix icon">
<use xlink:href="#ri-information-line" />
</svg></div>
</div>
</div>
</div>
Expand All @@ -42,11 +44,13 @@
<% if (taux[key].value > 0) { %>
<div onClick="showModal('<%= key %>')" class="block block-<%= key %> modal-link plausible-event-name=Modal+Open+<%= key %> <%= taux[key].value == 0 ? "grey-variant" : infos[key].colorText %>">
<div class="block-title">
<div><%= taux[key].description %></div>
<div class="description"><%= taux[key].description %></div>
<div>
<svg class="remix icon">
<use xlink:href="<%= infos[key].icon %>" />
</svg><%= infos[key].title %>
</svg><%= infos[key].title %> <svg class="remix icon">
<use xlink:href="#ri-information-line" />
</svg>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions server/tests/jobs/stats/importFormationsSupStats-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe("importFormationsSupStats", () => {
code_certification: "2500200",
code_certification_type: "sise",
libelle: "METIERS DE L'ENSEIGNEMENT",
libelle_etablissement: "Université Côte d'Azur",
millesime: "2020_2021",
filiere: "superieur",
date_fermeture: new Date("2023-01-01T00:00:00.000Z"),
Expand Down

0 comments on commit fcec2e9

Please sign in to comment.