@saooti/octopus-sdk 41.5.3 → 41.5.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 41.5.4 (12/02/2026)
4
+
5
+ **Misc**
6
+
7
+ - Ajouts d'options pour customiser les éléments de `TopBar`
8
+ - Ajout d'un slot `bottom` pour `PlaylistPage`
9
+
3
10
  ## 41.5.3 (09/02/2026)
4
11
 
5
12
  **Fix**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "41.5.3",
3
+ "version": "41.5.4",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -9,7 +9,7 @@
9
9
  <AppsIcon :size="30" />
10
10
  </button>
11
11
  <router-link
12
- v-if="isAuthenticatedWithOrga && authStore.isRoleContribution"
12
+ v-if="displayUpload"
13
13
  :title="t('Upload')"
14
14
  to="/main/priv/upload"
15
15
  class="btn admin-button hide-small-screen m-1 text-blue-octopus"
@@ -48,11 +48,15 @@ import { computed } from "vue";
48
48
  import { useI18n } from "vue-i18n";
49
49
  import { useRoute, useRouter } from "vue-router";
50
50
 
51
+ export interface HomeDropdownProps {
52
+ isEducation?: boolean;
53
+ mobileMenuDisplay?: boolean;
54
+ /** Display the upload button */
55
+ displayUpload?: boolean;
56
+ }
57
+
51
58
  //Props
52
- defineProps({
53
- isEducation: { default: false, type: Boolean },
54
- mobileMenuDisplay: { default: false, type: Boolean },
55
- })
59
+ defineProps<HomeDropdownProps>();
56
60
 
57
61
  //Composables
58
62
  const { t } = useI18n();
@@ -11,6 +11,7 @@
11
11
  :title-display="titleToDisplay"
12
12
  style="height: var(--header-size);"
13
13
  :class="headerBackgroundImage.length ? 'header-opacity':''"
14
+ :options="options?.topBarMainContent"
14
15
  />
15
16
  </header>
16
17
  <div v-if="generalStore.contentToDisplay" class="header-content-bg" :style="headerBackgroundImage" :class="{ scrolled: scrolled, 'header-force-blur':needToBlur }" >
@@ -30,7 +31,7 @@
30
31
 
31
32
  <script setup lang="ts">
32
33
  import {useImageProxy} from "../composable/useImageProxy";
33
- import TopBarMainContent from "./TopBarMainContent.vue";
34
+ import TopBarMainContent, { type TopBarMainContentOptions } from "./TopBarMainContent.vue";
34
35
  import { computed, defineAsyncComponent, onBeforeUnmount, onMounted, ref, watch } from "vue";
35
36
  import { useAuthStore } from "../../stores/AuthStore";
36
37
  import { useGeneralStore } from "../../stores/GeneralStore";
@@ -44,6 +45,11 @@ const SubscribeButtons = defineAsyncComponent(
44
45
  () => import("../display/sharing/SubscribeButtons.vue"),
45
46
  );
46
47
 
48
+ defineProps<{
49
+ options?: {
50
+ topBarMainContent?: TopBarMainContentOptions
51
+ }
52
+ }>();
47
53
 
48
54
  //Data
49
55
  const scrolled = ref(false);
@@ -138,6 +138,7 @@
138
138
  <HomeDropdown
139
139
  :is-education="generalStore.platformEducation"
140
140
  :mobile-menu-display="mobileMenuDisplay"
141
+ v-bind="options?.homeDropdown"
141
142
  />
142
143
  <router-link
143
144
  v-show="!isPhone && !inContentDisplayPage"
@@ -160,7 +161,7 @@ import ChevronDownIcon from "vue-material-design-icons/ChevronDown.vue";
160
161
  import MagnifyIcon from "vue-material-design-icons/Magnify.vue";
161
162
  import { useRubriquesFilterComputed } from "../composable/route/useRubriquesFilterComputed";
162
163
  import { state } from "../../stores/ParamSdkStore";
163
- import HomeDropdown from "./HomeDropdown.vue";
164
+ import HomeDropdown, { type HomeDropdownProps } from "./HomeDropdown.vue";
164
165
  import {useImageProxy} from "../composable/useImageProxy";
165
166
  import { useFilterStore } from "../../stores/FilterStore";
166
167
  import { useAuthStore } from "../../stores/AuthStore";
@@ -170,13 +171,21 @@ import { useGeneralStore } from "../../stores/GeneralStore";
170
171
  import { useI18n } from "vue-i18n";
171
172
  const MobileMenu = defineAsyncComponent(() => import("./MobileMenu.vue"));
172
173
 
174
+ export interface TopBarMainContentOptions {
175
+ homeDropdown?: HomeDropdownProps;
176
+ }
177
+
178
+ export interface TopBarMainContentProps {
179
+ isPhone?: boolean;
180
+ titleDisplay?: string;
181
+ scrolled?: boolean;
182
+ };
173
183
 
174
184
  //Props
175
- const props = defineProps({
176
- isPhone: { default: false, type: Boolean },
177
- titleDisplay: { default: "", type: String },
178
- scrolled: { default: false, type: Boolean },
179
- })
185
+ const props = defineProps<TopBarMainContentProps & {
186
+ /** Props for subcomponents */
187
+ options?: TopBarMainContentOptions;
188
+ }>();
180
189
 
181
190
 
182
191
  //Composables
@@ -57,6 +57,8 @@
57
57
  />
58
58
  </section>
59
59
  </div>
60
+
61
+ <slot name="bottom" v-bind="{ playlist }" />
60
62
  </template>
61
63
  <ClassicLoading
62
64
  :loading-text="!loaded ? t('Loading content ...') : undefined"
@@ -0,0 +1,43 @@
1
+ import '@tests/mocks/useRouter';
2
+ import '@tests/mocks/i18n';
3
+
4
+ import HomeDropdown from '@/components/misc/HomeDropdown.vue';
5
+ import { mount } from '@tests/utils';
6
+ import { describe, expect, it } from 'vitest';
7
+
8
+ describe('HomeDropdown - displayUpload prop', () => {
9
+ it('displays the upload button when displayUpload is true', async () => {
10
+ const wrapper = await mount(HomeDropdown, {
11
+ props: {
12
+ displayUpload: true
13
+ },
14
+ stubs: ['ClassicPopover', 'UserButtonContent', 'AppsIcon', 'AccountIcon', 'DownloadIcon']
15
+ });
16
+
17
+ const uploadButton = wrapper.find('a[title="Upload"]');
18
+ expect(uploadButton.exists()).toBe(true);
19
+ expect(uploadButton.attributes('to')).toBe('/main/priv/upload');
20
+ });
21
+
22
+ it('does not display the upload button when displayUpload is false', async () => {
23
+ const wrapper = await mount(HomeDropdown, {
24
+ props: {
25
+ displayUpload: false
26
+ },
27
+ stubs: ['ClassicPopover', 'UserButtonContent', 'AppsIcon', 'AccountIcon', 'DownloadIcon']
28
+ });
29
+
30
+ const uploadButton = wrapper.find('a[title="Upload"]');
31
+ expect(uploadButton.exists()).toBe(false);
32
+ });
33
+
34
+ it('does not display the upload button when displayUpload is undefined', async () => {
35
+ const wrapper = await mount(HomeDropdown, {
36
+ props: {},
37
+ stubs: ['ClassicPopover', 'UserButtonContent', 'AppsIcon', 'AccountIcon', 'DownloadIcon']
38
+ });
39
+
40
+ const uploadButton = wrapper.find('a[title="Upload"]');
41
+ expect(uploadButton.exists()).toBe(false);
42
+ });
43
+ });