imio.smartweb.core 1.2.37__py3-none-any.whl → 1.2.79__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imio/smartweb/core/behaviors/categorization.py +24 -0
- imio/smartweb/core/behaviors/configure.zcml +7 -0
- imio/smartweb/core/browser/controlpanel.py +43 -0
- imio/smartweb/core/browser/faceted/block_view.pt +4 -4
- imio/smartweb/core/browser/faceted/summary_view.pt +4 -4
- imio/smartweb/core/browser/sitemap.py +10 -3
- imio/smartweb/core/browser/static/icons/action-delete.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-engagement-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/action-panneaux.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-vote.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-attention.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-infos-travaux-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-nature.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-parcs-a-conteneurs.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-plus.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-primes-2.svg +5 -0
- imio/smartweb/core/browser/static/icons/categorie-sport-natation.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-ecole-sac.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-scout.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-behance.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-linkedin.svg +3 -0
- imio/smartweb/core/browser/static/smartweb-edit-compiled.css +1 -1
- imio/smartweb/core/browser/static/smartweb-view-compiled.css +1 -1
- imio/smartweb/core/browser/static/src/edit.less +42 -0
- imio/smartweb/core/browser/static/src/view.less +109 -56
- imio/smartweb/core/browser/vocabulary.py +8 -3
- imio/smartweb/core/contents/__init__.py +2 -0
- imio/smartweb/core/contents/configure.zcml +1 -0
- imio/smartweb/core/contents/folder/block_view.pt +8 -8
- imio/smartweb/core/contents/folder/summary_view.pt +4 -4
- imio/smartweb/core/contents/pages/cirkwi/content.py +5 -0
- imio/smartweb/core/contents/pages/cirkwi/view.py +2 -1
- imio/smartweb/core/contents/pages/configure.zcml +1 -0
- imio/smartweb/core/contents/pages/portal_page/view.py +3 -0
- imio/smartweb/core/contents/pages/views.py +47 -1
- imio/smartweb/core/contents/publication/__init__.py +0 -0
- imio/smartweb/core/contents/publication/configure.zcml +5 -0
- imio/smartweb/core/contents/publication/content.py +23 -0
- imio/smartweb/core/contents/rest/base.py +9 -7
- imio/smartweb/core/contents/rest/directory/endpoint.py +2 -2
- imio/smartweb/core/contents/rest/directory/view.pt +2 -1
- imio/smartweb/core/contents/rest/events/content.py +13 -0
- imio/smartweb/core/contents/rest/events/endpoint.py +5 -3
- imio/smartweb/core/contents/rest/events/view.pt +5 -1
- imio/smartweb/core/contents/rest/events/view.py +12 -0
- imio/smartweb/core/contents/rest/news/content.py +6 -0
- imio/smartweb/core/contents/rest/news/endpoint.py +4 -2
- imio/smartweb/core/contents/rest/news/view.pt +4 -1
- imio/smartweb/core/contents/rest/news/view.py +8 -0
- imio/smartweb/core/contents/rest/utils.py +0 -1
- imio/smartweb/core/contents/rest/view.py +4 -0
- imio/smartweb/core/contents/sections/common_templates/carousel.pt +5 -1
- imio/smartweb/core/contents/sections/common_templates/table.pt +18 -4
- imio/smartweb/core/contents/sections/configure.zcml +18 -0
- imio/smartweb/core/contents/sections/contact/content.py +2 -2
- imio/smartweb/core/contents/sections/contact/macros.pt +28 -3
- imio/smartweb/core/contents/sections/contact/utils.py +2 -0
- imio/smartweb/core/contents/sections/contact/view.py +28 -12
- imio/smartweb/core/contents/sections/events/content.py +12 -4
- imio/smartweb/core/contents/sections/events/view.py +20 -2
- imio/smartweb/core/contents/sections/external_content/view.pt +4 -4
- imio/smartweb/core/contents/sections/external_content/views.py +6 -4
- imio/smartweb/core/contents/sections/files/content.py +7 -1
- imio/smartweb/core/contents/sections/files/view.py +43 -12
- imio/smartweb/core/contents/sections/links/view.py +5 -0
- imio/smartweb/core/contents/sections/macros.pt +26 -0
- imio/smartweb/core/contents/sections/news/content.py +11 -3
- imio/smartweb/core/contents/sections/news/view.py +20 -2
- imio/smartweb/core/contents/sections/text/views.py +2 -0
- imio/smartweb/core/contents/sections/views.py +73 -10
- imio/smartweb/core/interfaces.py +4 -0
- imio/smartweb/core/profiles/default/metadata.xml +1 -1
- imio/smartweb/core/profiles/default/taxonomies/page_category.xml +16 -0
- imio/smartweb/core/profiles/default/taxonomies/procedure_category.xml +26 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.EventsView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.NewsView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.Publication.xml +38 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionEvents.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionFiles.xml +2 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionNews.xml +1 -0
- imio/smartweb/core/profiles/default/types.xml +1 -0
- imio/smartweb/core/profiles/icons/basic/registry.xml +120 -0
- imio/smartweb/core/rest/authentic_sources.py +17 -2
- imio/smartweb/core/subscribers.py +48 -0
- imio/smartweb/core/subscribers.zcml +12 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_institutions.json +60 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_publication.json +105 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_publications.json +270 -0
- imio/smartweb/core/tests/resources/json_rest_events.json +6 -2
- imio/smartweb/core/tests/resources/json_rest_news.json +2 -2
- imio/smartweb/core/tests/resources/json_rest_specific_events.json +1 -1
- imio/smartweb/core/tests/test_htmx_in_sections.py +131 -0
- imio/smartweb/core/tests/test_iadeliberations.py +136 -0
- imio/smartweb/core/tests/test_icons.py +1 -1
- imio/smartweb/core/tests/test_rest.py +58 -17
- imio/smartweb/core/tests/test_section_contact.py +42 -10
- imio/smartweb/core/tests/test_section_events.py +28 -5
- imio/smartweb/core/tests/test_section_external_content.py +28 -2
- imio/smartweb/core/tests/test_section_news.py +30 -8
- imio/smartweb/core/tests/test_sections.py +17 -0
- imio/smartweb/core/tests/test_vocabularies.py +60 -3
- imio/smartweb/core/tests/test_vocabulary.py +43 -0
- imio/smartweb/core/upgrades/configure.zcml +108 -0
- imio/smartweb/core/upgrades/profiles/1055_to_1056/types/imio.smartweb.SectionFiles.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.EventsView.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.NewsView.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionEvents.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionNews.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.cfg +9 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.xml +73 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.cfg +9 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.xml +118 -0
- imio/smartweb/core/upgrades/profiles/1058_to_1059/registry/linkedin-icon.xml +126 -0
- imio/smartweb/core/upgrades/profiles/1059_to_1060/registry/iadeliberation.xml +9 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.Publication.xml +38 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.SectionFiles.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types.xml +4 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/workflows.xml +6 -0
- imio/smartweb/core/utils.py +33 -2
- imio/smartweb/core/viewlets/configure.zcml +23 -1
- imio/smartweb/core/viewlets/footer.pt +5 -0
- imio/smartweb/core/viewlets/footer.py +5 -0
- imio/smartweb/core/viewlets/htmx.py +15 -0
- imio/smartweb/core/viewlets/htmx_js_header.pt +64 -0
- imio/smartweb/core/viewlets/ogptags.py +4 -3
- imio/smartweb/core/viewlets/social.py +23 -0
- imio/smartweb/core/vocabularies.py +65 -3
- imio/smartweb/core/vocabularies.zcml +18 -0
- imio/smartweb/core/webcomponents/build/1c1605a5fe9a2b10a88f.png +1 -0
- imio/smartweb/core/webcomponents/build/524db40e119aa11f4478.png +1 -0
- imio/smartweb/core/webcomponents/build/57d3b7cb1ab874660b39.svg +1 -0
- imio/smartweb/core/webcomponents/build/6cf03871df23ed2ee8b3.png +1 -0
- imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
- imio/smartweb/core/webcomponents/build/css/919.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +10 -8
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +2 -1
- imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js.LICENSE.txt → 373.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -4
- imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/499.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/{674.smartweb-webcomponents-compiled.js.LICENSE.txt → 499.smartweb-webcomponents-compiled.js.LICENSE.txt} +1 -8
- imio/smartweb/core/webcomponents/build/js/799.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/824.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js.LICENSE.txt +32 -0
- imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
- imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js → 963.smartweb-webcomponents-compiled.js} +2 -2
- imio/smartweb/core/webcomponents/build/js/963.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -0
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js.LICENSE.txt +11 -14
- imio/smartweb/core/webcomponents/package.json +42 -40
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +146 -79
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +415 -351
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +95 -62
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +328 -168
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +21 -4
- imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +213 -100
- imio/smartweb/core/webcomponents/src/components/Annuaire/index.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +76 -33
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +604 -377
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +29 -4
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +162 -88
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +496 -378
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +259 -91
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -55
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +68 -17
- imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
- imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +229 -0
- imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
- imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
- imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +139 -83
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +133 -67
- imio/smartweb/core/webcomponents/src/components/News/News.scss +170 -127
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +76 -44
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +261 -188
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +48 -9
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +21 -10
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +21 -10
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +8 -9
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +7 -6
- imio/smartweb/core/webcomponents/src/components/Search/Search.scss +115 -96
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +12 -3
- imio/smartweb/core/webcomponents/src/components/Search/index.js +1 -1
- imio/smartweb/core/webcomponents/src/hooks/ScrollContext.jsx +3 -0
- imio/smartweb/core/webcomponents/src/hooks/useAxios.js +3 -3
- imio/smartweb/core/webcomponents/src/hooks/useFilterQuery.js +1 -2
- imio/smartweb/core/webcomponents/src/index.scss +255 -211
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +26 -19
- imio/smartweb/core/webcomponents/src/utils/Map.scss +2 -2
- imio/smartweb/core/webcomponents/src/utils/translation.js +129 -9
- imio.smartweb.core-1.2.79-py3.8-nspkg.pth +2 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/METADATA +413 -10
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/RECORD +206 -160
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/assets/location-bla.1423bcce16ddcb21141430cac1428dc1.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/next-react-white.819cb069ac8eec300a9db6a7707712d6.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/next-react.17bc43ff4a6a86f4520f5782f6a89a72.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/search.57bdbf5b191499cd77514097d1c4972c.svg +0 -1
- imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/js/209.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/674.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/804.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/src/assets/facebook-news.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/location-bla.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/next-react.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/search.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/skeleton.svg +0 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/download.svg +0 -1
- imio.smartweb.core-1.2.37-py3.10-nspkg.pth +0 -3
- /imio/smartweb/core/webcomponents/build/js/{209.smartweb-webcomponents-compiled.js.LICENSE.txt → 824.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,23 @@
|
|
1
|
+
import React, { useEffect, useContext } from "react";
|
1
2
|
import ContactCard from "../ContactCard/ContactCard";
|
2
3
|
import { Link } from "react-router-dom";
|
3
|
-
import React from "react";
|
4
4
|
import removeAccents from "remove-accents";
|
5
|
-
|
5
|
+
import { ScrollContext } from "../../../hooks/ScrollContext";
|
6
|
+
const ContactList = ({ contactArray, onChange, onHover, contextAuthenticatedUser }) => {
|
7
|
+
const { scrollPos, updateScrollPos } = useContext(ScrollContext);
|
8
|
+
|
6
9
|
function handleClick(event) {
|
7
10
|
onChange(event);
|
11
|
+
updateScrollPos(window.scrollY);
|
8
12
|
}
|
9
13
|
|
10
14
|
function handleHover(event) {
|
11
15
|
onHover(event);
|
12
16
|
}
|
17
|
+
|
18
|
+
useEffect(() => {
|
19
|
+
window.scrollTo({ top: scrollPos, left: 0, behavior: "instant" });
|
20
|
+
}, [contactArray]);
|
13
21
|
return (
|
14
22
|
<React.Fragment>
|
15
23
|
<ul className="r-result-list annuaire-result-list">
|
@@ -25,14 +33,23 @@ const ContactList = ({ contactArray, onChange, onHover, parentCallback }) => {
|
|
25
33
|
className="r-list-item-link"
|
26
34
|
style={{ textDecoration: "none" }}
|
27
35
|
to={{
|
28
|
-
pathname:
|
36
|
+
pathname:
|
37
|
+
"/" +
|
38
|
+
removeAccents(item.title)
|
39
|
+
.replace(/[^a-zA-Z ]/g, "")
|
40
|
+
.replace(/\s/g, "-")
|
41
|
+
.toLowerCase(),
|
29
42
|
search: `?u=${item.UID}`,
|
30
43
|
state: {
|
31
44
|
idItem: item.UID,
|
32
45
|
},
|
33
46
|
}}
|
34
47
|
></Link>
|
35
|
-
<ContactCard
|
48
|
+
<ContactCard
|
49
|
+
item={item}
|
50
|
+
contextAuthenticatedUser={contextAuthenticatedUser}
|
51
|
+
key={item.created}
|
52
|
+
/>
|
36
53
|
</li>
|
37
54
|
))}
|
38
55
|
</ul>
|
@@ -1,16 +1,51 @@
|
|
1
1
|
import React, { useEffect, useRef, useCallback, useState } from "react";
|
2
2
|
import Select from "react-select";
|
3
|
-
import {
|
3
|
+
import { useNavigate } from "react-router-dom";
|
4
4
|
import useAxios from "../../../hooks/useAxios";
|
5
5
|
import { Translator } from "react-translated";
|
6
|
+
import queryString from "query-string";
|
7
|
+
// import TaxonomyFilter from "../../Filters/TaxonomyFilter";
|
8
|
+
import { iam } from "./../../Filters/IamData";
|
9
|
+
import { menuStyles, moreFilterStyles } from "./../../Filters/SelectStyles";
|
10
|
+
|
11
|
+
function formatData(data) {
|
12
|
+
let result = [];
|
13
|
+
|
14
|
+
data.forEach((item) => {
|
15
|
+
let titles = item.title.split(" » ");
|
16
|
+
let token = item.token;
|
17
|
+
|
18
|
+
let level = result;
|
19
|
+
titles.forEach((title) => {
|
20
|
+
let existingItem = level.find((x) => x.title === title);
|
21
|
+
if (existingItem) {
|
22
|
+
if (!existingItem.sub) {
|
23
|
+
existingItem.sub = [];
|
24
|
+
}
|
25
|
+
level = existingItem.sub;
|
26
|
+
} else {
|
27
|
+
let newItem = { title: title, token: token, sub: [] };
|
28
|
+
level.push(newItem);
|
29
|
+
level = newItem.sub;
|
30
|
+
}
|
31
|
+
});
|
32
|
+
});
|
33
|
+
|
34
|
+
// Remove empty 'sub' arrays
|
35
|
+
const cleanResult = JSON.parse(JSON.stringify(result).replace(/,"sub":\[\]/g, ""));
|
36
|
+
|
37
|
+
return cleanResult;
|
38
|
+
}
|
6
39
|
|
7
40
|
function Filters(props) {
|
8
|
-
let
|
9
|
-
const queryString = require("query-string");
|
41
|
+
let navigate = useNavigate();
|
10
42
|
const [inputValues, setInputValues] = useState(props.activeFilter);
|
11
|
-
const [topicsFilter, setTopicsFilter] = useState(
|
43
|
+
const [topicsFilter, setTopicsFilter] = useState([]);
|
44
|
+
// const [taxonomyData, setTaxonomyData] = useState(null);
|
12
45
|
const [taxonomyFilter, setTaxonomyFilter] = useState(null);
|
13
46
|
const [facilitiesFilter, setFacilitiesFilter] = useState(null);
|
47
|
+
const [cat, setCat] = useState(false);
|
48
|
+
const [activeComponent, setActiveComponent] = useState(null);
|
14
49
|
const { response, error, isLoading } = useAxios({
|
15
50
|
method: "get",
|
16
51
|
url: "",
|
@@ -29,6 +64,8 @@ function Filters(props) {
|
|
29
64
|
value: d.token,
|
30
65
|
label: d.title,
|
31
66
|
}));
|
67
|
+
|
68
|
+
// const taxodonnee = formatData(response.taxonomy_contact_category);
|
32
69
|
const optionsTaxonomy =
|
33
70
|
response.taxonomy_contact_category &&
|
34
71
|
response.taxonomy_contact_category.map((d) => ({
|
@@ -42,11 +79,13 @@ function Filters(props) {
|
|
42
79
|
label: d.title,
|
43
80
|
}));
|
44
81
|
setTopicsFilter(optionsTopics);
|
82
|
+
// setTaxonomyData(taxodonnee);
|
45
83
|
setTaxonomyFilter(optionsTaxonomy);
|
46
84
|
setFacilitiesFilter(optionsFacilities);
|
47
85
|
}
|
48
86
|
}, [response]);
|
49
87
|
|
88
|
+
// set values from search input
|
50
89
|
const onChangeHandler = useCallback(({ target: { name, value } }) => {
|
51
90
|
if (value.length > 2) {
|
52
91
|
setInputValues((state) => ({ ...state, [name]: value }), []);
|
@@ -58,6 +97,8 @@ function Filters(props) {
|
|
58
97
|
});
|
59
98
|
}
|
60
99
|
});
|
100
|
+
|
101
|
+
// set values from select
|
61
102
|
const onChangeHandlerSelect = useCallback((value, action) => {
|
62
103
|
const inputName = action.name;
|
63
104
|
if (value) {
|
@@ -78,7 +119,7 @@ function Filters(props) {
|
|
78
119
|
firstUpdate.current = false;
|
79
120
|
return;
|
80
121
|
}
|
81
|
-
|
122
|
+
navigate({
|
82
123
|
pathname: "./",
|
83
124
|
search: queryString.stringify(inputValues),
|
84
125
|
});
|
@@ -98,110 +139,182 @@ function Filters(props) {
|
|
98
139
|
taxonomyFilter.filter(
|
99
140
|
(option) => option.value === props.activeFilter.taxonomy_contact_category
|
100
141
|
);
|
142
|
+
|
101
143
|
let actFaci =
|
102
144
|
facilitiesFilter &&
|
103
145
|
facilitiesFilter.filter((option) => option.value === props.activeFilter.facilities);
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
height: "50px",
|
110
|
-
}),
|
111
|
-
placeholder: (styles) => ({
|
112
|
-
...styles,
|
113
|
-
color: "000",
|
114
|
-
fontWeight: "bold",
|
115
|
-
fontSize: "12px",
|
116
|
-
textTransform: "uppercase",
|
117
|
-
letterSpacing: "1.2px",
|
118
|
-
}),
|
119
|
-
option: (styles, { data, isDisabled, isFocused, isSelected }) => {
|
120
|
-
return {
|
121
|
-
...styles,
|
122
|
-
};
|
123
|
-
},
|
146
|
+
|
147
|
+
let actIam = iam && iam.filter((option) => option.value === props.activeFilter.topics);
|
148
|
+
|
149
|
+
const handleClick = (index) => {
|
150
|
+
setActiveComponent(index);
|
124
151
|
};
|
125
152
|
|
126
153
|
return (
|
127
154
|
<React.Fragment>
|
128
|
-
<
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
<
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
155
|
+
<div className="react-filters-menu">
|
156
|
+
<div className="react-filters-container">
|
157
|
+
<form className="r-filter r-filter-search" onSubmit={handleSubmit}>
|
158
|
+
{/* Filtre Recherche */}
|
159
|
+
<div className="relative">
|
160
|
+
<Translator>
|
161
|
+
{({ translate }) => (
|
162
|
+
<input
|
163
|
+
className="input-custom-class"
|
164
|
+
name="SearchableText"
|
165
|
+
type="text"
|
166
|
+
value={inputValues.SearchableText}
|
167
|
+
onChange={onChangeHandler}
|
168
|
+
placeholder={translate({
|
169
|
+
text: "Recherche",
|
170
|
+
})}
|
171
|
+
/>
|
172
|
+
)}
|
173
|
+
</Translator>
|
174
|
+
<svg
|
175
|
+
xmlns="http://www.w3.org/2000/svg"
|
176
|
+
fill="none"
|
177
|
+
stroke="#9f9f9f"
|
178
|
+
strokeWidth="4"
|
179
|
+
aria-hidden="true"
|
180
|
+
display="block"
|
181
|
+
overflow="visible"
|
182
|
+
style={{ height: 16, width: 16 }}
|
183
|
+
viewBox="0 0 32 32"
|
184
|
+
>
|
185
|
+
<path d="M13 24a11 11 0 1 0 0-22 11 11 0 0 0 0 22zm8-3 9 9" />
|
186
|
+
</svg>
|
187
|
+
</div>
|
188
|
+
</form>
|
189
|
+
{/* More filter*/}
|
190
|
+
<button
|
191
|
+
className="more-filter-btn collapsed"
|
192
|
+
type="button"
|
193
|
+
data-bs-toggle="collapse"
|
194
|
+
data-bs-target="#collapseOne"
|
195
|
+
aria-expanded="false"
|
196
|
+
aria-controls="collapseOne"
|
197
|
+
>
|
198
|
+
<svg
|
199
|
+
xmlns="http://www.w3.org/2000/svg"
|
200
|
+
viewBox="0 0 32 32"
|
201
|
+
style={{ height: 16, width: 16 }}
|
202
|
+
fill="none"
|
203
|
+
stroke="currentColor"
|
204
|
+
strokeWidth="3"
|
205
|
+
aria-hidden="true"
|
206
|
+
display="block"
|
207
|
+
overflow="visible"
|
208
|
+
>
|
209
|
+
<path d="M7 16H3m26 0H15M29 6h-4m-8 0H3m26 20h-4M7 16a4 4 0 108 0 4 4 0 00-8 0zM17 6a4 4 0 108 0 4 4 0 00-8 0zm0 20a4 4 0 108 0 4 4 0 00-8 0zm0 0H3"></path>
|
210
|
+
</svg>
|
211
|
+
</button>
|
212
|
+
<div className="react-sep-menu"></div>
|
213
|
+
{/* Filtre Thématique */}
|
214
|
+
<div className="r-filter top-filter topics-Filter">
|
215
|
+
<Translator>
|
216
|
+
{({ translate }) => (
|
217
|
+
<Select
|
218
|
+
styles={menuStyles}
|
219
|
+
name={"topics"}
|
220
|
+
className="select-custom-no-border"
|
221
|
+
isClearable
|
222
|
+
onChange={onChangeHandlerSelect}
|
223
|
+
options={topicsFilter && topicsFilter}
|
224
|
+
placeholder={translate({
|
225
|
+
text: "Thématiques",
|
226
|
+
})}
|
227
|
+
value={actTopi && actTopi[0]}
|
228
|
+
/>
|
229
|
+
)}
|
230
|
+
</Translator>
|
231
|
+
</div>
|
232
|
+
{/* Filtre iam */}
|
233
|
+
<div className="r-filter top-filter iam-Filter">
|
234
|
+
{/* <label>Thématiques</label> */}
|
235
|
+
<Translator>
|
236
|
+
{({ translate }) => (
|
237
|
+
<Select
|
238
|
+
styles={menuStyles}
|
239
|
+
name={"iam"}
|
240
|
+
className="select-custom-no-border"
|
241
|
+
isClearable
|
242
|
+
onChange={onChangeHandlerSelect}
|
243
|
+
options={iam && iam}
|
244
|
+
placeholder={translate({
|
245
|
+
text: "Profil",
|
246
|
+
})}
|
247
|
+
value={actIam && actIam[0]}
|
248
|
+
/>
|
249
|
+
)}
|
250
|
+
</Translator>
|
251
|
+
</div>
|
252
|
+
{/* Filtre Facilités */}
|
253
|
+
<div className="r-filter top-filter facilities-Filter">
|
254
|
+
{/* <label>Facilité</label> */}
|
255
|
+
<Translator>
|
256
|
+
{({ translate }) => (
|
257
|
+
<Select
|
258
|
+
styles={menuStyles}
|
259
|
+
name={"facilities"}
|
260
|
+
className="select-custom-no-border"
|
261
|
+
isClearable
|
262
|
+
onChange={onChangeHandlerSelect}
|
263
|
+
options={facilitiesFilter && facilitiesFilter}
|
264
|
+
placeholder={translate({
|
265
|
+
text: "Facilités",
|
266
|
+
})}
|
267
|
+
value={actFaci && actFaci[0]}
|
268
|
+
/>
|
269
|
+
)}
|
270
|
+
</Translator>
|
271
|
+
</div>
|
146
272
|
</div>
|
147
|
-
</form>
|
148
|
-
|
149
|
-
<div className="r-filter topics-Filter">
|
150
|
-
{/* <label>Thématiques</label> */}
|
151
|
-
<Translator>
|
152
|
-
{({ translate }) => (
|
153
|
-
<Select
|
154
|
-
styles={customStyles}
|
155
|
-
name={"topics"}
|
156
|
-
className="select-custom-class library-topics"
|
157
|
-
isClearable
|
158
|
-
onChange={onChangeHandlerSelect}
|
159
|
-
options={topicsFilter && topicsFilter}
|
160
|
-
placeholder={translate({
|
161
|
-
text: 'Thématiques'
|
162
|
-
})}
|
163
|
-
value={actTopi && actTopi[0]}
|
164
|
-
/>
|
165
|
-
)}
|
166
|
-
</Translator>
|
167
|
-
</div>
|
168
|
-
<div className="r-filter facilities-Filter">
|
169
|
-
{/* <label>Catégories</label> */}
|
170
|
-
<Translator>
|
171
|
-
{({ translate }) => (
|
172
|
-
<Select
|
173
|
-
styles={customStyles}
|
174
|
-
name={"taxonomy_contact_category_for_filtering"}
|
175
|
-
className="select-custom-class library-facilities"
|
176
|
-
isClearable
|
177
|
-
onChange={onChangeHandlerSelect}
|
178
|
-
options={taxonomyFilter && taxonomyFilter}
|
179
|
-
placeholder={translate({
|
180
|
-
text: 'Catégories'
|
181
|
-
})}
|
182
|
-
value={actTaxo && actTaxo[0]}
|
183
|
-
/>
|
184
|
-
)}
|
185
|
-
</Translator>
|
186
273
|
</div>
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
274
|
+
{/* More filter */}
|
275
|
+
|
276
|
+
{/* Affichage dynamique des liens avec divs associées */}
|
277
|
+
<div
|
278
|
+
id="collapseOne"
|
279
|
+
className="accordion-collapse collapse more-filter-container "
|
280
|
+
aria-labelledby="headingOne"
|
281
|
+
data-bs-parent="#accordionExample"
|
282
|
+
>
|
283
|
+
<div className="accordion-body">
|
284
|
+
{/* <div className="taxonomy-Filter">
|
285
|
+
{taxonomyData &&
|
286
|
+
taxonomyData.map((donnees, i) => (
|
287
|
+
<TaxonomyFilter
|
288
|
+
key={i}
|
289
|
+
{...donnees}
|
290
|
+
setCat={setCat}
|
291
|
+
isActive={i === activeComponent}
|
292
|
+
onClick={() => handleClick(i)}
|
293
|
+
onChange={onChangeHandlerSelect}
|
294
|
+
test={i}
|
295
|
+
/>
|
296
|
+
))}
|
297
|
+
</div> */}
|
298
|
+
<div className="r-filter facilities-Filter">
|
299
|
+
{/* <label>Catégories</label> */}
|
300
|
+
<Translator>
|
301
|
+
{({ translate }) => (
|
302
|
+
<Select
|
303
|
+
styles={moreFilterStyles}
|
304
|
+
name={"taxonomy_contact_category_for_filtering"}
|
305
|
+
className="select-custom-class library-facilities"
|
306
|
+
isClearable
|
307
|
+
onChange={onChangeHandlerSelect}
|
308
|
+
options={taxonomyFilter && taxonomyFilter}
|
309
|
+
placeholder={translate({
|
310
|
+
text: "Catégories",
|
311
|
+
})}
|
312
|
+
value={actTaxo && actTaxo[0]}
|
313
|
+
/>
|
314
|
+
)}
|
315
|
+
</Translator>
|
316
|
+
</div>
|
317
|
+
</div>
|
205
318
|
</div>
|
206
319
|
</React.Fragment>
|
207
320
|
);
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import loadable from "@loadable/component";
|
2
|
-
export default loadable(() => import("./Annuaire"));
|
2
|
+
export default loadable(() => import("./Annuaire"));
|
@@ -1,42 +1,85 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import moment from "moment";
|
3
|
-
import
|
4
|
-
const ContactCard = ({ item }) => {
|
5
|
-
const title = item.title && item.title;
|
6
|
-
const category =
|
7
|
-
item.taxonomy_contact_category && item.taxonomy_contact_category[0];
|
8
|
-
const start = moment(item.start && item.start);
|
3
|
+
import { Translate } from "react-translated";
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const country = item.country ? item.country : "";
|
16
|
-
const phones = item.phones ? item.phones : "";
|
17
|
-
const mails = item.mails ? item.mails : "";
|
18
|
-
const topics = item.topics ? item.topics : "";
|
5
|
+
const ContactCard = ({ item, showCategoriesOrTopics, contextAuthenticatedUser }) => {
|
6
|
+
moment.locale("be");
|
7
|
+
const title = item.title && item.title;
|
8
|
+
const start = moment.utc(item.start).format("DD-MM-YYYY");
|
9
|
+
const end = moment.utc(item.end).format("DD-MM-YYYY");
|
19
10
|
return (
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
11
|
+
<>
|
12
|
+
{contextAuthenticatedUser === "False" ? (
|
13
|
+
<a
|
14
|
+
href={item["@id"]}
|
15
|
+
target="_blank"
|
16
|
+
title="Editer la fiche"
|
17
|
+
className="edit-rest-elements"
|
18
|
+
>
|
19
|
+
<svg
|
20
|
+
xmlns="http://www.w3.org/2000/svg"
|
21
|
+
width="16"
|
22
|
+
height="16"
|
23
|
+
fill="currentColor"
|
24
|
+
class="bi bi-pencil-square"
|
25
|
+
viewBox="0 0 16 16"
|
26
|
+
>
|
27
|
+
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
|
28
|
+
<path
|
29
|
+
fill-rule="evenodd"
|
30
|
+
d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"
|
31
|
+
/>
|
32
|
+
</svg>
|
33
|
+
</a>
|
34
|
+
) : (
|
35
|
+
""
|
36
|
+
)}
|
37
|
+
<div className="r-list-item">
|
38
|
+
<div
|
39
|
+
className={
|
40
|
+
item.image_vignette_scale
|
41
|
+
? "r-item-img"
|
42
|
+
: "r-item-img r-item-img-placeholder"
|
43
|
+
}
|
44
|
+
style={{
|
45
|
+
backgroundImage: item.image_vignette_scale
|
46
|
+
? "url(" + item.image_vignette_scale + ")"
|
47
|
+
: "",
|
48
|
+
}}
|
49
|
+
/>
|
29
50
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
51
|
+
<div className="r-item-text">
|
52
|
+
{start && (
|
53
|
+
<span className="r-item-date">
|
54
|
+
{start === end ? (
|
55
|
+
start
|
56
|
+
) : (
|
57
|
+
<>
|
58
|
+
{start} <Translate text="au" /> {end}
|
59
|
+
</>
|
60
|
+
)}
|
61
|
+
</span>
|
62
|
+
)}
|
63
|
+
<span className="r-item-title">{title}</span>
|
64
|
+
{showCategoriesOrTopics === "topic" ? (
|
65
|
+
item.topics &&
|
66
|
+
item.topics[0] && (
|
67
|
+
<span className="r-item-categorie">{item.topics[0].title}</span>
|
68
|
+
)
|
69
|
+
) : showCategoriesOrTopics === "category" ? (
|
70
|
+
item.local_category ? (
|
71
|
+
<span className="r-item-categorie">{item.local_category.title}</span>
|
72
|
+
) : (
|
73
|
+
item.category && (
|
74
|
+
<span className="r-item-categorie">{item.category.title}</span>
|
75
|
+
)
|
76
|
+
)
|
77
|
+
) : (
|
78
|
+
""
|
79
|
+
)}
|
80
|
+
</div>
|
38
81
|
</div>
|
39
|
-
|
82
|
+
</>
|
40
83
|
);
|
41
84
|
};
|
42
85
|
|