@saooti/octopus-sdk 31.0.6 → 31.0.9

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.
Files changed (41) hide show
  1. package/README.md +7 -1
  2. package/index.ts +5 -2
  3. package/package.json +3 -2
  4. package/src/App.vue +7 -12
  5. package/src/assets/general.scss +1 -0
  6. package/src/components/display/emission/EmissionItem.vue +3 -3
  7. package/src/components/display/emission/EmissionPlayerItem.vue +4 -4
  8. package/src/components/display/filter/ProductorSearch.vue +1 -1
  9. package/src/components/display/organisation/OrganisationChooser.vue +2 -2
  10. package/src/components/display/organisation/OrganisationChooserLight.vue +1 -1
  11. package/src/components/display/participant/ParticipantItem.vue +3 -3
  12. package/src/components/display/playlist/PlaylistItem.vue +3 -6
  13. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +3 -3
  14. package/src/components/display/podcasts/AnimatorsItem.vue +1 -2
  15. package/src/components/display/podcasts/PodcastImage.vue +4 -1
  16. package/src/components/display/podcasts/PodcastInlineList.vue +29 -7
  17. package/src/components/display/podcasts/PodcastItem.vue +15 -173
  18. package/src/components/display/podcasts/PodcastItemInfo.vue +170 -0
  19. package/src/components/display/podcasts/PodcastList.vue +35 -34
  20. package/src/components/display/podcasts/PodcastModuleBox.vue +0 -11
  21. package/src/components/display/podcasts/PodcastPlayBar.vue +6 -6
  22. package/src/components/display/sharing/ShareButtons.vue +33 -9
  23. package/src/components/form/ClassicSelect.vue +68 -0
  24. package/src/components/misc/Footer.vue +28 -11
  25. package/src/components/misc/PlayerButtons.vue +1 -1
  26. package/src/components/pages/Emission.vue +2 -2
  27. package/src/components/pages/Participant.vue +4 -6
  28. package/src/components/pages/Playlist.vue +2 -2
  29. package/src/components/pages/Podcast.vue +1 -1
  30. package/src/locale/de.ts +300 -0
  31. package/src/locale/en.ts +2 -2
  32. package/src/locale/es.ts +300 -0
  33. package/src/locale/fr.ts +1 -1
  34. package/src/locale/it.ts +1 -1
  35. package/src/locale/messages.ts +6 -0
  36. package/src/locale/sl.ts +300 -0
  37. package/src/main.ts +14 -0
  38. package/src/store/class/general/organisation.ts +1 -1
  39. package/src/store/class/rubrique/rubriquage.ts +1 -0
  40. package/src/store/class/rubrique/rubrique.ts +1 -0
  41. package/src/store/paramStore.ts +7 -7
package/README.md CHANGED
@@ -567,6 +567,9 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
567
567
  * 30.0.68 Parlement européen
568
568
  * 30.0.69 Parlement européen
569
569
  * 30.0.70 Améliorations 30
570
+ * 30.0.71 Parlement européen
571
+ * 30.0.72 Ajout des traductions
572
+ * 30.0.73 Ajout classe css
570
573
 
571
574
  * 31.0.0 Passage en 31
572
575
  * 31.0.1 Ajout pocket casts
@@ -575,7 +578,10 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
575
578
  * 31.0.4 Selection des customPlayers
576
579
  * 31.0.5 Merge 30
577
580
  * 31.0.6 Erreur de Merge 30
578
-
581
+ * 31.0.7 Sécurisation
582
+ * 31.0.8 Dropdown Lang + classicSelect
583
+ * 31.0.9 LazyLoad image
579
584
 
580
585
 
581
586
 
587
+
package/index.ts CHANGED
@@ -56,6 +56,7 @@ import ClassicSearch from "./src/components/form/ClassicSearch.vue";
56
56
  import ClassicCheckbox from "./src/components/form/ClassicCheckbox.vue";
57
57
  import ClassicRadio from "./src/components/form/ClassicRadio.vue";
