@saooti/octopus-sdk 0.28.11 → 0.28.15

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
@@ -462,6 +462,10 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
462
462
  * 0.28.9 QrCode
463
463
  * 0.28.10 QrCode icone
464
464
  * 0.28.11 Podcastmaker modif
465
+ * 0.28.12 Rubriquage
466
+ * 0.28.13 Enlever les mises à jour
467
+ * 0.28.14 QrCode
468
+ * 0.28.15 Theme player beta
465
469
 
466
470
 
467
471
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "0.28.11",
3
+ "version": "0.28.15",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -161,6 +161,9 @@ export default Vue.extend({
161
161
  return;
162
162
  }
163
163
  this.isInternChanged = true;
164
+ if(0===this.arrayFilter.length){
165
+ this.arrayFilter.push({rubriquageId: this.availableRubriquage[0].rubriquageId!, rubriqueId: 0, name:""});
166
+ }
164
167
  if(this.isRubriquage){
165
168
  if(this.saveOrganisation !== this.organisation){
166
169
  this.fetchTopics(true);
@@ -95,6 +95,7 @@ export default Vue.extend({
95
95
  buttonPlus: { default:false as boolean},
96
96
  rubriqueId: { default: () => ([]) as Array<number> },
97
97
  rubriquageId:{ default: () => ([]) as Array<number> },
98
+ noRubriquageId: { default: () => ([]) as Array<number> },
98
99
  },
99
100
 
100
101
  components: {
@@ -185,8 +186,9 @@ export default Vue.extend({
185
186
  organisationId: this.organisation,
186
187
  emissionId: this.emissionId,
187
188
  iabId: this.iabId,
188
- rubriqueId: this.rubriqueId,
189
- rubriquageId: this.rubriquageId,
189
+ rubriqueId: this.rubriqueId.length ?this.rubriqueId:undefined,
190
+ rubriquageId: this.rubriquageId.length ?this.rubriquageId : undefined,
191
+ noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
190
192
  sort: this.popularSort ? 'POPULARITY' : 'DATE',
191
193
  });
192
194
  this.loading = false;
@@ -127,7 +127,7 @@ export default Vue.extend({
127
127
  return this.$store.state.filter.rubriqueFilter;
128
128
  },
129
129
  rubriqueDisplay(): Array<Rubrique>{
130
- return this.$store.state.filter.rubriqueDisplay;
130
+ return this.$store.state.filter.rubriqueDisplay.filter((rubrique: Rubrique) => 0 !== rubrique.podcastCount );
131
131
  },
132
132
  rubriquageDisplay(): Array<Rubriquage>{
133
133
  const elementToNotShow = Array.from(this.rubriqueFilter);
@@ -150,7 +150,7 @@ export default Vue.extend({
150
150
  },
151
151
  addFilter(rubrique: Rubrique): void{
152
152
  if(!this.rubriquage){ return ;}
153
- const filterToAdd = {rubriquageId: this.rubriquage.rubriquageId!, rubriqueId: rubrique.rubriqueId!, name: this.rubriquage.title +": "+rubrique.name};
153
+ const filterToAdd = {rubriquageId: this.rubriquage.rubriquageId!, rubriqueId: rubrique.rubriqueId!, name: this.rubriquage.title +" : "+rubrique.name};
154
154
  const newFilter: Array<RubriquageFilter> = Array.from(this.$store.state.filter.rubriqueFilter);
155
155
  newFilter.push(filterToAdd);
156
156
  this.$store.commit('filterRubrique', newFilter);
@@ -1,14 +1,32 @@
1
1
  <template>
2
2
  <div class="d-flex flex-column align-items-center">
3
- <qrcode-vue :value="url" :size="size" level="H" foreground="#40a372" class="myQrCode"/>
4
- <button class="btn m-3" @click="download">{{ $t('Download') }}</button>
5
- <Snackbar ref="snackbar" position="bottom-left"></Snackbar>
3
+ <qrcode-vue
4
+ :value="url"
5
+ :size="size"
6
+ level="H"
7
+ :foreground="color"
8
+ class="myQrCode"
9
+ :margin="2"
10
+ />
11
+ <button
12
+ class="btn m-3"
13
+ @click="download"
14
+ >
15
+ {{ $t('Download') }}
16
+ </button>
17
+ <Snackbar
18
+ ref="snackbar"
19
+ position="bottom-left"
20
+ />
6
21
  </div>
7
22
  </template>
8
23
 
24
+
9
25
  <style lang="scss">
10
26
  </style>
11
27
  <script lang="ts">
28
+ import { state } from '../../../store/paramStore';
29
+ import profileApi from '@/api/profile';
12
30
  import Snackbar from '../../misc/Snackbar.vue';
13
31
  import QrcodeVue from 'qrcode.vue'
14
32
  import Vue from 'vue';
@@ -26,8 +44,14 @@ export default Vue.extend({
26
44
  data() {
27
45
  return {
28
46
  size: 200 as number,
47
+ color: "#40a372" as string
29
48
  };
30
49
  },
50
+ computed:{
51
+ authenticated(): boolean {
52
+ return state.generalParameters.authenticated;
53
+ },
54
+ },
31
55
  methods:{
32
56
  download(): void{
33
57
  const link = document.createElement('a');
@@ -38,7 +62,22 @@ export default Vue.extend({
38
62
  link.click();
39
63
  (this.$refs.snackbar as any).open(this.$t('Download started'));
40
64
  }
41
- }
65
+ },
66
+ async initColor(): Promise<void> {
67
+ if (!this.authenticated) return;
68
+ let data;
69
+ if(this.$store.state.organisation && this.$store.state.organisation.attributes && Object.keys(this.$store.state.organisation.attributes).length > 1){
70
+ data = this.$store.state.organisation.attributes;
71
+ }else{
72
+ data= await profileApi.fetchOrganisationAttibutes(
73
+ this.$store.state,
74
+ state.generalParameters.organisationId
75
+ );
76
+ }
77
+ if (Object.prototype.hasOwnProperty.call(data,'COLOR')) {
78
+ this.color = data.COLOR;
79
+ }
80
+ },
42
81
  }
43
82
  });
44
83
  </script>
@@ -94,12 +94,12 @@
94
94
  ></swatches>
95
95
  </div>
96
96
  <swatches
97
- v-model="theme"
97
+ v-model="themeBeta"
98
98
  class="c-hand input-no-outline"
99
99
  show-fallback
100
100
  colors="text-advanced"
101
101
  popover-to="right"
102
- :data-color="theme"
102
+ :data-color="themeBeta"
103
103
  v-else
104
104
  ></swatches>
105
105
  </div>
@@ -223,6 +223,7 @@ export default Vue.extend({
223
223
  isShareModal: false as boolean,
224
224
  color: '#40a372' as string,
225
225
  theme: '#000000' as string,
226
+ themeBeta: '#000000' as string,
226
227
  proceedReading: true as boolean,
227
228
  episodeNumbers: 'number' as string,
228
229
  iFrameNumber: '3' as string,
@@ -347,11 +348,12 @@ export default Vue.extend({
347
348
  }
348
349
  }
349
350
  url.push('?distributorId=' + this.organisationId);
351
+ const theme = this.isBeta ? this.themeBeta : this.theme;
350
352
  url.push(
351
353
  '&color=' +
352
354
  this.color.substring(1) +
353
355
  '&theme=' +
354
- this.theme.substring(1)
356
+ theme.substring(1)
355
357
  );
356
358
  if (!this.proceedReading) {
357
359
  url.push('&proceed=false');
@@ -473,6 +475,9 @@ export default Vue.extend({
473
475
  this.theme = '#ffffff';
474
476
  }
475
477
  if (data.hasOwnProperty('playerBeta')) {
478
+ if (data.hasOwnProperty('THEMEBETA')) {
479
+ this.themeBeta = data.THEMEBETA;
480
+ }
476
481
  this.displayBetaChoice = data.playerBeta;
477
482
  let dataFetched = await octopusApi.fetchCustomPlayer('customPlayer/organisation/'+ this.organisationId!);
478
483
  this.customPlayers = dataFetched.content;
@@ -17,6 +17,13 @@
17
17
  :title="r.name"
18
18
  :buttonText="$t('All podcast button', { name: r.name })"
19
19
  />
20
+ <PodcastInlineList
21
+ v-if="rubriqueDisplay && rubriqueDisplay.length"
22
+ :noRubriquageId="[rubriqueDisplay[0].rubriquageId]"
23
+ :rubriqueId="rubriqueId"
24
+ :title="$t('Without rubric')"
25
+ :buttonText="$t('All podcast button', { name: $t('Without rubric') })"
26
+ />
20
27
  </template>
21
28
  </div>
22
29
  </template>
@@ -48,7 +55,7 @@ export default Vue.extend({
48
55
  },
49
56
  computed: {
50
57
  rubriqueDisplay(): Array<Rubrique>{
51
- return this.$store.state.filter.rubriqueDisplay;
58
+ return this.$store.state.filter.rubriqueDisplay.filter((rubrique: Rubrique) => 0 !== rubrique.podcastCount );
52
59
  },
53
60
  rubriquageFilter(): Array<Rubriquage>{
54
61
  if(this.$store.state.filter.organisationId){
package/src/main.ts CHANGED
@@ -17,8 +17,25 @@ import router from '@/router/router';
17
17
  const moment = require('moment');
18
18
  import store from '@/store/AppStore';
19
19
  const paramStore = require('./store/paramStore');
20
+ import VueRouter from 'vue-router';
21
+ import { ErrorHandler, RawLocation } from 'vue-router/types/router';
22
+
23
+
24
+ const originalPush: any = router.push;
25
+ router.push = function push(location: RawLocation, onResolve?: Function | undefined, onReject?: ErrorHandler | undefined){
26
+ if (onResolve || onReject) {
27
+ return originalPush.call(this, location, onResolve, onReject)
28
+ }
29
+
30
+ return originalPush.call(this, location).catch((err: any) => {
31
+ if (VueRouter.isNavigationFailure(err)) {
32
+ return err
33
+ }
34
+
35
+ return Promise.reject(err)
36
+ })
37
+ }
20
38
 
21
- moment.locale('fr');
22
39
  Vue.use(ModalPlugin);
23
40
  Vue.use(FormRadioPlugin);
24
41
  Vue.use(CardPlugin);
@@ -50,6 +67,7 @@ const i18n = new VueI18n({
50
67
  locale: language,
51
68
  messages: messages,
52
69
  });
70
+ moment.locale(language);
53
71
 
54
72
  // Initialisation store
55
73
  paramStore