imio.smartweb.core 1.2.46__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.
Files changed (85) hide show
  1. imio/smartweb/core/contents/sections/events/view.py +2 -1
  2. imio/smartweb/core/contents/sections/news/view.py +2 -1
  3. imio/smartweb/core/contents/sections/text/views.py +2 -0
  4. imio/smartweb/core/contents/sections/views.py +2 -0
  5. imio/smartweb/core/tests/resources/json_rest_events.json +4 -1
  6. imio/smartweb/core/tests/test_rest.py +4 -1
  7. imio/smartweb/core/tests/test_section_events.py +9 -8
  8. imio/smartweb/core/tests/test_section_news.py +6 -6
  9. imio/smartweb/core/tests/test_vocabularies.py +2 -2
  10. imio/smartweb/core/utils.py +1 -1
  11. imio/smartweb/core/viewlets/footer.pt +5 -0
  12. imio/smartweb/core/viewlets/footer.py +5 -0
  13. imio/smartweb/core/vocabularies.py +2 -2
  14. imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
  15. imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
  16. imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
  17. imio/smartweb/core/webcomponents/build/css/919.smartweb-webcomponents-compiled.css +1 -1
  18. imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
  19. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
  20. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +5 -0
  21. imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +1 -1
  22. imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
  23. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js +1 -1
  24. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -3
  25. imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
  26. imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
  27. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
  28. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +101 -74
  29. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +5 -23
  30. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +24 -19
  31. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +4 -2
  32. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +7 -2
  33. imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +211 -98
  34. imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +506 -378
  35. imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +13 -4
  36. imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +117 -82
  37. imio/smartweb/core/webcomponents/src/components/Events/Events.scss +53 -29
  38. imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +257 -90
  39. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -54
  40. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +60 -12
  41. imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
  42. imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +217 -0
  43. imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
  44. imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
  45. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
  46. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
  47. imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +127 -82
  48. imio/smartweb/core/webcomponents/src/components/News/News.jsx +86 -53
  49. imio/smartweb/core/webcomponents/src/components/News/News.scss +30 -10
  50. imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +34 -31
  51. imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +264 -244
  52. imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +13 -8
  53. imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +23 -12
  54. imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +23 -12
  55. imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +5 -5
  56. imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
  57. imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +4 -4
  58. imio/smartweb/core/webcomponents/src/components/Search/Search.scss +1 -1
  59. imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +13 -4
  60. imio/smartweb/core/webcomponents/src/index.jsx +3 -3
  61. imio/smartweb/core/webcomponents/src/index.scss +11 -65
  62. imio/smartweb/core/webcomponents/src/utils/Map.jsx +18 -9
  63. imio/smartweb/core/webcomponents/src/utils/translation.js +60 -0
  64. imio.smartweb.core-1.2.48-py3.10-nspkg.pth +3 -0
  65. {imio.smartweb.core-1.2.46.dist-info → imio.smartweb.core-1.2.48.dist-info}/METADATA +31 -3
  66. {imio.smartweb.core-1.2.46.dist-info → imio.smartweb.core-1.2.48.dist-info}/RECORD +71 -76
  67. {imio.smartweb.core-1.2.46.dist-info → imio.smartweb.core-1.2.48.dist-info}/WHEEL +1 -1
  68. imio/smartweb/core/webcomponents/build/10512eee43c7b5ed4757.svg +0 -1
  69. imio/smartweb/core/webcomponents/build/10dd862b2cdd9c68e1a8.svg +0 -1
  70. imio/smartweb/core/webcomponents/build/a38272f263f8328349f2.svg +0 -1
  71. imio/smartweb/core/webcomponents/build/assets/location-bla.1423bcce16ddcb21141430cac1428dc1.svg +0 -1
  72. imio/smartweb/core/webcomponents/build/assets/next-react.17bc43ff4a6a86f4520f5782f6a89a72.svg +0 -1
  73. imio/smartweb/core/webcomponents/build/assets/search.57bdbf5b191499cd77514097d1c4972c.svg +0 -1
  74. imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
  75. imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
  76. imio/smartweb/core/webcomponents/src/assets/facebook-news.svg +0 -1
  77. imio/smartweb/core/webcomponents/src/assets/location-bla.svg +0 -1
  78. imio/smartweb/core/webcomponents/src/assets/next-react.svg +0 -1
  79. imio/smartweb/core/webcomponents/src/assets/search.svg +0 -1
  80. imio/smartweb/core/webcomponents/src/assets/skeleton.svg +0 -1
  81. imio.smartweb.core-1.2.46-py3.8-nspkg.pth +0 -2
  82. {imio.smartweb.core-1.2.46.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.GPL +0 -0
  83. {imio.smartweb.core-1.2.46.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.rst +0 -0
  84. {imio.smartweb.core-1.2.46.dist-info → imio.smartweb.core-1.2.48.dist-info}/namespace_packages.txt +0 -0
  85. {imio.smartweb.core-1.2.46.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 'query-string';
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(null);
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
- const customStyles = {
105
- control: (styles) => ({
106
- ...styles,
107
- backgroundColor: "white",
108
- borderRadius: "0",
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
- <form className="r-filter" onSubmit={handleSubmit}>
129
- {/* <label>Recherche</label> */}
130
- <div className="r-filter-search">
131
- <Translator>
132
- {({ translate }) => (
133
- <input
134
- className="input-custom-class"
135
- name="SearchableText"
136
- type="text"
137
- value={inputValues.SearchableText}
138
- onChange={onChangeHandler}
139
- placeholder={translate({
140
- text: 'Recherche'
141
- })}
142
- />
143
- )}
144
- </Translator>
145
- <button type="submit"></button>
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
- <div className="r-filter facilities-Filter">
188
- {/* <label>Facilité</label> */}
189
- <Translator>
190
- {({ translate }) => (
191
- <Select
192
- styles={customStyles}
193
- name={"facilities"}
194
- className="select-custom-class library-facilities"
195
- isClearable
196
- onChange={onChangeHandlerSelect}
197
- options={facilitiesFilter && facilitiesFilter}
198
- placeholder={translate({
199
- text: 'Facilités'
200
- })}
201
- value={actFaci && actFaci[0]}
202
- />
203
- )}
204
- </Translator>
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;