@saooti/octopus-sdk 32.0.17 → 32.0.20

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
@@ -660,4 +660,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
660
660
  * 32.0.14 Mise en place Vite au lieu de Webpack
661
661
  * 32.0.15 Pb lié refactor
662
662
  * 32.0.16 Pb lié refactor
663
- * 32.0.17 AdvancedSearch components
663
+ * 32.0.17 AdvancedSearch components
664
+ * 32.0.18 AdvancedSearch components
665
+ * 32.0.19 Playlist publique
666
+ * 32.0.20 Playlist publique
package/index.ts CHANGED
@@ -42,7 +42,6 @@ import PodcastPlaylistInlineList from "./src/components/display/playlist/Podcast
42
42
 
43
43
  //AdvancedSearch
44
44
  import AdvancedSearch from "./src/components/display/filter/AdvancedSearch.vue";
45
- import CategorySearchFilter from "./src/components/display/filter/CategorySearchFilter.vue";
46
45
  import RubriqueFilter from "./src/components/display/filter/RubriqueFilter.vue";
47
46
  import DateFilter from "./src/components/display/filter/DateFilter.vue";
48
47
  import SearchOrder from "./src/components/display/filter/SearchOrder.vue";
@@ -118,7 +117,6 @@ const components = {
118
117
  Error403Page,
119
118
  Paginate,
120
119
  ListPaginate,
121
- CategorySearchFilter,
122
120
  RubriqueFilter,
123
121
  DateFilter,
124
122
  SearchOrder
@@ -179,7 +177,6 @@ export {
179
177
  Error403Page,
180
178
  Paginate,
181
179
  ListPaginate,
182
- CategorySearchFilter,
183
180
  RubriqueFilter,
184
181
  DateFilter,
185
182
  SearchOrder
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "32.0.17",
3
+ "version": "32.0.20",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -70,6 +70,8 @@ export default defineComponent({
70
70
  },
71
71
  props: {
72
72
  isEmission: { default: false, type: Boolean},
73
+ initToDate: { default: undefined, type: String},
74
+ initFromDate: { default: undefined, type: String},
73
75
  },
74
76
 
75
77
  emits: ['updateToDate', 'updateFromDate'],
@@ -91,6 +93,17 @@ export default defineComponent({
91
93
  this.$emit('updateToDate', this.isTo ? moment(this.toDate).toISOString(true) : undefined);
92
94
  },
93
95
  },
96
+
97
+ created(){
98
+ if(this.initToDate){
99
+ this.toDate = this.initToDate;
100
+ this.isTo = true;
101
+ }
102
+ if(this.initFromDate){
103
+ this.fromDate = this.initFromDate;
104
+ this.isFrom = true;
105
+ }
106
+ },
94
107
  methods: {
95
108
  updateFromDate(): void {
96
109
  if (
@@ -25,7 +25,7 @@
25
25
  class="ms-2"
26
26
  :multiple="false"
27
27
  :rubriquage-id="rubriquageId"
28
- :rubrique-selected="0 < rubriqueIdSelected? rubriqueIdSelected : undefined"
28
+ :rubrique-selected="0 !== rubriqueIdSelected? rubriqueIdSelected : undefined"
29
29
  :all-rubriques="getRubriques(rubriquageId)"
30
30
  :defaultanswer="$t('No rubric filter')"
31
31
  :reset="reset"
@@ -67,12 +67,23 @@ export default defineComponent({
67
67
  reset: false as boolean,
68
68
  };
69
69
  },
70
+ watch:{
71
+ rubriquageIdSelected(){
72
+ this.initRubriquage();
73
+ },
74
+ rubriqueIdSelected(){
75
+ this.initRubriquage();
76
+ }
77
+ },
70
78
 
71
79
  created(){
72
- this.rubriquageId = this.rubriquageIdSelected;
80
+ this.initRubriquage();
73
81
  },
74
82
 
75
83
  methods: {
84
+ initRubriquage(){
85
+ this.rubriquageId = this.rubriquageIdSelected;
86
+ },
76
87
  deleteRubriquage(){
77
88
  this.$emit('deleteRubriqueChoice');
78
89
  },
@@ -51,6 +51,8 @@ export default defineComponent({
51
51
  props: {
52
52
  organisationId: { default: undefined, type: String},
53
53
  resetRubriquage: { default: false, type: Boolean},
54
+ modifyFilter:{ default: true, type: Boolean},
55
+ initRubriqueFilter:{ default: undefined, type: Array as ()=> Array<RubriquageFilter>},
54
56
  },
55
57
  emits: ['updateRubriquageFilter'],
56
58
 
@@ -111,7 +113,9 @@ export default defineComponent({
111
113
  }else{
112
114
  this.$emit('updateRubriquageFilter', []);
113
115
  }
114
- this.resetRubriqueFilter();
116
+ if(this.modifyFilter){
117
+ this.resetRubriqueFilter();
118
+ }
115
119
  this.$nextTick(() => {
116
120
  this.isInternChanged = false;
117
121
  });
@@ -123,7 +127,9 @@ export default defineComponent({
123
127
  return;
124
128
  }
125
129
  this.isInternChanged = true;
126
- this.resetRubriqueFilter();
130
+ if(this.modifyFilter){
131
+ this.resetRubriqueFilter();
132
+ }
127
133
  if(this.isRubriquage){
128
134
  this.$emit('updateRubriquageFilter', this.arrayFilter);
129
135
  }
@@ -135,7 +141,7 @@ export default defineComponent({
135
141
  rubriqueFilter:{
136
142
  deep: true,
137
143
  async handler(){
138
- if(this.isInternChanged){
144
+ if(this.isInternChanged || !this.modifyFilter){
139
145
  return;
140
146
  }
141
147
  this.isInternChanged = true;
@@ -161,7 +167,12 @@ export default defineComponent({
161
167
  },
162
168
 
163
169
  created() {
164
- if(this.rubriqueFilter.length){
170
+ if(!this.modifyFilter){
171
+ if(this.initRubriqueFilter && this.initRubriqueFilter.length > 0){
172
+ this.arrayFilter = Array.from(this.initRubriqueFilter);
173
+ this.isRubriquage = true;
174
+ }
175
+ }else if(this.rubriqueFilter.length){
165
176
  this.arrayFilter = Array.from(this.rubriqueFilter);
166
177
  this.isRubriquage = true;
167
178
  }
@@ -218,7 +229,7 @@ export default defineComponent({
218
229
  }
219
230
  },
220
231
  resetRubriqueFilter(): void{
221
- if(0===this.rubriqueFilter.length || this.isInit){
232
+ if(0===this.rubriqueFilter.length || this.isInit || !this.modifyFilter){
222
233
  return;
223
234
  }
224
235
  const queries = this.$route.query;
@@ -100,7 +100,7 @@ export default defineComponent({
100
100
  true == state.generalParameters.isAdmin;
101
101
  },
102
102
  activePlaylist(): boolean {
103
- return 0 !== Object.keys(this.playlist.podcasts).length;
103
+ return 0 !== Object.keys(this.playlist.samplingViews??[]).length;
104
104
  },
105
105
  },
106
106
  mounted() {
@@ -85,7 +85,7 @@ export default defineComponent({
85
85
  return this.notEmptyPlaylist ? this.$t('Podcasts in the playlist') : this.$t('No podcasts in the playlist');
86
86
  },
87
87
  notEmptyPlaylist(): boolean {
88
- return 0 !== Object.keys(this.playlist.podcasts).length;
88
+ return 0 !== Object.keys(this.playlist.samplingViews??[]).length;
89
89
  },
90
90
  podcastsDisplay(): Array<Podcast>{
91
91
  if(this.isMobile){
@@ -122,11 +122,7 @@ export default defineComponent({
122
122
  this.podcasts.length = 0;
123
123
  this.loading = true;
124
124
  try {
125
- const content = await octopusApi.fetchData<Array<Podcast>>(0, 'playlist/'+this.playlist.playlistId+'/content');
126
- for (let index = 0, len = content.length; index < len; index++) {
127
- content[index].order = this.playlist.podcasts[content[index].podcastId];
128
- }
129
- this.podcasts = content;
125
+ this.podcasts = await octopusApi.fetchData<Array<Podcast>>(0, 'playlist/'+this.playlist.playlistId+'/content');
130
126
  if (!this.editRight) {
131
127
  this.podcasts = this.podcasts.filter((p: Podcast|null) => {
132
128
  return (
@@ -38,7 +38,6 @@
38
38
  :pub-date="podcast.pubDate"
39
39
  :podcast-organisation-id="podcast.organisation.id"
40
40
  :podcast-organisation-name="podcast.organisation.name"
41
- :podcast-order="podcast.order"
42
41
  :duration="podcast.duration"
43
42
  :animators="podcast.animators"
44
43
  @mouseenter="showDescription"
@@ -45,10 +45,6 @@
45
45
  >
46
46
  <div>{{ '© ' + podcastOrganisationName }}</div>
47
47
  </router-link>
48
- <span
49
- v-if="editRight && podcastOrder && podcastOrder > 1"
50
- class="saooti-pin text-danger pe-2"
51
- />
52
48
  </div>
53
49
  </div>
54
50
  </template>
@@ -79,7 +75,6 @@ export default defineComponent({
79
75
  pubDate: { default: "", type: String},
80
76
  podcastOrganisationId: { default: "", type: String},
81
77
  podcastOrganisationName: { default: "", type: String},
82
- podcastOrder: { default: undefined, type: Number},
83
78
  duration: { default: 0, type: Number},
84
79
  animators: { default: undefined, type: Object as ()=> Array<Participant>},
85
80
  },
@@ -1,13 +1,33 @@
1
1
  import { Organisation } from '../general/organisation';
2
2
  import { Person } from '../user/person';
3
+ import { FetchParam } from './fetchParam';
4
+
3
5
 
4
6
  export interface Playlist {
5
7
  imageUrl?: string;
6
8
  description: string;
7
9
  organisation?: Organisation;
8
10
  playlistId: number;
9
- podcasts: Array<number | undefined>;
11
+ podcasts?: Array<number | undefined>;
10
12
  score: number;
11
13
  title: string;
14
+ type: string;
15
+ samplingViews?: Array<PlaylistRule>;
12
16
  publisher?: Person;
13
17
  }
18
+
19
+ export interface PlaylistRule {
20
+ maxSize: number,
21
+ podcastId?: number,
22
+ query?: FetchParam,
23
+ type?:string,
24
+ title?: string,
25
+ }
26
+
27
+ export function emptyPlaylistRule(): PlaylistRule{
28
+ return {
29
+ maxSize: 1,
30
+ query: {},
31
+ title: undefined,
32
+ }
33
+ }