@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 +7 -0
- package/package.json +1 -1
- package/src/components/misc/HomeDropdown.vue +9 -5
- package/src/components/misc/TopBar.vue +7 -1
- package/src/components/misc/TopBarMainContent.vue +15 -6
- package/src/components/pages/PlaylistPage.vue +2 -0
- package/tests/components/misc/HomeDropdown.spec.ts +43 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<AppsIcon :size="30" />
|
|
10
10
|
</button>
|
|
11
11
|
<router-link
|
|
12
|
-
v-if="
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
})
|
|
185
|
+
const props = defineProps<TopBarMainContentProps & {
|
|
186
|
+
/** Props for subcomponents */
|
|
187
|
+
options?: TopBarMainContentOptions;
|
|
188
|
+
}>();
|
|
180
189
|
|
|
181
190
|
|
|
182
191
|
//Composables
|
|
@@ -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
|
+
});
|