@saooti/octopus-sdk 39.0.43 → 39.0.45

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "39.0.43",
3
+ "version": "39.0.45",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -83,7 +83,7 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
83
83
  text-decoration: none !important;
84
84
  white-space: nowrap;
85
85
  border-width: 0;
86
- min-width: 24px;
86
+ //min-width: 24px; Problème avec flex-shrink
87
87
  @media (max-width: 960px) {
88
88
  white-space: normal;
89
89
  }
@@ -138,6 +138,9 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
138
138
  left: 0;
139
139
  }
140
140
  }
141
+ &.btn-min-width{
142
+ min-width: 24px;
143
+ }
141
144
 
142
145
  &.btn-primary {
143
146
  display: flex;
@@ -23,10 +23,10 @@
23
23
  </svg>
24
24
  </button>
25
25
  <div v-for="pageNumber in pagination" :key="pageNumber">
26
- <span v-if="null === pageNumber" class="btn"> ... </span>
26
+ <span v-if="null === pageNumber" class="btn btn-min-width"> ... </span>
27
27
  <button
28
28
  v-else
29
- class="btn"
29
+ class="btn btn-min-width"
30
30
  :class="{ active: page === pageNumber - 1 }"
31
31
  @click="changeFirst((pageNumber - 1) * rowsPerPage)"
32
32
  >
@@ -36,7 +36,7 @@
36
36
  <button
37
37
  v-for="paginateButton in buttonsRight"
38
38
  :key="paginateButton.title"
39
- class="btn"
39
+ class="btn btn-min-width"
40
40
  :title="paginateButton.title"
41
41
  :disabled="paginateButton.disabled"
42
42
  @click="paginateButton.action"
@@ -28,6 +28,7 @@
28
28
  <div class="d-flex flex-column flex-grow-1">
29
29
  <SharePlayerTypes
30
30
  v-model:iFrameModel="iFrameModel"
31
+ v-model:typeCustomPlayer="typeCustomPlayer"
31
32
  :podcast="podcast"
32
33
  :emission="emission"
33
34
  :playlist="playlist"
@@ -53,9 +54,7 @@
53
54
  v-model:is-visible="isVisible"
54
55
  v-model:player-auto-play="playerAutoPlay"
55
56
  :is-visible="isVisible"
56
- :chose-number-episode="
57
- displayChoiceAllEpisodes || isLargeSuggestion
58
- "
57
+ :chose-number-episode="choseNumberEpisodes"
59
58
  :display-choice-all-episodes="displayChoiceAllEpisodes"
60
59
  :display-transcript-param="displayTranscriptParam"
61
60
  :display-article-param="displayArticleParam"
@@ -142,6 +141,7 @@ export default defineComponent({
142
141
 
143
142
  data() {
144
143
  return {
144
+ typeCustomPlayer: "",
145
145
  iFrameModel: "default" as string,
146
146
  isShareModal: false as boolean,
147
147
  color: "#40a372" as string,
@@ -166,6 +166,9 @@ export default defineComponent({
166
166
  displayWaveParam(): boolean {
167
167
  return "default" === this.iFrameModel || "emission" === this.iFrameModel;
168
168
  },
169
+ choseNumberEpisodes():boolean{
170
+ return this.displayChoiceAllEpisodes || this.isTypeSuggestion;
171
+ },
169
172
  displayArticleParam(): boolean {
170
173
  return (
171
174
  undefined !== this.podcast &&
@@ -204,7 +207,7 @@ export default defineComponent({
204
207
  : false;
205
208
  },
206
209
  displayChoiceAllEpisodes(): boolean {
207
- return !this.podcast || this.isEmission || this.isLargeEmission;
210
+ return !this.podcast || this.isTypeEmission;
208
211
  },
209
212
  baseUrl(): string {
210
213
  return state.podcastPage.MiniplayerUri as string;
@@ -218,8 +221,11 @@ export default defineComponent({
218
221
  isLargeEmission(): boolean {
219
222
  return "emissionLarge" === this.iFrameModel;
220
223
  },
221
- isLargeSuggestion(): boolean {
222
- return "largeSuggestion" === this.iFrameModel;
224
+ isTypeSuggestion(): boolean {
225
+ return "largeSuggestion" === this.iFrameModel || "SUGGESTION"===this.typeCustomPlayer;
226
+ },
227
+ isTypeEmission():boolean{
228
+ return this.isEmission || this.isLargeEmission || "EMISSION"===this.typeCustomPlayer;
223
229
  },
224
230
  titleStillAvailable(): string {
225
231
  return this.isPodcastNotVisible
@@ -263,11 +269,11 @@ export default defineComponent({
263
269
  url = this.constructPlaylistUrl(url);
264
270
  } else if (this.emission && this.podcast) {
265
271
  url.push(`${this.iFrameModel}/`);
266
- if (this.isEmission || this.isLargeEmission) {
272
+ if (this.isTypeEmission) {
267
273
  url.push(
268
274
  `${this.emission.emissionId}${iFrameNumber}/${this.podcast.podcastId}`,
269
275
  );
270
- } else if (this.isLargeSuggestion) {
276
+ } else if (this.isTypeSuggestion) {
271
277
  url.push(`${this.podcast.podcastId}${iFrameNumber}`);
272
278
  } else {
273
279
  url.push(`${this.podcast.podcastId}`);
@@ -3,8 +3,7 @@
3
3
  <select
4
4
  id="iframe-select"
5
5
  :value="iFrameModel"
6
- class=""
7
- @change="$emit('update:iFrameModel', $event.target.value)"
6
+ @change="selectChange($event)"
8
7
  >
9
8
  <template v-for="option in optionsSelect" :key="option.value">
10
9
  <option v-if="option.condition" :value="option.value">
@@ -36,10 +35,11 @@ export default defineComponent({
36
35
  emission: { default: undefined, type: Object as () => Emission },
37
36
  playlist: { default: undefined, type: Object as () => Playlist },
38
37
  iFrameModel: { default: "default", type: String },
38
+ typeCustomPlayer: { default: "", type: String },
39
39
  organisationId: { default: undefined, type: String },
40
40
  isLive: { default: false, type: Boolean },
41
41
  },
42
- emits: ["update:iFrameModel"],
42
+ emits: ["update:iFrameModel", "update:typeCustomPlayer"],
43
43
 
44
44
  data() {
45
45
  return {
@@ -120,10 +120,24 @@ export default defineComponent({
120
120
  this.initCustomPlayers();
121
121
  },
122
122
  methods: {
123
- async fetchCustomPlayers(
124
- type: string,
125
- trySelect: boolean,
126
- ): Promise<boolean> {
123
+ isNumeric(value: string):boolean {
124
+ return /^-?\d+$/.test(value);
125
+ },
126
+ selectChange($event: any){
127
+ const val = $event.target.value;
128
+ if(!val){
129
+ return;
130
+ }
131
+ if(this.isNumeric(val)){
132
+ var customPlayer = this.customPlayersDisplay.find((p) => {return p.customId.toString() === val});
133
+ if(customPlayer){
134
+ this.selectCustomPlayer(customPlayer);
135
+ }
136
+ }else{
137
+ this.$emit('update:iFrameModel',val)
138
+ }
139
+ },
140
+ async fetchPlayerPaginate(type: string): Promise<CustomPlayer[]>{
127
141
  let players = await octopusApi.fetchDataPublic<
128
142
  InterfacePageable<CustomPlayer>
129
143
  >(6, "customPlayer/type/" + this.organisationId + "/" + type);
@@ -145,38 +159,35 @@ export default defineComponent({
145
159
  playersContent = playersContent.concat(players.content);
146
160
  ++index;
147
161
  }
148
- this.customPlayers = this.customPlayers.concat(playersContent);
162
+ return playersContent;
163
+ },
164
+ selectCustomPlayer(customPlayer: CustomPlayer){
165
+ this.$emit("update:typeCustomPlayer", customPlayer.typePlayer);
166
+ this.$emit("update:iFrameModel",customPlayer.customId.toString());
167
+ },
168
+ async fetchCustomPlayers(type: string, selectIfPossible = true): Promise<boolean> {
169
+ let customPlayersForType = await this.fetchPlayerPaginate(type);
170
+ this.customPlayers = this.customPlayers.concat(customPlayersForType);
149
171
  if (
150
172
  "video" !== this.iFrameModel &&
151
- trySelect &&
152
- this.customPlayers[0] &&
153
- this.customPlayers[0].selected
173
+ selectIfPossible &&
174
+ customPlayersForType?.[0]?.selected
154
175
  ) {
155
- this.$emit(
156
- "update:iFrameModel",
157
- this.customPlayers[0].customId.toString(),
158
- );
159
- return false;
176
+ this.selectCustomPlayer(this.customPlayers[0]);
177
+ return true;
160
178
  }
161
- return true;
179
+ return false;
162
180
  },
163
181
  async initCustomPlayers(): Promise<void> {
164
182
  if (!state.generalParameters.authenticated) return;
165
183
  if (this.playlist) {
166
- this.fetchCustomPlayers("PLAYLIST", true);
184
+ this.fetchCustomPlayers("PLAYLIST");
167
185
  } else if (this.emission && !this.podcast) {
168
- this.fetchCustomPlayers("EMISSION", true);
186
+ this.fetchCustomPlayers("EMISSION");
169
187
  } else {
170
- let playerTrySelect = true;
171
- playerTrySelect = await this.fetchCustomPlayers(
172
- "EPISODE",
173
- playerTrySelect,
174
- );
175
- playerTrySelect = await this.fetchCustomPlayers(
176
- "EMISSION",
177
- playerTrySelect,
178
- );
179
- await this.fetchCustomPlayers("SUGGESTION", playerTrySelect);
188
+ const episodeSelected = await this.fetchCustomPlayers("EPISODE");
189
+ const emissionSelected = await this.fetchCustomPlayers("EMISSION", !episodeSelected);
190
+ await this.fetchCustomPlayers("SUGGESTION", !episodeSelected && !emissionSelected);
180
191
  }
181
192
  },
182
193
  },
@@ -41,8 +41,8 @@
41
41
  </svg>
42
42
  </button>
43
43
  <button
44
- :title="$t('Delete link')"
45
- data-selenium="unlink"
44
+ :title="$t('Link')"
45
+ data-selenium="link"
46
46
  :class="{ 'is-active': editor.isActive('link') }"
47
47
  @click="setLink"
48
48
  >
@@ -58,8 +58,8 @@
58
58
  </svg>
59
59
  </button>
60
60
  <button
61
- :title="$t('Unlink')"
62
- data-selenium="Heading3"
61
+ :title="$t('Delete link')"
62
+ data-selenium="unlink"
63
63
  :disabled="!editor.isActive('link')"
64
64
  @click="editor.chain().focus().unsetLink().run()"
65
65
  >
@@ -5,14 +5,14 @@ const state: ParamStore = {
5
5
  generalParameters: {
6
6
  organisationId: "ecbd98d9-79bd-4312-ad5e-fc7c1c4a191c",
7
7
  authenticated: false,
8
- isAdmin: false,
9
- isRoleLive: false,
10
- isCommments: false,
11
- isOrganisation:false,
12
- isPlaylist: false,
13
- isProduction: false,
14
- isContribution: false,
15
- isRadio: false,
8
+ isAdmin: true,
9
+ isRoleLive: true,
10
+ isCommments: true,
11
+ isOrganisation:true,
12
+ isPlaylist: true,
13
+ isProduction: true,
14
+ isContribution: true,
15
+ isRadio: true,
16
16
  ApiUri: "https://api.dev2.saooti.org/",
17
17
  podcastmaker: false,
18
18
  buttonPlus: true,