58
58
  import ClassicLoading from "./src/components/form/ClassicLoading.vue";
59
+ import ClassicSelect from "./src/components/form/ClassicSelect.vue";
59
60
 
60
61
  //mixins
61
62
  import {selenium} from "./src/components/mixins/functions";
@@ -114,7 +115,8 @@ const components = {
114
115
  ClassicRadio,
115
116
  ClassicLoading,
116
117
  AdvancedSearch,
117
- PodcastPlaylistInlineList
118
+ PodcastPlaylistInlineList,
119
+ ClassicSelect
118
120
  }
119
121
 
120
122
  export default components;
@@ -168,5 +170,6 @@ export {
168
170
  ClassicRadio,
169
171
  ClassicLoading,
170
172
  AdvancedSearch,
171
- PodcastPlaylistInlineList
173
+ PodcastPlaylistInlineList,
174
+ ClassicSelect
172
175
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "31.0.6",
3
+ "version": "31.0.9",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -15,7 +15,7 @@
15
15
  "main": "./dist/octopus.common.js",
16
16
  "dependencies": {
17
17
  "@popperjs/core": "^2.11.0",
18
- "@saooti/octopus-api": "^0.31.0",
18
+ "@saooti/octopus-api": "^0.31.1",
19
19
  "@vue/cli": "^5.0.0-rc.1",
20
20
  "@vue/compat": "^3.2.26",
21
21
  "axios": "^0.24.0",
@@ -37,6 +37,7 @@
37
37
  "vue-multiselect": "^3.0.0-alpha.2",
38
38
  "vue-recaptcha-v3": "^2.0.1",
39
39
  "vue-router": "^4.0.12",
40
+ "vue3-lazyload": "^0.2.5-beta",
40
41
  "vue3-swatches": "^1.0.5",
41
42
  "vuex": "^4.0.2",
42
43
  "webpack": "^5.66.0"
package/src/App.vue CHANGED
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div
2
+ <div
3
+ v-if="isInit"
3
4
  id="app"
4
5
  :key="reload"
5
6
  class="octopus-app"
@@ -45,27 +46,21 @@ export default defineComponent({
45
46
  data() {
46
47
  return {
47
48
  displayMenu: false as boolean,
48
- initQueryRouter: false,
49
49
  reload: false as boolean,
50
+ isInit: false as boolean,
50
51
  };
51
52
  },
52
53
 
53
54
  watch: {
54
- '$route': {
55
- deep: true,
56
- handler(){
57
- if(!this.initQueryRouter){
58
- this.initQueryRouter = true;
59
- this.initApp();
60
- }
61
- }
62
- },
63
55
  '$i18n.locale'(){
64
56
  this.$forceUpdate();
65
57
  this.reload = !this.reload;
66
58
  }
67
59
  },
68
-
60
+ async created(){
61
+ await this.initApp();
62
+ this.isInit =true;
63
+ },
69
64
  methods:{
70
65
  async initApp(){
71
66
  await this.initSdk();
@@ -213,6 +213,7 @@ body{
213
213
  background-size: cover;
214
214
  box-shadow: 0px 8px 26px 6px rgba(64, 163, 114, 0.3);
215
215
  margin: auto;
216
+ display: flex;
216
217
  }
217
218
 
218
219
  .comma {
@@ -11,10 +11,10 @@
11
11
  :title="$t('Emission')"
12
12
  class="d-flex text-dark"
13
13
  >
14
- <div
14
+ <img
15
+ v-lazy="emission.imageUrl"
15
16
  class="img-box"
16
- :style="{ 'background-image': 'url(\'' + emission.imageUrl + '\')' }"
17
- />
17
+ >
18
18
  <div class="emission-item-text">
19
19
  <div
20
20
  class="emission-name"
@@ -18,11 +18,11 @@
18
18
  </div>
19
19
  <div
20
20
  class="img-box rounded-0"
21
- :style="{
22
- 'background-image':
23
- 'url(\'' + emission.imageUrl + '?dummy=' + dummyParam + '\')',
24
- }"
25
21
  >
22
+ <img
23
+ v-lazy="emission.imageUrl"
24
+ class="img-box rounded-0"
25
+ >
26
26
  <div
27
27
  v-if="titleInImage"
28
28
  class="titleInImage"
@@ -119,7 +119,7 @@ export default defineComponent({
119
119
  this.keepOrganisation = false;
120
120
  if (organisation && organisation.id) {
121
121
  this.$emit('updateOrganisationId', organisation.id);
122
- if(organisation.private){
122
+ if(organisation.privacy){
123
123
  this.$nextTick(() => {
124
124
  this.onKeepOrganisation();
125
125
  });
@@ -44,8 +44,8 @@
44
44
  <div class="multiselect-octopus-proposition">
45
45
  <img
46
46
  v-if="!light"
47
+ v-lazy="option.imageUrl"
47
48
  class="option__image"
48
- :src="option.imageUrl"
49
49
  :alt="option.name"
50
50
  >
51
51
  <span
@@ -64,8 +64,8 @@
64
64
  >
65
65
  <img
66
66
  v-if="!light"
67
+ v-lazy="option.imageUrl"
67
68
  class="option__image"
68
- :src="option.imageUrl"
69
69
  :alt="option.name"
70
70
  >
71
71
  <span
@@ -82,7 +82,7 @@ export default defineComponent({
82
82
  const data = await octopusApi.fetchOrganisation(this.value);
83
83
  this.organisation = data;
84
84
  this.actual = data.id;
85
- this.privateOrganisation = data.private??false;
85
+ this.privateOrganisation = "PUBLIC"!==data.privacy;
86
86
  this.init = true;
87
87
  },
88
88
  },
@@ -12,10 +12,10 @@
12
12
  class="mt-3 text-dark"
13
13
  :title="$t('Participant')"
14
14
  >
15
- <div
15
+ <img
16
+ v-lazy="participant.imageUrl"
16
17
  class="img-box-circle"
17
- :style="{ 'background-image': 'url(\'' + participant.imageUrl + '\')' }"
18
- />
18
+ >
19
19
  <div class="participant-name">
20
20
  <img
21
21
  v-if="!activeParticipant && !isPodcastmaker && editRight"
@@ -12,13 +12,10 @@
12
12
  :title="$t('Playlist')"
13
13
  class="text-dark"
14
14
  >
15
- <div
15
+ <img
16
+ v-lazy="playlist.imageUrl"
16
17
  class="img-box"
17
- :style="{
18
- 'background-image':
19
- 'url(\'' + playlist.imageUrl + '?dummy=' + dummyParam + '\')',
20
- }"
21
- />
18
+ >
22
19
  </router-link>
23
20
  <div class="emission-item-text">
24
21
  <router-link
@@ -49,9 +49,9 @@
49
49
  <router-link
50
50
  class="btn btn-link align-self-center width-fit-content m-4"
51
51
  :to="{
52
- name: 'playlist',
53
- params: { playlistId: playlistId.toString() },
54
- }"
52
+ name: 'playlist',
53
+ params: { playlistId: playlistId.toString() },
54
+ }"
55
55
  >
56
56
  {{ $t('See more') }}
57
57
  <div
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="animators && 0 !== animators.length"
4
- class="d-flex align-items-center justify-content-start"
4
+ class="d-flex align-items-center justify-content-start animators-item"
5
5
  >
6
6
  <router-link
7
7
  v-for="(animator, index) in animators"
@@ -36,7 +36,6 @@ export default defineComponent({
36
36
  visibleIndex: 0 as number,
37
37
  };
38
38
  },
39
-
40
39
  methods: {
41
40
  getAnimatorName(animator: Participant): string {
42
41
  const first = animator.firstName || '';
@@ -2,8 +2,11 @@
2
2
  <div
3
3
  v-if="podcast"
4
4
  class="img-box d-flex flex-column justify-content-start align-items-start position-relative justify rounded-lg flex-shrink-0 float-start"
5
- :style="{ 'background-image': 'url(\'' + podcast.imageUrl + '\')' }"
6
5
  >
6
+ <img
7
+ v-lazy="podcast.imageUrl"
8
+ class="img-box"
9
+ >
7
10
  <template v-if="isPodcastmaker">
8
11
  <div
9
12
  :class="mainRubrique? 'mainRubrique' : 'notMainRubrique'"
@@ -8,17 +8,17 @@
8
8
  <div class="d-flex">
9
9
  <button
10
10
  class="btn btn-underline"
11
- :class="{ active: popularSort }"
12
- @click="sortPopular()"
11
+ :class="{ active: !popularSort }"
12
+ @click="sortChrono()"
13
13
  >
14
- {{ $t('Most popular') }}
14
+ {{ $t('Last added') }}
15
15
  </button>
16
16
  <button
17
17
  class="btn btn-underline"
18
- :class="{ active: !popularSort }"
19
- @click="sortChrono()"
18
+ :class="{ active: popularSort }"
19
+ @click="sortPopular()"
20
20
  >
21
- {{ $t('Last added') }}
21
+ {{ $t('Most popular') }}
22
22
  </button>
23
23
  </div>
24
24
  <div
@@ -68,6 +68,7 @@
68
68
  <router-link
69
69
  class="btn btn-link align-self-center width-fit-content m-4"
70
70
  :to="refTo"
71
+ @click="handleSeeMoreButton"
71
72
  >
72
73
  {{ buttonText }}
73
74
  <div
@@ -91,6 +92,7 @@ import { RubriquageFilter } from '@/store/class/rubrique/rubriquageFilter';
91
92
  import { defineComponent } from 'vue'
92
93
  import { RouteLocationRaw } from 'vue-router';
93
94
  import { AxiosError } from 'axios';
95
+ import { Rubrique } from '@/store/class/rubrique/rubrique';
94
96
  export default defineComponent({
95
97
  name: 'PodcastInlineList',
96
98
 
@@ -126,7 +128,7 @@ export default defineComponent({
126
128
  first: 0 as number,
127
129
  size: 5 as number,
128
130
  totalCount: 0 as number,
129
- popularSort: true as boolean,
131
+ popularSort: false as boolean,
130
132
  allPodcasts: [] as Array<Podcast>,
131
133
  direction: 1 as number,
132
134
  alignLeft: false as boolean,
@@ -214,6 +216,26 @@ export default defineComponent({
214
216
  this.fetchNext();
215
217
  },
216
218
  methods: {
219
+ handleSeeMoreButton(event: { preventDefault: () => void; }){
220
+ if(!this.rubriqueId || this.noRubriquageId.length){
221
+ return;
222
+ }
223
+ event.preventDefault();
224
+ const rubriqueChosenId = this.rubriqueId[this.rubriqueId.length - 1];
225
+ const rubriqueChosen = this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
226
+ const filterToAdd = {
227
+ rubriquageId: this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].rubriquageId,
228
+ rubriqueId: rubriqueChosenId,
229
+ nameRubriquage: this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].title,
230
+ nameRubrique: rubriqueChosen.name
231
+ };
232
+ const newFilter: Array<RubriquageFilter> = Array.from(this.$store.state.filter.rubriqueFilter);
233
+ newFilter.push(filterToAdd);
234
+ this.$store.commit('filterRubrique', newFilter);
235
+ const queries = this.$route.query;
236
+ const queryString = newFilter.map(value => value.rubriquageId+':'+value.rubriqueId).join();
237
+ this.$router.push({ name: 'podcasts',query: { ...queries, ...{ rubriquesId: queryString }} });
238
+ },
217
239
  async fetchNext(): Promise<void> {
218
240
  try {
219
241
  const data = await octopusApi.fetchPodcasts({
@@ -31,78 +31,34 @@
31
31
  />
32
32
  <!-- eslint-enable -->
33
33
  </div>
34
- <div
35
- class="d-contents"
34
+ <PodcastItemInfo
35
+ :podcast-id="podcast.podcastId"
36
+ :title="podcast.title"
37
+ :pub-date="podcast.pubDate"
38
+ :podcast-organisation-id="podcast.organisation.id"
39
+ :podcast-organisation-name="podcast.organisation.name"
40
+ :podcast-order="podcast.order"
41
+ :duration="podcast.duration"
42
+ :animators="podcast.animators"
36
43
  @mouseenter="showDescription"
37
44
  @mouseleave="hideDescription"
38
- >
39
- <div class="d-flex justify-content-between flex-wrap text-secondary mb-3">
40
- <div class="me-3 small-text">
41
- {{ date }}
42
- </div>
43
- <div
44
- v-if="0 !== duration.length"
45
- class="small-text"
46
- >
47
- {{ duration }}
48
- </div>
49
- </div>
50
- <AnimatorsItem :animators="podcast.animators" />
51
- <router-link
52
- :to="{
53
- name: 'podcast',
54
- params: { podcastId: podcast.podcastId },
55
- query: { productor: $store.state.filter.organisationId },
56
- }"
57
- class="text-dark d-flex flex-column flex-grow-1"
58
- >
59
- <div class="title-podcast-item">
60
- {{ title }}
61
- </div>
62
- </router-link>
63
- <PodcastPlayBar
64
- :podcast="podcast"
65
- class="mx-2"
66
- />
67
- <div class="d-flex justify-content-between">
68
- <router-link
69
- v-if="!isPodcastmaker"
70
- :to="{
71
- name: 'productor',
72
- params: { productorId: podcast.organisation.id },
73
- query: { productor: $store.state.filter.organisationId },
74
- }"
75
- class="text-dark producer-podcast-item"
76
- >
77
- <div>{{ '© ' + podcast.organisation.name }}</div>
78
- </router-link>
79
- <span
80
- v-if="editRight && podcast.order && podcast.order > 1"
81
- class="saooti-star-bounty text-danger pe-2"
82
- />
83
- </div>
84
- </div>
45
+ />
85
46
  </li>
86
47
  </template>
87
48
 
88
49
  <script lang="ts">
89
- import AnimatorsItem from './AnimatorsItem.vue';
50
+ import PodcastItemInfo from './PodcastItemInfo.vue';
90
51
  import PodcastImage from './PodcastImage.vue';
91
52
  import { state } from '../../../store/paramStore';
92
53
  import moment from 'moment';
93
- // @ts-ignore
94
- import humanizeDuration from 'humanize-duration';
95
- import PodcastPlayBar from '../podcasts/PodcastPlayBar.vue';
96
54
  import { Podcast } from '@/store/class/general/podcast';
97
- import { Category } from '@/store/class/general/category';
98
55
  import { defineComponent } from 'vue'
99
56
  export default defineComponent({
100
57
  name: 'PodcastItem',
101
58
 
102
59
  components: {
103
- AnimatorsItem,
60
+ PodcastItemInfo,
104
61
  PodcastImage,
105
- PodcastPlayBar
106
62
  },
107
63
 
108
64
  props: {
@@ -116,113 +72,24 @@ export default defineComponent({
116
72
  isDescriptionBig: false as boolean,
117
73
  };
118
74
  },
119
-
75
+
120
76
  computed: {
121
- isPodcastmaker(): boolean {
122
- return (state.generalParameters.podcastmaker as boolean);
123
- },
124
77
  podcastShadow(): boolean {
125
78
  return (state.podcastsPage.podcastShadow as boolean);
126
79
  },
127
80
  podcastBorderBottom(): boolean {
128
81
  return (state.podcastsPage.podcastBorderBottom as boolean);
129
82
  },
130
- date(): string {
131
- return moment(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
132
- },
133
83
  displayDate(): string {
134
84
  return moment(this.podcast.pubDate).format('X');
135
85
  },
136
- category(): string {
137
- const catIds = this.podcast.emission.iabIds;
138
- return this.$store.state.categories
139
- .filter((c: Category) => {
140
- return catIds && catIds.includes(c.id);
141
- })
142
- .map((c: Category) => {
143
- return c.name;
144
- })
145
- .join(', ');
146
- },
147
86
  description(): string {
148
87
  if (!this.podcast.description) return '';
149
88
  return this.podcast.description;
150
89
  },
151
- title(): string {
152
- return this.podcast.title;
153
- },
154
- organisationId(): string|undefined {
155
- return state.generalParameters.organisationId;
156
- },
157
- authenticated(): boolean {
158
- return (state.generalParameters.authenticated as boolean);
159
- },
160
- editRight(): boolean {
161
- if (
162
- (this.authenticated &&
163
- this.organisationId === this.podcast.organisation.id) ||
164
- state.generalParameters.isAdmin
165
- )
166
- return true;
167
- return false;
168
- },
169
- duration(): string {
170
- if (this.podcast.duration <= 1) return '';
171
- if (this.podcast.duration > 600000) {
172
- return humanizeDuration(this.podcast.duration, {
173
- language: 'short'+this.$i18n.locale.charAt(0).toUpperCase() + this.$i18n.locale.slice(1),
174
- largest: 1,
175
- round: true,
176
- languages: {
177
- shortFr: {
178
- y: () => 'années',
179
- mo: () => 'mois',
180
- w: () => 'semaines',
181
- d: () => 'jours',
182
- h: () => 'h',
183
- m: () => 'min',
184
- s: () => 'sec',
185
- ms: () => 'ms',
186
- },
187
- shortEn: {
188
- y: () => 'years',
189
- mo: () => 'months',
190
- w: () => 'weeks',
191
- d: () => 'days',
192
- h: () => 'h',
193
- m: () => 'min',
194
- s: () => 'sec',
195
- ms: () => 'ms',
196
- },
197
- shortIt: {
198
- y: () => 'anni',
199
- mo: () => 'mesi',
200
- w: () => 'settimane',
201
- d: () => 'giorni',
202
- h: () => 'h',
203
- m: () => 'min',
204
- s: () => 'sec',
205
- ms: () => 'ms',
206
- },
207
- },
208
- });
209
- }
210
- return humanizeDuration(this.podcast.duration, {
211
- language: 'short',
212
- largest: 2,
213
- round: true,
214
- languages: {
215
- short: {
216
- m: () => 'min',
217
- s: () => 'sec',
218
- ms: () => 'ms',
219
- },
220
- },
221
- });
222
- },
223
90
  },
224
91
 
225
- mounted() {
92
+ created() {
226
93
  const podcastDesc = document.getElementById(
227
94
  'description-podcast-' + this.podcast.podcastId
228
95
  );
@@ -262,26 +129,7 @@ export default defineComponent({
262
129
  text-align: left;
263
130
  background: #fff;
264
131
  flex-shrink: 0;
265
- .text-secondary {
266
- margin: 0.5rem !important;
267
- }
268
- .saooti-star-bounty {
269
- font-size: 22px;
270
- }
271
-
272
- .title-podcast-item {
273
- font-weight: 700;
274
- margin: 0.25rem 0.5rem 0.5rem;
275
- overflow: hidden;
276
- display: -webkit-box;
277
- flex-grow: 1;
278
- font-size: 0.7rem;
279
- -webkit-line-clamp: 3;
280
- -webkit-box-orient: vertical;
281
- min-height: 3rem;
282
- line-height: 1rem;
283
- word-break: break-word;
284
- }
132
+
285
133
  .description-podcast-item {
286
134
  padding: 1rem;
287
135
  color: #333;
@@ -306,12 +154,6 @@ export default defineComponent({
306
154
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 40%);
307
155
  }
308
156
  }
309
- .producer-podcast-item {
310
- margin: 0.2rem 0.5rem 0.5rem;
311
- font-size: 0.55rem;
312
- color: #666;
313
- }
314
-
315
157
  @media (max-width: 960px) {
316
158
  margin: 0.5rem !important;
317
159
  }