@saooti/octopus-sdk 33.0.4 → 33.0.6

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
@@ -688,6 +688,10 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
688
688
  * 32.0.35 Enlever Dummy param
689
689
  * 32.0.36 Select -> font family
690
690
  * 32.0.40 Problème majeur !!!
691
+ * 32.0.42 Parlement européen
691
692
 
692
693
  * 33.0.3 SpeechToText player octopus
693
694
  * 33.0.4 Image webp
695
+ * 33.0.5 Change recaptcha
696
+ * 33.0.6 Crédits
697
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "33.0.4",
3
+ "version": "33.0.6",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -37,7 +37,7 @@
37
37
  "vue": "^3.2.37",
38
38
  "vue-i18n": "^9.2.0-beta.40",
39
39
  "vue-multiselect": "^3.0.0-alpha.2",
40
- "vue-recaptcha-v3": "^2.0.1",
40
+ "vue-recaptcha": "^2.0.3",
41
41
  "vue-router": "^4.1.2",
42
42
  "vue3-lazyload": "^0.2.5-beta",
43
43
  "vue3-swatches": "^1.0.10",
@@ -5,9 +5,8 @@
5
5
  >
6
6
  <label
7
7
  :for="id"
8
- class="d-inline"
9
- title="select category"
10
- />
8
+ class="hid"
9
+ >{{$t('Type string to filter by categories')}}</label>
11
10
  <VueMultiselect
12
11
  :id="id"
13
12
  ref="multiselectRef"
@@ -45,11 +45,21 @@
45
45
  >
46
46
  {{ $t('Close') }}
47
47
  </button>
48
+ <vue-recaptcha
49
+ v-if="!isVerify"
50
+ ref="invisibleRecaptcha"
51
+ :load-recaptcha-script="true"
52
+ @verify="handleSuccess"
53
+ @expired="handleError"
54
+ size="invisible"
55
+ sitekey="6LfyP_4ZAAAAAPODj8nov2LvosIwcX0GYeBSungh"
56
+ >
57
+ </vue-recaptcha>
48
58
  <button
49
59
  v-if="!sending"
50
60
  class="btn btn-primary m-1"
51
61
  :disabled="0 === countName || !validName"
52
- @click="validateName"
62
+ @click="submit"
53
63
  >
54
64
  {{ $t('Validate') }}
55
65
  </button>
@@ -63,9 +73,13 @@
63
73
  import Constants from '../../../../public/config';
64
74
  import { state } from '../../../store/paramStore';
65
75
  import api from '@/api/initialize';
