imio.smartweb.core 1.2.29__py3-none-any.whl → 1.2.31__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/browser/configure.zcml +24 -0
- imio/smartweb/core/browser/redirect_to_main_react_view.py +47 -0
- imio/smartweb/core/browser/search/search.pt +2 -1
- imio/smartweb/core/browser/search/search.py +4 -0
- imio/smartweb/core/profiles/testing/types/imio.smartweb.DirectoryView.xml +11 -0
- imio/smartweb/core/profiles/testing/types/imio.smartweb.EventsView.xml +11 -0
- imio/smartweb/core/profiles/testing/types/imio.smartweb.NewsView.xml +11 -0
- imio/smartweb/core/tests/test_redirect_to_main_react_view.py +74 -0
- imio/smartweb/core/viewlets/offcanvas.pt +2 -1
- imio/smartweb/core/webcomponents/build/js/323.smartweb-webcomponents-compiled.js +1 -2
- imio/smartweb/core/webcomponents/build/js/392.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/493.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/528.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/647.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/729.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/{218.smartweb-webcomponents-compiled.js → 979.smartweb-webcomponents-compiled.js} +1 -1
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +1 -1
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +0 -1
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +1 -1
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +2 -1
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +16 -14
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +65 -62
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +19 -20
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +1 -1
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +5 -2
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +5 -2
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +48 -28
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +5 -2
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +15 -11
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +6 -2
- imio/smartweb/core/webcomponents/src/utils/translation.js +48 -0
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/METADATA +23 -3
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/RECORD +41 -37
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/js/212.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/323.smartweb-webcomponents-compiled.js.LICENSE.txt +0 -1
- /imio/smartweb/core/webcomponents/build/js/{212.smartweb-webcomponents-compiled.js.LICENSE.txt → 493.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- /imio.smartweb.core-1.2.29-py3.10-nspkg.pth → /imio.smartweb.core-1.2.31-py3.8-nspkg.pth +0 -0
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.29.dist-info → imio.smartweb.core-1.2.31.dist-info}/top_level.txt +0 -0
@@ -25,7 +25,7 @@ const ContactList = ({ contactArray, onChange, onHover, parentCallback }) => {
|
|
25
25
|
className="r-list-item-link"
|
26
26
|
style={{ textDecoration: "none" }}
|
27
27
|
to={{
|
28
|
-
pathname: removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
28
|
+
pathname: "/"+removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
29
29
|
search: `?u=${item.UID}`,
|
30
30
|
state: {
|
31
31
|
idItem: item.UID,
|
@@ -3,7 +3,6 @@ import React, { useEffect, useState } from "react";
|
|
3
3
|
import useAxios from "../../../hooks/useAxios";
|
4
4
|
import useFilterQuery from "../../../hooks/useFilterQuery";
|
5
5
|
import moment from "moment";
|
6
|
-
import Moment from "react-moment";
|
7
6
|
import ReactMarkdown from 'react-markdown'
|
8
7
|
import Spotlight from "spotlight.js";
|
9
8
|
import "../../../../node_modules/flexbin/flexbin.css"
|
@@ -25,7 +25,7 @@ const ContactList = ({ itemsArray, onChange, onHover, parentCallback }) => {
|
|
25
25
|
className="r-list-item-link"
|
26
26
|
style={{ textDecoration: "none" }}
|
27
27
|
to={{
|
28
|
-
pathname: removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
28
|
+
pathname: "/"+removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
29
29
|
search: `?u=${item.UID}`,
|
30
30
|
state: {
|
31
31
|
idItem: item.UID,
|
@@ -9,6 +9,7 @@ import "./Events.scss";
|
|
9
9
|
import useFilterQuery from "../../hooks/useFilterQuery";
|
10
10
|
import { Provider, Translate } from "react-translated";
|
11
11
|
import translation from '../../utils/translation';
|
12
|
+
import moment from "moment";
|
12
13
|
|
13
14
|
export default function Events(props) {
|
14
15
|
return (
|
@@ -29,7 +30,7 @@ export default function Events(props) {
|
|
29
30
|
function EventsView(props) {
|
30
31
|
const queryString = require("query-string");
|
31
32
|
const { u, ...parsed } = Object.assign(
|
32
|
-
{ b_start: 0, fullobjects: 1 },
|
33
|
+
{ b_start: 0, fullobjects: 1, "event_dates.query":[moment().format('YYYY-MM-DD')],"event_dates.range":"min"},
|
33
34
|
queryString.parse(useFilterQuery().toString())
|
34
35
|
);
|
35
36
|
const [itemsArray, setItemsArray] = useState([]);
|
@@ -14,7 +14,7 @@ function Filters(props) {
|
|
14
14
|
const [categoryFilter, setCategoryFilter] = useState(null);
|
15
15
|
|
16
16
|
// const [dates, setDates] = useState({ start: moment().format('YYYY-MM-DD'), end: null});
|
17
|
-
const [dates, setDates] = useState(
|
17
|
+
const [dates, setDates] = useState(null);
|
18
18
|
|
19
19
|
// Get data
|
20
20
|
const { response, error, isLoading } = useAxios({
|
@@ -118,18 +118,20 @@ function Filters(props) {
|
|
118
118
|
},
|
119
119
|
};
|
120
120
|
useEffect(() => {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
121
|
+
if (dates) {
|
122
|
+
setInputValues(prevState => {
|
123
|
+
if (dates["event_dates.query"].length > 1) {
|
124
|
+
const { "event_dates.range": _, ...rest } = dates;
|
125
|
+
const newValue = "min:max";
|
126
|
+
return { ...prevState, ...rest, "event_dates.range": newValue };
|
127
|
+
} else if (dates["event_dates.query"].every(item => item === null)) {
|
128
|
+
return { ...prevState, "event_dates.query": [moment().format('YYYY-MM-DD')], "event_dates.range": "min" }
|
129
|
+
}
|
130
|
+
else {
|
131
|
+
return { ...prevState, ...dates, "event_dates.range": "min" };
|
132
|
+
}
|
133
|
+
});
|
134
|
+
}
|
133
135
|
}, [dates]);
|
134
136
|
return (
|
135
137
|
<React.Fragment>
|
@@ -200,4 +202,4 @@ function Filters(props) {
|
|
200
202
|
);
|
201
203
|
}
|
202
204
|
|
203
|
-
export default Filters;
|
205
|
+
export default Filters;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
1
|
+
import React, { useEffect, useState, createContext, useContex } from "react";
|
2
2
|
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
|
3
3
|
import Filters from "./Filters/Filter";
|
4
4
|
import NewsContent from "./NewsContent/NewsContent";
|
@@ -9,18 +9,21 @@ import useFilterQuery from "../../hooks/useFilterQuery";
|
|
9
9
|
import { Provider, Translate } from "react-translated";
|
10
10
|
import translation from '../../utils/translation';
|
11
11
|
|
12
|
+
export const LanguageContext = createContext("fr");
|
12
13
|
export default function News(props) {
|
13
14
|
return (
|
14
|
-
<
|
15
|
-
<
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
<LanguageContext.Provider value={props.currentLanguage}>
|
16
|
+
<Router basename={props.viewPath}>
|
17
|
+
<Provider language={props.currentLanguage} translation={translation}>
|
18
|
+
<NewsView
|
19
|
+
queryFilterUrl={props.queryFilterUrl}
|
20
|
+
queryUrl={props.queryUrl}
|
21
|
+
proposeUrl={props.proposeUrl}
|
22
|
+
batchSize={props.batchSize}
|
23
|
+
/>
|
24
|
+
</Provider>
|
25
|
+
</Router>
|
26
|
+
</LanguageContext.Provider>
|
24
27
|
);
|
25
28
|
}
|
26
29
|
const NewsView = (props) => {
|
@@ -99,62 +102,62 @@ const NewsView = (props) => {
|
|
99
102
|
|
100
103
|
return (
|
101
104
|
<div>
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
</div>
|
117
|
-
)
|
118
|
-
}
|
119
|
-
{itemsNumber > 0 ? (
|
120
|
-
<p className="r-results-numbers">
|
121
|
-
<span>{itemsNumber}</span>{" "}
|
122
|
-
{itemsNumber > 1
|
123
|
-
? <Translate text='Actualités trouvées' />
|
124
|
-
: <Translate text='Actualité trouvée' />}
|
125
|
-
</p>
|
126
|
-
) : (
|
127
|
-
<p className="r-results-numbers"><Translate text='Aucun résultat' /></p>
|
128
|
-
)}
|
129
|
-
</div>
|
130
|
-
<div>{listRender}</div>
|
131
|
-
<div className="r-load-more">
|
132
|
-
{itemsNumber - props.batchSize > batchStart ? (
|
133
|
-
<div>
|
134
|
-
<span className="no-more-result">
|
135
|
-
{isLoading ? divLoader : ""}
|
136
|
-
</span>
|
137
|
-
<button onClick={loadMore} className="btn-grad">
|
138
|
-
{isLoading ? <Translate text='Chargement...' /> : <Translate text='Plus de résultats' />}
|
139
|
-
</button>
|
105
|
+
<div className="r-wrapper r-actu-wrapper">
|
106
|
+
<div className="r-result r-annuaire-result">
|
107
|
+
<Switch>
|
108
|
+
<Route exact path="/">
|
109
|
+
<div className="r-result-filter actu-result-filter">
|
110
|
+
<Filters
|
111
|
+
url={props.queryFilterUrl}
|
112
|
+
activeFilter={filters}
|
113
|
+
onChange={filtersChange}
|
114
|
+
/>
|
115
|
+
{props.proposeUrl &&
|
116
|
+
(
|
117
|
+
<div className="r-add-news">
|
118
|
+
<a target="_blank" href={props.proposeUrl}><Translate text='Proposer une actualité' /></a>
|
140
119
|
</div>
|
141
|
-
)
|
120
|
+
)
|
121
|
+
}
|
122
|
+
{itemsNumber > 0 ? (
|
123
|
+
<p className="r-results-numbers">
|
124
|
+
<span>{itemsNumber}</span>{" "}
|
125
|
+
{itemsNumber > 1
|
126
|
+
? <Translate text='Actualités trouvées' />
|
127
|
+
: <Translate text='Actualité trouvée' />}
|
128
|
+
</p>
|
129
|
+
) : (
|
130
|
+
<p className="r-results-numbers"><Translate text='Aucun résultat' /></p>
|
131
|
+
)}
|
132
|
+
</div>
|
133
|
+
<div>{listRender}</div>
|
134
|
+
<div className="r-load-more">
|
135
|
+
{itemsNumber - props.batchSize > batchStart ? (
|
136
|
+
<div>
|
142
137
|
<span className="no-more-result">
|
143
138
|
{isLoading ? divLoader : ""}
|
144
139
|
</span>
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
</
|
155
|
-
</
|
156
|
-
|
140
|
+
<button onClick={loadMore} className="btn-grad">
|
141
|
+
{isLoading ? <Translate text='Chargement...' /> : <Translate text='Plus de résultats' />}
|
142
|
+
</button>
|
143
|
+
</div>
|
144
|
+
) : (
|
145
|
+
<span className="no-more-result">
|
146
|
+
{isLoading ? divLoader : ""}
|
147
|
+
</span>
|
148
|
+
)}
|
149
|
+
</div>
|
150
|
+
</Route>
|
151
|
+
<Route path={"/:name"}>
|
152
|
+
<NewsContent
|
153
|
+
onChange={clickID}
|
154
|
+
onReturn={filtersChange}
|
155
|
+
queryUrl={props.queryUrl}
|
156
|
+
/>
|
157
|
+
</Route>
|
158
|
+
</Switch>
|
157
159
|
</div>
|
160
|
+
</div>
|
158
161
|
</div>
|
159
162
|
);
|
160
163
|
};
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
1
|
+
import React, { useEffect, useState, useContext } from "react";
|
2
2
|
import moment from "moment";
|
3
|
-
import Moment from "react-moment";
|
4
|
-
import removeAccents from "remove-accents";
|
5
3
|
import ReactMarkdown from 'react-markdown';
|
6
|
-
|
4
|
+
import { Translate } from "react-translated";
|
5
|
+
import { LanguageContext } from '../News.jsx';
|
7
6
|
const NewsCard = ({ item }) => {
|
8
7
|
const [limitDescription, setLimitDescription] = useState();
|
9
8
|
const numberLimit = 150;
|
@@ -19,13 +18,13 @@ const NewsCard = ({ item }) => {
|
|
19
18
|
setLimitDescription(description);
|
20
19
|
}
|
21
20
|
}, [item]);
|
22
|
-
moment.locale(
|
21
|
+
moment.locale(useContext(LanguageContext))
|
23
22
|
const created = moment(item.created).startOf('minute').fromNow();
|
24
23
|
const lastModified = moment(item.modified).startOf('minute').fromNow();
|
25
24
|
return (
|
26
25
|
<div className="r-list-item">
|
27
26
|
<div
|
28
|
-
className={item.image_vignette_scale?"r-item-img":"r-item-img r-item-img-placeholder"}
|
27
|
+
className={item.image_vignette_scale ? "r-item-img" : "r-item-img r-item-img-placeholder"}
|
29
28
|
style={{
|
30
29
|
backgroundImage: item.image_vignette_scale
|
31
30
|
? "url(" + item.image_vignette_scale + ")"
|
@@ -35,25 +34,25 @@ const NewsCard = ({ item }) => {
|
|
35
34
|
<div className="r-item-text">
|
36
35
|
{category ? <span className="r-item-categorie">{category}</span> : ""}
|
37
36
|
<span className="r-item-title">{title}</span>
|
38
|
-
{description ?
|
39
|
-
<ReactMarkdown className="r-item-description">{limitDescription}</ReactMarkdown>
|
37
|
+
{description ?
|
38
|
+
<ReactMarkdown className="r-item-description">{limitDescription}</ReactMarkdown>
|
40
39
|
: ""
|
41
40
|
}
|
42
41
|
<div className="r-item-read-more" style={{ textDecoration: "none" }}>
|
43
42
|
{
|
44
43
|
created === lastModified ?
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
44
|
+
(
|
45
|
+
<div className="r-card-date-last">
|
46
|
+
<span><Translate text="Publié" /> </span>
|
47
|
+
<span>{created}</span>
|
48
|
+
</div>
|
49
|
+
) :
|
50
|
+
(
|
51
|
+
<div className="r-card-date-last">
|
52
|
+
<span><Translate text="Actualisé" /> </span>
|
53
|
+
<span>{lastModified}</span>
|
54
|
+
</div>
|
55
|
+
)
|
57
56
|
}
|
58
57
|
</div>
|
59
58
|
</div>
|
@@ -19,7 +19,7 @@ const NewsList = ({ itemsArray, onChange, parentCallback }) => {
|
|
19
19
|
className="r-news-list-item-link"
|
20
20
|
style={{ textDecoration: "none" }}
|
21
21
|
to={{
|
22
|
-
pathname: removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
22
|
+
pathname: "/"+removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
23
23
|
search: `?u=${item.UID}`,
|
24
24
|
state: {
|
25
25
|
idItem: item.UID,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
2
2
|
import useAxios from "../../../hooks/useAxios";
|
3
3
|
import Highlighter from "react-highlight-words";
|
4
|
+
import { Translate } from "react-translated";
|
4
5
|
|
5
6
|
const ContactResult = (props) => {
|
6
7
|
const [resultArray, setresultArray] = useState([]);
|
@@ -27,9 +28,11 @@ const ContactResult = (props) => {
|
|
27
28
|
return (
|
28
29
|
<div className="search-contact">
|
29
30
|
<div className="r-search-header">
|
30
|
-
<h2 className="r-search-header-title">
|
31
|
+
<h2 className="r-search-header-title">
|
32
|
+
<Translate text="Contacts" />
|
33
|
+
</h2>
|
31
34
|
<p className="r-search-header-count">
|
32
|
-
{resultArray ? resultArray.length
|
35
|
+
{resultArray > 0 ? <> {resultArray.length} {" "} <Translate text='Résultats' /> </> : <Translate text='Aucun résultat' />}
|
33
36
|
</p>
|
34
37
|
</div>
|
35
38
|
<ul className="r-search-list">
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
2
2
|
import useAxios from "../../../hooks/useAxios";
|
3
3
|
import Highlighter from "react-highlight-words";
|
4
|
+
import { Translate } from "react-translated";
|
4
5
|
|
5
6
|
const EventsResult = (props) => {
|
6
7
|
const [resultArray, setresultArray] = useState([]);
|
@@ -27,9 +28,11 @@ const EventsResult = (props) => {
|
|
27
28
|
return (
|
28
29
|
<div className="search-events">
|
29
30
|
<div className="r-search-header">
|
30
|
-
<h2 className="r-search-header-title"
|
31
|
+
<h2 className="r-search-header-title">
|
32
|
+
<Translate text="Événements" />
|
33
|
+
</h2>
|
31
34
|
<p className="r-search-header-count">
|
32
|
-
{resultArray ? resultArray.length
|
35
|
+
{resultArray > 0 ? <> {resultArray.length} {" "} <Translate text='Résultats' /> </> : <Translate text='Aucun résultat' />}
|
33
36
|
</p>
|
34
37
|
</div>
|
35
38
|
<ul className="r-search-list">
|
@@ -2,6 +2,8 @@ import React, { useEffect, useCallback, useRef, useState } from "react";
|
|
2
2
|
import Select from "react-select";
|
3
3
|
import { useHistory } from "react-router-dom";
|
4
4
|
import axios from "axios";
|
5
|
+
import { Translate, Translator } from "react-translated";
|
6
|
+
|
5
7
|
function Filters(props) {
|
6
8
|
let history = useHistory();
|
7
9
|
const queryString = require("query-string");
|
@@ -144,43 +146,61 @@ function Filters(props) {
|
|
144
146
|
<div className="col-md-6 py-1 r-search search-bar-filter">
|
145
147
|
<form onSubmit={handleSubmit}>
|
146
148
|
<label>
|
147
|
-
<
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
149
|
+
<Translator>
|
150
|
+
{({ translate }) => (
|
151
|
+
<input
|
152
|
+
name="SearchableText"
|
153
|
+
type="text"
|
154
|
+
onChange={HandlerText}
|
155
|
+
value={searchValues.SearchableText}
|
156
|
+
placeholder={translate({
|
157
|
+
text: 'Recherche'
|
158
|
+
})}
|
159
|
+
/>
|
160
|
+
)}
|
161
|
+
</Translator>
|
154
162
|
</label>
|
155
163
|
<button type="submit"></button>
|
156
164
|
</form>
|
157
165
|
</div>
|
158
166
|
<div className="col-md-3 col-lg-2 py-1 r-search search-select-filter">
|
159
|
-
<
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
167
|
+
<Translator>
|
168
|
+
{({ translate }) => (
|
169
|
+
<Select
|
170
|
+
styles={customStyles}
|
171
|
+
name={"iam"}
|
172
|
+
className="r-search-select"
|
173
|
+
isClearable
|
174
|
+
onChange={onChangeHandlerSelect}
|
175
|
+
options={iamFilter && iamFilter}
|
176
|
+
placeholder={translate({
|
177
|
+
text: 'Je suis'
|
178
|
+
})}
|
179
|
+
value={actIam && actIam[0]}
|
180
|
+
/>
|
181
|
+
)}
|
182
|
+
</Translator>
|
169
183
|
</div>
|
170
184
|
<div className="col-md-3 col-lg-2 py-1 r-search search-select-filter">
|
171
|
-
<
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
185
|
+
<Translator>
|
186
|
+
{({ translate }) => (
|
187
|
+
<Select
|
188
|
+
styles={customStyles}
|
189
|
+
name={"topics"}
|
190
|
+
className="r-search-select"
|
191
|
+
isClearable
|
192
|
+
onChange={onChangeHandlerSelect}
|
193
|
+
options={topicsFilter && topicsFilter}
|
194
|
+
placeholder={translate({
|
195
|
+
text: 'Thématiques'
|
196
|
+
})}
|
197
|
+
value={actTopi && actTopi[0]}
|
198
|
+
/>
|
199
|
+
)}
|
200
|
+
</Translator>
|
181
201
|
</div>
|
182
202
|
</React.Fragment>
|
183
203
|
);
|
184
204
|
}
|
185
205
|
|
186
|
-
export default Filters;
|
206
|
+
export default Filters;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
2
2
|
import useAxios from "../../../hooks/useAxios";
|
3
3
|
import Highlighter from "react-highlight-words";
|
4
|
+
import { Translate } from "react-translated";
|
4
5
|
|
5
6
|
const NewsResult = (props) => {
|
6
7
|
const [resultArray, setresultArray] = useState([]);
|
@@ -27,9 +28,11 @@ const NewsResult = (props) => {
|
|
27
28
|
return (
|
28
29
|
<div className="search-news">
|
29
30
|
<div className="r-search-header">
|
30
|
-
<h2 className="r-search-header-title">
|
31
|
+
<h2 className="r-search-header-title">
|
32
|
+
<Translate text="Actualités"/>
|
33
|
+
</h2>
|
31
34
|
<p className="r-search-header-count">
|
32
|
-
{resultArray ? resultArray.length
|
35
|
+
{resultArray > 0 ? <> {resultArray.length} {" "} <Translate text='Résultats' /> </> : <Translate text='Aucun résultat' />}
|
33
36
|
</p>
|
34
37
|
</div>
|
35
38
|
<ul className="r-search-list">
|
@@ -1,33 +1,37 @@
|
|
1
|
-
import React, {
|
2
|
-
import { BrowserRouter as Router
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { BrowserRouter as Router } from "react-router-dom";
|
3
3
|
import Filters from "./Filters/Filter";
|
4
4
|
import ContactResult from "./ContactResult/ContactResult";
|
5
5
|
import NewsResult from "./NewsResult/NewsResult";
|
6
6
|
import EventsResult from "./EventsResult/EventsResult";
|
7
7
|
import WebResult from "./WebResult/WebResult";
|
8
8
|
import useFilterQuery from "../../hooks/useFilterQuery";
|
9
|
+
import { Provider } from "react-translated";
|
10
|
+
import translation from '../../utils/translation';
|
9
11
|
import "./Search.scss";
|
10
12
|
|
11
13
|
export default function Search(props) {
|
12
14
|
return (
|
13
15
|
<Router>
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
<Provider language={props.currentLanguage} translation={translation}>
|
17
|
+
<SearchView
|
18
|
+
queryFilterUrl={props.queryFilterUrl}
|
19
|
+
queryUrl={props.queryUrl}
|
20
|
+
resultOption={JSON.parse(props.resultOption)}
|
21
|
+
/>
|
22
|
+
</Provider>
|
23
|
+
</Router >
|
20
24
|
);
|
21
25
|
}
|
22
26
|
const SearchView = (props) => {
|
23
27
|
const queryString = require("query-string");
|
24
28
|
const parsed = queryString.parse(useFilterQuery().toString());
|
25
|
-
const { SearchableText, iam,topics } = parsed;
|
26
|
-
const parsed2 = {'SearchableText':SearchableText,'iam':iam,'topics':topics};
|
29
|
+
const { SearchableText, iam, topics } = parsed;
|
30
|
+
const parsed2 = { 'SearchableText': SearchableText, 'iam': iam, 'topics': topics };
|
27
31
|
// const parsed2 = { ...parsed };
|
28
32
|
const [filters, setFilters] = useState(parsed2);
|
29
33
|
const [batchSize, setBatchSize] = useState(6);
|
30
|
-
|
34
|
+
|
31
35
|
const filtersChange = (value) => {
|
32
36
|
setFilters(value);
|
33
37
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
2
2
|
import useAxios from "../../../hooks/useAxios";
|
3
3
|
import Highlighter from "react-highlight-words";
|
4
|
+
import { Translate } from "react-translated";
|
4
5
|
|
5
6
|
const WebResult = (props) => {
|
6
7
|
const [resultArray, setresultArray] = useState([]);
|
@@ -27,9 +28,12 @@ const WebResult = (props) => {
|
|
27
28
|
return (
|
28
29
|
<div className="search-web">
|
29
30
|
<div className="r-search-header">
|
30
|
-
<h2 className="r-search-header-title">
|
31
|
+
<h2 className="r-search-header-title">
|
32
|
+
<Translate text="Infos pratiques" />
|
33
|
+
|
34
|
+
</h2>
|
31
35
|
<p className="r-search-header-count">
|
32
|
-
{resultArray ? resultArray.length
|
36
|
+
{resultArray > 0 ? <> {resultArray.length} {" "} <Translate text='Résultats' /> </> : <Translate text='Aucun résultat' />}
|
33
37
|
</p>
|
34
38
|
</div>
|
35
39
|
<ul className="r-search-list">
|
@@ -1,5 +1,41 @@
|
|
1
1
|
export default {
|
2
2
|
// common
|
3
|
+
'Publié' : {
|
4
|
+
en: 'Published',
|
5
|
+
fr: 'Publié',
|
6
|
+
de: 'Veröffentlicht',
|
7
|
+
nl: 'Gepubliceerd',
|
8
|
+
},
|
9
|
+
'Actualisé' : {
|
10
|
+
en: 'Updated',
|
11
|
+
fr: 'Actualisé',
|
12
|
+
de: 'Aktualisiert',
|
13
|
+
nl: 'Bijgewerkt',
|
14
|
+
},
|
15
|
+
'Événements' : {
|
16
|
+
en: 'Events',
|
17
|
+
fr: 'Événements',
|
18
|
+
de: 'Veranstaltungen',
|
19
|
+
nl: 'Evenementen',
|
20
|
+
},
|
21
|
+
'Actualités' : {
|
22
|
+
en: 'News',
|
23
|
+
fr: 'Actualités',
|
24
|
+
de: 'Nachrichten',
|
25
|
+
nl: 'Nieuws',
|
26
|
+
},
|
27
|
+
'Contacts': {
|
28
|
+
en: 'Contacts',
|
29
|
+
fr: 'Contacts',
|
30
|
+
de: 'Kontakte',
|
31
|
+
nl: 'Contacten',
|
32
|
+
},
|
33
|
+
'Infos pratiques': {
|
34
|
+
en: 'Practical information',
|
35
|
+
fr: 'Infos pratiques',
|
36
|
+
de: 'Praktische Informationen',
|
37
|
+
nl: 'Praktische informatie',
|
38
|
+
},
|
3
39
|
'Chargement...': {
|
4
40
|
en: 'Loading',
|
5
41
|
fr: 'Chargement...',
|
@@ -18,6 +54,12 @@ export default {
|
|
18
54
|
de: "Themen",
|
19
55
|
nl: "Thema's",
|
20
56
|
},
|
57
|
+
'Je suis': {
|
58
|
+
en: 'I am',
|
59
|
+
fr: 'Je suis',
|
60
|
+
de: 'Ich bin',
|
61
|
+
nl: 'Ik ben',
|
62
|
+
},
|
21
63
|
"Catégories": {
|
22
64
|
en: 'Categories',
|
23
65
|
fr: "Catégories",
|
@@ -42,6 +84,12 @@ export default {
|
|
42
84
|
de: 'Kein Ergebnis',
|
43
85
|
nl: 'Geen resultaat',
|
44
86
|
},
|
87
|
+
'Résultats': {
|
88
|
+
en: 'Results',
|
89
|
+
fr: 'Résultats',
|
90
|
+
de: 'Ergebnisse',
|
91
|
+
nl: 'Resultaten',
|
92
|
+
},
|
45
93
|
'Retour': {
|
46
94
|
en: 'Return',
|
47
95
|
fr: 'Retour',
|