Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SocialGouv/fce into feat-add-marc…
Browse files Browse the repository at this point in the history
…he-public-infos
  • Loading branch information
ImenOuidou committed Oct 7, 2024
2 parents 0c1358d + e01cb09 commit ee87ef6
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .kontinuous/env/dev/templates/server.sealed-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ spec:
API_TOKEN: AgA5TseHibqsLxr1Cvom/JCKKSQNwFl8uWNS3sUf40jMc/bcyYWUyhQqYfsb/BCzzXpPP6O/S6Egy858/XZ2VshfIJ31iYYpoRydEzWZnOln4f9woxLc3U6pG5WP94QRJCpKUrsfTU68pZ+UDU3xnswXvQNwGgjb/F9ZTimwS585qHqdyuuFT6Fexf7kxPQXys1J7eAHUuqXcaUOrl/WDdzSuFjdA1HeKj6f747kNbT3wreEHqFtQTK+lNaSZUVZ5oMEJ5O3aGJd+eEWEHf9dvkKdVO1giGhH/hB42ziGq4bCVGFC4NerMUE/X7HYmtleR0MOiycTlBFzTbYkGugrMhgUEL4KxM/FXyCPfNr4YUbHJLOykUTeWstcclsx9Qhn3uRhdE9yXjabnh1NhLgjxp5ttD1EQGYQ8+floKGCsuXi/AMHvp0ewi1EJMV7WP5pDjx+3ywzDdfSnYolOI7iXkshEuZSkgIjBeU4K/wiqrcWbC3KX4Evgr+SoXO5DAucAu6InSjGdbRqxKfuhJcx1l12ggMOivYHt71CWJ3mFKS/vHLuTXwUOhpmr6Ifl6rxnMRHObmBjZdJmjF7WWWqkkpSxFJ9qWiNoKJYw/DtgNJlRyUQazjt6Qda8jv7XfDHuuO5qdChIjZU2ir2wwkLEd3GtlJRuJYSMq/SF8m0d+rShnWexM/MUe7RZIBdNTWwnflm0AhWvlX7JXe/5+GyraHa/MCM+QdQZvw/KfSAOPVNA==

