@saooti/octopus-sdk 40.0.1 → 40.0.2

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": "40.0.1",
3
+ "version": "40.0.2",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -49,17 +49,17 @@
49
49
  <ClassicSelect
50
50
  v-if="isSelectValidity"
51
51
  :text-init="validity"
52
- @update:text-init="updateValidity"
53
52
  id-select="valid-episodes-select"
54
53
  :label="$t('Episodes to validate')+' :'"
55
54
  :display-label="true"
56
- classLabel="flex-shrink-0 me-1"
55
+ class-label="flex-shrink-0 me-1"
57
56
  class="d-flex align-items-center mt-3 mb-0"
58
57
  :options="[
59
58
  { title: $t('Display only episodes to validate'), value: 'false' },
60
59
  { title: $t('Display episodes to validate'), value: '' },
61
60
  { title: $t('Do not display episodes to validate'), value: 'true' },
62
61
  ]"
62
+ @update:text-init="updateValidity"
63
63
  />
64
64
  <ClassicCheckbox
65
65
  v-if="!isEmission"
@@ -203,7 +203,7 @@ export default defineComponent({
203
203
  if (valSort !== this.sort) {
204
204
  this.$emit("update:sort", valSort);
205
205
  }
206
- this.updateRouteParam({
206
+ this.updateRouteParamAdvanced({
207
207
  q: search.length ? search : undefined,
208
208
  s: valSort,
209
209
  });
@@ -212,7 +212,7 @@ export default defineComponent({
212
212
  methods: {
213
213
  updateMonetisable(value: string): void {
214
214
  this.$emit("update:monetisable", value);
215
- this.updateRouteParam({ m: "UNDEFINED" !== value ? value : undefined });
215
+ this.updateRouteParamAdvanced({ m: "UNDEFINED" !== value ? value : undefined });
216
216
  },
217
217
  updateIab(value: number | undefined) {
218
218
  this.$emit("update:iabId", 0 !== value ? value : undefined);
@@ -220,26 +220,26 @@ export default defineComponent({
220
220
  if (this.filterIab && this.filterIab.id !== value) {
221
221
  filterIab = { iabId: undefined };
222
222
  }
223
- this.updateRouteParam({
223
+ this.updateRouteParamAdvanced({
224
224
  ...{ i: value ? value.toString() : undefined },
225
225
  ...filterIab,
226
226
  });
227
227
  },
228
228
  updateSort(value: string) {
229
229
  this.$emit("update:sort", value);
230
- this.updateRouteParam({ s: value });
230
+ this.updateRouteParamAdvanced({ s: value });
231
231
  },
232
232
  updateIncludeHidden(value: boolean) {
233
233
  this.$emit("update:includeHidden", value);
234
- this.updateRouteParam({ h: value.toString() });
234
+ this.updateRouteParamAdvanced({ h: value.toString() });
235
235
  },
236
236
  updateValidity(value: boolean) {
237
237
  this.$emit("update:validity", value);
238
- this.updateRouteParam({ vl: value.toString() });
238
+ this.updateRouteParamAdvanced({ vl: value.toString() });
239
239
  },
240
240
  updateOnlyVideo(value: boolean) {
241
241
  this.$emit("update:onlyVideo", value);
242
- this.updateRouteParam({ v: value ? "true" : undefined });
242
+ this.updateRouteParamAdvanced({ v: value ? "true" : undefined });
243
243
  },
244
244
  updateDates(value: {
245
245
  from: string | undefined;
@@ -247,7 +247,7 @@ export default defineComponent({
247
247
  }): void {
248
248
  this.$emit("update:fromDate", value.from);
249
249
  this.$emit("update:toDate", value.to);
250
- this.updateRouteParam({ from: value.from, to: value.to });
250
+ this.updateRouteParamAdvanced({ from: value.from, to: value.to });
251
251
  },
252
252
  updateRubriquageFilter(value: Array<RubriquageFilter>) {
253
253
  this.$emit("update:rubriqueFilter", value);
@@ -259,7 +259,7 @@ export default defineComponent({
259
259
  ) {
260
260
  filterRubriques = { rubriquesId: undefined };
261
261
  }
262
- this.updateRouteParam({
262
+ this.updateRouteParamAdvanced({
263
263
  ...{ r: valueString.length ? valueString : undefined },
264
264
  ...filterRubriques,
265
265
  });
@@ -112,7 +112,7 @@ export default defineComponent({
112
112
  this.internSizeChange = false;
113
113
  return;
114
114
  }
115
- this.updatePaginateRank(Math.floor(this.first / this.rowsPerPage) + 1);
115
+ this.updateRouteParam({pr:(Math.floor(this.first / this.rowsPerPage) + 1).toString()});
116
116
  },
117
117
  },
118
118
  methods: {
@@ -104,6 +104,9 @@ export default defineComponent({
104
104
  changePaginate(): string {
105
105
  return `${this.first}|${this.size}`;
106
106
  },
107
+ sort(): string {
108
+ return !this.query ? "NAME" : "SCORE";
109
+ },
107
110
  },
108
111
  watch: {
109
112
  changePaginate() {
@@ -149,6 +152,7 @@ export default defineComponent({
149
152
  size: this.dsize,
150
153
  query: this.query,
151
154
  organisationId: this.organisation,
155
+ sort: this.sort
152
156
  },
153
157
  specialTreatement: true,
154
158
  },
@@ -12,7 +12,8 @@
12
12
  class="d-flex align-items-center border p-1 m-1 text-dark"
13
13
  :to="{
14
14
  name: 'rubrique',
15
- params: { rubriqueId: rubriqueId },
15
+ params: { rubriqueId: rubriqueId},
16
+ query: organisationQuery
16
17
  }"
17
18
  >
18
19
  {{ rubriquagesOrga[rubriqueId]?.name ?? rubriqueId}}
@@ -21,10 +22,11 @@
21
22
  </template>
22
23
 
23
24
  <script lang="ts">
24
- import { mapActions } from "pinia";
25
+ import { mapActions, mapState } from "pinia";
25
26
  import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
26
27
  import {defineComponent } from "vue";
27
- import { Rubrique } from "@/stores/class/rubrique/rubrique";
28
+ import { Rubrique } from "../../../stores/class/rubrique/rubrique";
29
+ import { useFilterStore } from "../../../stores/FilterStore";
28
30
  export default defineComponent({
29
31
  name: "TagList",
30
32
  components: {
@@ -42,6 +44,15 @@ export default defineComponent({
42
44
  created() {
43
45
  this.fetchRubriquages();
44
46
  },
47
+ computed:{
48
+ ...mapState(useFilterStore, ["filterOrgaId"]),
49
+ organisationQuery(){
50
+ if(this.filterOrgaId){
51
+ return undefined;
52
+ }
53
+ return { o: this.orgaId};
54
+ }
55
+ },
45
56
  methods:{
46
57
  ...mapActions(useSaveFetchStore, ["getOrgaRubriques"]),
47
58
  async fetchRubriquages(){
@@ -55,6 +55,10 @@ export default defineComponent({
55
55
  height: 48px;
56
56
  }
57
57
 
58
+ input[type="search"]::-webkit-search-cancel-button {
59
+ display: none;
60
+ }
61
+
58
62
  .search-icon-container {
59
63
  position: absolute;
60
64
  inset-block:0;
@@ -1,16 +1,43 @@
1
+ import { useFilterStore } from '../../../stores/FilterStore';
2
+ import { routeParams } from "../../mixins/routeParam/routeParams";
3
+ import { mapState } from 'pinia';
1
4
  import { defineComponent } from 'vue';
2
5
  export const paginateParamInit = defineComponent({
6
+ mixins: [ routeParams],
3
7
  props: {
4
8
  pr: { default: 0, type: Number },
5
9
  ps: { default: 30, type: Number },
10
+ routeOrga: { default: undefined, type: String },
11
+ routeQuery: { default: "", type: String },
12
+ },
13
+ data() {
14
+ return {
15
+ organisationId: undefined as string | undefined,
16
+ searchPattern: "" as string,
17
+ };
6
18
  },
7
19
  computed:{
20
+ ...mapState(useFilterStore, ["filterOrgaId"]),
8
21
  paginateFirst(){
9
22
  if(!this.pr){
10
23
  return 0;
11
24
  }
12
25
  return Math.max((this.pr - 1 ) * this.ps, 0);
13
- }
14
- }
26
+ },
27
+ searchMinSize(): string{
28
+ return this.searchPattern.length>3 ? this.searchPattern : "";
29
+ },
30
+ },
31
+ watch: {
32
+ searchPattern(value: string): void {
33
+ this.updateRouteParam({
34
+ q: this.searchMinSize.length ? this.searchMinSize : undefined,
35
+ });
36
+ },
37
+ },
38
+ created() {
39
+ this.organisationId = this.filterOrgaId ?? this.routeOrga;
40
+ this.searchPattern = this.routeQuery ?? "";
41
+ },
15
42
  });
16
43
 
@@ -2,7 +2,7 @@ import { defineComponent } from 'vue';
2
2
  export const routeParams = defineComponent({
3
3
  methods: {
4
4
  checkPage(): boolean{
5
- return ['podcasts', 'emissions', 'participants', 'playlists', 'productors'].includes(this.$route.name?.toString()??"");
5
+ return ['podcasts', 'emissions', 'participants', 'playlists', 'productors', 'rubrique'].includes(this.$route.name?.toString()??"");
6
6
  },
7
7
  checkPageAdvanced(): boolean{
8
8
  return ['podcasts', 'emissions'].includes(this.$route.name?.toString()??"");
@@ -12,12 +12,12 @@ export const routeParams = defineComponent({
12
12
  this.$router.push({query: {...this.$route.query, ...{ps:ps, pr:1}}});
13
13
  }
14
14
  },
15
- updatePaginateRank(pr:number){
15
+ updateRouteParam(update: {[key:string]: string|undefined}){
16
16
  if(this.checkPage()){
17
- this.$router.push({query: {...this.$route.query, ...{pr:pr}}});
17
+ this.$router.push({query: {...this.$route.query, ...update}});
18
18
  }
19
19
  },
20
- updateRouteParam(update: {[key:string]: string|undefined}){
20
+ updateRouteParamAdvanced(update: {[key:string]: string|undefined}){
21
21
  if(this.checkPageAdvanced()){
22
22
  this.$router.push({query: {...this.$route.query, ...update}});
23
23
  }
@@ -9,7 +9,7 @@
9
9
  :show-count="true"
10
10
  :first="paginateFirst"
11
11
  :size="ps"
12
- :query="searchPattern"
12
+ :query="searchMinSize"
13
13
  :organisation-id="organisationId"
14
14
  />
15
15
  </section>
@@ -17,11 +17,9 @@
17
17
 
18
18
  <script lang="ts">
19
19
  import { paginateParamInit } from "../mixins/routeParam/paginateParamInit";
20
- import { useFilterStore } from "../../stores/FilterStore";
21
20
  import ParticipantList from "../display/participant/ParticipantList.vue";
22
21
  import ProductorSearch from "../display/filter/ProductorSearch.vue";
23
22
  import { defineComponent } from "vue";
24
- import { mapState } from "pinia";
25
23
  export default defineComponent({
26
24
  components: {
27
25
  ProductorSearch,
@@ -29,9 +27,10 @@ export default defineComponent({
29
27
  },
30
28
  mixins: [paginateParamInit],
31
29
  props: {
32
- productor: { default: undefined, type: String },
33
30
  pr: { default: 0, type: Number },
34
31
  ps: { default: 30, type: Number },
32
+ routeOrga: { default: undefined, type: String },
33
+ routeQuery: { default: "", type: String },
35
34
  },
36
35
  data() {
37
36
  return {
@@ -39,11 +38,5 @@ export default defineComponent({
39
38
  organisationId: undefined as string | undefined,
40
39
  };
41
40
  },
42
- computed: {
43
- ...mapState(useFilterStore, ["filterOrgaId"]),
44
- },
45
- created() {
46
- this.organisationId = this.productor ? this.productor : this.filterOrgaId;
47
- },
48
41
  });
49
42
  </script>
@@ -18,7 +18,7 @@
18
18
  :show-count="true"
19
19
  :first="paginateFirst"
20
20
  :size="ps"
21
- :query="searchPattern"
21
+ :query="searchMinSize"
22
22
  :organisation-id="organisationId"
23
23
  />
24
24
  </section>
@@ -28,7 +28,6 @@
28
28
  import { paginateParamInit } from "../mixins/routeParam/paginateParamInit";
29
29
  import PlaylistList from "../display/playlist/PlaylistList.vue";
30
30
  import { useAuthStore } from "../../stores/AuthStore";
31
- import { useFilterStore } from "../../stores/FilterStore";
32
31
  import { state } from "../../stores/ParamSdkStore";
33
32
  import { defineComponent, defineAsyncComponent } from "vue";
34
33
  import { mapState } from "pinia";
@@ -42,9 +41,10 @@ export default defineComponent({
42
41
  },
43
42
  mixins: [paginateParamInit],
44
43
  props: {
45
- productor: { default: undefined, type: String },
46
44
  pr: { default: 0, type: Number },
47
45
  ps: { default: 30, type: Number },
46
+ routeOrga: { default: undefined, type: String },
47
+ routeQuery: { default: "", type: String },
48
48
  },
49
49
 
50
50
  data() {
@@ -55,15 +55,10 @@ export default defineComponent({
55
55
  },
56
56
 
57
57
  computed: {
58
- ...mapState(useFilterStore, ["filterOrgaId"]),
59
58
  ...mapState(useAuthStore, ["isRolePlaylists"]),
60
59
  isPodcastmaker(): boolean {
61
60
  return state.generalParameters.podcastmaker as boolean;
62
61
  },
63
62
  },
64
-
65
- created() {
66
- this.organisationId = this.productor ? this.productor : this.filterOrgaId;
67
- },
68
63
  });
69
64
  </script>
@@ -1,38 +1,65 @@
1
1
  <template>
2
2
  <section class="page-box">
3
3
  <h1>{{ title }}</h1>
4
+ <ProductorSearch
5
+ v-model:organisation-id="organisationId"
6
+ v-model:search-pattern="searchPattern"
7
+ />
4
8
  <PodcastList
5
- :first="firstRoute"
6
- :size="sizeRoute"
7
- :rubrique-id="rubriqueId"
9
+ :first="paginateFirst"
10
+ :size="ps"
11
+ :rubrique-id="[rubriqueId]"
12
+ :organisation-id="orgaArray"
13
+ :query="searchMinSize"
14
+ :sort-criteria="sortOrder ?? 'DATE'"
8
15
  />
9
16
  </section>
10
17
  </template>
11
18
 
12
19
  <script lang="ts">
20
+ import { paginateParamInit } from "../mixins/routeParam/paginateParamInit";
21
+ import { seoTitleUrl } from "../mixins/seoTitleUrl";
13
22
  import classicApi from "../../api/classicApi";
14
23
  import PodcastList from "../display/podcasts/PodcastList.vue";
15
- import { defineComponent } from "vue";
24
+ import { defineAsyncComponent, defineComponent } from "vue";
16
25
  import { Rubrique } from "@/stores/class/rubrique/rubrique";
17
26
  import { useGeneralStore } from "../../stores/GeneralStore";
18
27
  import { mapState } from "pinia";
28
+ const ProductorSearch = defineAsyncComponent(
29
+ () => import("../display/filter/ProductorSearch.vue"),
30
+ );
19
31
  export default defineComponent({
20
32
  name: "RubriquePage",
21
33
  components: {
22
34
  PodcastList,
35
+ ProductorSearch
23
36
  },
37
+ mixins: [paginateParamInit, seoTitleUrl],
24
38
  props: {
25
- firstRoute: { default: 0, type: Number },
26
- sizeRoute: { default: 30, type: Number },
27
- rubriqueId: { default: undefined, type: [Number] },
39
+ pr: { default: 0, type: Number },
40
+ ps: { default: 30, type: Number },
41
+ rubriqueId: { default: undefined, type: Number },
42
+ routeOrga: { default: undefined, type: String },
43
+ routeQuery: { default: "", type: String },
28
44
  },
29
45
  data() {
30
46
  return {
31
47
  title: "" as string,
48
+ organisationId: undefined as string | undefined,
49
+ searchPattern: "" as string,
32
50
  };
33
51
  },
34
52
  computed:{
35
53
  ...mapState(useGeneralStore, ["metaTitle"]),
54
+ orgaArray(): Array<string> {
55
+ return this.organisationId ? [this.organisationId] : [];
56
+ },
57
+ sortOrder(){
58
+ if(this.searchMinSize.length){
59
+ return "SCORE";
60
+ }
61
+ return undefined;
62
+ }
36
63
  },
37
64
  watch: {
38
65
  rubriqueId: {
@@ -42,8 +69,8 @@ export default defineComponent({
42
69
  api: 0,
43
70
  path: "rubrique/" + this.rubriqueId,
44
71
  });
72
+ this.updatePathParams(data.name);
45
73
  this.title = data.name;
46
- document.title = this.title + ' - ' + this.metaTitle;
47
74
  },
48
75
  },
49
76
  },
@@ -128,6 +128,8 @@ const routes: Array<RouteRecordRaw> = [
128
128
  props: (route: RouteLocationNormalized) => ({
129
129
  pr: route.query.pr ? parseInt(route.query.pr.toString(), 10) : undefined,
130
130
  ps: route.query.ps ? parseInt(route.query.ps.toString(), 10) : undefined,
131
+ routeOrga:route.query.o,
132
+ routeQuery: route.query.q ?? "",
131
133
  }),
132
134
  meta:{
133
135
  title: "Speakers",
@@ -190,18 +192,15 @@ const routes: Array<RouteRecordRaw> = [
190
192
  }
191
193
  },
192
194
  {
193
- path: "/main/pub/rubrique/:rubriqueId/:productor?",
195
+ path: "/main/pub/rubrique/:rubriqueId(\\d+):title([^?]*)?:productor?",
194
196
  name: "rubrique",
195
197
  component: RubriquePage,
196
198
  props: (route: RouteLocationNormalized) => ({
197
- firstRoute: route.query.first
198
- ? parseInt(route.query.first.toString(), 10)
199
- : 0,
200
- sizeRoute: route.query.size
201
- ? parseInt(route.query.size.toString(), 10)
202
- : 12,
199
+ pr: route.query.pr ? parseInt(route.query.pr.toString(), 10) : undefined,
200
+ ps: route.query.ps ? parseInt(route.query.ps.toString(), 10) : undefined,
203
201
  rubriqueId: parseInt(route.params.rubriqueId.toString(), 10),
204
- productor: route.params.productor,
202
+ routeOrga:route.query.o,
203
+ routeQuery: route.query.q ?? "",
205
204
  }),
206
205
  meta:{
207
206
  title: "",
@@ -236,6 +235,8 @@ const routes: Array<RouteRecordRaw> = [
236
235
  props: (route: RouteLocationNormalized) => ({
237
236
  pr: route.query.pr ? parseInt(route.query.pr.toString(), 10) : undefined,
238
237
  ps: route.query.ps ? parseInt(route.query.ps.toString(), 10) : undefined,
238
+ routeOrga:route.query.o,
239
+ routeQuery: route.query.q ?? "",
239
240
  }),
240
241
  meta:{
241
242
  title: "Playlists"
@@ -34,22 +34,3 @@
34
34
  --octopus-line-clamp:2;
35
35
  --octopus-max-height-description: 7rem;
36
36
  }
37
-
38
- :root.dark-theme{
39
- // Colors
40
- --octopus-background: oklch(100% 0 0deg);
41
- --octopus-primary: oklch(55% 0.118 159.16deg);
42
- --octopus-secondary: oklch(90% 0 0deg);
43
- --octopus-tertiary: oklch(45.74% 0.0822 222.06deg);
44
- --octopus-danger: oklab(50% 0.18 0.105);
45
- --octopus-warning:oklch(55% 0.1647 42.35deg);
46
- --octopus-gray-text: oklch(44.75% 0.0121 229.13deg);
47
- --octopus-color-text: oklch(30% 0 0deg);
48
- --octopus-color-on-primary: oklch(100% 0 0deg);
49
- --octopus-border-default: oklch(91% 0.007 248deg);
50
- --octopus-shadow: oklch(0% 0 0deg / 40%);
51
- --octopus-player-color:oklch(27% 0 0deg);
52
- --octopus-gray: oklch(50% 0 0deg);
53
- }
54
-
55
-