@saooti/octopus-sdk 41.0.10-SNAPSHOT → 41.0.12-SNAPSHOT
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/package.json +1 -1
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useSimplePageParam.ts +11 -5
- package/src/components/display/emission/EmissionList.vue +5 -8
- package/src/components/display/filter/AdvancedSearch.vue +0 -3
- package/src/components/display/list/ListPaginate.vue +3 -1
- package/src/components/display/participant/ParticipantList.vue +6 -9
- package/src/components/display/playlist/PlaylistList.vue +5 -8
- package/src/components/display/podcasts/PodcastFilterList.vue +3 -1
- package/src/components/display/podcasts/PodcastList.vue +6 -9
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import dayjs from "dayjs";
|
|
|
9
9
|
|
|
10
10
|
export const useAdvancedParamInit = (props: any, isEmission: boolean)=>{
|
|
11
11
|
|
|
12
|
-
const { searchPattern,organisationId, searchMinSize, paginateFirst, initSearchPattern, initOrga} = useSimplePageParam(props);
|
|
12
|
+
const { searchPattern,organisationId, searchMinSize, paginateFirst, initSearchPattern, initOrga} = useSimplePageParam(props, false, true);
|
|
13
13
|
const { isEditRights, isPodcastmaker } = useOrgaComputed();
|
|
14
14
|
const { stringifyRubriquesFilter } = useRubriquesFilterParam();
|
|
15
15
|
|
|
@@ -2,7 +2,7 @@ import { useFilterStore } from '../../../stores/FilterStore';
|
|
|
2
2
|
import { useRouteUpdateParams } from './useRouteUpdateParams';
|
|
3
3
|
import { computed, onMounted, Ref, ref, watch } from "vue";
|
|
4
4
|
|
|
5
|
-
export const useSimplePageParam = (props: {readonly [key:string]: string|number}, force=false)=>{
|
|
5
|
+
export const useSimplePageParam = (props: {readonly [key:string]: string|number}, force=false, advancedSearch=false)=>{
|
|
6
6
|
|
|
7
7
|
const { updateRouteParam } = useRouteUpdateParams();
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ export const useSimplePageParam = (props: {readonly [key:string]: string|number}
|
|
|
12
12
|
const searchPattern = ref("");
|
|
13
13
|
const organisationId: Ref<string|undefined> = ref(undefined);
|
|
14
14
|
|
|
15
|
-
const searchMinSize = computed(() =>
|
|
15
|
+
const searchMinSize = computed(() => getMinSize((props.routeQuery as string)));
|
|
16
16
|
const paginateFirst = computed(() => {
|
|
17
17
|
if(!props.pr){
|
|
18
18
|
return 0;
|
|
@@ -21,9 +21,12 @@ export const useSimplePageParam = (props: {readonly [key:string]: string|number}
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
watch(searchPattern, () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
if(!advancedSearch){
|
|
25
|
+
const query = getMinSize(searchPattern.value);
|
|
26
|
+
updateRouteParam({
|
|
27
|
+
q: query.length ? query : undefined,
|
|
28
|
+
}, force);
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
|
|
29
32
|
onMounted(() => {
|
|
@@ -32,6 +35,9 @@ export const useSimplePageParam = (props: {readonly [key:string]: string|number}
|
|
|
32
35
|
isInit.value = true;
|
|
33
36
|
})
|
|
34
37
|
|
|
38
|
+
function getMinSize(param:string){
|
|
39
|
+
return param.length>3 ?param : ""
|
|
40
|
+
}
|
|
35
41
|
function initSearchPattern(){
|
|
36
42
|
searchPattern.value = (props.routeQuery as string) ?? "";
|
|
37
43
|
}
|
|
@@ -152,8 +152,8 @@ watch(changePaginate, () => {
|
|
|
152
152
|
dfirst.value = props.first;
|
|
153
153
|
dsize.value = props.size;
|
|
154
154
|
});
|
|
155
|
-
watch(changed, () =>
|
|
156
|
-
watch(dsize, () =>
|
|
155
|
+
watch(changed, () =>fetchContent(true));
|
|
156
|
+
watch(dsize, () =>fetchContent(true));
|
|
157
157
|
watch(dfirst, () =>{
|
|
158
158
|
if (
|
|
159
159
|
!emissions.value[dfirst.value] ||
|
|
@@ -165,21 +165,17 @@ watch(dfirst, () =>{
|
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
onMounted(()=>{
|
|
168
|
-
fetchContent(
|
|
168
|
+
fetchContent(false);
|
|
169
169
|
if (displayRubriquage.value) {
|
|
170
170
|
fetchRubriques();
|
|
171
171
|
}
|
|
172
172
|
})
|
|
173
173
|
|
|
174
174
|
//Methods
|
|
175
|
-
function reloadList() {
|
|
176
|
-
dfirst.value = 0;
|
|
177
|
-
fetchContent(true);
|
|
178
|
-
}
|
|
179
175
|
async function fetchContent(reset: boolean): Promise<void> {
|
|
180
176
|
loading.value = true;
|
|
181
177
|
const param: FetchParam = {
|
|
182
|
-
first: dfirst.value,
|
|
178
|
+
first: reset? 0: dfirst.value,
|
|
183
179
|
size: dsize.value,
|
|
184
180
|
query: props.query,
|
|
185
181
|
organisationId: organisation.value,
|
|
@@ -212,6 +208,7 @@ function afterFetching(
|
|
|
212
208
|
data: { count: number; result: Array<Emission>; sort: string },
|
|
213
209
|
): void {
|
|
214
210
|
if (reset) {
|
|
211
|
+
dfirst.value = 0;
|
|
215
212
|
emissions.value.length = 0;
|
|
216
213
|
}
|
|
217
214
|
if (dfirst.value > emissions.value.length) {
|
|
@@ -184,9 +184,6 @@ watch(()=>props.searchPattern, (value: string) => {
|
|
|
184
184
|
if(search.length <= 3){
|
|
185
185
|
valSort = props.isEmission? "LAST_PODCAST_DESC" : "DATE";
|
|
186
186
|
}
|
|
187
|
-
if (valSort !== props.sort) {
|
|
188
|
-
emit("update:sort", valSort);
|
|
189
|
-
}
|
|
190
187
|
updateRouteParamAdvanced({
|
|
191
188
|
q: search.length ? search : undefined,
|
|
192
189
|
s: valSort,
|
|
@@ -98,6 +98,9 @@ const rangeSize = computed(() => {
|
|
|
98
98
|
|
|
99
99
|
//Watch
|
|
100
100
|
watch(isPhone, () => {emit("update:isMobile", isPhone.value);}, {immediate: true});
|
|
101
|
+
watch(()=>props.first, () => {
|
|
102
|
+
updateRouteParam({pr:(Math.floor(props.first / props.rowsPerPage) + 1).toString()}, props.forceUpdateParameters);
|
|
103
|
+
});
|
|
101
104
|
|
|
102
105
|
//Methods
|
|
103
106
|
function fetchMore() {
|
|
@@ -106,7 +109,6 @@ function fetchMore() {
|
|
|
106
109
|
function changeFirst(firstValue: number) {
|
|
107
110
|
scrollToTop();
|
|
108
111
|
emit("update:first", firstValue);
|
|
109
|
-
updateRouteParam({pr:(Math.floor(firstValue/ props.rowsPerPage) + 1).toString()}, props.forceUpdateParameters);
|
|
110
112
|
}
|
|
111
113
|
function changeSize(sizeValue: number) {
|
|
112
114
|
scrollToTop();
|
|
@@ -103,9 +103,9 @@ watch(changePaginate, () => {
|
|
|
103
103
|
dfirst.value = props.first;
|
|
104
104
|
dsize.value = props.size;
|
|
105
105
|
});
|
|
106
|
-
watch(()=>props.query, () =>
|
|
107
|
-
watch(organisation, () =>
|
|
108
|
-
watch(dsize, () =>
|
|
106
|
+
watch(()=>props.query, () => fetchContent(true));
|
|
107
|
+
watch(organisation, () => fetchContent(true));
|
|
108
|
+
watch(dsize, () => fetchContent(true));
|
|
109
109
|
watch(dfirst, () => {
|
|
110
110
|
if (
|
|
111
111
|
!participants.value[dfirst.value] ||
|
|
@@ -115,14 +115,10 @@ watch(dfirst, () => {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
onBeforeMount(()=>fetchContent(
|
|
118
|
+
onBeforeMount(()=>fetchContent(false))
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
//Methods
|
|
122
|
-
function reloadList() {
|
|
123
|
-
dfirst.value = 0;
|
|
124
|
-
fetchContent(true);
|
|
125
|
-
}
|
|
126
122
|
async function fetchContent(reset: boolean): Promise<void> {
|
|
127
123
|
loading.value = true;
|
|
128
124
|
try {
|
|
@@ -131,7 +127,7 @@ async function fetchContent(reset: boolean): Promise<void> {
|
|
|
131
127
|
api: 0,
|
|
132
128
|
path: "participant/search",
|
|
133
129
|
parameters: {
|
|
134
|
-
first: dfirst.value,
|
|
130
|
+
first: reset? 0: dfirst.value,
|
|
135
131
|
size: dsize.value,
|
|
136
132
|
query: props.query,
|
|
137
133
|
organisationId: organisation.value,
|
|
@@ -141,6 +137,7 @@ async function fetchContent(reset: boolean): Promise<void> {
|
|
|
141
137
|
},
|
|
142
138
|
);
|
|
143
139
|
if (reset) {
|
|
140
|
+
dfirst.value = 0;
|
|
144
141
|
participants.value.length = 0;
|
|
145
142
|
}
|
|
146
143
|
displayCount.value = data.count;
|
|
@@ -98,8 +98,8 @@ watch(changePaginate, () => {
|
|
|
98
98
|
dfirst.value = props.first;
|
|
99
99
|
dsize.value = props.size;
|
|
100
100
|
});
|
|
101
|
-
watch(changed, () =>
|
|
102
|
-
watch(dsize, () =>
|
|
101
|
+
watch(changed, () => fetchContent(true));
|
|
102
|
+
watch(dsize, () =>fetchContent(true));
|
|
103
103
|
watch(dfirst, () => {
|
|
104
104
|
if (
|
|
105
105
|
!playlists.value[dfirst.value] ||
|
|
@@ -109,18 +109,14 @@ watch(dfirst, () => {
|
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
onMounted(()=>fetchContent(
|
|
112
|
+
onMounted(()=>fetchContent(false))
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
//Methods
|
|
116
|
-
function reloadList() {
|
|
117
|
-
dfirst.value = 0;
|
|
118
|
-
fetchContent(true);
|
|
119
|
-
}
|
|
120
116
|
async function fetchContent(reset: boolean): Promise<void> {
|
|
121
117
|
loading.value = true;
|
|
122
118
|
const param = {
|
|
123
|
-
first: dfirst.value,
|
|
119
|
+
first: reset ? 0 : dfirst.value,
|
|
124
120
|
size: dsize.value,
|
|
125
121
|
query: props.query,
|
|
126
122
|
organisationId: organisation.value,
|
|
@@ -144,6 +140,7 @@ function afterFetching(
|
|
|
144
140
|
data: { count: number; result: Array<Playlist>; sort: string },
|
|
145
141
|
): void {
|
|
146
142
|
if (reset) {
|
|
143
|
+
dfirst.value = 0;
|
|
147
144
|
playlists.value.length = 0;
|
|
148
145
|
}
|
|
149
146
|
if (dfirst.value > playlists.value.length) {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
:participant-id="participantId"
|
|
27
27
|
:emission-id="emissionId"
|
|
28
28
|
:organisation-id="productorId"
|
|
29
|
+
:sort-criteria="sort"
|
|
29
30
|
:reload="reloadList"
|
|
30
31
|
:include-hidden="editRight"
|
|
31
32
|
:show-count="showCount"
|
|
@@ -82,7 +83,8 @@ const titleFilter = computed(() => {
|
|
|
82
83
|
? t("All podcast button", { name: props.name })
|
|
83
84
|
: t("All podcast emission button");
|
|
84
85
|
});
|
|
85
|
-
const query = computed(() => searchPattern.value.length
|
|
86
|
+
const query = computed(() => searchPattern.value.length > 3 ? searchPattern.value : "");
|
|
87
|
+
const sort = computed(() => !query.value.length ? "DATE" : "SCORE");
|
|
86
88
|
|
|
87
89
|
//Watch
|
|
88
90
|
watch(()=>props.reload, () => {
|
|
@@ -150,9 +150,9 @@ watch(changePaginate, () => {
|
|
|
150
150
|
dfirst.value = props.first;
|
|
151
151
|
dsize.value = props.size;
|
|
152
152
|
});
|
|
153
|
-
watch(changed, () =>
|
|
154
|
-
watch(()=>props.reload, () =>
|
|
155
|
-
watch(dsize, () =>
|
|
153
|
+
watch(changed, () => fetchContent(true));
|
|
154
|
+
watch(()=>props.reload, () => fetchContent(true));
|
|
155
|
+
watch(dsize, () => fetchContent(true));
|
|
156
156
|
watch(dfirst, () => {
|
|
157
157
|
if (
|
|
158
158
|
!podcasts.value[dfirst.value] ||
|
|
@@ -162,17 +162,13 @@ watch(dfirst, () => {
|
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
onBeforeMount(()=>fetchContent(
|
|
165
|
+
onBeforeMount(()=>fetchContent(false))
|
|
166
166
|
|
|
167
167
|
//Methods
|
|
168
|
-
function reloadList() {
|
|
169
|
-
dfirst.value = 0;
|
|
170
|
-
fetchContent(true);
|
|
171
|
-
}
|
|
172
168
|
async function fetchContent(reset: boolean): Promise<void> {
|
|
173
169
|
loading.value = true;
|
|
174
170
|
const param: FetchParam = {
|
|
175
|
-
first: dfirst.value,
|
|
171
|
+
first: reset ? 0 : dfirst.value,
|
|
176
172
|
size: dsize.value,
|
|
177
173
|
organisationId: organisation.value,
|
|
178
174
|
emissionId: props.emissionId,
|
|
@@ -215,6 +211,7 @@ function afterFetching(
|
|
|
215
211
|
data: { count: number; result: Array<Podcast>; sort: string },
|
|
216
212
|
): void {
|
|
217
213
|
if (reset) {
|
|
214
|
+
dfirst.value = 0;
|
|
218
215
|
podcasts.value.length = 0;
|
|
219
216
|
}
|
|
220
217
|
if (dfirst.value > podcasts.value.length) {
|