Skip to content

Commit

Permalink
Merge pull request #9 from julienbdx/dev
Browse files Browse the repository at this point in the history
fix(frontend): Version 2.1.2
  • Loading branch information
julienbdx authored Dec 4, 2024
2 parents 0809c02 + 9fdf2b3 commit 0efcd6e
Show file tree
Hide file tree
Showing 11 changed files with 586 additions and 488 deletions.
4 changes: 3 additions & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ yarn-error.log*
/.idea
/.scannerwork

compose.overrides.yml
compose.overrides.yml

/src/api/OpenApi.yml
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oasis",
"version": "2.1.0",
"version": "2.1.2",
"private": true,
"dependencies": {
"@ant-design/icons": "^5.5.1",
Expand Down
79 changes: 70 additions & 9 deletions frontend/src/api/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/*
* Copyright (c) 2024. Esup - Université de Bordeaux
*
* This file is part of the Esup-Oasis project (https://github.com/EsupPortail/esup-oasis).
* For full copyright and license information please view the LICENSE file distributed with the source code.
*
* @author Julien Lemonnier <[email protected]>
*/

/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
Expand Down Expand Up @@ -942,6 +933,11 @@ export interface paths {
patch: operations["api_types_evenements_id_patch"];
};
"/types_evenements/{typeId}/taux": {
/**
* Retrieves the collection of TauxHoraire resources.
* @description Retrieves the collection of TauxHoraire resources.
*/
get: operations["api_types_evenements_typeIdtaux_get_collection"];
/**
* Creates a TauxHoraire resource.
* @description Creates a TauxHoraire resource.
Expand Down Expand Up @@ -11346,6 +11342,71 @@ export interface operations {
};
};
};
/**
* Retrieves the collection of TauxHoraire resources.
* @description Retrieves the collection of TauxHoraire resources.
*/
api_types_evenements_typeIdtaux_get_collection: {
parameters: {
query?: {
/** @description The collection page number */
page?: number;
/** @description The number of items per page */
itemsPerPage?: number;
date?: string;
};
path: {
/** @description TauxHoraire identifier */
typeId: string;
};
};
responses: {
/** @description TauxHoraire collection */
200: {
content: {
"application/ld+json": {
"hydra:member": components["schemas"]["TauxHoraire.jsonld-taux.out"][];
"hydra:totalItems"?: number;
/**
* @example {
* "@id": "string",
* "type": "string",
* "hydra:first": "string",
* "hydra:last": "string",
* "hydra:previous": "string",
* "hydra:next": "string"
* }
*/
"hydra:view"?: {
/** Format: iri-reference */
"@id"?: string;
"@type"?: string;
/** Format: iri-reference */
"hydra:first"?: string;
/** Format: iri-reference */
"hydra:last"?: string;
/** Format: iri-reference */
"hydra:previous"?: string;
/** Format: iri-reference */
"hydra:next"?: string;
};
"hydra:search"?: {
"@type"?: string;
"hydra:template"?: string;
"hydra:variableRepresentation"?: string;
"hydra:mapping"?: {
"@type"?: string;
variable?: string;
property?: string | null;
required?: boolean;
}[];
};
};
"text/html": components["schemas"]["TauxHoraire-taux.out"][];
};
};
};
};
/**
* Creates a TauxHoraire resource.
* @description Creates a TauxHoraire resource.
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/controls/AppLayout/AppLayout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
.user .ant-menu-title-content {
padding: 0 !important;
}

.user .ant-menu-title-content, .recherche .ant-menu-title-content {
background-color: $light-grey;
}
Expand Down Expand Up @@ -86,6 +87,10 @@
align-items: center;
}

.ant-menu .recherche {
line-height: 1;
}

.recherche.recherche-en-cours {

.ant-menu-submenu-title {
Expand Down Expand Up @@ -155,6 +160,8 @@
background: none;
}



.sider-trigger {
background: transparent !important;
color: $primary;
Expand Down Expand Up @@ -278,10 +285,15 @@
vertical-align: middle !important;
}

.ant-menu-submenu-title {
line-height: 52px;
}

.user-space {
font-size: 1rem;
vertical-align: middle;
font-weight: 400;
text-align: left;

.ant-space-item {
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const menuItemUtilisateur = (
{
key: "user",
label: (
<Button type="text" className="bg-light-grey">
<Button type="text" className="bg-transparent">
<LabelUtilisateurMenu
auth={auth}
apiFetching={apiFetching}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/controls/Avatars/UtilisateurAvatarImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function UtilisateurAvatarImage(props: {
credentials: "include",
cache: "force-cache",
headers: {
Accept: "image/*",
Accept: "image/jpeg",
},
};

Expand Down
19 changes: 12 additions & 7 deletions frontend/src/controls/Forms/TarifEvenementField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ export default function TarifEvenementField({
}: ITarifEvenementFieldProps) {
const { data: typesEvenements, isFetching: isFetchingTypeEvenement } =
useApi().useGetCollection(PREFETCH_TYPES_EVENEMENTS);
const { data: taux } = useApi().useGetItem({
path: "/types_evenements/{typeId}/taux/{id}",
url: typesEvenements?.items.find((t) => t["@id"] === evenement.type)?.tauxActif as string,
const { data: taux } = useApi().useGetCollection({
path: "/types_evenements/{typeId}/taux",
parameters: {
typeId: evenement.type as string,
},
query: {
date: dayjs(evenement.debut).format("YYYY-MM-DD"),
},
enabled:
!!typesEvenements &&
!!evenement.type &&
Expand All @@ -44,7 +49,7 @@ export default function TarifEvenementField({
return <Skeleton active />;
}

if (!taux || !taux?.montant) {
if (!taux || taux.items.length !== 1 || !taux.items[0].montant) {
return (
<p className="text-warning">
Pas de taux horaire défini actuellement pour les évènements de la catégorie "
Expand All @@ -61,12 +66,12 @@ export default function TarifEvenementField({
addonAfter={<div style={{ width: 55 }}></div>}
placeholder="0,00"
className="text-center text-primary semi-bold"
value={montantToString((dureeTotale / 60).toString(), taux?.montant)}
value={montantToString((dureeTotale / 60).toString(), taux.items[0].montant)}
/>
<div className="legende">
Tarif horaire des évènements de la catégorie "
{typesEvenements?.items.find((t) => t["@id"] === evenement.type)?.libelle}"&nbsp;:{" "}
{taux?.montant || "?"}
{taux.items[0].montant || "?"}
&nbsp;€ / heure
</div>
</>
Expand All @@ -75,7 +80,7 @@ export default function TarifEvenementField({

return (
<Space>
<span>{montantToString((dureeTotale / 60).toString(), taux?.montant)}</span>
<span>{montantToString((dureeTotale / 60).toString(), taux.items[0].montant)}</span>
<span></span>
</Space>
);
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/controls/Progress/ProgressAffectation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ interface IProgressAffectation {
*/
export default function ProgressAffectation({ evenements }: IProgressAffectation): ReactElement {
return useMemo(() => {
const evts = evenements.filter((e) => !e.dateAnnulation)
const taux =
evenements.length === 0
? 100
: Math.round(
(100 *
evenements.filter((e) => !e.dateAnnulation).filter((e) => e.isAffecte())
evts.filter((e) => e.isAffecte())
.length) /
evenements.length,
evts.length,
);

return (
Expand Down
38 changes: 20 additions & 18 deletions frontend/src/controls/Table/DemandeTableFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,24 +193,6 @@ export function DemandeTableFilters(props: {
/>
</Col>

<Col xs={24} sm={24} md={6}>
<Space direction="vertical" size={0}>
<span aria-label="Campagne archivée">Campagne archivée</span>
</Space>
</Col>
<Col xs={24} sm={24} md={18}>
<Switch
checked={props.filtreDemande.archivees}
onChange={(checked) => {
props.setFiltreDemande((prev) => ({
...prev,
archivees: checked,
page: 1,
}));
}}
/>
</Col>

<Col xs={24} sm={24} md={6}>
<Space direction="vertical" size={0}>
<span aria-label="Chargés d'accompagnement">
Expand Down Expand Up @@ -324,6 +306,26 @@ export function DemandeTableFilters(props: {
Seules les formations ayant au moins un demandeur sont proposées.
</div>
</Col>

<Col xs={24} sm={24} md={6}>
<Space direction="vertical" size={0}>
<span aria-label="Afficher les campagnes archivées">
Afficher campagnes archivées
</span>
</Space>
</Col>
<Col xs={24} sm={24} md={18}>
<Switch
checked={props.filtreDemande.archivees}
onChange={(checked) => {
props.setFiltreDemande((prev) => ({
...prev,
archivees: checked,
page: 1,
}));
}}
/>
</Col>
</Row>
</>
),
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const VERSIONS: IVersion[] = [
description: `Amélioration de l'accessibilité / police Lexend`,
type: "add",
},
{
description: "Filtre campagnes archivées",
type: "add",
},
],
},
{
Expand Down
Loading

0 comments on commit 0efcd6e

Please sign in to comment.