|
|
@@ -1,25 +1,88 @@
|
|
|
-<!-- Page de détails d'un temps d'enseignement -->
|
|
|
+<!-- Page de détails d'un sous-domaine -->
|
|
|
<template>
|
|
|
<main>
|
|
|
- <FormParametersSubdomain :id="id" v-if="!fetchState.pending"></FormParametersSubdomain>
|
|
|
+ <LayoutContainer>
|
|
|
+ <v-card class="mb-5 mt-4">
|
|
|
+ <FormToolbar title="subdomain" icon="fa-at"/>
|
|
|
+
|
|
|
+ <v-container fluid class="container pa-6">
|
|
|
+ <v-row>
|
|
|
+ <v-col cols="12" sm="12">
|
|
|
+ <v-skeleton-loader
|
|
|
+ v-if="fetchState.pending"
|
|
|
+ type="text"
|
|
|
+ />
|
|
|
+ <div v-else>
|
|
|
+ <div>
|
|
|
+ {{ $t('youRegisteredTheFollowingSubdomain')}} :
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="pa-8">
|
|
|
+ <b>{{ entry.subdomain }}</b> <span class="grey--text">.opentalent.fr</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div v-if="entry.active">
|
|
|
+ <v-icon class="ot_green--text icon small mr-2">
|
|
|
+ fa-solid fa-check
|
|
|
+ </v-icon>
|
|
|
+ {{ $t('subdomainIsCurrentlyActive') }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{ $t('doYouWantToActivateThisSubdomain') }} ?
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mt-6 d-flex flex-row">
|
|
|
+ <v-btn to="/parameters/communication" class="mr-12">{{ $t('back') }}</v-btn>
|
|
|
+ <div v-if="!entry.active">
|
|
|
+ <v-btn color="primary" @click="activateAndQuit">{{ $t('activate') }}</v-btn>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </v-col>
|
|
|
+ </v-row>
|
|
|
+ </v-container>
|
|
|
+ </v-card>
|
|
|
+ </LayoutContainer>
|
|
|
</main>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import {defineComponent, useContext} from '@nuxtjs/composition-api'
|
|
|
+import {computed, ComputedRef, defineComponent, useContext} from '@nuxtjs/composition-api'
|
|
|
import {useDataUtils} from "~/composables/data/useDataUtils";
|
|
|
-import {EducationTiming} from "~/models/Education/EducationTiming";
|
|
|
+import {Subdomain} from "~/models/Organization/Subdomain";
|
|
|
+import {Repository as VuexRepository} from "@vuex-orm/core/dist/src/repository/Repository";
|
|
|
+import {Model, Query} from "@vuex-orm/core";
|
|
|
+import {repositoryHelper} from "~/services/store/repository";
|
|
|
+import {AnyJson} from "~/types/interfaces";
|
|
|
+import {queryHelper} from "~/services/store/query";
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'EditFormParametersEducationTiming',
|
|
|
+ name: 'EditFormParametersSubdomain',
|
|
|
setup () {
|
|
|
- const {$dataProvider, route} = useContext()
|
|
|
+ const {$dataProvider, route, app: { $router }} = useContext()
|
|
|
const {getItemToEdit} = useDataUtils($dataProvider)
|
|
|
const id = parseInt(route.value.params.id)
|
|
|
- const {fetchState} = getItemToEdit(id, EducationTiming)
|
|
|
+ const {fetchState} = getItemToEdit(id, Subdomain)
|
|
|
+
|
|
|
+ const repository: VuexRepository<Model> = repositoryHelper.getRepository(Subdomain)
|
|
|
+ const query: Query = repository.query()
|
|
|
+ const entry: ComputedRef<AnyJson> = computed(() => {
|
|
|
+ return queryHelper.getFlattenEntry(query, id)
|
|
|
+ })
|
|
|
+
|
|
|
+ const activateAndQuit = function() {
|
|
|
+ repositoryHelper.updateStoreFromField(Subdomain, entry.value, '1', 'active')
|
|
|
+ $router.push('/parameters/communication')
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
id,
|
|
|
- fetchState
|
|
|
+ fetchState,
|
|
|
+ entry,
|
|
|
+ activateAndQuit: () => activateAndQuit()
|
|
|
}
|
|
|
}
|
|
|
})
|