@saooti/octopus-sdk 33.2.11 → 33.2.12

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": "33.2.11",
3
+ "version": "33.2.12",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -30,11 +30,12 @@
30
30
  </div>
31
31
  </div>
32
32
  <ClassicSearch
33
- v-model:textInit="queryIntern"
33
+ :text-init="searchPattern"
34
34
  class="d-flex align-items-center flex-grow-1"
35
35
  :autofocus="true"
36
36
  id-checkbox="productor-search-input"
37
37
  :label="searchText"
38
+ @update:textInit="$emit('update:searchPattern', $event)"
38
39
  />
39
40
  </div>
40
41
  </template>
@@ -60,16 +61,14 @@ export default defineComponent({
60
61
  searchPattern: { default: '', type: String },
61
62
  type: { default: 'podcast', type: String },
62
63
  },
63
- emits: ['updateOrganisationId', 'updateSearchPattern'],
64
+ emits: ['update:organisationId', 'update:searchPattern'],
64
65
 
65
66
  data() {
66
67
  return {
67
68
  keepOrganisation: false as boolean,
68
69
  showBubble: false as boolean,
69
- queryIntern: '' as string,
70
70
  };
71
71
  },
72
-
73
72
  computed: {
74
73
  isPodcastmaker(): boolean {
75
74
  return (state.generalParameters.podcastmaker as boolean);
@@ -85,22 +84,14 @@ export default defineComponent({
85
84
  },
86
85
  },
87
86
  watch: {
88
- queryIntern(): void {
89
- if(this.queryIntern !== this.searchPattern){
90
- this.$emit('updateSearchPattern', this.queryIntern);
91
- }
92
- },
93
87
  filterOrga():void{
94
88
  this.keepOrganisation = undefined!==this.filterOrga;
95
89
  if (this.filterOrga) {
96
- this.$emit('updateOrganisationId', this.filterOrga);
90
+ this.$emit('update:organisationId', this.filterOrga);
97
91
  }
98
92
  },
99
93
  },
100
94
  async created() {
101
- if(this.searchPattern){
102
- this.queryIntern=this.searchPattern;
103
- }
104
95
  if (!this.organisationId) return;
105
96
  if(this.$store.state.filter.organisationId === this.organisationId){
106
97
  this.keepOrganisation = true;
@@ -114,7 +105,7 @@ export default defineComponent({
114
105
  this.$store.commit('filterOrga', {orgaId: undefined});
115
106
  this.keepOrganisation = false;
116
107
  if (organisation && organisation.id) {
117
- this.$emit('updateOrganisationId', organisation.id);
108
+ this.$emit('update:organisationId', organisation.id);
118
109
  if("PUBLIC"!==organisation.privacy){
119
110
  this.$nextTick(() => {
120
111
  this.onKeepOrganisation();
@@ -126,7 +117,7 @@ export default defineComponent({
126
117
  }, 6000);
127
118
  }
128
119
  } else {
129
- this.$emit('updateOrganisationId', undefined);
120
+ this.$emit('update:organisationId', undefined);
130
121
  }
131
122
  },
132
123
  async onKeepOrganisation(): Promise<void> {
@@ -7,8 +7,9 @@
7
7
  <label for="rows-per-page-select">{{ $t('Items per page :') }}</label>
8
8
  <select
9
9
  id="rows-per-page-select"
10
- v-model="rowsPerPageIntern"
10
+ :model-value="rowsPerPage"
11
11
  class="c-hand p-1 mx-2"
12
+ @update:modelValue="$emit('update:rowsPerPage',$event)"
12
13
  >
13
14
  <option
14
15
  v-for="option in optionsRowsPerPage"
@@ -57,7 +58,7 @@
57
58
  v-else
58
59
  class="btn"
59
60
  :class="{ 'active': page === (pageNumber-1) }"
60
- @click="changeFirst((pageNumber-1)*rowsPerPageIntern)"
61
+ @click="changeFirst((pageNumber-1)*rowsPerPage)"
61
62
  >
62
63
  {{ pageNumber }}
63
64
  </button>
@@ -87,26 +88,26 @@
87
88
  </div>
88
89
  </div>
89
90
  </template>
90
-
91
91
  <script lang="ts">
92
92
  import { defineComponent } from 'vue';
93
93
  export default defineComponent({
94
94
  name: "Paginate",
95
- components: {
96
- },
95
+
97
96
  props: {
98
97
  totalCount: { default: 0, type: Number },
99
98
  first: { default: 0, type: Number },
100
99
  rowsPerPage:{ default:0, type:Number},
101
100
  rangeSize:{default:1, type: Number}
102
101
  },
102
+
103
103
  emits:['update:first', 'update:rowsPerPage'],
104
+
104
105
  data() {
105
106
  return {
106
- rowsPerPageIntern: 30 as number,
107
107
  optionsRowsPerPage: [5, 10, 15, 20, 25 , 30, 50] as Array<number>,
108
108
  };
109
109
  },
110
+
110
111
  computed:{
111
112
  buttonsLeft(){
112
113
  return [{
@@ -144,18 +145,6 @@ export default defineComponent({
144
145
  return (this.totalPage-1)*this.rowsPerPage;
145
146
  }
146
147
  },
147
- watch: {
148
- rowsPerPageIntern(){
149
- if(this.rowsPerPage !== this.rowsPerPageIntern){
150
- this.$emit('update:rowsPerPage', this.rowsPerPageIntern);
151
- }
152
- },
153
- rowsPerPage(){
154
- if(this.rowsPerPage !== this.rowsPerPageIntern){
155
- this.rowsPerPageIntern =this.rowsPerPage;
156
- }
157
- }
158
- },
159
148
  created(){
160
149
  this.initRowsPerPage();
161
150
  },
@@ -189,11 +178,11 @@ export default defineComponent({
189
178
  return res;
190
179
  },
191
180
  initRowsPerPage(){
192
- if(!this.optionsRowsPerPage.includes(this.rowsPerPage)){
193
- this.optionsRowsPerPage.push(this.rowsPerPage);
194
- this.optionsRowsPerPage.sort((a,b)=>a-b);
181
+ if(this.optionsRowsPerPage.includes(this.rowsPerPage)){
182
+ return;
195
183
  }
196
- this.rowsPerPageIntern = this.rowsPerPage;
184
+ this.optionsRowsPerPage.push(this.rowsPerPage);
185
+ this.optionsRowsPerPage.sort((a,b)=>a-b);
197
186
  },
198
187
  changeFirst(newFirst: number){
199
188
  this.$emit('update:first', newFirst);
@@ -80,10 +80,10 @@ export default defineComponent({
80
80
 
81
81
  <style lang="scss">
82
82
  .octopus-app{
83
- .organisation-chooser-light select {
84
- -webkit-appearance: none;
85
- -moz-appearance: none;
86
- appearance: none;
87
- }
83
+ .organisation-chooser-light select {
84
+ -webkit-appearance: none;
85
+ -moz-appearance: none;
86
+ appearance: none;
87
+ }
88
88
  }
89
89
  </style>
@@ -3,23 +3,25 @@
3
3
  <div class="d-flex flex-column align-items-center flex-shrink-0 me-3">
4
4
  <div>{{ $t('Choose color') }}</div>
5
5
  <VSwatches
6
- v-model="internColor"
6
+ :model-value="color"
7
7
  class="c-hand "
8
8
  show-fallback
9
9
  colors="text-advanced"
10
10
  popover-to="right"
11
- :data-color="internColor"
11
+ :data-color="color"
12
+ @update:modelValue="$emit('update:color',$event)"
12
13
  />
13
14
  </div>
14
15
  <div class="d-flex flex-column align-items-center">
15
16
  <div>{{ $t('Choose theme') }}</div>
16
17
  <VSwatches
17
- v-model="internTheme"
18
+ :model-value="theme"
18
19
  class="c-hand "
19
20
  show-fallback
20
21
  colors="text-advanced"
21
22
  popover-to="right"
22
- :data-color="internTheme"
23
+ :data-color="theme"
24
+ @update:modelValue="$emit('update:theme',$event)"
23
25
  />
24
26
  </div>
25
27
  </div>
@@ -39,40 +41,5 @@ export default defineComponent({
39
41
  theme: { default: '#000000', type: String},
40
42
  },
41
43
  emits:['update:color', 'update:theme'],
42
-
43
- data() {
44
- return {
45
- internColor:'#40a372' as string,
46
- internTheme:'#000000' as string,
47
- };
48
- },
49
- watch:{
50
- internColor(){
51
- if(this.color !== this.internColor){
52
- this.$emit('update:color', this.internColor);
53
- }
54
- },
55
- internTheme(){
56
- if(this.theme !== this.internTheme ){
57
- this.$emit('update:theme', this.internTheme);
58
- }
59
- },
60
- theme: {
61
- immediate: true,
62
- handler() {
63
- if(this.theme !== this.internTheme){
64
- this.internTheme = this.theme;
65
- }
66
- },
67
- },
68
- color: {
69
- immediate: true,
70
- handler() {
71
- if(this.color !== this.internColor){
72
- this.internColor = this.color;
73
- }
74
- },
75
- },
76
- },
77
44
  })
78
45
  </script>
@@ -5,17 +5,18 @@
5
5
  >
6
6
  <input
7
7
  :id="idCheckbox"
8
- v-model="textValue"
8
+ :model-value="textInit"
9
9
  type="checkbox"
10
10
  :disabled="isDisabled"
11
11
  :title="displayLabel?'':label"
12
12
  :data-selenium="selenium"
13
+ @update:modelValue="$emit('update:textInit',$event)"
13
14
  @click="emitClickAction"
14
15
  >
15
16
  <span
16
17
  v-if="isSwitch"
17
18
  class="slider"
18
- @click="textValue=!textValue;emitClickAction"
19
+ @click="$emit('update:textInit',!textInit);emitClickAction"
19
20
  />
20
21
  </div>
21
22
  <label
@@ -41,27 +42,6 @@ export default defineComponent({
41
42
  selenium: { default: '', type: String },
42
43
  },
43
44
  emits: ['update:textInit', 'clickAction'],
44
-
45
- data() {
46
- return {
47
- textValue: false as boolean,
48
- };
49
- },
50
- watch: {
51
- textValue(){
52
- if(this.textInit !== this.textValue){
53
- this.$emit('update:textInit', this.textValue)
54
- }
55
- },
56
- textInit: {
57
- immediate: true,
58
- handler() {
59
- if(this.textInit !== this.textValue){
60
- this.textValue =this.textInit;
61
- }
62
- },
63
- },
64
- },
65
45
  methods:{
66
46
  emitClickAction():void{
67
47
  this.$emit('clickAction');
@@ -11,11 +11,12 @@
11
11
  >
12
12
  <input
13
13
  :id="idRadio + option.value"
14
- v-model="textValue"
14
+ :model-value="textInit"
15
15
  type="radio"
16
16
  :name="idRadio"
17
17
  :value="option.value"
18
18
  :disabled="isDisabled"
19
+ @update:modelValue="$emit('update:textInit',$event)"
19
20
  >
20
21
  <label
21
22
  class="c-hand"
@@ -40,27 +41,6 @@ export default defineComponent({
40
41
  isColumn: {default:true, type:Boolean}
41
42
  },
42
43
  emits: ['update:textInit'],
43
-
44
- data() {
45
- return {
46
- textValue: undefined as string|undefined,
47
- };
48
- },
49
- watch: {
50
- textValue(){
51
- if(this.textInit !== this.textValue){
52
- this.$emit('update:textInit', this.textValue)
53
- }
54
- },
55
- textInit: {
56
- immediate: true,
57
- handler() {
58
- if(this.textInit !== this.textValue){
59
- this.textValue =this.textInit;
60
- }
61
- },
62
- },
63
- }
64
44
  });
65
45
  </script>
66
46
  <style lang="scss">
@@ -3,24 +3,25 @@
3
3
  <input
4
4
  :id="idSearch"
5
5
  ref="search"
6
- v-model="textValue"
6
+ :model-value="textInit"
7
7
  type="text"
8
8
  class="search-input w-100 p-2 "
9
9
  :placeholder="label"
10
10
  :autofocus="autofocus"
11
+ @update:modelValue="$emit('update:textInit',$event)"
11
12
  >
12
13
  <label
13
14
  :for="idSearch"
14
15
  :title="label"
15
16
  />
16
17
  <div
17
- v-if="!textValue"
18
+ v-if="!textInit"
18
19
  class="saooti-search search-icon-container"
19
20
  />
20
21
  <div
21
22
  v-else
22
23
  class="saooti-remove search-icon-container c-hand"
23
- @click="textValue = ''"
24
+ @click="$emit('update:textInit','')"
24
25
  />
25
26
  </div>
26
27
  </template>
@@ -37,27 +38,6 @@ export default defineComponent({
37
38
  },
38
39
 
39
40
  emits: ['update:textInit'],
40
-
41
- data() {
42
- return {
43
- textValue: '' as string,
44
- };
45
- },
46
- watch: {
47
- textValue(){
48
- if(this.textInit !== this.textValue){
49
- this.$emit('update:textInit', this.textValue)
50
- }
51
- },
52
- textInit: {
53
- immediate: true,
54
- handler() {
55
- if(this.textInit !== this.textValue){
56
- this.textValue =this.textInit;
57
- }
58
- },
59
- },
60
- }
61
41
  });
62
42
  </script>
63
43
  <style lang="scss">
@@ -7,11 +7,12 @@
7
7
  >{{ label }}</label>
8
8
  <select
9
9
  :id="idSelect"
10
- v-model="textValue"
10
+ :model-value="textInit"
11
11
  :disabled="isDisabled"
12
12
  class="c-hand w-100"
13
13
  :class="transparent?'transparent':''"
14
14
  :style="getFontFamily"
15
+ @update:modelValue="$emit('update:textInit',$event)"
15
16
  >
16
17
  <option
17
18
  v-for="option in options"
@@ -38,15 +39,10 @@ export default defineComponent({
38
39
  textInit: { default: undefined, type: String },
39
40
  },
40
41
  emits: ['update:textInit'],
41
- data() {
42
- return {
43
- textValue: undefined as string|undefined,
44
- };
45
- },
46
42
  computed:{
47
43
  getFontFamily(): string{
48
44
  const item = this.options.find((x) => {
49
- return this.textValue === x.value;
45
+ return this.textInit === x.value;
50
46
  });
51
47
  if(item && item.fontFamily){
52
48
  return 'font-family:'+item.fontFamily;
@@ -54,21 +50,6 @@ export default defineComponent({
54
50
  return "";
55
51
  }
56
52
  },
57
- watch: {
58
- textValue(){
59
- if(this.textInit !== this.textValue){
60
- this.$emit('update:textInit', this.textValue)
61
- }
62
- },
63
- textInit: {
64
- immediate: true,
65
- handler() {
66
- if(this.textInit !== this.textValue){
67
- this.textValue =this.textInit;
68
- }
69
- },
70
- },
71
- },
72
53
  });
73
54
  </script>
74
55
  <style lang="scss">
@@ -4,7 +4,7 @@
4
4
  <ProductorSearch
5
5
  v-if="isProductorSearch"
6
6
  v-model:organisationId="organisationId"
7
- :search-pattern="searchPattern"
7
+ v-model:search-pattern="searchPattern"
8
8
  type="emission"
9
9
  @updateOrganisationId="updateOrganisationId"
10
10
  @updateSearchPattern="updateSearchPattern"
@@ -27,8 +27,8 @@
27
27
  />
28
28
  <EmissionList
29
29
  :show-count="true"
30
- :first="first"
31
- :size="size"
30
+ :first="0"
31
+ :size="30"
32
32
  :query="searchPattern"
33
33
  :organisation-id="organisationId"
34
34
  :monetization="monetization"
@@ -66,8 +66,7 @@ export default defineComponent({
66
66
 
67
67
  data() {
68
68
  return {
69
- first: 0 as number,
70
- size: 30 as number,
69
+ isInit: false as boolean,
71
70
  searchPattern: '' as string,
72
71
  organisationId: undefined as string | undefined,
73
72
  monetization: 'UNDEFINED' as string, // UNDEFINED, YES, NO
@@ -99,6 +98,18 @@ export default defineComponent({
99
98
  return this.organisationId?this.organisationId:this.filterOrga;
100
99
  },
101
100
  },
101
+ watch:{
102
+ organisationId(): void {
103
+ if(!this.isInit){return;}
104
+ this.resetRubriquage = !this.resetRubriquage;
105
+ this.rubriquageId = [];
106
+ this.rubriqueId = [];
107
+ this.noRubriquageId = [];
108
+ },
109
+ searchPattern(value: string): void {
110
+ this.sortEmission = '' !== value ? 'SCORE' : 'DATE';
111
+ },
112
+ },
102
113
 
103
114
  created() {
104
115
  this.initComponent();
@@ -132,17 +143,6 @@ export default defineComponent({
132
143
  this.rubriqueId = rubriqueId;
133
144
  this.noRubriquageId = noRubriquageId;
134
145
  },
135
- updateOrganisationId(value: string | undefined): void {
136
- this.resetRubriquage = !this.resetRubriquage;
137
- this.rubriquageId = [];
138
- this.rubriqueId = [];
139
- this.noRubriquageId = [];
140
- this.organisationId = value;
141
- },
142
- updateSearchPattern(value: string): void {
143
- this.sortEmission = '' !== value ? 'SCORE' : 'LAST_PODCAST_DESC';
144
- this.searchPattern = value;
145
- },
146
146
  },
147
147
  })
148
148
  </script>
@@ -2,11 +2,9 @@
2
2
  <div class="page-box">
3
3
  <h1>{{ titleDisplay }}</h1>
4
4
  <ProductorSearch
5
- :organisation-id="organisationId"
6
- :search-pattern="searchPattern"
5
+ v-model:organisation-id="organisationId"
6
+ v-model:search-pattern="searchPattern"
7
7
  type="participant"
8
- @updateOrganisationId="organisationId = $event"
9
- @updateSearchPattern="searchPattern = $event"
10
8
  />
11
9
  <ParticipantList
12
10
  :show-count="true"
@@ -13,10 +13,8 @@
13
13
  <ProductorSearch
14
14
  v-if="isProductorSearch"
15
15
  v-model:organisationId="organisationId"
16
- :search-pattern="searchPattern"
16
+ v-model:search-pattern="searchPattern"
17
17
  type="playlist"
18
- @updateOrganisationId="organisationId = $event"
19
- @updateSearchPattern="searchPattern = $event"
20
18
  />
21
19
  <PlaylistList
22
20
  :show-count="true"
@@ -19,10 +19,8 @@
19
19
  </div>
20
20
  <ProductorSearch
21
21
  v-if="pageParameters.isProductorSearch"
22
- :organisation-id="organisationId"
23
- :search-pattern="searchPattern"
24
- @updateOrganisationId="updateOrganisationId"
25
- @updateSearchPattern="updateSearchPattern"
22
+ v-model:organisation-id="organisationId"
23
+ v-model:search-pattern="searchPattern"
26
24
  />
27
25
  <AdvancedSearch
28
26
  :is-education="isEducation"
@@ -43,8 +41,8 @@
43
41
  />
44
42
  <PodcastList
45
43
  :show-count="true"
46
- :first="first"
47
- :size="size"
44
+ :first="0"
45
+ :size="30"
48
46
  :organisation-id="organisationId"
49
47
  :query="searchPattern"
50
48
  :monetization="monetization"
@@ -89,8 +87,7 @@ export default defineComponent({
89
87
  },
90
88
  data() {
91
89
  return {
92
- first: 0 as number,
93
- size: 30 as number,
90
+ isInit: false as boolean,
94
91
  searchPattern: '' as string,
95
92
  organisationId: undefined as string|undefined,
96
93
  monetization: 'UNDEFINED' as string, // UNDEFINED, YES, NO
@@ -126,11 +123,21 @@ export default defineComponent({
126
123
  }
127
124
  }
128
125
  },
129
-
126
+ watch:{
127
+ organisationId(): void {
128
+ if(!this.isInit){return;}
129
+ this.resetRubriquage = !this.resetRubriquage;
130
+ this.rubriquageId = [];
131
+ this.rubriqueId = [];
132
+ this.noRubriquageId = [];
133
+ },
134
+ searchPattern(value: string): void {
135
+ this.sortCriteria = '' !== value ? 'SCORE' : 'DATE';
136
+ },
137
+ },
130
138
  created() {
131
139
  this.initPodcastsPage();
132
140
  },
133
-
134
141
  methods: {
135
142
  initPodcastsPage(){
136
143
  this.searchPattern = this.searchInit ?? '';
@@ -140,6 +147,7 @@ export default defineComponent({
140
147
  if(this.$store.state.filter.rubriqueFilter.length){
141
148
  this.updateRubriquageFilter(this.$store.state.filter.rubriqueFilter);
142
149
  }
150
+ this.isInit=true;
143
151
  },
144
152
  updateRubriquageFilter(value: Array<RubriquageFilter>){
145
153
  const length = value.length;
@@ -159,17 +167,6 @@ export default defineComponent({
159
167
  this.rubriqueId = rubriqueId;
160
168
  this.noRubriquageId = noRubriquageId;
161
169
  },
162
- updateOrganisationId(value: string): void {
163
- this.resetRubriquage = !this.resetRubriquage;
164
- this.rubriquageId = [];
165
- this.rubriqueId = [];
166
- this.noRubriquageId = [];
167
- this.organisationId = value;
168
- },
169
- updateSearchPattern(value: string): void {
170
- this.sortCriteria = '' !== value ? 'SCORE' : 'DATE';
171
- this.searchPattern = value;
172
- },
173
170
  emissionSelected(emission: Emission): void {
174
171
  this.emissionId = emission && emission.emissionId ? emission.emissionId : undefined;
175
172
  },