|
|
@@ -145,8 +145,7 @@ Page 'Mon abonnement'
|
|
|
<v-col cols="12" v-if="!organizationProfile.isArtistPremiumProduct && (accessProfileStore.isAdmin || accessProfileStore.isCaMember)">
|
|
|
<v-btn
|
|
|
class="btn trialBtn"
|
|
|
- href="https://logiciels.opentalent.fr/opentalent-artist"
|
|
|
- target="_blank"
|
|
|
+ @click="startTrial"
|
|
|
>
|
|
|
Essayer la version premium <i class="fa-solid fa-greater-than small"></i>
|
|
|
</v-btn>
|
|
|
@@ -270,6 +269,11 @@ Page 'Mon abonnement'
|
|
|
</v-expansion-panels>
|
|
|
|
|
|
</LayoutContainer>
|
|
|
+
|
|
|
+ <DialogTrialAllReadyDid
|
|
|
+ :show="showDialog"
|
|
|
+ @closeDialog = "showDialog = false"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -281,6 +285,8 @@ import {useOrganizationProfileStore} from '~/stores/organizationProfile'
|
|
|
import {useEntityFetch} from '~/composables/data/useEntityFetch'
|
|
|
import DolibarrAccount from '~/models/Organization/DolibarrAccount'
|
|
|
import MobytUserStatus from '~/models/Organization/MobytUserStatus'
|
|
|
+import UrlUtils from "~/services/utils/urlUtils";
|
|
|
+import {useAp2iRequestService} from "~/composables/data/useAp2iRequestService";
|
|
|
|
|
|
//meta
|
|
|
definePageMeta({
|
|
|
@@ -293,8 +299,10 @@ const runtimeConfig = useRuntimeConfig()
|
|
|
const {mdAndUp, md} = useDisplay()
|
|
|
const {fetch} = useEntityFetch()
|
|
|
const i18n = useI18n()
|
|
|
+const { apiRequestService } = useAp2iRequestService()
|
|
|
|
|
|
//Init ref
|
|
|
+const showDialog: Ref<boolean> = ref(false)
|
|
|
const openedPanels: Ref<Array<string>> = initPanel()
|
|
|
const organizationProfile = getOrganizationProfile()
|
|
|
const accessProfileStore = useAccessProfileStore()
|
|
|
@@ -393,6 +401,26 @@ function getMobytInformations(): Record<Ref<MobytUserStatus | null>, Ref<boolean
|
|
|
}
|
|
|
return {mobytStatus, mobytPending}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+async function startTrial(){
|
|
|
+ try{
|
|
|
+ const apiV1BaseURL = runtimeConfig.baseUrlLegacy || runtimeConfig.public.baseUrlLegacy
|
|
|
+ await apiRequestService.get(
|
|
|
+ UrlUtils.join(apiV1BaseURL, '/api/trial/is_available')
|
|
|
+ )
|
|
|
+
|
|
|
+ const v1BaseURL = runtimeConfig.baseUrlAdminLegacy || runtimeConfig.public.baseUrlAdminLegacy
|
|
|
+ await navigateTo(UrlUtils.join(v1BaseURL, '#', 'trial'), {
|
|
|
+ external: true
|
|
|
+ })
|
|
|
+ }catch(error){
|
|
|
+ showDialog.value = true
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
|