imio.smartweb.core 1.2.47__py3-none-any.whl → 1.2.48__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/contents/sections/events/view.py +2 -1
- imio/smartweb/core/contents/sections/news/view.py +2 -1
- imio/smartweb/core/contents/sections/text/views.py +2 -0
- imio/smartweb/core/contents/sections/views.py +2 -0
- imio/smartweb/core/tests/resources/json_rest_events.json +4 -1
- imio/smartweb/core/tests/test_rest.py +4 -1
- imio/smartweb/core/tests/test_section_events.py +9 -8
- imio/smartweb/core/tests/test_section_news.py +6 -6
- imio/smartweb/core/tests/test_vocabularies.py +2 -2
- imio/smartweb/core/utils.py +1 -1
- imio/smartweb/core/viewlets/footer.pt +5 -0
- imio/smartweb/core/viewlets/footer.py +5 -0
- imio/smartweb/core/vocabularies.py +2 -2
- 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/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 +5 -0
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -3
- 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/smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +101 -74
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +4 -22
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +22 -18
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +4 -2
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +7 -2
- imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +211 -98
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +506 -378
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +13 -4
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +117 -82
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +52 -28
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +257 -90
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -54
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +60 -12
- imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
- imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +217 -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 +127 -82
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +86 -53
- imio/smartweb/core/webcomponents/src/components/News/News.scss +29 -9
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +34 -31
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +264 -244
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +13 -8
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +5 -5
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +4 -4
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +13 -4
- imio/smartweb/core/webcomponents/src/index.jsx +3 -3
- imio/smartweb/core/webcomponents/src/index.scss +11 -65
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +18 -9
- imio/smartweb/core/webcomponents/src/utils/translation.js +18 -0
- imio.smartweb.core-1.2.48-py3.10-nspkg.pth +3 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/METADATA +22 -3
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/RECORD +69 -63
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
- imio.smartweb.core-1.2.47-py3.8-nspkg.pth +0 -2
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/top_level.txt +0 -0
@@ -3,14 +3,49 @@ import Select from "react-select";
|
|
3
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
|
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
|
+
}
|
7
39
|
|
8
40
|
function Filters(props) {
|
9
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) {
|
@@ -98,113 +139,185 @@ 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
|
);
|
208
321
|
}
|
209
322
|
|
210
|
-
export default Filters;
|
323
|
+
export default Filters;
|