@saooti/octopus-sdk 41.0.3-SNAPSHOT → 41.0.3
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/index.ts +2 -1
- package/package.json +3 -1
- package/src/App.vue +3 -7
- package/src/components/composable/player/usePlayerLive.ts +1 -1
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/display/categories/CategoryChooser.vue +6 -0
- 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 +4 -12
- package/src/components/display/live/LiveItem.vue +2 -3
- package/src/components/display/participant/ParticipantList.vue +6 -9
- package/src/components/display/playlist/PlaylistList.vue +5 -8
- package/src/components/display/playlist/PodcastList.vue +16 -7
- package/src/components/display/podcasts/PodcastFilterList.vue +19 -8
- package/src/components/display/podcasts/PodcastList.vue +8 -9
- package/src/components/display/podcasts/PodcastModuleBox.vue +1 -1
- package/src/components/display/sharing/SharePlayerTypes.vue +1 -1
- package/src/components/form/ClassicInputText.vue +4 -1
- package/src/components/form/ClassicMultiselect.vue +36 -8
- package/src/components/misc/ClassicAccordion.vue +4 -4
- package/src/components/misc/ClassicPopover.vue +1 -1
- package/src/components/misc/ClassicSpinner.vue +1 -1
- package/src/components/misc/FooterSection.vue +1 -20
- package/src/components/misc/TopBar.vue +4 -11
- package/src/components/pages/EmissionPage.vue +14 -0
- package/src/components/pages/PageLogout.vue +1 -6
- package/src/components/pages/ParticipantPage.vue +14 -0
- package/src/components/pages/PlaylistPage.vue +17 -4
- package/src/components/pages/PodcastPage.vue +2 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/style/_variables.scss +3 -0
- package/src/style/general.scss +5 -0
package/index.ts
CHANGED
|
@@ -108,7 +108,7 @@ import {useMetaTitleWatch} from "./src/components/composable/useMetaTitleWatch.t
|
|
|
108
108
|
import {useOrganisationFilter} from "./src/components/composable/useOrganisationFilter.ts";
|
|
109
109
|
import {useInit} from "./src/components/composable/useInit.ts";
|
|
110
110
|
import {useErrorHandler} from "./src/components/composable/useErrorHandler.ts";
|
|
111
|
-
|
|
111
|
+
import { useSimplePageParam } from "./src/components/composable/route/useSimplePageParam";
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
//helper
|
|
@@ -157,6 +157,7 @@ export {
|
|
|
157
157
|
useOrganisationFilter,
|
|
158
158
|
useInit,
|
|
159
159
|
useErrorHandler,
|
|
160
|
+
useSimplePageParam,
|
|
160
161
|
debounce,
|
|
161
162
|
useVastStore,
|
|
162
163
|
useSaveFetchStore,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saooti/octopus-sdk",
|
|
3
|
-
"version": "41.0.3
|
|
3
|
+
"version": "41.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"serve": "vite preview",
|
|
9
9
|
"build": "vite build",
|
|
10
10
|
"dev": "vite",
|
|
11
|
+
"bundle":"vite-bundle-visualizer",
|
|
11
12
|
"proxy_authentifié": "node proxy.ts",
|
|
12
13
|
"proxy_non_authentifié": "node proxy.ts false",
|
|
13
14
|
"lint": "eslint --fix src",
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
"video.js": "^8.23.3",
|
|
54
55
|
"videojs-quality-selector-hls": "^1.1.1",
|
|
55
56
|
"vite": "^6.3.5",
|
|
57
|
+
"vite-bundle-visualizer": "^1.2.1",
|
|
56
58
|
"vue": "^3.5.16",
|
|
57
59
|
"vue-i18n": "^11.1.5",
|
|
58
60
|
"vue-material-design-icons": "^5.3.1",
|
package/src/App.vue
CHANGED
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
<router-view />
|
|
9
9
|
<PlayerComponent />
|
|
10
10
|
</main>
|
|
11
|
-
<
|
|
12
|
-
<FooterOctopus />
|
|
13
|
-
</ClassicLazy>
|
|
11
|
+
<FooterOctopus />
|
|
14
12
|
</template>
|
|
15
13
|
</div>
|
|
16
14
|
</template>
|
|
17
15
|
<script setup lang="ts">
|
|
18
16
|
import TopBar from "@/components/misc/TopBar.vue";
|
|
17
|
+
import FooterOctopus from "@/components/misc/FooterSection.vue";
|
|
19
18
|
import PlayerComponent from "@/components/misc/player/PlayerComponent.vue";
|
|
20
|
-
import ClassicLazy from "@/components/misc/ClassicLazy.vue";
|
|
21
19
|
import {useInit} from "./components/composable/useInit";
|
|
22
20
|
import {useMetaTitle} from "./components/composable/useMetaTitle";
|
|
23
21
|
import {useOrganisationFilter} from "./components/composable/useOrganisationFilter";
|
|
@@ -25,9 +23,7 @@ import { useAuthStore } from "./stores/AuthStore";
|
|
|
25
23
|
import { defineAsyncComponent, getCurrentInstance, onBeforeMount, ref, watch } from "vue";
|
|
26
24
|
import { useRoute } from "vue-router";
|
|
27
25
|
import { useI18n } from "vue-i18n";
|
|
28
|
-
|
|
29
|
-
() => import("@/components/misc/FooterSection.vue"),
|
|
30
|
-
);
|
|
26
|
+
|
|
31
27
|
const CategoryFilter = defineAsyncComponent(
|
|
32
28
|
() => import("@/components/display/categories/CategoryFilter.vue"),
|
|
33
29
|
);
|
|
@@ -16,7 +16,7 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
|
|
|
16
16
|
const audioElement: Ref<HTMLAudioElement | null>= ref(null);
|
|
17
17
|
const hls: Ref<any>= ref(null);
|
|
18
18
|
const hlsRetryTimeout: Ref<ReturnType<typeof setTimeout> | undefined>= ref(undefined);
|
|
19
|
-
const playPromise: Ref<
|
|
19
|
+
const playPromise: Ref<Promise<void>|undefined>= ref(undefined);
|
|
20
20
|
const errorHls= ref(false);
|
|
21
21
|
|
|
22
22
|
|
|
@@ -3,10 +3,10 @@ import { useVastStore } from "../../../stores/VastStore";
|
|
|
3
3
|
import { loadScript } from "../../../helper/loadScript";
|
|
4
4
|
import {nextTick, Ref, ref, watch} from 'vue';
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
|
-
let adsLoader:
|
|
7
|
-
let adsManager:
|
|
8
|
-
let adDisplayContainer:
|
|
9
|
-
let adsRequest:
|
|
6
|
+
let adsLoader: google.ima.AdsLoader;
|
|
7
|
+
let adsManager:google.ima.AdsManager;
|
|
8
|
+
let adDisplayContainer:google.ima.AdDisplayContainer;
|
|
9
|
+
let adsRequest: google.ima.AdsRequest;
|
|
10
10
|
export const usePlayerVast = ()=>{
|
|
11
11
|
const imaLoaded = ref(false);
|
|
12
12
|
const isContentFinished = ref(false);
|
|
@@ -83,7 +83,7 @@ export const usePlayerVast = ()=>{
|
|
|
83
83
|
adsRequest.adTagUrl = vastUrl;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function onAdsManagerLoaded(adsManagerLoadedEvent:
|
|
86
|
+
function onAdsManagerLoaded(adsManagerLoadedEvent: google.ima.AdsManagerLoadedEvent) {
|
|
87
87
|
const adsRenderingSettings = new google.ima.AdsRenderingSettings();
|
|
88
88
|
adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true;
|
|
89
89
|
adsManager = adsManagerLoadedEvent.getAdsManager(audioContainer.value, adsRenderingSettings);
|
|
@@ -117,7 +117,7 @@ export const usePlayerVast = ()=>{
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
function onAdError(adErrorEvent:
|
|
120
|
+
function onAdError(adErrorEvent: google.ima.AdErrorEvent) {
|
|
121
121
|
console.log(adErrorEvent.getError());
|
|
122
122
|
destroyAdManager();
|
|
123
123
|
}
|
|
@@ -132,7 +132,7 @@ export const usePlayerVast = ()=>{
|
|
|
132
132
|
isAdRequested.value = false;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
function onAdEvent(adEvent:
|
|
135
|
+
function onAdEvent(adEvent: google.ima.AdEvent) {
|
|
136
136
|
const ad = adEvent.getAd();
|
|
137
137
|
if(ad){
|
|
138
138
|
vastStore.updateCurrentAd(ad);
|
|
@@ -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
|
|
|
@@ -12,14 +12,14 @@ export const useRouteUpdateParams = ()=>{
|
|
|
12
12
|
return ['podcasts', 'emissions'].includes(route.name?.toString()??"");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function updatePaginateSize(ps:number){
|
|
16
|
-
if(checkPage()){
|
|
15
|
+
function updatePaginateSize(ps:number, force= false){
|
|
16
|
+
if(force ||checkPage()){
|
|
17
17
|
router.push({query: {...route.query, ...{ps:ps, pr:1}}});
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function updateRouteParam(update: {[key:string]: string|undefined}){
|
|
22
|
-
if(checkPage()){
|
|
21
|
+
function updateRouteParam(update: {[key:string]: string|undefined}, force= false){
|
|
22
|
+
if(force || checkPage()){
|
|
23
23
|
router.push({query: {...route.query, ...update}});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -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:
|
|
5
|
+
export const useSimplePageParam = (props: {readonly [key:string]: string|number}, force=false, advancedSearch=false)=>{
|
|
6
6
|
|
|
7
7
|
const { updateRouteParam } = useRouteUpdateParams();
|
|
8
8
|
|
|
@@ -12,18 +12,21 @@ export const useSimplePageParam = (props: any)=>{
|
|
|
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;
|
|
19
19
|
}
|
|
20
|
-
return Math.max((props.pr - 1 ) * props.ps, 0);
|
|
20
|
+
return Math.max(((props.pr as number) - 1 ) * (props.ps as number), 0);
|
|
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,11 +35,14 @@ export const useSimplePageParam = (props: any)=>{
|
|
|
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
|
-
searchPattern.value = props.routeQuery ?? "";
|
|
42
|
+
searchPattern.value = (props.routeQuery as string) ?? "";
|
|
37
43
|
}
|
|
38
44
|
function initOrga(){
|
|
39
|
-
organisationId.value = filterStore.filterOrgaId ?? props.routeOrga;
|
|
45
|
+
organisationId.value = filterStore.filterOrgaId ?? (props.routeOrga as string);
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
|
|
@@ -47,6 +53,7 @@ export const useSimplePageParam = (props: any)=>{
|
|
|
47
53
|
paginateFirst,
|
|
48
54
|
initSearchPattern,
|
|
49
55
|
initOrga,
|
|
56
|
+
updateRouteParam,
|
|
50
57
|
isInit
|
|
51
58
|
}
|
|
52
59
|
}
|
|
@@ -13,9 +13,12 @@
|
|
|
13
13
|
:multiple="multiple"
|
|
14
14
|
:min-search-length="1"
|
|
15
15
|
:width="width"
|
|
16
|
+
:height="height"
|
|
16
17
|
:is-disabled="isDisabled"
|
|
17
18
|
:no-deselect="noDeselect"
|
|
18
19
|
:display-required="displayRequired"
|
|
20
|
+
:popover="popover"
|
|
21
|
+
:popover-relative-class="popoverRelativeClass"
|
|
19
22
|
@on-search="onSearchCategory"
|
|
20
23
|
@selected="onCategorySelected"
|
|
21
24
|
/>
|
|
@@ -32,6 +35,7 @@ import { useI18n } from "vue-i18n";
|
|
|
32
35
|
const props = defineProps({
|
|
33
36
|
defaultanswer: { default: "", type: String },
|
|
34
37
|
width: { default: "100%", type: String },
|
|
38
|
+
height: { default: undefined, type: String },
|
|
35
39
|
multiple: { default: false, type: Boolean },
|
|
36
40
|
isDisabled: { default: false, type: Boolean },
|
|
37
41
|
initCategories: {
|
|
@@ -50,6 +54,8 @@ const props = defineProps({
|
|
|
50
54
|
displayLabel: { default: false, type: Boolean },
|
|
51
55
|
textDanger :{ default: undefined, type: String },
|
|
52
56
|
displayRequired: { default: false, type: Boolean },
|
|
57
|
+
popover: { default: undefined, type: String },
|
|
58
|
+
popoverRelativeClass: { default: undefined, type: String },
|
|
53
59
|
})
|
|
54
60
|
|
|
55
61
|
//Emits
|
|
@@ -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,
|
|
@@ -54,7 +54,7 @@ import PaginateParams from "./PaginateParams.vue";
|
|
|
54
54
|
import PaginateSection from "./PaginateSection.vue";
|
|
55
55
|
import {useResizePhone} from "../../composable/useResizePhone";
|
|
56
56
|
import { useRouteUpdateParams } from "../../composable/route/useRouteUpdateParams";
|
|
57
|
-
import { computed,
|
|
57
|
+
import { computed, watch } from "vue";
|
|
58
58
|
import { usePlayerStore } from "../../../stores/PlayerStore";
|
|
59
59
|
import { useI18n } from "vue-i18n";
|
|
60
60
|
|
|
@@ -72,13 +72,12 @@ const props = defineProps({
|
|
|
72
72
|
isMobile: { default: false, type: Boolean },
|
|
73
73
|
justSizeChosen: { default: false, type: Boolean },
|
|
74
74
|
playerResponsive: { default: false, type: Boolean },
|
|
75
|
+
forceUpdateParameters: { default: false, type: Boolean },
|
|
75
76
|
})
|
|
76
77
|
|
|
77
78
|
//Emits
|
|
78
79
|
const emit = defineEmits(["update:first", "update:rowsPerPage", "update:isMobile"]);
|
|
79
80
|
|
|
80
|
-
//Data
|
|
81
|
-
const internSizeChange = ref(false);
|
|
82
81
|
|
|
83
82
|
//Composables
|
|
84
83
|
const { t } = useI18n();
|
|
@@ -100,11 +99,7 @@ const rangeSize = computed(() => {
|
|
|
100
99
|
//Watch
|
|
101
100
|
watch(isPhone, () => {emit("update:isMobile", isPhone.value);}, {immediate: true});
|
|
102
101
|
watch(()=>props.first, () => {
|
|
103
|
-
|
|
104
|
-
internSizeChange.value = false;
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
updateRouteParam({pr:(Math.floor(props.first / props.rowsPerPage) + 1).toString()});
|
|
102
|
+
updateRouteParam({pr:(Math.floor(props.first / props.rowsPerPage) + 1).toString()}, props.forceUpdateParameters);
|
|
108
103
|
});
|
|
109
104
|
|
|
110
105
|
//Methods
|
|
@@ -117,11 +112,8 @@ function changeFirst(firstValue: number) {
|
|
|
117
112
|
}
|
|
118
113
|
function changeSize(sizeValue: number) {
|
|
119
114
|
scrollToTop();
|
|
120
|
-
if (0 !== props.first) {
|
|
121
|
-
internSizeChange.value = true;
|
|
122
|
-
}
|
|
123
115
|
emit("update:rowsPerPage", sizeValue);
|
|
124
|
-
updatePaginateSize(sizeValue);
|
|
116
|
+
updatePaginateSize(sizeValue, props.forceUpdateParameters);
|
|
125
117
|
}
|
|
126
118
|
function scrollToTop() {
|
|
127
119
|
const element = document.getElementById(props.id);
|
|
@@ -75,11 +75,10 @@ async function fetchStatus(): Promise<void> {
|
|
|
75
75
|
api: 9,
|
|
76
76
|
path: "conference/info/" + props.fetchConference.conferenceId,
|
|
77
77
|
});
|
|
78
|
-
|
|
79
|
-
if (newStatus !== props.fetchConference.status) {
|
|
78
|
+
if (confInfo.status !== props.fetchConference.status) {
|
|
80
79
|
emit("updateItem", {
|
|
81
80
|
...props.fetchConference,
|
|
82
|
-
...
|
|
81
|
+
...confInfo,
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
84
|
}
|
|
@@ -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) {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
/>
|
|
13
13
|
<ListPaginate
|
|
14
14
|
id="podcastPlaylistListPaginate"
|
|
15
|
-
v-model:first="
|
|
16
|
-
v-model:rows-per-page="
|
|
15
|
+
v-model:first="dfirst"
|
|
16
|
+
v-model:rows-per-page="dsize"
|
|
17
17
|
v-model:is-mobile="isMobile"
|
|
18
18
|
:text-count="
|
|
19
19
|
podcasts.length > 1
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
: undefined
|
|
30
30
|
"
|
|
31
31
|
:player-responsive="true"
|
|
32
|
+
:force-update-parameters="true"
|
|
32
33
|
>
|
|
33
34
|
<template #list>
|
|
34
35
|
<div class="octopus-element-list">
|
|
@@ -73,14 +74,20 @@ import { useI18n } from "vue-i18n";
|
|
|
73
74
|
//Props
|
|
74
75
|
const props = defineProps({
|
|
75
76
|
playlist: { default: () => ({}), type: Object as () => Playlist },
|
|
77
|
+
first: { default: 0, type: Number },
|
|
78
|
+
size: { default: 30, type: Number },
|
|
79
|
+
query: { default: undefined, type: String },
|
|
76
80
|
})
|
|
77
81
|
|
|
82
|
+
//Emits
|
|
83
|
+
const emit = defineEmits(["update:query"]);
|
|
84
|
+
|
|
78
85
|
//Data
|
|
79
86
|
const loading = ref(true);
|
|
80
87
|
const podcasts: Ref<Array<Podcast>> = ref([]);
|
|
81
88
|
const podcastsQuery: Ref<Array<Podcast>> = ref([]);
|
|
82
|
-
const
|
|
83
|
-
const
|
|
89
|
+
const dfirst = ref(props.first);
|
|
90
|
+
const dsize = ref(props.size);
|
|
84
91
|
const searchPattern = ref("");
|
|
85
92
|
const isMobile = ref(false);
|
|
86
93
|
|
|
@@ -96,18 +103,19 @@ const podcastsDisplay = computed(() => {
|
|
|
96
103
|
if (isMobile.value) {
|
|
97
104
|
return podcastsQuery.value.slice(
|
|
98
105
|
0,
|
|
99
|
-
Math.min(
|
|
106
|
+
Math.min(dfirst.value + dsize.value, podcasts.value.length),
|
|
100
107
|
);
|
|
101
108
|
}
|
|
102
109
|
return podcastsQuery.value.slice(
|
|
103
|
-
|
|
104
|
-
Math.min(
|
|
110
|
+
dfirst.value,
|
|
111
|
+
Math.min(dfirst.value + dsize.value, podcasts.value.length),
|
|
105
112
|
);
|
|
106
113
|
});
|
|
107
114
|
const editRight = computed(() =>isEditRights(props.playlist.organisation?.id));
|
|
108
115
|
|
|
109
116
|
//Watch
|
|
110
117
|
watch(searchPattern,() => {
|
|
118
|
+
emit('update:query', searchPattern.value);
|
|
111
119
|
if ("" !== searchPattern.value) {
|
|
112
120
|
podcastsQuery.value = podcasts.value.filter((el: Podcast) => {
|
|
113
121
|
return el.title
|
|
@@ -141,6 +149,7 @@ async function fetchContent(): Promise<void> {
|
|
|
141
149
|
});
|
|
142
150
|
}
|
|
143
151
|
podcastsQuery.value = podcasts.value;
|
|
152
|
+
searchPattern.value = props.query ?? "";
|
|
144
153
|
} catch (error) {
|
|
145
154
|
handle403(error as AxiosError);
|
|
146
155
|
}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
<h3 class="mb-2">
|
|
4
4
|
{{ titleFilter }}
|
|
5
5
|
</h3>
|
|
6
|
-
<div class="d-flex align-items-
|
|
6
|
+
<div class="d-flex align-items-stretch flex-wrap mb-2">
|
|
7
7
|
<div id="podcast-filter-list-category-chooser" class="w-50-responsive pe-3">
|
|
8
8
|
<CategoryChooser
|
|
9
|
+
height="100%"
|
|
9
10
|
:defaultanswer="t('No category filter')"
|
|
10
11
|
@selected="onCategorySelected"
|
|
11
12
|
/>
|
|
@@ -18,17 +19,19 @@
|
|
|
18
19
|
/>
|
|
19
20
|
</div>
|
|
20
21
|
<PodcastList
|
|
21
|
-
:first="
|
|
22
|
-
:size="
|
|
22
|
+
:first="dfirst"
|
|
23
|
+
:size="dsize"
|
|
23
24
|
:iab-id="iabId"
|
|
24
25
|
:query="query"
|
|
25
26
|
:participant-id="participantId"
|
|
26
27
|
:emission-id="emissionId"
|
|
27
28
|
:organisation-id="productorId"
|
|
29
|
+
:sort-criteria="sort"
|
|
28
30
|
:reload="reloadList"
|
|
29
31
|
:include-hidden="editRight"
|
|
30
32
|
:show-count="showCount"
|
|
31
33
|
:display-sort-text="false"
|
|
34
|
+
:force-update-parameters="forceUpdateParameters"
|
|
32
35
|
@fetch="fetch"
|
|
33
36
|
/>
|
|
34
37
|
</section>
|
|
@@ -47,6 +50,9 @@ const CategoryChooser = defineAsyncComponent(
|
|
|
47
50
|
|
|
48
51
|
//Props
|
|
49
52
|
const props = defineProps({
|
|
53
|
+
first: { default: 0, type: Number },
|
|
54
|
+
size: { default: 30, type: Number },
|
|
55
|
+
query: { default: undefined, type: String },
|
|
50
56
|
participantId: { default: undefined, type: Number },
|
|
51
57
|
name: { default: undefined, type: String },
|
|
52
58
|
emissionId: { default: undefined, type: Number },
|
|
@@ -55,15 +61,16 @@ const props = defineProps({
|
|
|
55
61
|
editRight: { default: false, type: Boolean },
|
|
56
62
|
productorId: { default: () => [], type: Array as () => Array<string> },
|
|
57
63
|
showCount: { default: false, type: Boolean },
|
|
64
|
+
forceUpdateParameters: { default: false, type: Boolean },
|
|
58
65
|
})
|
|
59
66
|
|
|
60
67
|
//Emits
|
|
61
|
-
const emit = defineEmits(["fetch"]);
|
|
68
|
+
const emit = defineEmits(["fetch", "update:query"]);
|
|
62
69
|
|
|
63
70
|
//Data
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const searchPattern = ref("");
|
|
71
|
+
const dfirst = ref(props.first);
|
|
72
|
+
const dsize = ref(props.size);
|
|
73
|
+
const searchPattern = ref(props.query ?? "");
|
|
67
74
|
const reloadList = ref(false);
|
|
68
75
|
const iabId : Ref<number | undefined>= ref(undefined);
|
|
69
76
|
|
|
@@ -76,12 +83,16 @@ const titleFilter = computed(() => {
|
|
|
76
83
|
? t("All podcast button", { name: props.name })
|
|
77
84
|
: t("All podcast emission button");
|
|
78
85
|
});
|
|
79
|
-
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");
|
|
80
88
|
|
|
81
89
|
//Watch
|
|
82
90
|
watch(()=>props.reload, () => {
|
|
83
91
|
reloadList.value = !reloadList.value;
|
|
84
92
|
});
|
|
93
|
+
watch(searchPattern, () => {
|
|
94
|
+
emit('update:query', searchPattern.value);
|
|
95
|
+
});
|
|
85
96
|
|
|
86
97
|
//Methods
|
|
87
98
|
function onCategorySelected(category: Category | undefined): void {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"
|
|
20
20
|
:just-size-chosen="justSizeChosen"
|
|
21
21
|
:player-responsive="true"
|
|
22
|
+
:force-update-parameters="forceUpdateParameters"
|
|
22
23
|
>
|
|
23
24
|
<template #list>
|
|
24
25
|
<div class="octopus-element-list">
|
|
@@ -85,6 +86,7 @@ const props = defineProps({
|
|
|
85
86
|
justSizeChosen: { default: false, type: Boolean },
|
|
86
87
|
withVideo: { default: undefined, type: Boolean },
|
|
87
88
|
includeTag:{ default: () => [], type: Array as () => Array<string> },
|
|
89
|
+
forceUpdateParameters: { default: false, type: Boolean },
|
|
88
90
|
})
|
|
89
91
|
|
|
90
92
|
//Emits
|
|
@@ -148,9 +150,9 @@ watch(changePaginate, () => {
|
|
|
148
150
|
dfirst.value = props.first;
|
|
149
151
|
dsize.value = props.size;
|
|
150
152
|
});
|
|
151
|
-
watch(changed, () =>
|
|
152
|
-
watch(()=>props.reload, () =>
|
|
153
|
-
watch(dsize, () =>
|
|
153
|
+
watch(changed, () => fetchContent(true));
|
|
154
|
+
watch(()=>props.reload, () => fetchContent(true));
|
|
155
|
+
watch(dsize, () => fetchContent(true));
|
|
154
156
|
watch(dfirst, () => {
|
|
155
157
|
if (
|
|
156
158
|
!podcasts.value[dfirst.value] ||
|
|
@@ -160,17 +162,13 @@ watch(dfirst, () => {
|
|
|
160
162
|
}
|
|
161
163
|
});
|
|
162
164
|
|
|
163
|
-
onBeforeMount(()=>fetchContent(
|
|
165
|
+
onBeforeMount(()=>fetchContent(false))
|
|
164
166
|
|
|
165
167
|
//Methods
|
|
166
|
-
function reloadList() {
|
|
167
|
-
dfirst.value = 0;
|
|
168
|
-
fetchContent(true);
|
|
169
|
-
}
|
|
170
168
|
async function fetchContent(reset: boolean): Promise<void> {
|
|
171
169
|
loading.value = true;
|
|
172
170
|
const param: FetchParam = {
|
|
173
|
-
first: dfirst.value,
|
|
171
|
+
first: reset ? 0 : dfirst.value,
|
|
174
172
|
size: dsize.value,
|
|
175
173
|
organisationId: organisation.value,
|
|
176
174
|
emissionId: props.emissionId,
|
|
@@ -213,6 +211,7 @@ function afterFetching(
|
|
|
213
211
|
data: { count: number; result: Array<Podcast>; sort: string },
|
|
214
212
|
): void {
|
|
215
213
|
if (reset) {
|
|
214
|
+
dfirst.value = 0;
|
|
216
215
|
podcasts.value.length = 0;
|
|
217
216
|
}
|
|
218
217
|
if (dfirst.value > podcasts.value.length) {
|
|
@@ -252,7 +252,7 @@ const isDebriefing = computed(() => {
|
|
|
252
252
|
);
|
|
253
253
|
});
|
|
254
254
|
const isOctopusAndAnimator = computed(() => {
|
|
255
|
-
return !isPodcastmaker && editRight && authStore.isRoleLive;
|
|
255
|
+
return !isPodcastmaker.value && editRight.value && authStore.isRoleLive;
|
|
256
256
|
});
|
|
257
257
|
const podcastNotValid = computed(() => {
|
|
258
258
|
return (
|