Skip to content
Snippets Groups Projects
Commit 5887359c authored by Mathieu Dartigues's avatar Mathieu Dartigues
Browse files

fix: Réparation du build

* import manuel de la variable `t` pour traduire
* transformation de OcLink en setup lang="ts"
* fix du composant OcLink sur le typage
* et d'autres corrections
parent cb530b59
No related branches found
No related tags found
1 merge request!6Ajout de la CI/CD
......@@ -31,7 +31,7 @@ build:
artifacts:
expire_in: 3 week
paths:
- /dist/
- ./dist/
deploy:
stage: deploy
......
......@@ -5,8 +5,11 @@
<p class="m-0 font-bold line-clamp-5">
{{ description }}
</p>
<OcLink :title="$t('home.goToCommunity', { label: title })" :to="'/community/' + community.name"
class="absolute top-0 left-0 h-full w-full" />
<OcLink
:title="t('home.goToCommunity', { label: title })"
:to="'/community/' + community.name"
class="absolute top-0 left-0 h-full w-full"
/>
</div>
</template>
......@@ -24,7 +27,7 @@ const props = defineProps({
}
})
const { locale, fallbackLocale } = useI18n()
const { locale, fallbackLocale, t } = useI18n()
const title = computed(() => translateValue(props.community.title, locale.value, fallbackLocale.value) ?? '')
const description = computed(() => translateValue(props.community.description, locale.value, fallbackLocale.value) ?? '')
......
......@@ -2,18 +2,18 @@
<Form class="flex flex-col gap-2" :validation-schema="validationSchema"
@submit="emit('login', $event.username, $event.password)">
<Field name="username" v-slot="{ field, errorMessage }">
<label for="username">{{ $t('connection.username') }}</label>
<label for="username">{{ t('connexion.username') }}</label>
<InputText id="username" v-bind="field" :invalid="!!errorMessage" />
<Message v-if="errorMessage" severity="error">{{ errorMessage }}</Message>
</Field>
<Field name="password" v-slot="{ value, errorMessage, handleChange }">
<label for="password">{{ $t('connection.password') }}</label>
<label for="password">{{ t('connexion.password') }}</label>
<Password id="password" :model-value="value" @update:model-value="handleChange" :feedback="false"
:invalid="!!errorMessage" pt:pcInput:root="w-full" toggleMask />
<Message v-if="errorMessage" severity="error">{{ errorMessage }}</Message>
</Field>
<div class="flex justify-end mt-4">
<Button rounded type="submit">{{ $t('connection.login') }}</Button>
<Button rounded type="submit">{{ t('connexion.login') }}</Button>
</div>
</form>
</template>
......
<template>
<RouterLink v-bind="routerLinkProps">
<RouterLink :to="routerLinkPropsTo">
<slot />
</RouterLink>
</template>
<script setup>
<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { RouterLink } from 'vue-router'
const props = defineProps({
...RouterLink.props
})
import { type RouterLinkProps } from 'vue-router'
const { locale } = useI18n()
const routerLinkProps = computed(() => {
return {
...props,
to: '/' + locale.value + props.to
}
})
const props = defineProps<RouterLinkProps>()
const routerLinkPropsTo = computed(() => '/' + locale.value + props.to)
</script>
\ No newline at end of file
<template>
<div class="flex items-center">
<Button v-if="!isAuthenticated" rounded :as="OcLink" to="/connection" size="small">{{ $t('topMenu.signIn')
}}</Button>
<Button
v-if="!isAuthenticated"
rounded
:as="OcLink"
to="/connexion"
size="small"
>
{{ t('topMenu.signIn')}}
</Button>
<Menubar ref="menu" id="overlay_menu_top" :model="menuItems" :popup="true" :style="menuStyle" />
</div>
</template>
......
......@@ -6,25 +6,31 @@
</header>
<div class="flex flex-col items-center p-10">
<h1 class="font-title text-6xl font-bold text-primary mb-8">
{{ $t('error.title') }} {{ $route.query.code }}
{{ t('error.title') }} {{ route.query.code }}
</h1>
<div class="mb-8">
<p v-if="$route.query.code === '404' && $route.query.from">
{{ $t('error.notFoundMessage.1') }}
<code class="bg-gray-200 rounded py-1 px-2">{{ $route.query.from }}</code>
{{ $t('error.notFoundMessage.2') }}
<p v-if="route.query.code === '404' && route.query.from">
{{ t('error.notFoundMessage.1') }}
<code class="bg-gray-200 rounded py-1 px-2">{{ route.query.from }}</code>
{{ t('error.notFoundMessage.2') }}
</p>
<p v-else>
{{ $t('error.genericMessage') }}
{{ t('error.genericMessage') }}
</p>
</div>
<Button rounded :as="OcLink" to="">{{ $t('backHome') }}</Button>
<Button rounded :as="OcLink" to="">{{ t('backHome') }}</Button>
</div>
</template>
<script setup lang="ts">
import OcLink from '@/components/OcLink.vue';
import Button from 'primevue/button';
import OcLink from '@/components/OcLink.vue'
import Button from 'primevue/button'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
const route = useRoute()
const { t } = useI18n()
</script>
\ No newline at end of file
......@@ -3,25 +3,31 @@
<div class="w-11/12 md:w-10/12 xl:w-7/12">
<img src="/logo.png" class="h-16" />
<p class="font-title font-bold text-5xl uppercase text-primary mb-4">Open Common</p>
<p class="text-lg line mb-4">{{ $t('connection.catchphrase') }}</p>
<p class="text-lg line mb-4">{{ t('connection.catchphrase') }}</p>
<Message class="mb-4" severity="error" v-if="loginError">{{ $t('connection.errorOnLogin') }}</Message>
<Message class="mb-4" severity="error" v-if="loginError">{{ t('connection.errorOnLogin') }}</Message>
<OcConnectionForm v-if="!accountStore.isAuthenticated" @login="connection" />
<Message v-else severity="warn">{{ $t('connection.alreadyLoggedIn', { login: accountStore.infos?.loginID }) }}
<Message v-else severity="warn">{{ t('connection.alreadyLoggedIn', { login: accountStore.infos?.loginID }) }}
</Message>
<hr class="my-8" />
<div class="flex justify-center">
<Button outlined rounded :as="OcLink" to="/register">{{ $t('connection.createAccount') }}</Button>
<Button outlined rounded :as="OcLink" to="/register">{{ t('connection.createAccount') }}</Button>
</div>
<hr class="my-8" />
<div class="flex justify-center">
<Button :as="OcLink" to="" severity="secondary" rounded>{{ $t('connection.continueAsGuest')
}}</Button>
<Button
:as="OcLink"
to=""
severity="secondary"
rounded
>
{{ t('connection.continueAsGuest') }}
</Button>
</div>
</div>
</OcLayoutBiColumn>
......@@ -37,9 +43,11 @@ import Button from 'primevue/button';
import Message from 'primevue/message';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'
const accountStore = useAccountStore()
const router = useRouter()
const { t } = useI18n()
const loginError = ref(false)
......
......@@ -22,7 +22,7 @@
</header>
<div class="w-11/12 md:w-10/12 lg:w-9/12 xl:w-7/12 mx-auto mb-10">
<p class="font-bold mb-4 text-center text-xl">{{ $t('communities') }}</p>
<p class="font-bold mb-4 text-center text-xl">{{ t('communities') }}</p>
<div class="flex justify-center flex-wrap gap-4">
<OcCardCommunity
v-for="(community, index) in communityStore.state.data"
......
<template>
<OcLayoutSimple :is-authenticated="!!accountStore.isAuthenticated">
<div class="shadow-lg p-8">
<h1 class="text-xl font-bold mb-8">{{ $t('profile.profile') }}</h1>
<h1 class="text-xl font-bold mb-8">{{ t('profile.profile') }}</h1>
<ul class=" list-disc pl-4">
<li>
<span class="font-bold">{{ $t('profile.email') }}:</span>
<span class="font-bold">{{ t('profile.email') }}:</span>
{{ email }}
</li>
<li>
<span class="font-bold">{{ $t('profile.familyName') }}:</span>
<span class="font-bold">{{ t('profile.familyName') }}:</span>
{{ accountStore.profile?.familyName }}
</li>
<li>
<span class="font-bold">{{ $t('profile.givenName') }}:</span>
<span class="font-bold">{{ t('profile.givenName') }}:</span>
{{ accountStore.profile?.givenName }}
</li>
<li>
<span class="font-bold">{{ $t('profile.description') }}:</span>
<span class="font-bold">{{ t('profile.description') }}:</span>
{{ accountStore.profile?.description }}
</li>
<li>
<span class="font-bold">{{ $t('profile.homepage') }}:</span>
<span class="font-bold">{{ t('profile.homepage') }}:</span>
{{ accountStore.profile?.homepage }}
</li>
<li>
<span class="font-bold">{{ $t('profile.topicInterest') }}:</span>
<span class="font-bold">{{ t('profile.topicInterest') }}:</span>
{{ accountStore.profile?.homepage }}
</li>
</ul>
......@@ -37,8 +37,10 @@
import OcLayoutSimple from '@/layout/OcLayoutSimple/OcLayoutSimple.vue'
import { useAccountStore } from '@/stores/account'
import { computed } from 'vue';
import { useI18n } from 'vue-i18n'
const accountStore = useAccountStore()
const { t } = useI18n()
const email = computed(() => Array.isArray(accountStore.profile?.mbox) ? accountStore.profile?.mbox.join(', ') : accountStore.profile?.mbox);
</script>
......@@ -2,7 +2,7 @@ import { getMemberInfos, getMemberProfile } from "./members"
import { executeSparqlInsert } from "./sparql"
// import DigestClient from "digest-fetch"
export async function connect(/* username: string, password: string */) {
export async function connect(_username: string, _password: string) {
// await fetch(
// `${import.meta.env.VITE_OC_BASE_URL}/sparql-auth`,
// {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment