@saooti/octopus-sdk 36.0.51 → 36.0.52

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": "36.0.51",
3
+ "version": "36.0.52",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -12,8 +12,8 @@
12
12
  v-if="!justSizeChosen"
13
13
  class="d-flex justify-content-between align-items-center flex-grow-1 w-100"
14
14
  >
15
- <div class="text-secondary">
16
- <template v-if="textCount && (windowWidth > 1300 || windowWidth<=960)">
15
+ <div class="text-secondary me-3">
16
+ <template v-if="textCount">
17
17
  {{ textCount }}
18
18
  </template>
19
19
  </div>
@@ -31,11 +31,11 @@
31
31
  <script lang="ts">
32
32
  import ClassicCheckbox from '../../form/ClassicCheckbox.vue';
33
33
  import { state } from '../../../stores/ParamSdkStore';
34
- import octopusApi from '@saooti/octopus-api';
35
34
  import Snackbar from '../../misc/Snackbar.vue';
36
35
  import QrcodeVue from 'qrcode.vue';
36
+ import { useSaveFetchStore } from '@/stores/SaveFetchStore';
37
37
  import { useAuthStore } from '@/stores/AuthStore';
38
- import { mapState } from 'pinia';
38
+ import { mapState, mapActions } from 'pinia';
39
39
  import { defineComponent } from 'vue'
40
40
  export default defineComponent({
41
41
  name: 'QrCode',
@@ -68,6 +68,7 @@ export default defineComponent({
68
68
  this.initColor();
69
69
  },
70
70
  methods:{
71
+ ...mapActions(useSaveFetchStore, ['getOrgaAttributes']),
71
72
  download(): void{
72
73
  const link = document.createElement('a');
73
74
  link.download = 'qrcode.png';
@@ -84,14 +85,10 @@ export default defineComponent({
84
85
  return;
85
86
  }
86
87
  if (!state.generalParameters.authenticated) return;
87
- let data;
88
- if(""!==this.authOrganisation.id && this.authOrganisation.attributes && Object.keys(this.authOrganisation.attributes).length > 1){
89
- data = this.authOrganisation.attributes;
90
- }else{
91
- data= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+state.generalParameters.organisationId);
92
- }
93
- if (Object.prototype.hasOwnProperty.call(data,'COLOR')) {
94
- this.otherColor = (data.COLOR as string);
88
+ const orgaId = ""!==this.authOrganisation.id ? this.authOrganisation.id : state.generalParameters.organisationId;
89
+ const attributes = await this.getOrgaAttributes(orgaId??"");
90
+ if (Object.prototype.hasOwnProperty.call(attributes,'COLOR')) {
91
+ this.otherColor = (attributes.COLOR as string);
95
92
  }
96
93
  },
97
94
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="module-box">
2
+ <div class="module-box" v-if="!isLoading && !noSharing">
3
3
  <div class="d-flex align-items-center mb-3">
4
4
  <h2 class="big-h2 mb-0">
5
5
  {{ $t('Share') }}
@@ -31,6 +31,8 @@
31
31
  </template>
32
32
 
33
33
  <script lang="ts">
34
+ import { useSaveFetchStore } from '@/stores/SaveFetchStore';
35
+ import { mapActions } from 'pinia';
34
36
  import { Emission } from '@/stores/class/general/emission';
35
37
  import { Podcast } from '@/stores/class/general/podcast';
36
38
  import { state } from '../../../stores/ParamSdkStore';
@@ -52,10 +54,25 @@ export default defineComponent({
52
54
  participantId: { default: undefined, type: Number},
53
55
  organisationId: { default: undefined, type: String},
54
56
  },
57
+ data() {
58
+ return {
59
+ noSharing: true as boolean,
60
+ isLoading: true as boolean
61
+ };
62
+ },
55
63
  computed: {
56
64
  authenticated(): boolean {
57
65
  return (state.generalParameters.authenticated as boolean);
58
66
  },
59
67
  },
68
+ async created(){
69
+ if(!this.organisationId){return;}
70
+ const attributes = await this.getOrgaAttributes(this.organisationId);
71
+ this.noSharing = 'true'===attributes.noSharing;
72
+ this.isLoading = false;
73
+ },
74
+ methods:{
75
+ ...mapActions(useSaveFetchStore, ['getOrgaAttributes']),
76
+ }
60
77
  })
61
78
  </script>
@@ -191,17 +191,17 @@ export default defineComponent({
191
191
  if (this.participantId){
192
192
  return api +'participant/' + this.participantId + '.rss';
193
193
  }
194
- if (this.organisationId){
195
- return api +'productor/' + this.organisationId + '.rss';
196
- }
197
194
  if(this.playlist){
198
195
  return api +'playlist/' + this.playlist.playlistId + '.rss';
199
196
  }
197
+ if (this.organisationId){
198
+ return api +'productor/' + this.organisationId + '.rss';
199
+ }
200
200
  return '';
201
201
  },
202
202
  },
203
203
  async created(){
204
- if(this.organisationId || this.participantId){
204
+ if(undefined!==this.participantId){
205
205
  this.displayRss = await octopusApi.fetchDataPublic<boolean>(0,`rss/participants/allowed/${this.organisationId}`);
206
206
  }else{
207
207
  this.displayRss = true;
@@ -90,7 +90,8 @@ import { Podcast } from '@/stores/class/general/podcast';
90
90
  import { Emission } from '@/stores/class/general/emission';
91
91
  import { Playlist } from '@/stores/class/general/playlist';
92
92
  import { useAuthStore } from '@/stores/AuthStore';
93
- import { mapState } from 'pinia';
93
+ import { useSaveFetchStore } from '@/stores/SaveFetchStore';
94
+ import { mapState, mapActions } from 'pinia';
94
95
  import { defineComponent, defineAsyncComponent } from 'vue';
95
96
  const ShareModalPlayer = defineAsyncComponent(() => import('../../misc/modal/ShareModalPlayer.vue'));
96
97
  const PlayerParameters = defineAsyncComponent(() => import('./PlayerParameters.vue'));
@@ -241,13 +242,15 @@ export default defineComponent({
241
242
  }
242
243
  },
243
244
  async created() {
244
- await this.fetchOrgaAttributes();
245
+ const orgaId = ""!==this.authOrganisation.id ? this.authOrganisation.id : state.generalParameters.organisationId;
246
+ this.orgaAttributes = await this.getOrgaAttributes(orgaId??"");
245
247
  this.initColor();
246
248
  if (this.isLiveReadyToRecord) {
247
249
  this.iFrameModel = 'large';
248
250
  }
249
251
  },
250
252
  methods: {
253
+ ...mapActions(useSaveFetchStore, ['getOrgaAttributes']),
251
254
  getIframeNumber(): string{
252
255
  return this.displayChoiceAllEpisodes && 'all' === this.episodeNumbers ? '/0' : '/' + this.iFrameNumber;
253
256
  },
@@ -291,13 +294,6 @@ export default defineComponent({
291
294
  }
292
295
  return url;
293
296
  },
294
- async fetchOrgaAttributes(): Promise<void>{
295
- if(""!==this.authOrganisation.id && this.authOrganisation.attributes && Object.keys(this.authOrganisation.attributes).length > 1){
296
- this.orgaAttributes = this.authOrganisation.attributes;
297
- }else{
298
- this.orgaAttributes= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+this.myOrganisationId);
299
- }
300
- },
301
297
  initColor(): void {
302
298
  if(!this.orgaAttributes){return;}
303
299
  this.color = Object.prototype.hasOwnProperty.call(this.orgaAttributes,'COLOR') ? (this.orgaAttributes.COLOR as string) : '#40a372';
@@ -37,9 +37,9 @@
37
37
  <script lang="ts">
38
38
  import { orgaComputed } from '../../mixins/orgaComputed';
39
39
  import { state } from '../../../stores/ParamSdkStore';
40
- import octopusApi from '@saooti/octopus-api';
40
+ import { useSaveFetchStore } from '@/stores/SaveFetchStore';
41
41
  import { useAuthStore } from '@/stores/AuthStore';
42
- import { mapState } from 'pinia';
42
+ import { mapState, mapActions } from 'pinia';
43
43
  import { defineComponent, defineAsyncComponent } from 'vue';
44
44
  import { Canal } from '@/stores/class/radio/canal';
45
45
  const ShareModalPlayer = defineAsyncComponent(() => import('../../misc/modal/ShareModalPlayer.vue'));
@@ -76,17 +76,12 @@ export default defineComponent({
76
76
 
77
77
  },
78
78
  async created() {
79
- await this.fetchOrgaAttributes();
79
+ const orgaId = ""!==this.authOrganisation.id ? this.authOrganisation.id : state.generalParameters.organisationId;
80
+ this.orgaAttributes = await this.getOrgaAttributes(orgaId??"");
80
81
  this.initColor();
81
82
  },
82
83
  methods: {
83
- async fetchOrgaAttributes(): Promise<void>{
84
- if(""!==this.authOrganisation.id && this.authOrganisation.attributes && Object.keys(this.authOrganisation.attributes).length > 1){
85
- this.orgaAttributes = this.authOrganisation.attributes;
86
- }else{
87
- this.orgaAttributes= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+this.myOrganisationId);
88
- }
89
- },
84
+ ...mapActions(useSaveFetchStore, ['getOrgaAttributes']),
90
85
  initColor(): void {
91
86
  if(!this.orgaAttributes){return;}
92
87
  this.color = Object.prototype.hasOwnProperty.call(this.orgaAttributes,'COLOR') ? (this.orgaAttributes.COLOR as string) : '#40a372';
@@ -29,7 +29,7 @@
29
29
  :reset="reset"
30
30
  @selected="onOrganisationSelected"
31
31
  />
32
- <div class="d-flex justify-content-end flex-grow-1">
32
+ <div class="d-flex justify-content-end align-items-center flex-grow-1">
33
33
  <template
34
34
  v-for="link in routerLinkArray"
35
35
  :key="link.routeName"
@@ -102,8 +102,9 @@ import { Participant } from '@/stores/class/general/participant';
102
102
  import { Podcast } from '@/stores/class/general/podcast';
103
103
  import { state } from '../../../stores/ParamSdkStore';
104
104
  import { defineComponent } from 'vue';
105
+ import { useSaveFetchStore } from '@/stores/SaveFetchStore';
105
106
  import { useAuthStore } from '@/stores/AuthStore';
106
- import { mapState } from 'pinia';
107
+ import { mapState, mapActions } from 'pinia';
107
108
  import octopusApi from '@saooti/octopus-api';
108
109
  import { Emission } from '@/stores/class/general/emission';
109
110
  import { Playlist } from '@/stores/class/general/playlist';
@@ -279,6 +280,7 @@ export default defineComponent({
279
280
  this.initData();
280
281
  },
281
282
  methods: {
283
+ ...mapActions(useSaveFetchStore, ['getOrgaAttributes']),
282
284
  closePopup(): void {
283
285
  this.$emit('close');
284
286
  },
@@ -296,12 +298,8 @@ export default defineComponent({
296
298
  (this.$refs.snackbar as InstanceType<typeof Snackbar>).open(this.$t('Data in clipboard'));
297
299
  },
298
300
  async initData(): Promise<void> {
299
- let attributes;
300
- if(""!==this.authOrganisation.id && this.authOrganisation.attributes && Object.keys(this.authOrganisation.attributes).length > 1){
301
- attributes = this.authOrganisation.attributes;
302
- }else{
303
- attributes = await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+state.generalParameters.organisationId);
304
- }
301
+ const orgaId = ""!==this.authOrganisation.id ? this.authOrganisation.id : state.generalParameters.organisationId;
302
+ const attributes = await this.getOrgaAttributes(orgaId??"");
305
303
  if (Object.prototype.hasOwnProperty.call(attributes,'podcastmakerUrl')) {
306
304
  this.shareUrl = attributes.podcastmakerUrl + window.location.pathname+window.location.search;
307
305
  }
@@ -47,6 +47,7 @@
47
47
  <ShareButtons
48
48
  v-if="pageParameters.isShareButtons"
49
49
  :emission="emission"
50
+ :organisation-id="emission.orga.id"
50
51
  />
51
52
  <SubscribeButtons
52
53
  v-if="pageParameters.isShareButtons && countLink >= 1"
@@ -44,6 +44,7 @@
44
44
  <ShareButtons
45
45
  v-if="pageParameters.isShareButtons"
46
46
  :playlist="playlist"
47
+ :organisation-id="playlist.organisation.id"
47
48
  />
48
49
  <PodcastList :playlist="playlist" />
49
50
  </div>
@@ -33,6 +33,7 @@
33
33
  <ShareButtons
34
34
  v-if="pageParameters.isShareButtons"
35
35
  :podcast="podcast"
36
+ :organisation-id="podcast.organisation.id"
36
37
  />
37
38
  <SubscribeButtons
38
39
  v-if="pageParameters.isShareButtons && countLink >= 1"
@@ -225,10 +226,10 @@ export default defineComponent({
225
226
 
226
227
  methods: {
227
228
  async fetchConferencePublic(){
228
- const data = await octopusApi.fetchData<string>(9, 'conference/realstatus/'+this.podcast.conferenceId);
229
+ const data = await octopusApi.fetchData<string>(9, 'conference/realstatus/'+this.podcast?.conferenceId);
229
230
  this.fetchConference = {
230
231
  status: data,
231
- conferenceId: this.podcast.conferenceId,
232
+ conferenceId: this.podcast?.conferenceId,
232
233
  title:'',
233
234
  };
234
235
  },
@@ -36,7 +36,7 @@
36
36
  :canal="radio"
37
37
  :organisation-id="myOrganisationId"
38
38
  />
39
- <ShareButtons />
39
+ <ShareButtons :organisation-id="radio.organisationId" />
40
40
  </div>
41
41
  </template>
42
42
  <ClassicLoading
@@ -0,0 +1,27 @@
1
+
2
+ import { defineStore } from 'pinia';
3
+ import octopusApi from '@saooti/octopus-api';
4
+ import { useAuthStore } from '@/stores/AuthStore';
5
+
6
+ interface SaveFetchState{
7
+ orgaPublicAttributes: {[key:string]: {[key: string]:string|number|boolean|undefined}},
8
+ }
9
+ export const useSaveFetchStore = defineStore('SaveFetchStore', {
10
+ state: (): SaveFetchState => ({
11
+ orgaPublicAttributes:{}
12
+ }),
13
+ actions:{
14
+ async getOrgaAttributes(orgaId: string): Promise<{ [key: string]: string | number | boolean | undefined; }>{
15
+ if(this.orgaPublicAttributes[orgaId]){
16
+ return this.orgaPublicAttributes[orgaId];
17
+ }
18
+ const authStore = useAuthStore();
19
+ if(orgaId === authStore.authOrganisation.id && authStore.authOrganisation.attributes && Object.keys(authStore.authOrganisation.attributes).length > 1){
20
+ this.orgaPublicAttributes[orgaId] = authStore.authOrganisation.attributes;
21
+ }else{
22
+ this.orgaPublicAttributes[orgaId] = await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+orgaId);
23
+ }
24
+ return this.orgaPublicAttributes[orgaId];
25
+ }
26
+ }
27
+ })