Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions components/Datasets/FileEditModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<p>
{{ $t(`Attention : l'`) }}
<a
:href="`https://tabular-api.data.gouv.fr/api/resources/${resource.resource?.id}/`"
:href="`${config.tabularApiUrl}/api/resources/${resource.resource?.id}/`"
target="_blank"
class="fr-link"
>
Expand Down Expand Up @@ -150,7 +150,7 @@
<p>
{{ $t('Attention : cette ressource est exposée via une') }}
<a
href="https://www.data.gouv.fr/dataservices/api-tabulaire-data-gouv-fr-beta"
:href="`${siteConfig.url}/dataservices/${runtimeConfig.public.tabularApiDataserviceId}`"
target="_blank"
class="fr-link"
>
Comment on lines 152 to 156
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a simple relative NuxtLink , no?

Expand All @@ -161,7 +161,7 @@
<p>
{{ $t('Si vous supprimez la ressource,') }}
<a
:href="`https://tabular-api.data.gouv.fr/api/resources/${resource.resource?.id}/`"
:href="`${config.tabularApiUrl}/api/resources/${resource.resource?.id}/`"
target="_blank"
class="fr-link"
>
Expand Down Expand Up @@ -199,10 +199,14 @@ import { RiDeleteBin6Line, RiPencilLine } from '@remixicon/vue'
import ModalWithButton from '../Modal/ModalWithButton.vue'
import DescribeResource from './DescribeResource.vue'
import type { CommunityResourceForm, ResourceForm } from '~/types/types'
import { useComponentsConfig } from '../../datagouv-components/src/config'

const { t } = useTranslation()
const { $api } = useNuxtApp()
const formId = useId()
const config = useComponentsConfig()
const siteConfig = useSiteConfig()
const runtimeConfig = useRuntimeConfig()

const props = withDefaults(defineProps<{
openOnMounted?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ const tabsOptions = computed(() => {
options.push({ key: 'downloads', label: t('Téléchargements') })

if (hasTabularData.value) {
options.push({ key: 'swagger', label: t('Swagger') })
options.push({ key: 'api', label: t('API') })
}

return options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,15 @@
</template>
</dl>
</div>
<div v-if="tab.key === 'swagger'">
<div v-if="tab.key === 'api'">
<div class="fr-mb-4w">
<p>{{ t("Cette API est générée automatiquement par {platform} à partir du fichier.", { platform: config.name }) }}</p>
<p>{{ t("- Si le fichier est modifié, l'API sera mise à jour et sa structure pourra changer.") }}</p>
<p>{{ t("- Si le fichier est supprimé, l'API sera également supprimée.") }}</p>
<p>{{ t("Pour des usages pérennes, prévoyez que cette API dépend directement du fichier source.") }}</p>
<p v-if="config.tabularApiUrl">
{{ t("L'URL de base de l'API est {url}", { url: config.tabularApiUrl }) }}
</p>
</div>
<OpenApiViewer
v-if="hasTabularData"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function useResourceCapabilities(
options.push({ key: 'downloads', label: t('Téléchargements') })

if (hasTabularData.value) {
options.push({ key: 'swagger', label: t('Swagger') })
options.push({ key: 'api', label: t('API') })
}

return options
Expand Down
Loading