#BCE
BCE_URL: AgAD7FqkOzeNjQlBIuEx4Yp3ca+fUPTZ86P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a0ht3LBws6ynhkhCmSavLqT+nlP8zs6vc455RKNFfKhC8uCn8WIsIWG2s/MpteBpJpA1bqdyqHGrgnh9jY18NrDelNtXqILpLFs3usn+IdqzcNrSD9yoZEYiQhuyBmPAaNsqE5xTwaQMjg8Vzu8IRG4dD57oudMdpGErkvncX/dvyt0yAAG3Jbfj3frdXpo7Vj+1jpuvOhSsZPhBwgjjld+ccY98Xm5vljLnHFiQioIoWbjNZw/S1uo4Q6mrDxNAZLXbTwjPE7BgLknHT0lMrMva8Pr+Ej9yn/LENmVCiHiwmmkWucaiXu4/Phom8rA+3P3kMiZfETHnZmMb4Zumqk1nSc89fcEd7S5tGmGYlY+ofeP3d5pdUQ+YJEWJtyvnKL5QfCpfkgNOERx5bqL0xOLKaZ387vD0DKUDfkdvAbvVTbRLJmLc/Yc9lEFNrmHn0Ej1B5+QhheMvsjFFiu2VacOX+2Wl7qTOL1WWvR2qCn5GHuO+nroykfl0OVaEsuhWJK/mSzpIcHLF5NbNk+IIJe+T3Q3oSMGThUmLhUX70axJF/qMxg1vB/7gNMwK03bbqldkVVzy3jZxb3bPpKND3y4zBx4V61qdE+gQxuEAwFBss87AH2Mohh/0KI7OINhibA8s9V65Xn96uFIgpks0YXFIvDOG6rPdqYyEiNznoJB51SxajLYZQO//ko3IBexJogCIxq4zdIAcAJMdhKbDYbgWGH2R6LeC6BhcDupr0g5UwZOUZaVrjbk/6nuE7rQS3i3uXOVMjg0uL5dCfWb1AfHSZnGNzeCOq1XCpQKu+0zXJaNq/b3Ohyiovf1Gt/qpofidULi0RgVHaRbcz3iN+xqVP1BpLLnC10Uwg4B9wrby2r5BQzb+xe9s0a0vHRJzIf8LkdBUjCdaY2QElzm7E8wb9dOqHvdMSmAvY+jT9WjY+Vh6/whKPrnztjdDaIbJ4LT8SyZYxjDA550uitOVXdVySy3vxzVmOPREAwerCCKq/
template:
metadata:
annotations: *a1
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [27.106.0](https://github.com/SocialGouv/fce/compare/v27.105.0...v27.106.0) (2024-09-25)


### Features

* Sort search result ([#351](https://github.com/SocialGouv/fce/issues/351)) ([f4d2f0b](https://github.com/SocialGouv/fce/commit/f4d2f0b782075efe6d71a70f63b2416ab3e98b32))

# [27.105.0](https://github.com/SocialGouv/fce/compare/v27.104.0...v27.105.0) (2024-09-19)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fce",
"version": "27.105.0",
"version": "27.106.0",
"description": "",
"author": "commit42",
"private": true,
Expand Down
8 changes: 7 additions & 1 deletion src/client/src/components/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Search = ({
searchTerm,
setSearchTerm,
resetSearch,
resetSort,
handlePageChange,
addFilter,
removeFilter,
Expand Down Expand Up @@ -94,7 +95,10 @@ const Search = ({
setSearchTerm={setSearchTerm}
resetSearch={resetSearch}
isLoading={isLoading}
onEnterPress={() => sendRequest(searchTerm, options)}
onEnterPress={() => {
resetSort();
sendRequest(searchTerm, options);
}}
/>
</div>
<div className="column is-3 ">
Expand All @@ -105,6 +109,7 @@ const Search = ({
})}
onClick={(e) => {
e.preventDefault();
resetSort();
sendRequest(searchTerm, options);
}}
>
Expand Down Expand Up @@ -257,6 +262,7 @@ Search.propTypes = {
removeFilter: PropTypes.func.isRequired,
removeFilters: PropTypes.func.isRequired,
resetSearch: PropTypes.func.isRequired,
resetSort: PropTypes.func.isRequired,
results: PropTypes.array,
searchTerm: PropTypes.string.isRequired,
sendRequest: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import "./awesomeTable.scss";

import {
faSort,
faSortDown,
faSortUp,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import classNames from "classnames";
import PropTypes from "prop-types";
import React from "react";
Expand All @@ -9,6 +15,12 @@ import LeftArrow from "../shared/Icons/LeftArrow.jsx";
import RightArrow from "../shared/Icons/RightArrow.jsx";
import LoadSpinner from "../shared/LoadSpinner";

const getSortIcon = (field, sortField, sortDirection) => {
if (field === sortField) {
return sortDirection === "asc" ? faSortDown : faSortUp;
}
return faSort;
};
const SearchAwesomeTable = ({
showPagination = false,
pagination,
Expand All @@ -17,6 +29,10 @@ const SearchAwesomeTable = ({
isLoading = false,
data,
fields,
// isSortable = true,
sortColumn,
sortField,
sortDirection,
}) => {
const handleRowClick = (event, element) => {
if (event.target.tagName === "A") {
Expand All @@ -29,9 +45,23 @@ const SearchAwesomeTable = ({
<thead className="at__head">
<tr className="at__head__tr">
{fields.map((field) => {
const isSortableField = field.sortKey;
return (
<th key={field.headName} className="at__head__th">
<th
key={field.headName}
className={classNames({
at__head__th: true,
"at__head__th--important": field.importantHead,
"at__head__th--is-sortable": !!isSortableField,
})}
onClick={() => isSortableField && sortColumn(field.sortKey)}
>
{field.headName}
{isSortableField && (
<FontAwesomeIcon
icon={getSortIcon(field.sortKey, sortField, sortDirection)}
/>
)}
</th>
);
})}
Expand Down
14 changes: 4 additions & 10 deletions src/client/src/components/SearchResults/SearchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ const SearchResults = ({
});
},
headName: "SIRET",
importantHead: true,
link: ({ siret }) => `/establishment/${siret}`,
sortKey: "siret",
},
{
accessor: ({ etatAdministratifEtablissement, siret }) => {
Expand All @@ -130,7 +128,7 @@ const SearchResults = ({
});
},
headName: "État",
sortKey: "etatadministratifetablissement",
sortKey: "etatAdministratifEtablissement",
},
{
accessor: (etablissement) => {
Expand All @@ -140,7 +138,6 @@ const SearchResults = ({
},
headName: "Raison sociale / Nom",
html: true,
sortKey: "enterprise_name",
},
{
accessor: (fields) => {
Expand Down Expand Up @@ -172,10 +169,8 @@ const SearchResults = ({
},

headName: "Dirigeants",
importantHead: true,
link: ({ fields }) =>
`/enterprise/${fields?.siren}#mandataires`,
sortKey: "dirigeants",
},
{
accessor: ({ etablissementSiege }) => {
Expand All @@ -186,7 +181,6 @@ const SearchResults = ({
});
},
headName: "Catégorie établissement",
sortKey: "etablissementsiege",
},
{
accessor: ({
Expand All @@ -201,8 +195,8 @@ const SearchResults = ({
});
},
headName: "Code postal",
sortKey: "codepostaletablissement",
},

{
accessor: ({
trancheEffectifsEtablissement,
Expand All @@ -222,7 +216,7 @@ const SearchResults = ({
});
},
headName: "Effectif (DSN)",
sortKey: "lastdsntrancheeffectifsetablissement",
sortKey: "trancheEffectifsEtablissement",
},
{
accessor: ({
Expand All @@ -239,7 +233,7 @@ const SearchResults = ({
);
},
headName: "Activité",
sortKey: "activiteprincipaleetablissement",
sortKey: "codeActivitePrincipale",
},
]}
/>
Expand Down
38 changes: 31 additions & 7 deletions src/client/src/containers/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { groupBy, omit } from "lodash";
import { prop } from "lodash/fp";
import moment from "moment";
import React, { useEffect } from "react";
import { useSelector } from "react-redux";

import SearchView from "../../components/Search";
import Http from "../../services/Http";
import {
useResetSearch,
useResetSort,
useSearchFilters,
useSearchPage,
useSearchQuery,
Expand All @@ -23,7 +25,7 @@ const PAGE_SIZE = 10;
const XLSX_DOC_TYPE =
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

const formatLocationFilter = (filters) => {
const formatLocationFilter = (filters, sortDirection, sortField) => {
const locationFilters = groupBy(filters.location, "type");
const codesCommunes = locationFilters?.commune?.map(prop("value")) || [];
const departements = [
Expand All @@ -32,39 +34,52 @@ const formatLocationFilter = (filters) => {
regionItem.regions.map((region) => region.value)
) || []),
];

return {
...omit(filters, "location"),
codesCommunes: normalizeCodeCommunes(codesCommunes),
departements,

sortField: sortField,
sortOrder: sortDirection,
};
};

const Search = () => {
const [searchQuery, setSearchQuery] = useSearchTerms();
const [searchPage, setSearchPage] = useSearchPage();
const sortFieldFromStore = useSelector(
(state) => state?.search?.sort?.sortField
);

const sortOrderFromStore = useSelector(
(state) => state?.search?.sort?.sortOrder
);

const { filters, addFilter, removeFilter, removeFilters } =
useSearchFilters();
const { sortField, sortDirection, toggleSortField } = useSort();

const { data, loading, error, makeQuery, query } = useSearchQuery();
const resetSearch = useResetSearch();

const resetSort = useResetSort();
useEffect(() => {
if (searchQuery) {
onSearch();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [sortField, sortDirection]);

const downloadQuery = async () => {
const trimmedQuery = searchQuery?.trim();

const response = await Http.get("/downloadXlsx", {
params: {
q: trimmedQuery,
...formatLocationFilter(filters),
...formatLocationFilter(
filters,
sortOrderFromStore != null ? sortDirection : null,
sortFieldFromStore != null ? sortField : null
),
},
responseType: "blob",
});
Expand All @@ -89,15 +104,23 @@ const Search = () => {
setSearchPage(nextCurrentPage);
makeQuery(searchQuery, {
page: { current: nextCurrentPage - 1, size: PAGE_SIZE },
params: formatLocationFilter(filters),
params: formatLocationFilter(
filters,
sortOrderFromStore != null ? sortDirection : null,
sortFieldFromStore != null ? sortField : null
),
});
};

const onSearch = () => {
setSearchPage(1);
makeQuery(searchQuery, {
page: { current: 0, size: PAGE_SIZE },
params: formatLocationFilter(filters),
params: formatLocationFilter(
filters,
sortOrderFromStore != null ? sortDirection : null,
sortFieldFromStore != null ? sortField : null
),
});
};

Expand All @@ -114,6 +137,7 @@ const Search = () => {
searchTerm={searchQuery || ""}
setSearchTerm={setSearchQuery}
resetSearch={resetSearch}
resetSort={resetSort}
handlePageChange={handlePageChange}
addFilter={addFilter}
removeFilter={removeFilter}
Expand Down
18 changes: 18 additions & 0 deletions src/client/src/services/Store/actions/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ export const setSearchTerm = (term) => (dispatch) => {
type: types.SET_SEARCH_TERM,
});
};
export const setSearchSortOrder = (sortOrder) => (dispatch) => {
dispatch({
sortOrder,
type: types.SET_SEARCH_SORT_ORDER,
});
};
export const setSearchSortField = (sortField) => (dispatch) => {
dispatch({
sortField,
type: types.SET_SEARCH_SORT_FIELD,
});
};

export const setSearchPage = (page) => (dispatch) => {
dispatch({
Expand Down Expand Up @@ -33,3 +45,9 @@ export const resetSearch = () => (dispatch) => {
type: types.RESET_SEARCH,
});
};

export const resetSort = () => (dispatch) => {
dispatch({
type: types.RESET_SORT,
});
};
3 changes: 3 additions & 0 deletions src/client/src/services/Store/constants/ActionTypes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export const SET_SEARCH_TERM = "SET_SEARCH_TERM";
export const SET_SEARCH_SORT_ORDER = "SET_SEARCH_SORT_ORDER";
export const SET_SEARCH_SORT_FIELD = "SET_SEARCH_SORT_FIELD";
export const SET_SEARCH_PAGE = "SET_SEARCH_PAGE";
export const SET_SEARCH_FILTERS = "SET_SEARCH_FILTERS";
export const SET_SEARCH_SORT = "SET_SEARCH_SORT";
export const SET_SEARCH_RESULTS = "SET_SEARCH_RESULTS";
export const RESET_SEARCH = "RESET_SEARCH";
export const RESET_SORT = "RESET_SORT";
Loading

0 comments on commit ee87ef6

Please sign in to comment.