Skip to content

Commit

Permalink
Merge pull request #190 from ecolabdata/feat-add-ressource-component
Browse files Browse the repository at this point in the history
npm package @etalab/data.gouv.fr-components + replaced DsfrFileDownloadList by ResourceAccordion
  • Loading branch information
geoffreyaldebert authored Nov 29, 2023
2 parents 34d06fa + 31e9222 commit a3fa475
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"prepare": "husky install"
},
"dependencies": {
"@etalab/data.gouv.fr-components": "^1.6.0",
"@gouvminint/vue-dsfr": "^3.6.0",
"@vueform/multiselect": "^2.6.2",
"axios": "^1.6.2",
Expand Down
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { setupI18n } from '@etalab/data.gouv.fr-components'
import '@etalab/data.gouv.fr-components/dist/style.css'
import '@gouvfr/dsfr/dist/dsfr.min.css'
import '@gouvfr/dsfr/dist/utility/utility.min.css'
import VueDsfr from '@gouvminint/vue-dsfr'
// Import des styles du DSFR
import '@gouvminint/vue-dsfr/styles'
Expand All @@ -19,10 +22,12 @@ import router from './router'

const app = createApp(App)
const pinia = createPinia()
const i18n = setupI18n()

app.use(router)
app.use(VueDsfr, { icons: Object.values(icons) })
app.use(pinia)
app.use(i18n)

app.use(TextClamp)
app.use(LoadingPlugin)
Expand Down
13 changes: 8 additions & 5 deletions src/views/datasets/DatasetDetailView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup>
import { ResourceAccordion } from '@etalab/data.gouv.fr-components'
import { filesize } from 'filesize'
import { computed, onMounted, ref, watchEffect } from 'vue'
import { useRoute } from 'vue-router'
Expand Down Expand Up @@ -146,11 +147,13 @@ watchEffect(async () => {
tab-id="tab-0"
:selected="selectedTabIndex === 0"
>
<DsfrFileDownloadList
class="fr-mt-4w"
:files="files"
title="Fichiers du jeu de données"
/>
<div class="datagouv-components" v-if="selectedTabIndex === 0">
<ResourceAccordion
v-for="resource in dataset.resources"
:datasetId="datasetId"
:resource="resource"
/>
</div>
</DsfrTabContent>
<!-- Réutilisations -->
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default defineConfig(({ mode }) => {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@root': resolve(__dirname, './'),
'@siteConfig': fileURLToPath(new URL(configDir, import.meta.url))
'@siteConfig': fileURLToPath(new URL(configDir, import.meta.url)),
vue: 'vue/dist/vue.esm-bundler.js'
}
},
test: {
Expand Down

0 comments on commit a3fa475

Please sign in to comment.