Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Nov 22, 2024
2 parents 2537f1d + 5f1b02d commit ee5bfcd
Show file tree
Hide file tree
Showing 46 changed files with 684 additions and 524 deletions.
33 changes: 21 additions & 12 deletions .github/config/changelog.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
module.exports = {
types: [
{ types: ['feat', 'feature'], label: '🎉 Nouvelle fonctionalité' },
{ types: ['fix', 'bugfix'], label: '🐛 Réparation de bug' },
{ types: ['improvements', 'enhancement'], label: '🔨 Amélioration' },
{ types: ['build', 'ci'], label: '🏗️ Déploiement' },
{ types: ['refactor'], label: '🪚 Réamenagement de code' },
{ types: ['perf'], label: '🏎️ Amélioration de performance' },
{ types: ['doc', 'docs'], label: '📚 Changement de documentation' },
{ types: ['test', 'tests'], label: '🔍 Tests' },
{ types: ['style'], label: '💅 Style de code' },
{ types: ['chore'], label: '🧹 Nettoyage' },
{ types: ['other'], label: 'Autres changements' },
{ types: ["feat", "feature"], label: "🎉 Nouvelle fonctionalité" },
{ types: ["fix", "bugfix"], label: "🐛 Réparation de bug" },
{ types: ["improvements", "enhancement"], label: "🔨 Amélioration" },
{ types: ["build", "ci"], label: "🏗️ Déploiement" },
{ types: ["refactor"], label: "🪚 Réamenagement de code" },
{ types: ["perf"], label: "🏎️ Amélioration de performance" },
{ types: ["doc", "docs"], label: "📚 Changement de documentation" },
{ types: ["test", "tests"], label: "🔍 Tests" },
{ types: ["style"], label: "💅 Style de code" },
{ types: ["chore"], label: "🧹 Nettoyage" },
{ types: ["other"], label: "Autres changements" },
],

excludeTypes: ['other', 'perf', 'test', 'tests', 'style', 'chore', 'doc', 'docs'],
excludeTypes: [
"other",
"perf",
"test",
"tests",
"style",
"chore",
"doc",
"docs",
],
};
12 changes: 3 additions & 9 deletions client/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode } from "react";
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter, Link } from "react-router-dom";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
Expand All @@ -8,7 +8,8 @@ import "react-toastify/dist/ReactToastify.min.css";

import Router from "./router";
import { DSFRConfig } from "@dataesr/dsfr-plus";
import { DataListProvider } from "./src/pages/api-operation-page/link-publications/data-list-context";
import { DataListProvider } from "./src/pages/api-operation-page/data-list-context";
import { RouterLinkProps } from "./types";

