@saooti/octopus-sdk 32.0.29 → 32.0.30

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 CHANGED
@@ -673,4 +673,5 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
673
673
  * 32.0.26 Image Proxy
674
674
  * 32.0.27 Image Proxy -> webp
675
675
  * 32.0.28 Image Proxy
676
- * 32.0.29 SpeechToText
676
+ * 32.0.29 SpeechToText
677
+ * 32.0.30 SpeechToText
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "32.0.29",
3
+ "version": "32.0.30",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -82,7 +82,7 @@
82
82
  />
83
83
  </div>
84
84
  <div
85
- v-else
85
+ v-if="displayArticleParam"
86
86
  class="d-flex flex-column flex-grow-1"
87
87
  >
88
88
  <ClassicCheckbox
@@ -91,6 +91,16 @@
91
91
  :label="$t('Display associated article')"
92
92
  />
93
93
  </div>
94
+ <div
95
+ v-if="displayTranscriptParam"
96
+ class="d-flex flex-column flex-grow-1"
97
+ >
98
+ <ClassicCheckbox
99
+ v-model:textInit="displayTranscript"
100
+ id-checkbox="display-transcript-checkbox"
101
+ :label="$t('If the transcript is available, show it')"
102
+ />
103
+ </div>
94
104
  </div>
95
105
  </div>
96
106
  </div>