66
- import { defineComponent } from 'vue'
76
+ import { VueRecaptcha } from 'vue-recaptcha';
77
+ import { defineComponent } from 'vue';
67
78
  export default defineComponent({
68
79
  name: 'AddCommentModal',
80
+ components:{
81
+ VueRecaptcha
82
+ },
69
83
 
70
84
  props: {},
71
85
  emits: ['close','validate'],
@@ -74,8 +88,8 @@ export default defineComponent({
74
88
  return {
75
89
  name: '' as string,
76
90
  sending: false as boolean,
77
- needVerify: true as boolean,
78
91
  sendError: false as boolean,
92
+ isVerify: false as boolean,
79
93
  maxName : Constants.MAX_COMMENT_NAME as number
80
94
  };
81
95
  },
@@ -97,34 +111,26 @@ export default defineComponent({
97
111
  },
98
112
  },
99
113
 
100
- mounted() {
101
- this.displayCaptcha('block');
114
+ created() {
102
115
  this.initAuthenticatedName();
103
116
  },
104
- unmounted() {
105
- this.displayCaptcha('none');
106
- },
107
117
  methods: {
108
118
  initAuthenticatedName():void{
109
119
  if (!state.generalParameters.authenticated) { return; }
110
120
  this.name = (`${this.$store.state.profile.firstname||''} ${this.$store.state.profile.lastname||''}`).trim();
111
- this.needVerify = false;
121
+ this.isVerify = true;
122
+ },
123
+ async handleSuccess(token: string) {
124
+ this.isVerify = await api.checkToken(token);
125
+ this.sendComment();
112
126
  },
113
- displayCaptcha(displayStyle: string): void{
114
- const captcha = document.getElementsByClassName('grecaptcha-badge')[0];
115
- if (!captcha) {return;}
116
- (captcha as HTMLElement).style.display = displayStyle;
127
+ handleError() {
128
+ this.isVerify = false;
129
+ this.sendError = true;
117
130
  },
118
- async validateName(): Promise<void> {
119
- if (this.needVerify && this.isCaptchaTest) {
120
- try {
121
- await this.$recaptchaLoaded()
122
- const token = await this.$recaptcha('login');
123
- this.sendError = !await api.checkToken(token);
124
- } catch {
125
- this.sendError = true;
126
- }
127
- if(this.sendError){return;}
131
+ async submit(): Promise<void> {
132
+ if (!this.isVerify && !this.isCaptchaTest) {
133
+ return (this.$refs.invisibleRecaptcha as InstanceType<typeof VueRecaptcha>).execute();
128
134
  }
129
135
  this.sendComment();
130
136
  },
@@ -85,6 +85,12 @@
85
85
  {{ podcast.organisation.name }}
86
86
  </router-link>
87
87
  </div>
88
+ <div v-if="''!==photoCredit">
89
+ {{ $t('Photo credits') + " : "+ photoCredit }}
90
+ </div>
91
+ <div v-if="''!==audioCredit">
92
+ {{ $t('Audio credits') + " : "+ audioCredit }}
93
+ </div>
88
94
  <a
89
95
  v-if="podcast.article"
90
96
  class="btn d-flex align-items-center my-2 width-fit-content"
@@ -224,6 +230,12 @@ export default defineComponent({
224
230
  podcastNotValid(): boolean {
225
231
  return undefined!==this.podcast?.availability && false === this.podcast?.valid;
226
232
  },
233
+ photoCredit():string{
234
+ return (this.podcast?.annotations?.photoCredit as string) ?? '';
235
+ },
236
+ audioCredit():string{
237
+ return (this.podcast?.annotations?.audioCredit as string) ?? '';
238
+ }
227
239
  },
228
240
  methods: {
229
241
  playPodcast(podcast: Podcast): void {
@@ -4,7 +4,12 @@
4
4
  ref="rubriqueListContainer"
5
5
  class="rubrique-list-container"
6
6
  >
7
+ <label
8
+ for="rubrique-list-select"
9
+ class="hid"
10
+ >{{$t('By topic')}}</label>
7
11
  <select
12
+ id="rubrique-list-select"
8
13
  v-model="rubriquage"
9
14
  class="c-hand"
10
15
  @change="onRubriquageSelected"
@@ -23,12 +23,6 @@ export default defineComponent({
23
23
  iabId: { default: undefined, type: Number},
24
24
  },
25
25
 
26
- data() {
27
- return {
28
- title: '' as string,
29
- };
30
- },
31
-
32
26
  computed: {
33
27
  categories(): Array<Category> {
34
28
  return this.$store.state.categories;
@@ -36,22 +30,11 @@ export default defineComponent({
36
30
  filterOrga(): string {
37
31
  return this.$store.state.filter.organisationId;
38
32
  },
39
- },
40
- watch: {
41
- iabId(): void {
42
- this.extractTitle();
43
- },
44
- },
45
-
46
- mounted() {
47
- this.extractTitle();
48
- },
49
- methods: {
50
- extractTitle(): void {
33
+ title():string{
51
34
  const matchCategories = this.categories.filter((c: Category) => c.id === this.iabId);
52
- if (1 !== matchCategories.length) return;
53
- this.title = matchCategories[0]['name'];
54
- },
35
+ if (1 !== matchCategories.length) return "";
36
+ return matchCategories[0]['name'];
37
+ }
55
38
  },
56
39
  })
57
40
  </script>
package/src/locale/de.ts CHANGED
@@ -307,4 +307,6 @@ export default{
307
307
  "Warning":"Warnung",
308
308
  "Visual":"Bild von {name}",
309
309
  "If the transcript is available, show it":"Wenn die Abschrift vorhanden ist, zeigen Sie sie",
310
+ "Photo credits":"Bildnachweis",
311
+ "Audio credits":"Audio-Credits",
310
312
  }
package/src/locale/en.ts CHANGED
@@ -314,4 +314,6 @@ export default{
314
314
  "Warning":"Warning",
315
315
  "Visual":"Visual of {name}",
316
316
  "If the transcript is available, show it":"If the transcript is available, show it",
317
+ "Photo credits":"Photo credits",
318
+ "Audio credits":"Audio credits",
317
319
  };
package/src/locale/es.ts CHANGED
@@ -307,4 +307,6 @@ export default{
307
307
  "Warning":"Advertencia",
308
308
  "Visual":"Imagen de {name}",
309
309
  "If the transcript is available, show it":"Si la transcripción está disponible, muéstrela",
310
+ "Photo credits":"Créditos fotográficos",
311
+ "Audio credits":"Créditos de audio",
310
312
  }
package/src/locale/fr.ts CHANGED
@@ -314,4 +314,6 @@ export default{
314
314
  "Warning":"Avertissement",
315
315
  "Visual":"Visuel de {name}",
316
316
  "If the transcript is available, show it":"Si la transcription est disponible, l'afficher",
317
+ "Photo credits":"Crédits photo",
318
+ "Audio credits":"Crédits audio",
317
319
  };
package/src/locale/it.ts CHANGED
@@ -304,4 +304,6 @@ export default{
304
304
  "Warning":"Avvertimento",
305
305
  "Visual":"Visiva di {name}",
306
306
  "If the transcript is available, show it":"Se la trascrizione è disponibile, mostrala",
307
+ "Photo credits":"Crediti fotografici",
308
+ "Audio credits":"Crediti audio",
307
309
  };
package/src/locale/sl.ts CHANGED
@@ -307,4 +307,6 @@ export default{
307
307
  "Warning":"Opozorilo",
308
308
  "Visual":"Slika od {name}",
309
309
  "If the transcript is available, show it":"Če je prepis na voljo, ga pokažite",
310
+ "Photo credits":"Avtorji fotografij",
311
+ "Audio credits":"Avdio krediti",
310
312
  }
package/src/main.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { createApp } from 'vue';
2
- import { VueReCaptcha } from 'vue-recaptcha-v3';
3
2
  import VueLazyLoad from 'vue3-lazyload';
4
3
  import App from './App.vue';
5
4
  import {setupI18n} from './i18n';
@@ -57,5 +56,4 @@ createApp(App)
57
56
  .use(store)
58
57
  .use(router)
59
58
  .use(VueLazyLoad)
60
- .use(VueReCaptcha, { siteKey: '6LfyP_4ZAAAAAPODj8nov2LvosIwcX0GYeBSungh' })
61
59
  .mount('#app');
@@ -1,9 +0,0 @@
1
- import { ReCaptchaInstance } from 'recaptcha-v3'
2
-
3
- declare module '@vue/runtime-core' {
4
- interface ComponentCustomProperties {
5
- $recaptcha: (action: string) => Promise<string>
6
- $recaptchaLoaded: () => Promise<boolean>
7
- $recaptchaInstance: ReCaptchaInstance
8
- }
9
- }