const queryClient = new QueryClient({
defaultOptions: {
Expand All @@ -20,13 +21,6 @@ const queryClient = new QueryClient({
},
});

type RouterLinkProps = {
href: string;
replace?: boolean;
target?: string;
children?: ReactNode;
};

const RouterLink = ({ href, replace, target, ...props }: RouterLinkProps) => {
if (target === "_blank") return <a href={href} target={target} {...props} />;
return <Link to={href} replace={replace} {...props} />;
Expand Down
2 changes: 1 addition & 1 deletion client/router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Route, Routes } from "react-router-dom";

import Home from "./src/pages/home";
import ApiOperationPage from "./src/pages/api-operation-page/link-publications";
import ApiOperationPage from "./src/pages/api-operation-page/index";
import Layout from "./src/layout";
import React from "react";
import ContactAndContributionPage from "./src/pages/contact-contributionbyobject-page";
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/send-mail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
Row,
Col,
} from "@dataesr/dsfr-plus";
import { EmailSenderProps } from "../../types";
import { toast } from "react-toastify";
import ProfileModal from "../../components/profil-modal";
import EmailForm from "../../components/mail-form";
import { getCollectionNameFromUrl } from "../utils/collectionName";
import { EmailSenderProps } from "../../types";

function EmailSender({ contribution, refetch }: EmailSenderProps) {
const [, setEmailSent] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/edit-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {
DismissibleTag,
Text,
} from "@dataesr/dsfr-plus";
import { EditModalProps, Inputs } from "../../types";
import { postHeaders } from "../../config/api";
import { toast } from "react-toastify";
import TagSelectionModal from "./modal-select-tags";
import ProfileModal from "../profil-modal";
import { EditModalProps, Inputs } from "../../types";

const EditModal: React.FC<EditModalProps> = ({
isOpen,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/graphs/by-domains.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";
import { Col, SegmentedControl, SegmentedElement } from "@dataesr/dsfr-plus";
import { ContributionDataType } from "../../types";
import { ClipLoader } from "react-spinners";
import { ContributionDataType } from "../../types";

const ContributionsGraphByDomains = ({
contributions,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/graphs/by-status.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";
import { ClipLoader } from "react-spinners";
import { ContributionDataType } from "../../types";
import "./styles.scss";
import { ContributionDataType } from "../../types";

const ContributionsGraphByStatus = ({ contributions, isLoading, isError }) => {
if (isLoading) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/graphs/by-tags.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";
import { ClipLoader } from "react-spinners";
import { ContributionDataType } from "../../types";
import "./styles.scss";
import { ContributionDataType } from "../../types";

const ContributionsGraphByTags = ({ contributions, isLoading, isError }) => {
if (isLoading) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/graphs/by-types.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";
import { ContributionDataType } from "../../types";
import { ClipLoader } from "react-spinners";
import { Col } from "@dataesr/dsfr-plus";
import { ContributionDataType } from "../../types";

const ContributionsGraphByTypes = ({ contributions, isLoading, isError }) => {
if (isLoading) {
Expand Down
1 change: 0 additions & 1 deletion client/src/components/graphs/contributions-by-name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const ContributionsGraphByTopContributors = ({
</div>
);
}

if (isError) {
return <div>Une erreur s'est produite</div>;
}
Expand Down
49 changes: 15 additions & 34 deletions client/src/components/graphs/styles.scss
Original file line number Diff line number Diff line change
@@ -1,41 +1,22 @@
.filter-buttons-container {
.loading-container {
display: flex;
justify-content: center;
gap: 15px;
margin-bottom: 30px;
}

.filter-button {
background-color: #f7f7f7;
border: 2px solid #ccc;
padding: 10px 20px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
border-radius: 25px;
color: #333;
}

.filter-button:hover {
background-color: #2196f3;
color: white;
border-color: #2196f3;
transform: translateY(-3px);
align-items: center;
height: 100vh;
border-radius: 10px;
box-shadow: 0 0 20px rgba(62, 111, 225, 0.6), 0 0 50px rgba(62, 111, 225, 0.4);
animation: neon-glow 1.5s ease-in-out infinite alternate;
}

.filter-button.active {
background-color: #2196f3;
color: white;
border-color: #2196f3;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
@keyframes neon-glow {
from {
box-shadow: 0 0 20px rgba(62, 111, 225, 0.6), 0 0 50px rgba(17, 0, 255, 0.4);
}
to {
box-shadow: 0 0 30px rgba(62, 111, 225, 0.6), 0 0 60px rgba(17, 0, 255, 0.4);
}
}

.graph-container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: white;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
.clip-loader {
border-color: #0ff;
}
2 changes: 1 addition & 1 deletion client/src/components/graphs/treatment-by-admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import HighchartsReact from "highcharts-react-official";
import Highcharts from "highcharts";

import { Col, SegmentedControl, SegmentedElement } from "@dataesr/dsfr-plus";
import { ContributionDataType } from "../../types";
import { ClipLoader } from "react-spinners";
import { ContributionDataType } from "../../types";

const AdminTreatmentGraph = ({
contributions,
Expand Down
28 changes: 14 additions & 14 deletions client/src/config/profil-config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[
"Eric",
"Emmanuel",
"Zoé",
"Anne",
"Mihoub",
"Fred",
"Julia",
"Victor",
"Yann",
"Jeremy",
"Mialy",
"Hafsa",
"Alexandra"
]
"Eric",
"Emmanuel",
"Zoé",
"Anne",
"Mihoub",
"Fred",
"Julia",
"Victor",
"Yann",
"Jeremy",
"Mialy",
"Hafsa",
"Alexandra"
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ import ContributorProductionInfo from "./contributor-production-info";
import StaffProductionActions from "./staff-production-action";
import { useState } from "react";
import { FaCopy } from "react-icons/fa";
import { Contribute_Production } from "../../../types";
import { BadgeStatus, StatusLabel } from "../../../utils/index";
import { BadgeStatus, StatusLabel } from "../../utils/index";
import { ContributionProductionItemProps } from "./types";

const ContributionProductionItem = ({
const ContributionProductionItem: React.FC<ContributionProductionItemProps> = ({
data,
refetch,
allTags,
}: {
data: Contribute_Production;
refetch: any;
allTags: string[];
}) => {
const [copiedId, setCopiedId] = useState<string | null>(null);

Expand All @@ -34,6 +30,7 @@ const ContributionProductionItem = ({
}, 2000);
});
};

const renderAccordion = () => (
<Container fluid className="accordion">
<Row>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Contribute_Production } from "../../../types";
import MessagePreview from "./message-preview";
import { ContributorProductionInfoProps } from "./types";

const ContributorProductionInfo = ({
const ContributorProductionInfo: React.FC<ContributorProductionInfoProps> = ({
data,
refetch,
allTags,
}: {
data: Contribute_Production;
refetch: any;
allTags: any;
}) => {
return <MessagePreview allTags={allTags} data={data} refetch={refetch} />;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ import { ExternalLinks } from "./external-links";
import { useDataList } from "./data-list-context";
import { Col } from "@dataesr/dsfr-plus";
import "./styles.scss";
import { Production } from "../../../types";
import { ContributorRequestsProps } from "./types";

const ContributorRequests: React.FC<{
data: {
objectId: string;
id: string;
name: string;
productions: Production[];
};
coloredName: string;
}> = ({ data, coloredName }) => {
const ContributorRequests: React.FC<ContributorRequestsProps> = ({
data,
coloredName,
}) => {
const [copiedId, setCopiedId] = useState<string | null>(null);
const { dataList } = useDataList();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import { Key, useState } from "react";
import { useState, Key } from "react";
import { Badge, Button, ButtonGroup, Text, Title } from "@dataesr/dsfr-plus";
import * as XLSX from "xlsx";
import { AiOutlineDelete } from "react-icons/ai";
import { toast } from "react-toastify";
import { useDataList } from "./data-list-context";
import "./styles.scss";
import { postHeaders } from "../../../config/api";

interface ExcelExportButtonProps {
refetch: () => void;
}
import { postHeaders } from "../../config/api";
import { ContributionData, ExcelExportButtonProps } from "./types";

const ExcelExportButton: React.FC<ExcelExportButtonProps> = ({ refetch }) => {
const { dataList, setDataList } = useDataList();
const [isMinimized, setIsMinimized] = useState(false);
const markAsTreated = async (
contributionIds: any[] | Iterable<unknown> | null | undefined
) => {

const markAsTreated = async (contributionIds: string[]) => {
const basePath = window.location.pathname.includes("contributionpage")
? "contribute"
: window.location.pathname.includes("apioperations")
Expand Down Expand Up @@ -58,15 +54,16 @@ const ExcelExportButton: React.FC<ExcelExportButtonProps> = ({ refetch }) => {
};

const handleExportClick = async () => {
const dataToExport = dataList
const dataToExport: ContributionData[] = dataList
.filter((item) => item.export === true)
.map((item) => ({
person_id: item.person_id || "",
publi_id: item.publi_id || "",
contribution_id: item.contribution_id || "",
full_name: item.fullName || "",
fullName: item.fullName || "",
first_name: item.first_name || "",
last_name: item.last_name || "",
export: false,
}));

if (dataToExport.length === 0) {
Expand Down
Loading

0 comments on commit ee5bfcd

Please sign in to comment.