@saooti/octopus-sdk 41.2.0 → 41.2.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 41.2.1 (05/01/2026)
4
+
5
+ **Fixes**
6
+
7
+ - Recherche avancées
8
+ - Correction chargements groupes & ayants-droits depuis routing
9
+ - Filtrage des groupes par organisation
10
+
11
+ **Misc**
12
+
13
+ - Export des routes principales pour réutilisation dans projets incluant le SDK
14
+
3
15
  ## 41.2.0 (05/01/2026)
4
16
 
5
17
  **Features**
package/index.ts CHANGED
@@ -176,7 +176,8 @@ export const getTuninIcon = () => import("./src/components/icons/TuninIcon.vue")
176
176
  export const getXIcon = () => import("./src/components/icons/XIcon.vue");
177
177
 
178
178
  // Routing
179
- import { setupRouter } from './src/router/utils';
179
+ import { setupRouter, getSimpleRouteProps, getRouteProps } from './src/router/utils';
180
+ import { routes as sdkRoutes } from './src/router/routes';
180
181
 
181
182
  // Types
182
183
  import { type SelectOption } from "./src/components/form/ClassicSelect.vue";
@@ -217,6 +218,9 @@ export {
217
218
  downloadHelper,
218
219
  displayHelper,
219
220
  setupRouter,
221
+ getSimpleRouteProps,
222
+ getRouteProps,
223
+ sdkRoutes,
220
224
  SelectOption,
221
225
  ROUTE_PARAMS
222
226
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "41.2.0",
3
+ "version": "41.2.1",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -86,6 +86,8 @@ export const useAdvancedParamInit = (props: RouteProps, isEmission: boolean) =>
86
86
  initSort();
87
87
  initFromDate();
88
88
  initToDate();
89
+ initBeneficiariesFilter();
90
+ initEmissionGroups();
89
91
  nextTick(() => {
90
92
  isInit.value = true;
91
93
  });
@@ -23,7 +23,7 @@ import { groupsApi, EmissionGroup } from "../../../api/groupsApi";
23
23
  //Props
24
24
  const props = defineProps<{
25
25
  /** Filter by organisation */
26
- organisationId?: Array<string>;
26
+ organisationId?: string|Array<string>;
27
27
  /** Currently selected groups */
28
28
  groups: Array<EmissionGroup>;
29
29
  }>();
@@ -41,7 +41,7 @@ async function onSearch(query?: string): Promise<void> {
41
41
  first: 0,
42
42
  size: maxElement,
43
43
  search: query,
44
- organisationIds: props.organisationId,
44
+ organisationIds: [props.organisationId].flat(),
45
45
  });
46
46
 