@@ -107,9 +117,11 @@ export default defineComponent({
107
117
  props: {
108
118
  isVisible: { default: false, type: Boolean},
109
119
  choseNumberEpisode: {default: false, type: Boolean},
110
- displayChoiceAllEpisodes: {default: false, type: Boolean}
120
+ displayChoiceAllEpisodes: {default: false, type: Boolean},
121
+ displayTranscriptParam: {default: false, type: Boolean},
122
+ displayArticleParam: {default: false, type: Boolean},
111
123
  },
112
- emits: ['episodeNumbers', 'proceedReading', 'isVisible', 'iFrameNumber', 'displayArticle'],
124
+ emits: ['episodeNumbers', 'proceedReading', 'isVisible', 'iFrameNumber', 'displayArticle', 'displayTranscript'],
113
125
 
114
126
  data() {
115
127
  return {
@@ -118,6 +130,7 @@ export default defineComponent({
118
130
  iFrameNumberPriv: '3' as string,
119
131
  isVisibleTemp: this.isVisible as boolean,
120
132
  displayArticle: true as boolean,
133
+ displayTranscript:true as boolean,
121
134
  };
122
135
  },
123
136
  computed: {
@@ -151,6 +164,9 @@ export default defineComponent({
151
164
  },
152
165
  displayArticle(): void{
153
166
  this.$emit('displayArticle', this.displayArticle);
167
+ },
168
+ displayTranscript(): void{
169
+ this.$emit('displayTranscript', this.displayTranscript);
154
170
  }
155
171
  },
156
172
  })
@@ -44,7 +44,10 @@
44
44
  :is-visible="isVisible"
45
45
  :chose-number-episode="displayChoiceAllEpisodes|| isLargeSuggestion"
46
46
  :display-choice-all-episodes="displayChoiceAllEpisodes"
47
+ :displayTranscriptParam="displayTranscriptParam"
48
+ :displayArticleParam="displayArticleParam"
47
49
  @displayArticle="displayArticle = $event"
50
+ @displayTranscript="displayTranscript = $event"
48
51
  @episodeNumbers="episodeNumbers = $event"
49
52
  @proceedReading="proceedReading = $event"
50
53
  @isVisible="isVisible = $event"
@@ -119,17 +122,32 @@ export default defineComponent({
119
122
  iFrameNumber: '3' as string,
120
123
  isVisible: false as boolean,
121
124
  displayArticle: true as boolean,
125
+ displayTranscript: true as boolean,
122
126
  colors: ['#000000', '#ffffff'],
127
+ orgaAttributes: undefined as{[key: string]:string|number|boolean|undefined}|undefined,
123
128
  };
124
129
  },
125
130
 
126
131
  computed: {
132
+ displayArticleParam():boolean{
133
+ return undefined!==this.podcast && undefined!==this.podcast.article && 0 !== this.podcast.article.length;
134
+ },
135
+ displayTranscriptParam():boolean{
136
+ return this.isTranscriptionAuthorize && (this.isDefault || this.isEmission);
137
+ },
138
+ isTranscriptionAuthorize(): boolean{
139
+ if(!this.orgaAttributes){return false;}
140
+ return this.orgaAttributes && Object.prototype.hasOwnProperty.call(this.orgaAttributes,'speechtotext.active')?(this.orgaAttributes['speechtotext.active'] as boolean): false;
141
+ },
127
142
  displayChoiceAllEpisodes():boolean{
128
143
  return !this.podcast || this.isEmission || this.isLargeEmission;
129
144
  },
130
145
  baseUrl(): string{
131
146
  return (state.podcastPage.MiniplayerUri as string);
132
147
  },
148
+ isDefault(): boolean {
149
+ return 'default' === this.iFrameModel;
150
+ },
133
151
  isEmission(): boolean {
134
152
  return 'emission' === this.iFrameModel;
135
153
  },
@@ -193,6 +211,9 @@ export default defineComponent({
193
211
  if(!this.displayArticle){
194
212
  url.push('&article=false');
195
213
  }
214
+ if(!this.displayTranscript){
215
+ url.push('&transcript=false');
216
+ }
196
217
  if (this.isVisible) {
197
218
  url.push('&key=' + window.btoa(this.dataTitle.toString()));
198
219
  }
@@ -247,26 +268,32 @@ export default defineComponent({
247
268
  return 0;
248
269
  },
249
270
  isPlayerParameter(): boolean{
250
- return (!this.podcast || (this.podcast.article && 0 !== this.podcast.article.length) || this.isEmission || this.isLargeEmission || this.isLargeSuggestion) && !this.playlist;
271
+ return (!this.podcast ||
272
+ (this.displayArticle) ||
273
+ this.isEmission || this.isLargeEmission || this.isLargeSuggestion ||
274
+ (this.displayTranscriptParam))
275
+ && !this.playlist;
251
276
  }
252
277
  },
253
278
  async created() {
279
+ await this.fetchOrgaAttributes();
254
280
  await this.initColor();
255
281
  if (this.isLiveReadyToRecord) {
256
282
  this.iFrameModel = 'large';
257
283
  }
258
284
  },
259
285
  methods: {
260
- async initColor(): Promise<void> {
261
- if (!this.authenticated) return;
262
- let data;
286
+ async fetchOrgaAttributes(): Promise<void>{
263
287
  if(this.$store.state.organisation?.attributes && Object.keys(this.$store.state.organisation.attributes).length > 1){
264
- data = this.$store.state.organisation.attributes;
288
+ this.orgaAttributes = this.$store.state.organisation.attributes;
265
289
  }else{
266
- data= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+this.myOrganisationId);
290
+ this.orgaAttributes= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+this.myOrganisationId);
267
291
  }
268
- this.color = Object.prototype.hasOwnProperty.call(data,'COLOR') ? data.COLOR : '#40a372';
269
- this.theme = Object.prototype.hasOwnProperty.call(data,'THEME') ? data.THEME : '#000000';
292
+ },
293
+ initColor(): void {
294
+ if(!this.orgaAttributes){return;}
295
+ this.color = Object.prototype.hasOwnProperty.call(this.orgaAttributes,'COLOR') ? (this.orgaAttributes.COLOR as string) : '#40a372';
296
+ this.theme = Object.prototype.hasOwnProperty.call(this.orgaAttributes,'THEME') ? (this.orgaAttributes.THEME as string) : '#000000';
270
297
  },
271
298
  },
272
299
  })
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="loadingText"
4
- class="d-flex justify-content-center"
4
+ class="d-flex align-items-center justify-content-center"
5
5
  >
6
- <div class="spinner-border me-3" />
6
+ <div class="spinner-border me-3 flex-shrink-0" />
7
7
  <div class="h3 mt-2">
8
8
  {{ loadingText }}
9
9
  </div>
package/src/locale/de.ts CHANGED
@@ -306,4 +306,5 @@ export default{
306
306
  'Back to home': "Zurück zur Startseite",
307
307
  "Warning":"Warnung",
308
308
  "Visual":"Bild von {name}",
309
+ "If the transcript is available, show it":"Wenn die Abschrift vorhanden ist, zeigen Sie sie",
309
310
  }
package/src/locale/en.ts CHANGED
@@ -313,4 +313,5 @@ export default{
313
313
  "Go to previous page":"Go to previous page",
314
314
  "Warning":"Warning",
315
315
  "Visual":"Visual of {name}",
316
+ "If the transcript is available, show it":"If the transcript is available, show it",
316
317
  };
package/src/locale/es.ts CHANGED
@@ -306,4 +306,5 @@ export default{
306
306
  'Back to home': 'Volver a la página de inicio',
307
307
  "Warning":"Advertencia",
308
308
  "Visual":"Imagen de {name}",
309
+ "If the transcript is available, show it":"Si la transcripción está disponible, muéstrela",
309
310
  }
package/src/locale/fr.ts CHANGED
@@ -313,4 +313,5 @@ export default{
313
313
  "Go to previous page":"Aller à la page précédente",
314
314
  "Warning":"Avertissement",
315
315
  "Visual":"Visuel de {name}",
316
+ "If the transcript is available, show it":"Si la transcription est disponible, l'afficher",
316
317
  };
package/src/locale/it.ts CHANGED
@@ -304,4 +304,5 @@ export default{
304
304
  'Back to home': "Torna alla schermata 'home'",
305
305
  "Warning":"Avvertimento",
306
306
  "Visual":"Visiva di {name}",
307
+ "If the transcript is available, show it":"Se la trascrizione è disponibile, mostrala",
307
308
  };
package/src/locale/sl.ts CHANGED
@@ -306,4 +306,5 @@ export default{
306
306
  'Back to home': 'Nazaj domov',
307
307
  "Warning":"Opozorilo",
308
308
  "Visual":"Slika od {name}",
309
+ "If the transcript is available, show it":"Če je prepis na voljo, ga pokažite",
309
310
  }