@saooti/octopus-sdk 31.0.1 → 31.0.2
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 +12 -1
- package/index.ts +8 -2
- package/package.json +3 -3
- package/src/assets/general.scss +8 -0
- package/src/assets/share.scss +21 -0
- package/src/components/display/categories/CategoryFilter.vue +10 -8
- package/src/components/display/categories/CategoryList.vue +26 -24
- package/src/components/display/comments/CommentInput.vue +21 -19
- package/src/components/display/comments/CommentList.vue +2 -0
- package/src/components/display/comments/CommentPlayer.vue +2 -0
- package/src/components/display/emission/EmissionInlineList.vue +32 -29
- package/src/components/display/emission/EmissionList.vue +12 -8
- package/src/components/display/emission/EmissionPlayerItem.vue +16 -1
- package/src/components/display/filter/AdvancedSearch.vue +2 -0
- package/src/components/display/filter/ProductorSearch.vue +6 -1
- package/src/components/display/live/LiveHorizontalList.vue +1 -1
- package/src/components/display/live/LiveItem.vue +2 -1
- package/src/components/display/live/LiveList.vue +51 -41
- package/src/components/display/organisation/OrganisationChooser.vue +1 -1
- package/src/components/display/organisation/OrganisationChooserLight.vue +28 -19
- package/src/components/display/participant/ParticipantItem.vue +2 -0
- package/src/components/display/participant/ParticipantList.vue +30 -19
- package/src/components/display/playlist/PlaylistList.vue +12 -3
- package/src/components/display/playlist/PodcastList.vue +26 -16
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +204 -0
- package/src/components/display/podcasts/AnimatorsItem.vue +2 -0
- package/src/components/display/podcasts/ParticipantDescription.vue +1 -5
- package/src/components/display/podcasts/PodcastImage.vue +2 -1
- package/src/components/display/podcasts/PodcastInlineList.vue +40 -28
- package/src/components/display/podcasts/PodcastItem.vue +12 -0
- package/src/components/display/podcasts/PodcastList.vue +11 -3
- package/src/components/display/podcasts/PodcastPlayBar.vue +2 -0
- package/src/components/display/podcasts/TagList.vue +2 -0
- package/src/components/display/rubriques/RubriqueList.vue +3 -1
- package/src/components/display/sharing/PlayerParameters.vue +2 -0
- package/src/components/display/sharing/QrCode.vue +7 -0
- package/src/components/display/sharing/ShareDistribution.vue +2 -0
- package/src/components/display/sharing/SharePlayer.vue +2 -0
- package/src/components/form/ClassicSearch.vue +2 -0
- package/src/components/misc/ErrorMessage.vue +2 -0
- package/src/components/misc/Footer.vue +2 -0
- package/src/components/misc/LeftMenu.vue +2 -0
- package/src/components/misc/Player.vue +14 -0
- package/src/components/misc/PlayerButtons.vue +2 -14
- package/src/components/misc/PlayerClockAndTimeline.vue +2 -0
- package/src/components/misc/PlayerProgressBar.vue +2 -0
- package/src/components/misc/Popover.vue +5 -0
- package/src/components/misc/Snackbar.vue +2 -0
- package/src/components/misc/TopBar.vue +2 -0
- package/src/components/misc/modal/NewsletterModal.vue +11 -3
- package/src/components/misc/modal/ShareModalPlayer.vue +2 -0
- package/src/components/mixins/handle403.ts +17 -0
- package/src/components/pages/Emission.vue +17 -4
- package/src/components/pages/Error403Page.vue +24 -0
- package/src/components/pages/Participant.vue +19 -4
- package/src/components/pages/Playlist.vue +17 -3
- package/src/components/pages/Podcast.vue +28 -12
- package/src/components/pages/Podcasts.vue +4 -0
- package/src/locale/en.ts +1 -0
- package/src/locale/fr.ts +1 -0
- package/src/locale/it.ts +298 -0
- package/src/locale/messages.ts +2 -0
- package/src/main.ts +1 -1
- package/src/router/router.ts +6 -0
- package/src/store/class/general/organisation.ts +1 -0
- package/src/store/paramStore.ts +5 -2
|
@@ -37,11 +37,13 @@
|
|
|
37
37
|
<script lang="ts">
|
|
38
38
|
import ClassicLoading from '../../form/ClassicLoading.vue';
|
|
39
39
|
import LiveItem from './LiveItem.vue';
|
|
40
|
+
import { handle403 } from '../../mixins/handle403';
|
|
40
41
|
import octopusApi from '@saooti/octopus-api';
|
|
41
42
|
import moment from 'moment';
|
|
42
43
|
import { state } from '../../../store/paramStore';
|
|
43
44
|
import { Conference } from '@/store/class/conference/conference';
|
|
44
45
|
import { defineComponent } from 'vue'
|
|
46
|
+
import { AxiosError } from 'axios';
|
|
45
47
|
export default defineComponent({
|
|
46
48
|
name: 'LiveList',
|
|
47
49
|
components: {
|
|
@@ -49,6 +51,8 @@ export default defineComponent({
|
|
|
49
51
|
ClassicLoading
|
|
50
52
|
},
|
|
51
53
|
|
|
54
|
+
mixins: [handle403],
|
|
55
|
+
|
|
52
56
|
props: {
|
|
53
57
|
conferenceWatched: { default: () => [], type: Array as ()=>Array<Conference>},
|
|
54
58
|
organisationId: { default: undefined, type: String},
|
|
@@ -153,51 +157,55 @@ export default defineComponent({
|
|
|
153
157
|
}
|
|
154
158
|
},
|
|
155
159
|
async fetchContent(): Promise<void> {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
this.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
this.loading = true;
|
|
163
|
-
this.loaded = false;
|
|
164
|
-
let indexPast = 0;
|
|
165
|
-
let dataLivesToBe: Array<Conference> = [];
|
|
166
|
-
for (let i = 0, len = this.livesArray.length; i < len; i++) {
|
|
167
|
-
if (!this.organisationRight &&
|
|
168
|
-
("DEBRIEFING"===this.livesArray[i].status ||"ERROR"===this.livesArray[i].status ||"PUBLISHING"===this.livesArray[i].status)) {
|
|
169
|
-
continue;
|
|
160
|
+
try {
|
|
161
|
+
this.initArrays();
|
|
162
|
+
if (!this.filterOrgaUsed) {
|
|
163
|
+
this.loading = false;
|
|
164
|
+
this.loaded = true;
|
|
165
|
+
return;
|
|
170
166
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
this.livesArray[i].
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
167
|
+
this.loading = true;
|
|
168
|
+
this.loaded = false;
|
|
169
|
+
let indexPast = 0;
|
|
170
|
+
let dataLivesToBe: Array<Conference> = [];
|
|
171
|
+
for (let i = 0, len = this.livesArray.length; i < len; i++) {
|
|
172
|
+
if (!this.organisationRight &&
|
|
173
|
+
("DEBRIEFING"===this.livesArray[i].status ||"ERROR"===this.livesArray[i].status ||"PUBLISHING"===this.livesArray[i].status)) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const dataLives = await octopusApi.listConferences(
|
|
177
|
+
this.filterOrgaUsed,
|
|
178
|
+
true,
|
|
179
|
+
this.livesArray[i].status
|
|
180
|
+
);
|
|
181
|
+
if("PLANNED"!==this.livesArray[i].status && "PENDING"!==this.livesArray[i].status){
|
|
182
|
+
this.livesArray[i].lives = dataLives.filter((p: Conference | null) => {
|
|
183
|
+
return null !== p;
|
|
184
|
+
});
|
|
185
|
+
}else if("PENDING"===this.livesArray[i].status){
|
|
186
|
+
dataLivesToBe = dataLives;
|
|
187
|
+
for (let index = 0, len = dataLives.length; index < len; index++) {
|
|
188
|
+
if (moment(dataLives[index].date).isBefore(moment())) {
|
|
189
|
+
this.livesArray[i].lives.push(dataLives[index]);
|
|
190
|
+
indexPast = index + 1;
|
|
191
|
+
} else {break;}
|
|
192
|
+
}
|
|
193
|
+
}else{
|
|
194
|
+
this.livesArray[i].lives = dataLivesToBe
|
|
195
|
+
.slice(indexPast)
|
|
196
|
+
.concat(dataLives)
|
|
197
|
+
.filter((p: Conference | null) => {
|
|
198
|
+
return null !== p;
|
|
199
|
+
});
|
|
187
200
|
}
|
|
188
|
-
}else{
|
|
189
|
-
this.livesArray[i].lives = dataLivesToBe
|
|
190
|
-
.slice(indexPast)
|
|
191
|
-
.concat(dataLives)
|
|
192
|
-
.filter((p: Conference | null) => {
|
|
193
|
-
return null !== p;
|
|
194
|
-
});
|
|
195
201
|
}
|
|
202
|
+
const listIds = this.livesArray[0].lives
|
|
203
|
+
.concat(this.livesArray[1].lives)
|
|
204
|
+
.concat(this.livesArray[2].lives);
|
|
205
|
+
this.$emit('initConferenceIds', listIds);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
this.handle403((error as AxiosError));
|
|
196
208
|
}
|
|
197
|
-
const listIds = this.livesArray[0].lives
|
|
198
|
-
.concat(this.livesArray[1].lives)
|
|
199
|
-
.concat(this.livesArray[2].lives);
|
|
200
|
-
this.$emit('initConferenceIds', listIds);
|
|
201
209
|
this.loading = false;
|
|
202
210
|
this.loaded = true;
|
|
203
211
|
},
|
|
@@ -238,9 +246,11 @@ export default defineComponent({
|
|
|
238
246
|
</script>
|
|
239
247
|
|
|
240
248
|
<style lang="scss">
|
|
249
|
+
.octopus-app{
|
|
241
250
|
.live-list-category {
|
|
242
251
|
align-self: flex-start;
|
|
243
252
|
text-transform: uppercase;
|
|
244
253
|
font-weight: bold;
|
|
245
254
|
}
|
|
255
|
+
}
|
|
246
256
|
</style>
|
|
@@ -4,30 +4,35 @@
|
|
|
4
4
|
class="default-multiselect-width organisation-chooser-light"
|
|
5
5
|
:style="{ width: width }"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
<template v-if="!privateOrganisation">
|
|
8
|
+
<select
|
|
9
|
+
:id="'organisation_chooser_light' + page"
|
|
10
|
+
v-model="actual"
|
|
11
|
+
class="mb-0 c-hand border-0"
|
|
12
|
+
@change="onOrganisationSelected"
|
|
13
|
+
>
|
|
14
|
+
<option :value="organisation.id">
|
|
15
|
+
{{ organisation.name }}
|
|
16
|
+
</option>
|
|
17
|
+
<option :value="-1">
|
|
18
|
+
{{ $t('No organisation filter') }}
|
|
19
|
+
</option>
|
|
20
|
+
</select>
|
|
21
|
+
<label
|
|
22
|
+
:for="'organisation_chooser_light' + page"
|
|
23
|
+
class="d-inline"
|
|
24
|
+
:title="$t('select productor')"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
<template v-else>
|
|
28
|
+
{{ organisation.name }}
|
|
29
|
+
</template>
|
|
25
30
|
</div>
|
|
26
31
|
</template>
|
|
27
32
|
|
|
28
33
|
<script lang="ts">
|
|
29
|
-
import octopusApi from '@saooti/octopus-api';
|
|
30
34
|
import { Organisation } from '@/store/class/general/organisation';
|
|
35
|
+
import octopusApi from '@saooti/octopus-api';
|
|
31
36
|
import { defineComponent } from 'vue'
|
|
32
37
|
export default defineComponent({
|
|
33
38
|
props: {
|
|
@@ -43,6 +48,7 @@ export default defineComponent({
|
|
|
43
48
|
actual: -1 as number|string,
|
|
44
49
|
organisation: undefined as Organisation|undefined,
|
|
45
50
|
init: false as boolean,
|
|
51
|
+
privateOrganisation: false as boolean
|
|
46
52
|
};
|
|
47
53
|
},
|
|
48
54
|
|
|
@@ -76,6 +82,7 @@ export default defineComponent({
|
|
|
76
82
|
const data = await octopusApi.fetchOrganisation(this.value);
|
|
77
83
|
this.organisation = data;
|
|
78
84
|
this.actual = data.id;
|
|
85
|
+
this.privateOrganisation = data.private??false;
|
|
79
86
|
this.init = true;
|
|
80
87
|
},
|
|
81
88
|
},
|
|
@@ -83,9 +90,11 @@ export default defineComponent({
|
|
|
83
90
|
</script>
|
|
84
91
|
|
|
85
92
|
<style lang="scss">
|
|
93
|
+
.octopus-app{
|
|
86
94
|
.organisation-chooser-light select {
|
|
87
95
|
-webkit-appearance: none;
|
|
88
96
|
-moz-appearance: none;
|
|
89
97
|
appearance: none;
|
|
90
98
|
}
|
|
99
|
+
}
|
|
91
100
|
</style>
|
|
@@ -134,6 +134,7 @@ export default defineComponent({
|
|
|
134
134
|
})
|
|
135
135
|
</script>
|
|
136
136
|
<style lang="scss">
|
|
137
|
+
.octopus-app{
|
|
137
138
|
.participant-item-container {
|
|
138
139
|
list-style: none;
|
|
139
140
|
border-radius: 2rem;
|
|
@@ -184,4 +185,5 @@ export default defineComponent({
|
|
|
184
185
|
margin: 1rem 0 0;
|
|
185
186
|
}
|
|
186
187
|
}
|
|
188
|
+
}
|
|
187
189
|
</style>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</ul>
|
|
24
24
|
<button
|
|
25
25
|
v-show="!allFetched"
|
|
26
|
-
class="btn btn-more saooti-
|
|
26
|
+
class="btn btn-more saooti-more"
|
|
27
27
|
:title="$t('See more')"
|
|
28
28
|
:disabled="loading"
|
|
29
29
|
@click="fetchContent(false)"
|
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script lang="ts">
|
|
36
|
+
import { handle403 } from '../../mixins/handle403';
|
|
36
37
|
import octopusApi from '@saooti/octopus-api';
|
|
37
38
|
import ParticipantItem from './ParticipantItem.vue';
|
|
38
39
|
import ClassicLoading from '../../form/ClassicLoading.vue';
|
|
39
40
|
import { Participant } from '@/store/class/general/participant';
|
|
40
41
|
import { defineComponent } from 'vue'
|
|
42
|
+
import { AxiosError } from 'axios';
|
|
41
43
|
export default defineComponent({
|
|
42
44
|
name: 'ParticipantList',
|
|
43
45
|
|
|
@@ -45,6 +47,9 @@ export default defineComponent({
|
|
|
45
47
|
ParticipantItem,
|
|
46
48
|
ClassicLoading
|
|
47
49
|
},
|
|
50
|
+
|
|
51
|
+
mixins: [handle403],
|
|
52
|
+
|
|
48
53
|
props: {
|
|
49
54
|
first: { default: 0, type: Number },
|
|
50
55
|
size: { default: 12, type: Number },
|
|
@@ -99,25 +104,29 @@ export default defineComponent({
|
|
|
99
104
|
if (reset) {
|
|
100
105
|
this.dfirst = 0;
|
|
101
106
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.displayCount = data.count;
|
|
113
|
-
this.participants = this.participants.concat(data.result).filter((p: Participant | null) => {
|
|
114
|
-
if (null === p) {
|
|
115
|
-
this.displayCount--;
|
|
107
|
+
try {
|
|
108
|
+
const data = await octopusApi.fetchParticipants({
|
|
109
|
+
first: this.dfirst,
|
|
110
|
+
size: this.dsize,
|
|
111
|
+
query: this.query,
|
|
112
|
+
organisationId: this.organisation,
|
|
113
|
+
});
|
|
114
|
+
if (reset) {
|
|
115
|
+
this.participants.length = 0;
|
|
116
|
+
this.dfirst = 0;
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
this.displayCount = data.count;
|
|
119
|
+
this.participants = this.participants.concat(data.result).filter((p: Participant | null) => {
|
|
120
|
+
if (null === p) {
|
|
121
|
+
this.displayCount--;
|
|
122
|
+
}
|
|
123
|
+
return null !== p;
|
|
124
|
+
});
|
|
125
|
+
this.dfirst += this.dsize;
|
|
126
|
+
this.totalCount = data.count;
|
|
127
|
+
} catch (error) {
|
|
128
|
+
this.handle403((error as AxiosError));
|
|
129
|
+
}
|
|
121
130
|
this.loading = false;
|
|
122
131
|
},
|
|
123
132
|
},
|
|
@@ -125,6 +134,7 @@ export default defineComponent({
|
|
|
125
134
|
</script>
|
|
126
135
|
|
|
127
136
|
<style lang="scss">
|
|
137
|
+
.octopus-app{
|
|
128
138
|
.participant-list {
|
|
129
139
|
align-self: stretch;
|
|
130
140
|
flex-grow: 1;
|
|
@@ -147,4 +157,5 @@ export default defineComponent({
|
|
|
147
157
|
grid-gap: 0;
|
|
148
158
|
}
|
|
149
159
|
}
|
|
160
|
+
}
|
|
150
161
|
</style>
|
|
@@ -29,19 +29,21 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
<div
|
|
31
31
|
:class="buttonPlus?'ms-1':''"
|
|
32
|
-
class="saooti-
|
|
32
|
+
class="saooti-more"
|
|
33
33
|
/>
|
|
34
34
|
</button>
|
|
35
35
|
</div>
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script lang="ts">
|
|
39
|
+
import { handle403 } from '../../mixins/handle403';
|
|
39
40
|
import octopusApi from '@saooti/octopus-api';
|
|
40
41
|
import PlaylistItem from './PlaylistItem.vue';
|
|
41
42
|
import { state } from '../../../store/paramStore';
|
|
42
43
|
import ClassicLoading from '../../form/ClassicLoading.vue';
|
|
43
44
|
import { Playlist } from '@/store/class/general/playlist';
|
|
44
45
|
import { defineComponent } from 'vue'
|
|
46
|
+
import { AxiosError } from 'axios';
|
|
45
47
|
export default defineComponent({
|
|
46
48
|
name: 'PlaylistList',
|
|
47
49
|
|
|
@@ -49,6 +51,9 @@ export default defineComponent({
|
|
|
49
51
|
PlaylistItem,
|
|
50
52
|
ClassicLoading
|
|
51
53
|
},
|
|
54
|
+
|
|
55
|
+
mixins: [handle403],
|
|
56
|
+
|
|
52
57
|
props: {
|
|
53
58
|
first: { default: 0, type: Number },
|
|
54
59
|
size: { default: 12, type: Number },
|
|
@@ -117,8 +122,12 @@ export default defineComponent({
|
|
|
117
122
|
organisationId: this.organisation,
|
|
118
123
|
sort: this.sort,
|
|
119
124
|
};
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
try {
|
|
126
|
+
const data = await octopusApi.fetchPlaylists(param);
|
|
127
|
+
this.afterFetching(reset, data);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
this.handle403((error as AxiosError));
|
|
130
|
+
}
|
|
122
131
|
},
|
|
123
132
|
afterFetching(reset: boolean, data: {count: number, result: Array<Playlist>, sort: string}): void {
|
|
124
133
|
if (reset) {
|
|
@@ -49,13 +49,14 @@
|
|
|
49
49
|
</template>
|
|
50
50
|
<div
|
|
51
51
|
:class="buttonPlus?'ms-1':''"
|
|
52
|
-
class="saooti-
|
|
52
|
+
class="saooti-more"
|
|
53
53
|
/>
|
|
54
54
|
</button>
|
|
55
55
|
</div>
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
58
|
<script lang="ts">
|
|
59
|
+
import { handle403 } from '../../mixins/handle403';
|
|
59
60
|
import octopusApi from '@saooti/octopus-api';
|
|
60
61
|
import PodcastItem from '../podcasts/PodcastItem.vue';
|
|
61
62
|
import { state } from '../../../store/paramStore';
|
|
@@ -64,6 +65,7 @@ import ClassicLoading from '../../form/ClassicLoading.vue';
|
|
|
64
65
|
import { Podcast } from '@/store/class/general/podcast';
|
|
65
66
|
import { Playlist } from '@/store/class/general/playlist';
|
|
66
67
|
import { defineComponent } from 'vue'
|
|
68
|
+
import { AxiosError } from 'axios';
|
|
67
69
|
export default defineComponent({
|
|
68
70
|
name: 'PodcastList',
|
|
69
71
|
|
|
@@ -73,6 +75,8 @@ export default defineComponent({
|
|
|
73
75
|
ClassicLoading
|
|
74
76
|
},
|
|
75
77
|
|
|
78
|
+
mixins: [handle403],
|
|
79
|
+
|
|
76
80
|
props: {
|
|
77
81
|
playlist: { default: ()=>({}), type: Object as ()=>Playlist},
|
|
78
82
|
},
|
|
@@ -144,22 +148,26 @@ export default defineComponent({
|
|
|
144
148
|
this.podcasts.length = 0;
|
|
145
149
|
this.loading = true;
|
|
146
150
|
this.loaded = false;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
151
|
+
try {
|
|
152
|
+
const content = await octopusApi.fetchPlaylistContent(
|
|
153
|
+
this.playlist.playlistId.toString()
|
|
154
|
+
);
|
|
155
|
+
for (let index = 0, len = content.length; index < len; index++) {
|
|
156
|
+
content[index].order = this.playlist.podcasts[content[index].podcastId];
|
|
157
|
+
}
|
|
158
|
+
this.podcasts = content;
|
|
159
|
+
if (!this.editRight) {
|
|
160
|
+
this.podcasts = this.podcasts.filter((p: Podcast|null) => {
|
|
161
|
+
return (
|
|
162
|
+
null !== p &&
|
|
163
|
+
(!p.availability || true === p.availability.visibility)
|
|
164
|
+
);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
this.podcastsQuery = this.podcasts;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
this.handle403((error as AxiosError));
|
|
161
170
|
}
|
|
162
|
-
this.podcastsQuery = this.podcasts;
|
|
163
171
|
this.loading = false;
|
|
164
172
|
this.loaded = true;
|
|
165
173
|
},
|
|
@@ -173,10 +181,12 @@ export default defineComponent({
|
|
|
173
181
|
|
|
174
182
|
|
|
175
183
|
<style lang="scss">
|
|
184
|
+
.octopus-app{
|
|
176
185
|
.width-600 {
|
|
177
186
|
width: 600px;
|
|
178
187
|
@media (max-width: 600px) {
|
|
179
188
|
width: 100%;
|
|
180
189
|
}
|
|
181
190
|
}
|
|
191
|
+
}
|
|
182
192
|
</style>
|
|
@@ -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>
|
|
@@ -48,6 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
50
|
<style lang="scss">
|
|
51
|
+
.octopus-app{
|
|
51
52
|
.podcast-item-animator {
|
|
52
53
|
display: flex;
|
|
53
54
|
align-items: flex-start;
|
|
@@ -58,4 +59,5 @@ export default defineComponent({
|
|
|
58
59
|
text-transform: capitalize;
|
|
59
60
|
margin: 00.25rem 0.5rem 0;
|
|
60
61
|
}
|
|
62
|
+
}
|
|
61
63
|
</style>
|