47
47
  selectGroupRef.value!.afterSearch(
@@ -44,6 +44,7 @@
44
44
  <EmissionGroupChooser
45
45
  v-if="emissionGroupCheckbox"
46
46
  class="ms-4 flex-grow-1"
47
+ :organisation-id="organisationId"
47
48
  :groups="emissionGroups"
48
49
  @update:groups="updateEmissionGroupFilter"
49
50
  />
@@ -1,276 +1,17 @@
1
1
  import {
2
2
  createRouter,
3
3
  createWebHistory,
4
- RouteLocationNormalized,
5
- RouteRecordRaw,
6
4
  } from "vue-router";
7
- import classicApi from "@/api/classicApi";
5
+ import classicApi from "../api/classicApi";
8
6
  import { AuthStore } from "../stores/AuthStore";
9
- import fetchHelper from "@/helper/fetchHelper";
10
- import { setupRouter } from "./utils";
7
+ import fetchHelper from "../helper/fetchHelper";
8
+ import { setupRouter } from "./utils";
9
+ import { routes } from "./routes";
11
10
 
12
- import { ROUTE_PARAMS, RouteProps } from "../components/composable/route/types";
11
+ const Home = () => import("../components/pages/HomePage.vue");
13
12
 
14
- /*--------------------------------------------------------------------------
15
- Composants publics
16
- --------------------------------------------------------------------------*/
17
-
18
- const Home = () => import("@/components/pages/HomePage.vue");
19
- const MapPage = () => import("@/components/pages/MapPage.vue");
20
- const PodcastsPage = () => import("@/components/pages/PodcastsPage.vue");
21
- const EmissionPage = () => import("@/components/pages/EmissionPage.vue");
22
- const EmissionsPage = () => import("@/components/pages/EmissionsPage.vue");
23
- const ParticpantsPage = () => import("@/components/pages/ParticipantsPage.vue");
24
- const PodcastPage = () => import("@/components/pages/PodcastPage.vue");
25
- const ParticipantPage = () => import("@/components/pages/ParticipantPage.vue");
26
- const SearchPage = () => import("@/components/pages/SearchPage.vue");
27
- const CategoryPage = () => import("@/components/pages/CategoryPage.vue");
28
- const RubriquePage = () => import("@/components/pages/RubriquePage.vue");
29
- const TagPage = () => import("@/components/pages/TagPage.vue");
30
- const LivesPage = () => import("@/components/pages/LivesPage.vue");
31
- const PlaylistPage = () => import("@/components/pages/PlaylistPage.vue");
32
- const PlaylistsPage = () => import("@/components/pages/PlaylistsPage.vue");
33
- const error403Page = () => import("@/components/pages/Error403Page.vue");
34
- const PageNotFound = () => import("@/components/pages/PageNotFound.vue");
35
- const RadioPage = () => import("@/components/pages/RadioPage.vue");
36
- const VideoPage = () => import("@/components/pages/VideoPage.vue");
37
- const PageLogout = () => import("@/components/pages/PageLogout.vue");
38
-
39
- function getSimpleRouteProps(route:RouteLocationNormalized): RouteProps {
40
- return {
41
- pr: route.query.pr ? parseInt(route.query.pr.toString(), 10) : undefined,
42
- ps: route.query.ps ? parseInt(route.query.ps.toString(), 10) : undefined,
43
- routeQuery: route.query.q as string ?? ""
44
- };
45
- }
46
-
47
- /**
48
- * Return route props used for filtering
49
- */
50
- function getRouteProps(route: RouteLocationNormalized): RouteProps {
51
- return {
52
- ...getSimpleRouteProps(route),
53
- routeMonetisable: route.query.m as string ?? "",
54
- routeIab: route.query.i ? parseInt(route.query.i.toString(), 10) : undefined,
55
- routeSort: route.query.s as string ?? "",
56
- routeIncludeHidden: route.query.h as string ?? "",
57
- routeFrom: route.query.from as string|undefined,
58
- routeTo: route.query.to as string|undefined,
59
- routeOrga:route.query.o as string|undefined,
60
- routeRubriques :route.query.r as string ?? route.query.rubriquesId as string|undefined,
61
- routeBeneficiaries: route.query[ROUTE_PARAMS.Beneficiaries] as string[]|undefined,
62
- routeEmissionGroups: (route.query[ROUTE_PARAMS.EmissionGroups] as string[]|undefined)?.map(g => parseInt(g, 10))
63
- }
64
- }
65
-
66
- const routes: Array<RouteRecordRaw> = [
67
- /*--------------------------------------------------------------------------
68
- Liens publics
69
- --------------------------------------------------------------------------*/
70
- {
71
- path: "/",
72
- name: "",
73
- component: Home,
74
- meta:{
75
- title: "Home"
76
- }
77
- },
78
- {
79
- path: "/main/pub/error",
80
- name: "error",
81
- component: error403Page,
82
- },
83
- {
84
- path: "/main/pub/home",
85
- name: "home",
86
- component: Home,
87
- meta:{
88
- title: "Home",
89
- }
90
- },
91
- {
92
- path: "/main/pub/map",
93
- name: "map",
94
- component: MapPage,
95
- meta:{
96
- title: "Site map",
97
- }
98
- },
99
- {
100
- path: "/main/pub/search/:query?",
101
- name: "search",
102
- component: SearchPage,
103
- props: (route: RouteLocationNormalized) => ({
104
- queryRoute: route.params.query,
105
- }),
106
- meta:{
107
- title: "Search",
108
- }
109
- },
110
- {
111
- path: "/main/pub/podcasts/",
112
- name: "podcasts",
113
- component: PodcastsPage,
114
- props: getRouteProps,
115
- meta:{
116
- title: "Podcasts",
117
- }
118
- },
119
- {
120
- path: "/main/pub/emissions/",
121
- name: "emissions",
122
- component: EmissionsPage,
123
- props: getRouteProps,
124
- meta:{
125
- title: "Emissions",
126
- }
127
- },
128
- {
129
- path: "/main/pub/participants",
130
- name: "participants",
131
- component: ParticpantsPage,
132
- props: (route: RouteLocationNormalized) => ({
133
- ...getSimpleRouteProps(route),
134
- routeOrga:route.query.o,
135
- }),
136
- meta:{
137
- title: "Speakers",
138
- }
139
- },
140
- {
141
- path: "/main/pub/emission/:emissionId(\\d+):title([^?]*)?:productor?",
142
- name: "emission",
143
- component: EmissionPage,
144
- props: (route: RouteLocationNormalized) => ({
145
- ...getSimpleRouteProps(route),
146
- emissionId: parseInt(route.params.emissionId.toString(), 10),
147
- }),
148
- meta:{
149
- title: "",
150
- noScroll:true
151
- }
152
- },
153
- {
154
- path: "/main/pub/podcast/:podcastId(\\d+):title([^?]*)?:productor?",
155
- name: "podcast",
156
- component: PodcastPage,
157
- props: (route: RouteLocationNormalized) => ({
158
- podcastId: parseInt(route.params.podcastId.toString(), 10)
159
- }),
160
- meta:{
161
- title: ""
162
- }
163
- },
164
- {
165
- path: "/main/pub/video/:podcastId(\\d+):title([^?]*)?:productor?",
166
- name: "video",
167
- component: VideoPage,
168
- props: (route: RouteLocationNormalized) => ({
169
- podcastId: parseInt(route.params.podcastId.toString(), 10),
170
- }),
171
- meta:{
172
- title: ""
173
- }
174
- },
175
- {
176
- path: "/main/pub/participant/:participantId(\\d+):title([^?]*)?:productor?",
177
- name: "participant",
178
- component: ParticipantPage,
179
- props: (route: RouteLocationNormalized) => ({
180
- ...getSimpleRouteProps(route),
181
- participantId: parseInt(route.params.participantId.toString(), 10),
182
- }),
183
- meta:{
184
- title: "",
185
- noScroll:true
186
- }
187
- },
188
- {
189
- path: "/main/pub/category/:iabId/:productor?",
190
- name: "category",
191
- component: CategoryPage,
192
- props: (route: RouteLocationNormalized) => ({
193
- iabId: parseInt(route.params.iabId.toString(), 10),
194
- productor: route.params.productor,
195
- }),
196
- meta:{
197
- title: "",
198
- }
199
- },
200
- {
201
- path: "/main/pub/rubrique/:rubriqueId(\\d+):title([^?]*)?:productor?",
202
- name: "rubrique",
203
- component: RubriquePage,
204
- props: (route: RouteLocationNormalized) => ({
205
- ...getSimpleRouteProps(route),
206
- rubriqueId: parseInt(route.params.rubriqueId.toString(), 10),
207
- routeOrga:route.query.o,
208
- }),
209
- meta:{
210
- title: "",
211
- }
212
- },
213
- {
214
- path: "/main/pub/tag/:tag([^?]*)?:productor?",
215
- name: "tag",
216
- component: TagPage,
217
- props: (route: RouteLocationNormalized) => ({
218
- ...getSimpleRouteProps(route),
219
- tag: route.params.tag,
220
- routeOrga:route.query.o,
221
- }),
222
- meta:{
223
- title: "",
224
- }
225
- },
226
- {
227
- path: "/main/pub/lives/:productor?",
228
- name: "lives",
229
- component: LivesPage,
230
- props: (route: RouteLocationNormalized) => ({
231
- productor: route.params.productor,
232
- }),
233
- meta:{
234
- title: "Radio & Live",
235
- }
236
- },
237
- {
238
- path: "/main/pub/radio/:canalId(\\d+):title([^?]*)?:productor?",
239
- name: "radio",
240
- component: RadioPage,
241
- props: (route: RouteLocationNormalized) => ({
242
- canalId: parseInt(route.params.canalId.toString(), 10),
243
- }),
244
- meta:{
245
- title: ""
246
- }
247
- },
248
- {
249
- path: "/main/pub/playlists/",
250
- name: "playlists",
251
- component: PlaylistsPage,
252
- props: (route: RouteLocationNormalized) => ({
253
- ...getSimpleRouteProps(route),
254
- routeOrga:route.query.o,
255
- }),
256
- meta:{
257
- title: "Playlists"
258
- }
259
- },
260
- {
261
- path: "/main/pub/playlist/:playlistId(\\d+):title([^?]*)?:productor?",
262
- name: "playlist",
263
- component: PlaylistPage,
264
- props: (route: RouteLocationNormalized) => ({
265
- ...getSimpleRouteProps(route),
266
- playlistId: parseInt(route.params.playlistId.toString(), 10),
267
- }),
268
- meta:{
269
- title: "",
270
- noScroll:true
271
- }
272
- },
273
- //Fake route to avoid errors
13
+ //Fake route to avoid errors
14
+ const fakeRoutes = [
274
15
  {
275
16
  path: "/",
276
17
  name: "backoffice",
@@ -313,13 +54,14 @@ const routes: Array<RouteRecordRaw> = [
313
54
  path: "/main/priv/distribution/:distrib/:id",
314
55
  component: Home,
315
56
  },
316
- { path: "/logout", component: PageLogout },
317
- { path: "/sso/logout", component: PageLogout },
318
- { path: "/:pathMatch(.*)*", component: PageNotFound },
319
57
  ];
58
+
320
59
  const router = createRouter({
321
60
  history: createWebHistory(),
322
- routes: routes,
61
+ routes: {
62
+ ...routes,
63
+ ...fakeRoutes
64
+ },
323
65
  scrollBehavior(to, from) {
324
66
  if (to.name === from.name && to.meta.noScroll) {
325
67
  return false;
@@ -330,7 +72,7 @@ const router = createRouter({
330
72
  });
331
73
 
332
74
  //Do in frontoffice but not podcastmakers
333
- async function getMyOrgaActive(authStore: AuthStore): Promise<string>{
75
+ async function getMyOrgaActive(authStore: AuthStore): Promise<void>{
334
76
  const orgaActive = await classicApi.fetchData<string>({
335
77
  api: 3,
336
78
  path: "user/active"
@@ -340,7 +82,6 @@ async function getMyOrgaActive(authStore: AuthStore): Promise<string>{
340
82
  await authStore.fetchProfile();
341
83
  fetchHelper.createAuthenticatedFetchHeader(true);
342
84
  }
343
- return orgaActive;
344
85
  }
345
86
 
346
87
  setupRouter(router, getMyOrgaActive);
@@ -0,0 +1,236 @@
1
+ import { RouteRecordRaw, RouteLocationNormalized } from "vue-router";
2
+
3
+ import { getRouteProps, getSimpleRouteProps } from "./utils";
4
+
5
+ const Home = () => import("../components/pages/HomePage.vue");
6
+ const MapPage = () => import("../components/pages/MapPage.vue");
7
+ const PodcastsPage = () => import("../components/pages/PodcastsPage.vue");
8
+ const EmissionPage = () => import("../components/pages/EmissionPage.vue");
9
+ const EmissionsPage = () => import("../components/pages/EmissionsPage.vue");
10
+ const ParticpantsPage = () => import("../components/pages/ParticipantsPage.vue");
11
+ const PodcastPage = () => import("../components/pages/PodcastPage.vue");
12
+ const ParticipantPage = () => import("../components/pages/ParticipantPage.vue");
13
+ const SearchPage = () => import("../components/pages/SearchPage.vue");
14
+ const CategoryPage = () => import("../components/pages/CategoryPage.vue");
15
+ const RubriquePage = () => import("../components/pages/RubriquePage.vue");
16
+ const TagPage = () => import("../components/pages/TagPage.vue");
17
+ const LivesPage = () => import("../components/pages/LivesPage.vue");
18
+ const PlaylistPage = () => import("../components/pages/PlaylistPage.vue");
19
+ const PlaylistsPage = () => import("../components/pages/PlaylistsPage.vue");
20
+ const error403Page = () => import("../components/pages/Error403Page.vue");
21
+ const PageNotFound = () => import("../components/pages/PageNotFound.vue");
22
+ const RadioPage = () => import("../components/pages/RadioPage.vue");
23
+ const VideoPage = () => import("../components/pages/VideoPage.vue");
24
+ const PageLogout = () => import("../components/pages/PageLogout.vue");
25
+
26
+ export const routes: Array<RouteRecordRaw> = [
27
+ /*--------------------------------------------------------------------------
28
+ Liens publics
29
+ --------------------------------------------------------------------------*/
30
+ {
31
+ path: "/",
32
+ name: "",
33
+ component: Home,
34
+ meta:{
35
+ title: "Home"
36
+ }
37
+ },
38
+ {
39
+ path: "/main/pub/error",
40
+ name: "error",
41
+ component: error403Page,
42
+ },
43
+ {
44
+ path: "/main/pub/home",
45
+ name: "home",
46
+ component: Home,
47
+ meta:{
48
+ title: "Home",
49
+ }
50
+ },
51
+ {
52
+ path: "/main/pub/map",
53
+ name: "map",
54
+ component: MapPage,
55
+ meta:{
56
+ title: "Site map",
57
+ }
58
+ },
59
+ {
60
+ path: "/main/pub/search/:query?",
61
+ name: "search",
62
+ component: SearchPage,
63
+ props: (route: RouteLocationNormalized) => ({
64
+ queryRoute: route.params.query,
65
+ }),
66
+ meta:{
67
+ title: "Search",
68
+ }
69
+ },
70
+ {
71
+ path: "/main/pub/podcasts/",
72
+ name: "podcasts",
73
+ component: PodcastsPage,
74
+ props: getRouteProps,
75
+ meta:{
76
+ title: "Podcasts",
77
+ }
78
+ },
79
+ {
80
+ path: "/main/pub/emissions/",
81
+ name: "emissions",
82
+ component: EmissionsPage,
83
+ props: getRouteProps,
84
+ meta:{
85
+ title: "Emissions",
86
+ }
87
+ },
88
+ {
89
+ path: "/main/pub/participants",
90
+ name: "participants",
91
+ component: ParticpantsPage,
92
+ props: (route: RouteLocationNormalized) => ({
93
+ ...getSimpleRouteProps(route),
94
+ routeOrga:route.query.o,
95
+ }),
96
+ meta:{
97
+ title: "Speakers",
98
+ }
99
+ },
100
+ {
101
+ path: "/main/pub/emission/:emissionId(\\d+):title([^?]*)?:productor?",
102
+ name: "emission",
103
+ component: EmissionPage,
104
+ props: (route: RouteLocationNormalized) => ({
105
+ ...getSimpleRouteProps(route),
106
+ emissionId: parseInt(route.params.emissionId.toString(), 10),
107
+ }),
108
+ meta:{
109
+ title: "",
110
+ noScroll:true
111
+ }
112
+ },
113
+ {
114
+ path: "/main/pub/podcast/:podcastId(\\d+):title([^?]*)?:productor?",
115
+ name: "podcast",
116
+ component: PodcastPage,
117
+ props: (route: RouteLocationNormalized) => ({
118
+ podcastId: parseInt(route.params.podcastId.toString(), 10)
119
+ }),
120
+ meta:{
121
+ title: ""
122
+ }
123
+ },
124
+ {
125
+ path: "/main/pub/video/:podcastId(\\d+):title([^?]*)?:productor?",
126
+ name: "video",
127
+ component: VideoPage,
128
+ props: (route: RouteLocationNormalized) => ({
129
+ podcastId: parseInt(route.params.podcastId.toString(), 10),
130
+ }),
131
+ meta:{
132
+ title: ""
133
+ }
134
+ },
135
+ {
136
+ path: "/main/pub/participant/:participantId(\\d+):title([^?]*)?:productor?",
137
+ name: "participant",
138
+ component: ParticipantPage,
139
+ props: (route: RouteLocationNormalized) => ({
140
+ ...getSimpleRouteProps(route),
141
+ participantId: parseInt(route.params.participantId.toString(), 10),
142
+ }),
143
+ meta:{
144
+ title: "",
145
+ noScroll:true
146
+ }
147
+ },
148
+ {
149
+ path: "/main/pub/category/:iabId/:productor?",
150
+ name: "category",
151
+ component: CategoryPage,
152
+ props: (route: RouteLocationNormalized) => ({
153
+ iabId: parseInt(route.params.iabId.toString(), 10),
154
+ productor: route.params.productor,
155
+ }),
156
+ meta:{
157
+ title: "",
158
+ }
159
+ },
160
+ {
161
+ path: "/main/pub/rubrique/:rubriqueId(\\d+):title([^?]*)?:productor?",
162
+ name: "rubrique",
163
+ component: RubriquePage,
164
+ props: (route: RouteLocationNormalized) => ({
165
+ ...getSimpleRouteProps(route),
166
+ rubriqueId: parseInt(route.params.rubriqueId.toString(), 10),
167
+ routeOrga:route.query.o,
168
+ }),
169
+ meta:{
170
+ title: "",
171
+ }
172
+ },
173
+ {
174
+ path: "/main/pub/tag/:tag([^?]*)?:productor?",
175
+ name: "tag",
176
+ component: TagPage,
177
+ props: (route: RouteLocationNormalized) => ({
178
+ ...getSimpleRouteProps(route),
179
+ tag: route.params.tag,
180
+ routeOrga:route.query.o,
181
+ }),
182
+ meta:{
183
+ title: "",
184
+ }
185
+ },
186
+ {
187
+ path: "/main/pub/lives/:productor?",
188
+ name: "lives",
189
+ component: LivesPage,
190
+ props: (route: RouteLocationNormalized) => ({
191
+ productor: route.params.productor,
192
+ }),
193
+ meta:{
194
+ title: "Radio & Live",
195
+ }
196
+ },
197
+ {
198
+ path: "/main/pub/radio/:canalId(\\d+):title([^?]*)?:productor?",
199
+ name: "radio",
200
+ component: RadioPage,
201
+ props: (route: RouteLocationNormalized) => ({
202
+ canalId: parseInt(route.params.canalId.toString(), 10),
203
+ }),
204
+ meta:{
205
+ title: ""
206
+ }
207
+ },
208
+ {
209
+ path: "/main/pub/playlists/",
210
+ name: "playlists",
211
+ component: PlaylistsPage,
212
+ props: (route: RouteLocationNormalized) => ({
213
+ ...getSimpleRouteProps(route),
214
+ routeOrga:route.query.o,
215
+ }),
216
+ meta:{
217
+ title: "Playlists"
218
+ }
219
+ },
220
+ {
221
+ path: "/main/pub/playlist/:playlistId(\\d+):title([^?]*)?:productor?",
222
+ name: "playlist",
223
+ component: PlaylistPage,
224
+ props: (route: RouteLocationNormalized) => ({
225
+ ...getSimpleRouteProps(route),
226
+ playlistId: parseInt(route.params.playlistId.toString(), 10),
227
+ }),
228
+ meta:{
229
+ title: "",
230
+ noScroll:true
231
+ }
232
+ },
233
+ { path: "/logout", component: PageLogout },
234
+ { path: "/sso/logout", component: PageLogout },
235
+ { path: "/:pathMatch(.*)*", component: PageNotFound },
236
+ ];
@@ -5,6 +5,47 @@ import { Rubriquage } from "../stores/class/rubrique/rubriquage";
5
5
  import classicApi from "../api/classicApi";
6
6
  import { useAuthStore, AuthStore } from "../stores/AuthStore";
7
7
  import { deepEqual } from "../helper/equals";
8
+ import { RouteLocationNormalized } from "vue-router";
9
+ import { RouteProps } from "../components/composable/route/types";
10
+ import { ROUTE_PARAMS } from "../components/composable/route/types";
11
+
12
+ export function getSimpleRouteProps(route: RouteLocationNormalized): RouteProps {
13
+ return {
14
+ pr: route.query.pr ? parseInt(route.query.pr.toString(), 10) : undefined,
15
+ ps: route.query.ps ? parseInt(route.query.ps.toString(), 10) : undefined,
16
+ routeQuery: route.query.q as string ?? ""
17
+ };
18
+ }
19
+
20
+ /**
21
+ * Return route props used for filtering
22
+ */
23
+ export function getRouteProps(route: RouteLocationNormalized): RouteProps {
24
+ let routeEmissionGroups: number[]|undefined = undefined;
25
+ const reg = route.query[ROUTE_PARAMS.EmissionGroups];
26
+
27
+ if (reg !== undefined) {
28
+ if (Array.isArray(reg)) {
29
+ routeEmissionGroups = reg.map(g => parseInt(g, 10));
30
+ } else {
31
+ routeEmissionGroups = [parseInt(reg, 10)];
32
+ }
33
+ }
34
+
35
+ return {
36
+ ...getSimpleRouteProps(route),
37
+ routeMonetisable: route.query.m as string ?? "",
38
+ routeIab: route.query.i ? parseInt(route.query.i.toString(), 10) : undefined,
39
+ routeSort: route.query.s as string ?? "",
40
+ routeIncludeHidden: route.query.h as string ?? "",
41
+ routeFrom: route.query.from as string|undefined,
42
+ routeTo: route.query.to as string|undefined,
43
+ routeOrga:route.query.o as string|undefined,
44
+ routeRubriques :route.query.r as string ?? route.query.rubriquesId as string|undefined,
45
+ routeBeneficiaries: route.query[ROUTE_PARAMS.Beneficiaries] as string[]|undefined,
46
+ routeEmissionGroups
47
+ }
48
+ }
8
49
 
9
50
  async function changeOrgaFilter(orgaFilter: string, filterStore: FilterStore){
10
51
  const saveStore = useSaveFetchStore();
@@ -37,7 +78,7 @@ let resolved = false;
37
78
  /**
38
79
  * Utility function seting up the router with a custom beforeEach
39
80
  */
40
- export function setupRouter(router: Router, getMyOrgaActive: (authStore: AuthStore) => Promise<string>): void {
81
+ export function setupRouter(router: Router, getMyOrgaActive: (authStore: AuthStore) => Promise<void>): void {
41
82
  router.beforeResolve(async () =>{
42
83
  fetchMyOrgaActive = false;
43
84
  // Reinit variable to allow one redirect
@@ -109,4 +150,4 @@ export function setupRouter(router: Router, getMyOrgaActive: (authStore: AuthSto
109
150
  }
110
151
  }
111
152
  });
112
- }
153
+ }