@saooti/octopus-sdk 41.0.6 → 41.0.7
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
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
:left-pos="true"
|
|
33
33
|
:is-top-layer="true"
|
|
34
34
|
>
|
|
35
|
-
<UserButtonContent :isEducation="isEducation" :navLabel="t('User menu')"
|
|
35
|
+
<UserButtonContent :isEducation="isEducation" :navLabel="t('User menu')"/>
|
|
36
36
|
</ClassicPopover>
|
|
37
37
|
</div>
|
|
38
38
|
</template>
|
|
@@ -61,44 +61,7 @@ const route = useRoute();
|
|
|
61
61
|
const router = useRouter();
|
|
62
62
|
|
|
63
63
|
//Computed
|
|
64
|
-
const isAuthenticated = computed(() => undefined !== authStore.authProfile?.userId);
|
|
65
64
|
const isAuthenticatedWithOrga = computed(() => undefined !== authStore.authOrgaId);
|
|
66
|
-
const organisationsAvailable = computed(() => authStore.authProfile?.organisations ?? []);
|
|
67
|
-
|
|
68
|
-
const routerBackoffice = computed(() => {
|
|
69
|
-
if(!isAuthenticated.value){
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
return [
|
|
73
|
-
{
|
|
74
|
-
title: t("My space"),
|
|
75
|
-
class: "octopus-dropdown-item show-small-phone-flex",
|
|
76
|
-
path: "/main/priv/backoffice",
|
|
77
|
-
condition: isAuthenticatedWithOrga.value,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
title: t("Upload"),
|
|
81
|
-
class: "octopus-dropdown-item show-small-phone-flex",
|
|
82
|
-
path: "/main/priv/upload",
|
|
83
|
-
condition: isAuthenticatedWithOrga.value && authStore.isRoleContribution,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
title: t("Edit my profile"),
|
|
87
|
-
class: "octopus-dropdown-item",
|
|
88
|
-
path: "/main/priv/edit/profile",
|
|
89
|
-
condition: true,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
title: t("Edit my organisation"),
|
|
93
|
-
class: "octopus-dropdown-item",
|
|
94
|
-
path: "/main/priv/edit/organisation",
|
|
95
|
-
condition:
|
|
96
|
-
isAuthenticatedWithOrga.value &&
|
|
97
|
-
(authStore.isRoleOrganisation || 1 < organisationsAvailable.value.length),
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
});
|
|
101
|
-
|
|
102
65
|
|
|
103
66
|
//Methods
|
|
104
67
|
function goToAdministration() {
|
|
@@ -33,9 +33,9 @@ import { useRubriquesFilterComputed } from "../composable/route/useRubriquesFilt
|
|
|
33
33
|
import { state } from "../../stores/ParamSdkStore";
|
|
34
34
|
import { defineAsyncComponent, ref, computed } from "vue";
|
|
35
35
|
import { useFilterStore } from "../../stores/FilterStore";
|
|
36
|
-
import { useAuthStore } from "../../stores/AuthStore";
|
|
37
36
|
import { useI18n } from "vue-i18n";
|
|
38
37
|
import { useResizePhone } from "../composable/useResizePhone";
|
|
38
|
+
import { useAuthStore } from "@/stores/AuthStore";
|
|
39
39
|
const ClassicPopover = defineAsyncComponent(
|
|
40
40
|
() => import("../misc/ClassicPopover.vue"),
|
|
41
41
|
);
|
|
@@ -48,6 +48,7 @@ const props = defineProps({
|
|
|
48
48
|
isEducation: { default: false, type: Boolean },
|
|
49
49
|
show: { default: false, type: Boolean },
|
|
50
50
|
notPodcastAndEmission: { default: false, type: Boolean },
|
|
51
|
+
inContentDisplayPage: { default: false, type: Boolean },
|
|
51
52
|
})
|
|
52
53
|
|
|
53
54
|
//Data
|
|
@@ -56,25 +57,21 @@ const firstLoaded = ref(false);
|
|
|
56
57
|
//Composables
|
|
57
58
|
const { t } = useI18n();
|
|
58
59
|
const { rubriqueQueryParam } = useRubriquesFilterComputed();
|
|
59
|
-
const authStore = useAuthStore();
|
|
60
60
|
const filterStore = useFilterStore();
|
|
61
|
+
const authStore = useAuthStore();
|
|
61
62
|
const { windowWidth } = useResizePhone();
|
|
62
63
|
|
|
63
64
|
|
|
64
65
|
//Computed
|
|
65
|
-
const displayUserContent = computed(() => 500>=windowWidth.value);
|
|
66
66
|
const isAuthenticatedWithOrga = computed(() => undefined !== authStore.authOrgaId);
|
|
67
|
+
const displayUserContent = computed(() =>{
|
|
68
|
+
if(isAuthenticatedWithOrga.value){
|
|
69
|
+
return 500>=windowWidth.value;
|
|
70
|
+
}
|
|
71
|
+
return props.show && !props.inContentDisplayPage;
|
|
72
|
+
});
|
|
67
73
|
const routerLinkArray = computed(() =>{
|
|
68
74
|
return [
|
|
69
|
-
{
|
|
70
|
-
title: t("My space"),
|
|
71
|
-
path:{
|
|
72
|
-
name: "backoffice",
|
|
73
|
-
query: getQueriesRouter(true),
|
|
74
|
-
},
|
|
75
|
-
class: "octopus-dropdown-item",
|
|
76
|
-
condition: isAuthenticatedWithOrga.value,
|
|
77
|
-
},
|
|
78
75
|
{
|
|
79
76
|
title: t("Home"),
|
|
80
77
|
path:{
|
|
@@ -31,6 +31,16 @@
|
|
|
31
31
|
</li>
|
|
32
32
|
</template>
|
|
33
33
|
<template v-else>
|
|
34
|
+
<li v-for="routeBackoffice in routerBackoffice" :key="routeBackoffice.path" class="li-style-none">
|
|
35
|
+
<router-link
|
|
36
|
+
v-if="!state.generalParameters.podcastmaker && routeBackoffice.condition"
|
|
37
|
+
:class="routeBackoffice.class"
|
|
38
|
+
:to="routeBackoffice.path"
|
|
39
|
+
>
|
|
40
|
+
{{ routeBackoffice.title }}
|
|
41
|
+
</router-link>
|
|
42
|
+
</li>
|
|
43
|
+
<hr />
|
|
34
44
|
<template v-if="helpLinks.length">
|
|
35
45
|
<li v-for="helpLink in helpLinks" :key="helpLink.title" class="li-style-none">
|
|
36
46
|
<a
|
|
@@ -44,8 +54,8 @@
|
|
|
44
54
|
<OpenInNewIcon class="ms-1" :size="15"/>
|
|
45
55
|
</a>
|
|
46
56
|
</li>
|
|
57
|
+
<hr />
|
|
47
58
|
</template>
|
|
48
|
-
<hr />
|
|
49
59
|
<li class="li-style-none">
|
|
50
60
|
<a class="octopus-dropdown-item c-hand" href="/logout">
|
|
51
61
|
{{ t("Logout") }}
|
|
@@ -87,7 +97,7 @@ interface RouteInfo{
|
|
|
87
97
|
const props = defineProps({
|
|
88
98
|
isEducation: { default: false, type: Boolean },
|
|
89
99
|
navLabel: { default: "", type: String },
|
|
90
|
-
specificRoutes: { default:
|
|
100
|
+
specificRoutes: { default: ()=>[], type: Array as ()=> Array<RouteInfo> },
|
|
91
101
|
displayUserContent: { default: true, type: Boolean },
|
|
92
102
|
})
|
|
93
103
|
|
|
@@ -100,6 +110,9 @@ const route = useRoute();
|
|
|
100
110
|
//Computed
|
|
101
111
|
const isAuthenticated = computed(() => undefined !== authStore.authProfile?.userId);
|
|
102
112
|
const pathLogin = computed(() => "/sso/login?redirect_url="+encodeURI(apiStore.frontendUrl + route.fullPath));
|
|
113
|
+
const isAuthenticatedWithOrga = computed(() => undefined !== authStore.authOrgaId);
|
|
114
|
+
const organisationsAvailable = computed(() => authStore.authProfile?.organisations ?? []);
|
|
115
|
+
|
|
103
116
|
const helpLinks = computed(() => {
|
|
104
117
|
if (authStore.isGarRole || props.isEducation) {
|
|
105
118
|
return [];
|
|
@@ -109,5 +122,38 @@ const helpLinks = computed(() => {
|
|
|
109
122
|
{ title: t("TutoMag"), href: "https://help.octopus.saooti.com/" },
|
|
110
123
|
];
|
|
111
124
|
});
|
|
125
|
+
const routerBackoffice = computed(() => {
|
|
126
|
+
if(!isAuthenticated.value){
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
return [
|
|
130
|
+
{
|
|
131
|
+
title: t("My space"),
|
|
132
|
+
class: "octopus-dropdown-item show-small-screen",
|
|
133
|
+
path: "/main/priv/backoffice",
|
|
134
|
+
condition: isAuthenticatedWithOrga.value,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
title: t("Upload"),
|
|
138
|
+
class: "octopus-dropdown-item show-small-screen",
|
|
139
|
+
path: "/main/priv/upload",
|
|
140
|
+
condition: isAuthenticatedWithOrga.value && authStore.isRoleContribution,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: t("Edit my profile"),
|
|
144
|
+
class: "octopus-dropdown-item",
|
|
145
|
+
path: "/main/priv/edit/profile",
|
|
146
|
+
condition: true,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: t("Edit my organisation"),
|
|
150
|
+
class: "octopus-dropdown-item",
|
|
151
|
+
path: "/main/priv/edit/organisation",
|
|
152
|
+
condition:
|
|
153
|
+
isAuthenticatedWithOrga.value &&
|
|
154
|
+
(authStore.isRoleOrganisation || 1 < organisationsAvailable.value.length),
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
});
|
|
112
158
|
|
|
113
159
|
</script>
|