@saooti/octopus-sdk 30.0.59 → 30.0.60
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/README.md +2 -1
- package/index.ts +5 -2
- package/package.json +1 -1
- package/src/components/display/categories/CategoryList.vue +1 -1
- package/src/components/display/emission/EmissionList.vue +1 -1
- package/src/components/display/live/LiveHorizontalList.vue +1 -1
- package/src/components/display/participant/ParticipantList.vue +1 -1
- package/src/components/display/playlist/PlaylistList.vue +1 -1
- package/src/components/display/playlist/PodcastList.vue +1 -1
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +204 -0
- package/src/components/display/podcasts/PodcastInlineList.vue +1 -1
- package/src/components/display/podcasts/PodcastList.vue +1 -1
- package/src/components/display/rubriques/RubriqueList.vue +1 -1
package/README.md
CHANGED
|
@@ -555,4 +555,5 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
555
555
|
* 30.0.56 Popover title
|
|
556
556
|
* 30.0.57 podcastmaker Le soir améliorations
|
|
557
557
|
* 30.0.58 Prefix css dans component par octopus-app
|
|
558
|
-
* 30.0.59 Pb productorChooser
|
|
558
|
+
* 30.0.59 Pb productorChooser
|
|
559
|
+
* 30.0.60 PlaylistPodcastInlineList
|
package/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ import EmissionInlineList from "./src/components/display/emission/EmissionInline
|
|
|
49
49
|
import RubriqueChooser from "./src/components/display/rubriques/RubriqueChooser.vue";
|
|
50
50
|
import CommentList from "./src/components/display/comments/CommentList.vue";
|
|
51
51
|
import CommentInput from "./src/components/display/comments/CommentInput.vue";
|
|
52
|
+
import PodcastPlaylistInlineList from "./src/components/display/playlist/PodcastPlaylistInlineList.vue";
|
|
52
53
|
|
|
53
54
|
//form
|
|
54
55
|
import ClassicSearch from "./src/components/form/ClassicSearch.vue";
|
|
@@ -112,7 +113,8 @@ const components = {
|
|
|
112
113
|
ClassicCheckbox,
|
|
113
114
|
ClassicRadio,
|
|
114
115
|
ClassicLoading,
|
|
115
|
-
AdvancedSearch
|
|
116
|
+
AdvancedSearch,
|
|
117
|
+
PodcastPlaylistInlineList
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
export default components;
|
|
@@ -165,5 +167,6 @@ export {
|
|
|
165
167
|
ClassicCheckbox,
|
|
166
168
|
ClassicRadio,
|
|
167
169
|
ClassicLoading,
|
|
168
|
-
AdvancedSearch
|
|
170
|
+
AdvancedSearch,
|
|
171
|
+
PodcastPlaylistInlineList
|
|
169
172
|
};
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
class="dropdown btn-group"
|
|
23
23
|
>
|
|
24
24
|
<button
|
|
25
|
-
class="btn dropdown-toggle admin-button dropdown-toggle-no-caret saooti-
|
|
25
|
+
class="btn dropdown-toggle admin-button dropdown-toggle-no-caret saooti-more"
|
|
26
26
|
data-bs-toggle="dropdown"
|
|
27
27
|
aria-expanded="false"
|
|
28
28
|
:title="$t('See more')"
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="loading || (!loading && 0 !== allPodcasts.length)"
|
|
4
|
+
class="d-flex flex-column p-3 playlist-inline-podcast"
|
|
5
|
+
>
|
|
6
|
+
<h2>{{ title }}</h2>
|
|
7
|
+
<div
|
|
8
|
+
v-if="!overflowScroll"
|
|
9
|
+
class="d-flex justify-content-end hide-phone"
|
|
10
|
+
>
|
|
11
|
+
<button
|
|
12
|
+
class="btn admin-button m-1"
|
|
13
|
+
:class="{ disabled: !previousAvailable }"
|
|
14
|
+
:title="$t('Display previous')"
|
|
15
|
+
@click="displayPrevious()"
|
|
16
|
+
>
|
|
17
|
+
<div class="saooti-left fw-bold" />
|
|
18
|
+
</button>
|
|
19
|
+
<button
|
|
20
|
+
class="btn admin-button m-1"
|
|
21
|
+
:class="{ disabled: !nextAvailable }"
|
|
22
|
+
:title="$t('Display next')"
|
|
23
|
+
@click="displayNext()"
|
|
24
|
+
>
|
|
25
|
+
<div class="saooti-right fw-bold" />
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
<ClassicLoading
|
|
29
|
+
:loading-text="loading?$t('Loading podcasts ...'):undefined"
|
|
30
|
+
/>
|
|
31
|
+
<transition-group
|
|
32
|
+
:name="transitionName"
|
|
33
|
+
class="element-list-inline"
|
|
34
|
+
tag="ul"
|
|
35
|
+
:class="[
|
|
36
|
+
alignLeft ? 'justify-content-start' : '',
|
|
37
|
+
overflowScroll ? 'overflowScroll' : '',
|
|
38
|
+
]"
|
|
39
|
+
:css="isInlineAnimation"
|
|
40
|
+
>
|
|
41
|
+
<PodcastItem
|
|
42
|
+
v-for="p in podcasts"
|
|
43
|
+
:key="p.podcastId"
|
|
44
|
+
class="flex-shrink-0 item-phone-margin"
|
|
45
|
+
:podcast="p"
|
|
46
|
+
:class="[alignLeft ? 'me-3' : '']"
|
|
47
|
+
/>
|
|
48
|
+
</transition-group>
|
|
49
|
+
<router-link
|
|
50
|
+
class="btn btn-link align-self-center width-fit-content m-4"
|
|
51
|
+
:to="{
|
|
52
|
+
name: 'playlist',
|
|
53
|
+
params: { playlistId: playlistId.toString() },
|
|
54
|
+
}"
|
|
55
|
+
>
|
|
56
|
+
{{ $t('See more') }}
|
|
57
|
+
<div
|
|
58
|
+
class="ms-1 saooti-more"
|
|
59
|
+
/>
|
|
60
|
+
</router-link>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script lang="ts">
|
|
65
|
+
import octopusApi from '@saooti/octopus-api';
|
|
66
|
+
import domHelper from '../../../helper/dom';
|
|
67
|
+
import PodcastItem from '../podcasts/PodcastItem.vue';
|
|
68
|
+
import ClassicLoading from '../../form/ClassicLoading.vue';
|
|
69
|
+
const PHONE_WIDTH = 960;
|
|
70
|
+
import { state } from '../../../store/paramStore';
|
|
71
|
+
import { Podcast } from '@/store/class/general/podcast';
|
|
72
|
+
import { defineComponent } from 'vue'
|
|
73
|
+
import { Playlist } from '@saooti/octopus-api/class/playlist';
|
|
74
|
+
export default defineComponent({
|
|
75
|
+
name: 'PodcastPlaylistInlineList',
|
|
76
|
+
|
|
77
|
+
components: {
|
|
78
|
+
PodcastItem,
|
|
79
|
+
ClassicLoading
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
props: {
|
|
83
|
+
playlistId: { default: undefined, type: Number},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
loading: true as boolean,
|
|
89
|
+
index: 0 as number,
|
|
90
|
+
first: 0 as number,
|
|
91
|
+
size: 5 as number,
|
|
92
|
+
totalCount: 0 as number,
|
|
93
|
+
playlist: undefined as Playlist|undefined,
|
|
94
|
+
allPodcasts: [] as Array<Podcast>,
|
|
95
|
+
direction: 1 as number,
|
|
96
|
+
alignLeft: false as boolean,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
title(): string{
|
|
101
|
+
if(this.playlist){
|
|
102
|
+
return this.playlist.title;
|
|
103
|
+
}
|
|
104
|
+
return "";
|
|
105
|
+
},
|
|
106
|
+
podcasts(): Array<Podcast> {
|
|
107
|
+
return this.allPodcasts.slice(this.index, this.index + this.size);
|
|
108
|
+
},
|
|
109
|
+
sizeItem(): number {
|
|
110
|
+
return state.generalParameters.podcastItem ? (state.generalParameters.podcastItem as number): 13;
|
|
111
|
+
},
|
|
112
|
+
overflowScroll(): boolean {
|
|
113
|
+
return (state.emissionPage.overflowScroll as boolean);
|
|
114
|
+
},
|
|
115
|
+
isInlineAnimation(): boolean {
|
|
116
|
+
return (state.generalParameters.isInlineAnimation as boolean);
|
|
117
|
+
},
|
|
118
|
+
previousAvailable(): boolean {
|
|
119
|
+
return this.index > 0;
|
|
120
|
+
},
|
|
121
|
+
nextAvailable(): boolean {
|
|
122
|
+
return this.index + this.size < this.totalCount;
|
|
123
|
+
},
|
|
124
|
+
transitionName(): string {
|
|
125
|
+
return this.direction > 0 ? 'out-left' : 'out-right';
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
watch: {
|
|
129
|
+
playlistId(): void {
|
|
130
|
+
this.reset();
|
|
131
|
+
this.fetchContent();
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
created() {
|
|
136
|
+
window.addEventListener('resize', this.handleResize);
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
unmounted() {
|
|
140
|
+
window.removeEventListener('resize', this.handleResize);
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
mounted() {
|
|
144
|
+
this.handleResize();
|
|
145
|
+
this.fetchContent();
|
|
146
|
+
},
|
|
147
|
+
methods: {
|
|
148
|
+
async fetchContent(): Promise<void> {
|
|
149
|
+
this.allPodcasts.length = 0;
|
|
150
|
+
this.loading = true;
|
|
151
|
+
this.playlist = await octopusApi.fetchPlaylist(this.playlistId ? this.playlistId.toString(): "");
|
|
152
|
+
this.allPodcasts = await octopusApi.fetchPlaylistContent(
|
|
153
|
+
this.playlist.playlistId.toString()
|
|
154
|
+
);
|
|
155
|
+
if (!((state.generalParameters.authenticated && state.generalParameters.organisationId === this.playlist.organisation.id) ||
|
|
156
|
+
state.generalParameters.isAdmin)) {
|
|
157
|
+
this.allPodcasts = this.allPodcasts.filter((p: Podcast|null) => {
|
|
158
|
+
return (
|
|
159
|
+
null !== p &&
|
|
160
|
+
(!p.availability || true === p.availability.visibility)
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (this.allPodcasts.length <= 3) {
|
|
165
|
+
this.alignLeft = true;
|
|
166
|
+
} else {
|
|
167
|
+
this.alignLeft = false;
|
|
168
|
+
}
|
|
169
|
+
this.loading = false;
|
|
170
|
+
},
|
|
171
|
+
displayPrevious(): void {
|
|
172
|
+
this.direction = -1;
|
|
173
|
+
if (this.previousAvailable) {
|
|
174
|
+
this.index -= 1;
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
displayNext(): void {
|
|
178
|
+
this.direction = 1;
|
|
179
|
+
if (!this.nextAvailable) return;
|
|
180
|
+
this.index += 1;
|
|
181
|
+
},
|
|
182
|
+
handleResize(): void {
|
|
183
|
+
if (!this.$el) return;
|
|
184
|
+
if (this.overflowScroll) {
|
|
185
|
+
this.size = 20;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (window.innerWidth <= PHONE_WIDTH) {
|
|
189
|
+
this.size = 10;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const width = (this.$el as HTMLElement).offsetWidth;
|
|
193
|
+
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.7);
|
|
194
|
+
this.size = Math.floor(width / sixteen);
|
|
195
|
+
},
|
|
196
|
+
reset(): void {
|
|
197
|
+
this.index = 0;
|
|
198
|
+
this.first = 0;
|
|
199
|
+
this.totalCount = 0;
|
|
200
|
+
this.allPodcasts.length = 0;
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
})
|
|
204
|
+
</script>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
class="dropdown btn-group"
|
|
32
32
|
>
|
|
33
33
|
<button
|
|
34
|
-
class="btn dropdown-toggle admin-button dropdown-toggle-no-caret saooti-
|
|
34
|
+
class="btn dropdown-toggle admin-button dropdown-toggle-no-caret saooti-more"
|
|
35
35
|
data-bs-toggle="dropdown"
|
|
36
36
|
aria-expanded="false"
|
|
37
37
|
:title="$t('See more')"
|