diff --git a/package-lock.json b/package-lock.json index 91f51d9546dc4352f1b478b92a3d0d96e437ce2d..b99f39edffbedd9cfc41d1f8f814d0e87b72226c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7298,25 +7298,6 @@ "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", "license": "MIT" }, - "node_modules/@storybook/addon-a11y": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-8.5.6.tgz", - "integrity": "sha512-LsJ93KTT9f3EW1XamH1U4zZaCbiP5wFWjQm3nw3meGZC1FE2X6vaaIEERVJwUtIPZtEU94Cu1WD15/FZqnpmAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@storybook/addon-highlight": "8.5.6", - "@storybook/test": "8.5.6", - "axe-core": "^4.2.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "peerDependencies": { - "storybook": "^8.5.6" - } - }, "node_modules/@storybook/addon-actions": { "version": "8.5.6", "resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-8.5.6.tgz", @@ -7357,23 +7338,6 @@ "storybook": "^8.5.6" } }, - "node_modules/@storybook/addon-highlight": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/@storybook/addon-highlight/-/addon-highlight-8.5.6.tgz", - "integrity": "sha512-uuwBe+FwT9vKbEG9S/yqwZLD1GP3y5Mpu2gsiNcYcfhxHpwDQVbknOSeJJig/CGhuDMqy95GcgItIs/kPPFKqg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@storybook/global": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "peerDependencies": { - "storybook": "^8.5.6" - } - }, "node_modules/@storybook/addon-interactions": { "version": "8.5.6", "resolved": "https://registry.npmjs.org/@storybook/addon-interactions/-/addon-interactions-8.5.6.tgz", @@ -10335,16 +10299,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/axe-core": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.2.tgz", - "integrity": "sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==", - "dev": true, - "license": "MPL-2.0", - "engines": { - "node": ">=4" - } - }, "node_modules/axios": { "version": "1.7.9", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", @@ -31124,7 +31078,6 @@ "@babel/preset-env": "^7.26.8", "@rollup/plugin-inject": "^5.0.5", "@rollup/plugin-node-resolve": "^15.3.0", - "@storybook/addon-a11y": "^8.5.5", "@storybook/addon-actions": "^8.5.5", "@storybook/addon-controls": "^8.5.5", "@storybook/addon-interactions": "^8.5.5", diff --git a/packages/ui/.storybook/main.ts b/packages/ui/.storybook/main.ts index c142d42ba5e6c01df509037d2fef4d8ab492ab0b..c61a462198b0bbaddeeda19b052e82798a57c6b7 100644 --- a/packages/ui/.storybook/main.ts +++ b/packages/ui/.storybook/main.ts @@ -1,10 +1,13 @@ import { dirname, join } from 'path' import type { StorybookConfig } from '@storybook/vue3-vite' import { rollupOptions } from '../vite-rollup' -import { optimizeDeps } from 'vite' + const config: StorybookConfig = { stories: ['../src/components/titre.stories.tsx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], - addons: [getAbsolutePath('@storybook/addon-actions'), getAbsolutePath('@storybook/addon-controls'), getAbsolutePath('@storybook/addon-interactions'), getAbsolutePath('@storybook/addon-a11y')], + addons: [getAbsolutePath('@storybook/addon-actions'), getAbsolutePath('@storybook/addon-controls'), getAbsolutePath('@storybook/addon-interactions'), + // TODO 2025-02-19: à partir des version 8.5.x de storybook, l'addon a11y génère plusieurs warnings en console et, surtout, fait échouer certains tests de manière aléatoire : https://github.com/storybookjs/storybook/issues/30472 + // getAbsolutePath('@storybook/addon-a11y') + ], framework: '@storybook/vue3-vite', docs: {}, core: { disableTelemetry: true }, diff --git a/packages/ui/package.json b/packages/ui/package.json index 216cf0dff962cddcc346a2562138f54d208bb059..eace0e9841668a245a427b8a0a8e7ddd979192fe 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -23,7 +23,6 @@ "@babel/preset-env": "^7.26.8", "@rollup/plugin-inject": "^5.0.5", "@rollup/plugin-node-resolve": "^15.3.0", - "@storybook/addon-a11y": "^8.5.5", "@storybook/addon-actions": "^8.5.5", "@storybook/addon-controls": "^8.5.5", "@storybook/addon-interactions": "^8.5.5", diff --git a/packages/ui/src/api/client-rest.ts b/packages/ui/src/api/client-rest.ts index 8d65a1932c6e9476d1f336fefae339808bf2b5e5..cdcef8c9a1afc6baf10db046c5344fd712b127a5 100644 --- a/packages/ui/src/api/client-rest.ts +++ b/packages/ui/src/api/client-rest.ts @@ -15,7 +15,7 @@ import { NewPutRestRoutes, NewDeleteRestRoutes, } from 'camino-common/src/rest' -import { isNotNullNorUndefined } from 'camino-common/src/typescript-tools' +import { isNotNullNorUndefined, isNotNullNorUndefinedNorEmpty } from 'camino-common/src/typescript-tools' import { CaminoError } from 'camino-common/src/zod-tools' import { ZodType, z } from 'zod' @@ -85,6 +85,41 @@ type GetWithJsonArgs<T extends GetRestRoutes | NewGetRestRoutes, Method extends export const getWithJson = async <T extends GetRestRoutes>(...args: GetWithJsonArgs<T, 'get'>): Promise<z.infer<(typeof CaminoRestRoutes)[T]['get']['output']>> => callFetch(args[0], args[1], 'get', args.length === 3 ? args[2] : {}) +export const downloadBlob = async <T extends DownloadRestRoutes>( + path: T, + params: CaminoRestParams<T>, + searchParams: Record<string, string> = {} +): Promise<{ data: Blob; filename: string } | undefined> => { + const url = getUiRestRoute(path, params, searchParams) + + const fetched = await fetch(url) + if (fetched.ok) { + if (fetched.status === 200) { + let filename: string = 'telechargement_camino' + + const contentDisposition = fetched.headers.get('Content-Disposition') + if (isNotNullNorUndefinedNorEmpty(contentDisposition)) { + const filenameMatch = contentDisposition.match(/filename=(.+)/) + if (isNotNullNorUndefinedNorEmpty(filenameMatch) && filenameMatch.length > 1) { + filename = filenameMatch[1] + } + } + + return { data: await fetched.blob(), filename } + } + + return + } + + if (fetched.status === HTTP_STATUS.UNAUTHORIZED) { + window.location.replace('/oauth2/sign_in?rd=' + encodeURIComponent(window.location.href)) + } + + console.error(`Une erreur s'est produite lors de la récupération des données ${await fetched.text()}`) + // TODO 2024-05-02 améliorer la gestion du status http + throw new CaminoHttpError(`Une erreur s'est produite lors de la récupération des données`, fetched.status as HttpStatus) +} + const errorMessage: CaminoError<string> = { message: "L'api est inaccessible" } export const newGetWithJson = async <T extends NewGetRestRoutes>(...args: GetWithJsonArgs<T, 'newGet'>): Promise<CaminoError<string> | z.infer<(typeof CaminoRestRoutes)[T]['newGet']['output']>> => { try { diff --git a/packages/ui/src/components/_common/demande-titre-button.tsx b/packages/ui/src/components/_common/demande-titre-button.tsx index 69ebf99c7d29bd97526aa0af65fa9e488f9246f2..f4fa8f6e4c4697d4feabe9a0bca35e085ebc9a84 100644 --- a/packages/ui/src/components/_common/demande-titre-button.tsx +++ b/packages/ui/src/components/_common/demande-titre-button.tsx @@ -6,7 +6,7 @@ import { DsfrLink } from '../_ui/dsfr-button' export const DemandeTitreButton: FunctionalComponent<{ user: User }> = ({ user }) => { if (TitresTypesIds.some(titreTypeId => canCreateTitre(user, titreTypeId))) { - return <DsfrLink to={{ name: 'titreCreation', params: {} }} buttonType="primary" title="Demander un titre" icon="fr-icon-add-line" disabled={false} /> + return <DsfrLink to={{ name: 'titreCreation', params: {} }} buttonType="primary" title="Demander un titre" icon={{ name: 'fr-icon-add-line', position: 'right' }} disabled={false} /> } return null diff --git a/packages/ui/src/components/_common/downloads.stories.tsx b/packages/ui/src/components/_common/downloads.stories.tsx index 6c1690ce47daf01cce10ea6b9b218f290970e158..321927bea05282e1c8562145e08c4678b6a8b98b 100644 --- a/packages/ui/src/components/_common/downloads.stories.tsx +++ b/packages/ui/src/components/_common/downloads.stories.tsx @@ -8,10 +8,6 @@ const meta: Meta = { } export default meta -export const Default: StoryFn = () => <PureDownloads formats={['geojson', 'xlsx']} downloadRoute={'/demarches'} params={{}} route={{ query: {} }} id="id" /> +export const Default: StoryFn = () => <PureDownloads downloadTitle="Télécharger les démarches" formats={['geojson', 'xlsx']} downloadRoute={'/demarches'} params={{}} route={{ query: {} }} id="id" /> -export const OnlyOneFormat: StoryFn = () => <PureDownloads formats={['pdf']} downloadRoute={'/demarches'} params={{}} route={{ query: {} }} id="id" /> - -export const WithOverridenTitle: StoryFn = () => ( - <PureDownloads formats={['pdf']} downloadRoute={'/demarches'} params={{}} route={{ query: {} }} id="id" downloadTitle="Surchage du titre du bouton de téléchargement" /> -) +export const OnlyOneFormat: StoryFn = () => <PureDownloads downloadTitle="Télécharger les démarches" formats={['pdf']} downloadRoute={'/demarches'} params={{}} route={{ query: {} }} id="id" /> diff --git a/packages/ui/src/components/_common/downloads.stories_snapshots_Default.html b/packages/ui/src/components/_common/downloads.stories_snapshots_Default.html index 1d969bb5bb9696c0133400133c29612e2ba7d598..554426577fcce7eef3ddc48c08289d81eb5bde7d 100644 --- a/packages/ui/src/components/_common/downloads.stories_snapshots_Default.html +++ b/packages/ui/src/components/_common/downloads.stories_snapshots_Default.html @@ -1,11 +1,3 @@ -<div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="id" aria-label="Téléchargements" name="id"> - <option value="geojson">geojson</option> - <option value="xlsx">xlsx</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> -</div> \ No newline at end of file +<button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les démarches" aria-label="Télécharger les démarches" type="button"> + <!----> +</button> \ No newline at end of file diff --git a/packages/ui/src/components/_common/downloads.stories_snapshots_OnlyOneFormat.html b/packages/ui/src/components/_common/downloads.stories_snapshots_OnlyOneFormat.html index 864bec479982224062e14e897868701b8acbf1c6..7fd6fa1803169cf8e2360023bf2dcb4ae1cc9f93 100644 --- a/packages/ui/src/components/_common/downloads.stories_snapshots_OnlyOneFormat.html +++ b/packages/ui/src/components/_common/downloads.stories_snapshots_OnlyOneFormat.html @@ -1,5 +1,5 @@ -<div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger au format pdf" aria-label="Télécharger au format pdf" type="button"> +<div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger les démarches" aria-label="Télécharger les démarches" type="button"> <!----> </button> + <!----> </div> \ No newline at end of file diff --git a/packages/ui/src/components/_common/downloads.stories_snapshots_WithOverridenTitle.html b/packages/ui/src/components/_common/downloads.stories_snapshots_WithOverridenTitle.html deleted file mode 100644 index 1a4dc92096163d379783611845cd5310073a84c0..0000000000000000000000000000000000000000 --- a/packages/ui/src/components/_common/downloads.stories_snapshots_WithOverridenTitle.html +++ /dev/null @@ -1,5 +0,0 @@ -<div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Surchage du titre du bouton de téléchargement" aria-label="Surchage du titre du bouton de téléchargement" type="button"> - <!----> - </button> -</div> \ No newline at end of file diff --git a/packages/ui/src/components/_common/downloads.tsx b/packages/ui/src/components/_common/downloads.tsx index 148034a5d78956adb31a610a6332cbe12bed18e8..b16da074027d1239d23fc2839361a94ac40267f7 100644 --- a/packages/ui/src/components/_common/downloads.tsx +++ b/packages/ui/src/components/_common/downloads.tsx @@ -1,12 +1,15 @@ -import { ref, defineComponent, HTMLAttributes, watch } from 'vue' +import { defineComponent, HTMLAttributes, ref } from 'vue' import { useRoute } from 'vue-router' -import { DsfrSelect, Item } from '../_ui/dsfr-select' import { DownloadRestRoutes, DownloadFormat, CaminoRestParams } from 'camino-common/src/rest' -import { NonEmptyArray, isNonEmptyArray, isNotNullNorUndefined } from 'camino-common/src/typescript-tools' -import { getDownloadRestRoute } from '@/api/client-rest' -import { saveAs } from 'file-saver' +import { NonEmptyArray } from 'camino-common/src/typescript-tools' +import { AsyncData, downloadBlob } from '@/api/client-rest' import { DsfrButtonIcon } from '../_ui/dsfr-button' import { CaminoRouteLocation } from '@/router/routes' +import { useState } from '@/utils/vue-tsx-utils' +import { FunctionalPopup } from '../_ui/functional-popup' +import { DsfrInputRadio, RadioElement } from '../_ui/dsfr-input-radio' +import { Alert } from '../_ui/alert' +import { LoadingElement } from '../_ui/functional-loader' export const Downloads = defineComponent(<T extends DownloadRestRoutes>(props: Omit<Props<T>, 'route'>) => { const route = useRoute() @@ -24,63 +27,114 @@ export interface Props<T extends DownloadRestRoutes> { downloadRoute: T params: CaminoRestParams<T> route: Pick<CaminoRouteLocation, 'query'> - downloadTitle?: string + downloadTitle: string } +const download = async <T extends DownloadRestRoutes>(route: T, params: CaminoRestParams<T>, format: DownloadFormat | null, query: CaminoRouteLocation['query']): Promise<void> => { + if (format === null) { + return + } + + const response = await downloadBlob(route, params, { format, ...query }) + if (response === undefined) { + return + } + + const url = window.URL.createObjectURL(response.data) + const hiddenElement = document.createElement('a') + hiddenElement.href = url + hiddenElement.target = '_blank' + hiddenElement.download = response.filename + hiddenElement.click() +} + +const isArrayWith2Elements = <T,>(elements: Readonly<NonEmptyArray<T>>): elements is Readonly<[T, T, ...T[]]> => { + return elements.length > 1 +} export const PureDownloads = defineComponent(<T extends DownloadRestRoutes>(props: Props<T>) => { - const downloadFormat = ref<DownloadFormat | null>(null) - - watch( - () => props.formats, - formats => { - if (formats.length === 1) { - downloadFormat.value = formats[0] - } - }, - { immediate: true, deep: true } - ) + const [dowloadPopup, setDownloadPopup] = useState<boolean>(false) + + const downloadResult = ref<AsyncData<null>>({ + status: 'LOADED', + value: null, + }) + const downloadSingleFormat = async (): Promise<void> => { + if (downloadResult.value.status === 'LOADING') { + return + } + + downloadResult.value = { status: 'LOADING' } + try { + await download(props.downloadRoute, props.params, props.formats[0], props.route.query) + downloadResult.value = { status: 'LOADED', value: null } + } catch (e: any) { + downloadResult.value = { status: 'ERROR', message: e.message ?? "Une erreur s'est produite" } + } + } - const items: Item<DownloadFormat>[] = props.formats.map(f => ({ id: f, label: f })) - if (isNonEmptyArray(items)) { - return () => ( - <div style={{ display: 'flex' }}> - {props.formats.length > 1 ? ( - <DsfrSelect - required={false} - id={props.id} - class="fr-mr-1v" - items={items} - legend={{ main: 'Téléchargements', visible: false, placeholder: "Choississez un format d'export" }} - initialValue={downloadFormat.value} - valueChanged={id => { - downloadFormat.value = id - }} - /> - ) : null} - - <DsfrButtonIcon - icon="fr-icon-file-download-line" - buttonType="secondary" - disabled={downloadFormat.value === null} - title={ - isNotNullNorUndefined(props.downloadTitle) ? props.downloadTitle : downloadFormat.value !== null ? `Télécharger au format ${downloadFormat.value}` : 'Télécharger (choisissez le format)' - } - onClick={() => download(downloadFormat.value, props.route.query, props)} - /> - </div> - ) - } else { - return () => null + const openDownloadPopup = () => { + setDownloadPopup(true) + } + const closeDownloadPopup = () => { + setDownloadPopup(false) } + + return () => ( + <> + {isArrayWith2Elements(props.formats) ? ( + <> + <DsfrButtonIcon icon="fr-icon-file-download-line" buttonType="secondary" title={props.downloadTitle} onClick={openDownloadPopup} /> + {dowloadPopup.value ? <DownloadPopup close={closeDownloadPopup} {...props} formats={props.formats} /> : null} + </> + ) : ( + <div style={{ display: 'flex', gap: '1rem' }}> + {downloadResult.value.status !== 'LOADING' ? <DsfrButtonIcon icon="fr-icon-download-line" buttonType="secondary" title={props.downloadTitle} onClick={downloadSingleFormat} /> : null} + {downloadResult.value.status !== 'LOADED' ? <LoadingElement data={downloadResult.value} renderItem={() => null} /> : null} + </div> + )} + </> + ) }) // @ts-ignore waiting for https://github.com/vuejs/core/issues/7833 PureDownloads.props = ['formats', 'downloadRoute', 'params', 'route', 'id', 'downloadTitle', 'class'] -async function download<T extends DownloadRestRoutes>(selectedFormat: DownloadFormat | null, query: CaminoRouteLocation['query'], props: Omit<Props<T>, 'formats' | 'route'>) { - if (selectedFormat !== null) { - const url = getDownloadRestRoute(props.downloadRoute, props.params, { format: selectedFormat, ...query }) +interface DownloadPopupProps<T extends DownloadRestRoutes> { + id?: string + formats: readonly [DownloadFormat, DownloadFormat, ...DownloadFormat[]] + downloadRoute: T + params: CaminoRestParams<T> + route: Pick<CaminoRouteLocation, 'query'> + downloadTitle: string + close: () => void +} +const DownloadPopup = defineComponent(<T extends DownloadRestRoutes>(props: DownloadPopupProps<T>) => { + const [downloadFormat, setDownloadFormat] = useState<DownloadFormat | null>(null) - saveAs(url) + const items: RadioElement<DownloadFormat>[] = props.formats.map(f => ({ itemId: f, legend: { main: f } })) + const fileTypeSelected = (value: DownloadFormat) => { + setDownloadFormat(value) } -} + const content = () => ( + <form> + <DsfrInputRadio legend={{ main: 'Choisissez le format du fichier que vous souhaitez' }} required={true} orientation="horizontal" valueChanged={fileTypeSelected} elements={items} /> + <Alert small={true} type="info" title={'Une fois le téléchargement effectué, cette fenêtre se fermera automatiquement'} /> + </form> + ) + + return () => ( + <FunctionalPopup + title={props.downloadTitle} + content={content} + close={props.close} + validate={{ + text: 'Télécharger', + action: () => download(props.downloadRoute, props.params, downloadFormat.value, props.route.query), + }} + canValidate={downloadFormat.value !== null} + /> + ) +}) + +// @ts-ignore waiting for https://github.com/vuejs/core/issues/7833 +DownloadPopup.props = ['formats', 'downloadRoute', 'params', 'route', 'id', 'downloadTitle', 'close'] diff --git a/packages/ui/src/components/_common/dsfr-perimetre-table.tsx b/packages/ui/src/components/_common/dsfr-perimetre-table.tsx index 59b31fdb06d163444c4fa306084ef734d10b8002..e2b6b7f8920bc68f1b688f665fe83485b842e3c8 100644 --- a/packages/ui/src/components/_common/dsfr-perimetre-table.tsx +++ b/packages/ui/src/components/_common/dsfr-perimetre-table.tsx @@ -99,7 +99,7 @@ const TablePoints: FunctionalComponent<Pick<Props, 'geo_systeme_id' | 'geojson_o style={{ marginLeft: 'auto' }} href={`data:${contentTypes.csv};charset=utf-8,${csvContent}`} download={`points-${props.titreSlug}.csv`} - icon="fr-icon-download-line" + icon={{ name: 'fr-icon-download-line', position: 'right' }} buttonType="secondary" title="Télécharge les points au format csv" label=".csv" @@ -135,7 +135,7 @@ const TableForages: FunctionalComponent<NotNullableKeys<Pick<Props, 'geo_systeme style={{ alignSelf: 'end' }} href={`data:${contentTypes.csv};charset=utf-8,${csvContent}`} download={`forages-${props.titreSlug}.csv`} - icon="fr-icon-download-line" + icon={{ name: 'fr-icon-download-line', position: 'right' }} buttonType="secondary" title="Télécharge les forages au format csv" label=".csv" diff --git a/packages/ui/src/components/_common/dsfr-perimetre.tsx b/packages/ui/src/components/_common/dsfr-perimetre.tsx index 90424fc84386ced3fc79241f6857c7474b0592a2..dea55179eff54e1e92adc4d0c7db30b24376de0e 100644 --- a/packages/ui/src/components/_common/dsfr-perimetre.tsx +++ b/packages/ui/src/components/_common/dsfr-perimetre.tsx @@ -123,7 +123,7 @@ const TabCaminoMap = defineComponent<TabCaminoMapProps>(props => { class="fr-mr-2w" href={`data:${contentTypes.geojson};charset=utf-8,${encodeURI(JSON.stringify(geojson_origine.value))}`} download={`perimetre-${props.titreSlug}-${props.perimetre.geojson_origine_geo_systeme_id}.geojson`} - icon="fr-icon-download-line" + icon={{ name: 'fr-icon-download-line', position: 'right' }} buttonType="secondary" title={`Télécharge le périmètre au format geojson dans le référentiel d'origine ${props.perimetre.geojson_origine_geo_systeme_id}`} label={`.geojson (${props.perimetre.geojson_origine_geo_systeme_id})`} @@ -132,7 +132,7 @@ const TabCaminoMap = defineComponent<TabCaminoMapProps>(props => { <DsfrLink href={`data:${contentTypes.geojson};charset=utf-8,${encodeURI(JSON.stringify(geojson_4326.value))}`} download={`perimetre-${props.titreSlug}-4326.geojson`} - icon="fr-icon-download-line" + icon={{ name: 'fr-icon-download-line', position: 'right' }} buttonType="secondary" title="Télécharge le périmètre au format geojson dans le référentiel 4326" label=".geojson (4326)" diff --git a/packages/ui/src/components/_common/page-header-content.tsx b/packages/ui/src/components/_common/page-header-content.tsx index 05ab946cd3bb4f2674ea2f3bfc344d335ccff65c..c3f6693879a9376e3c059317fecf945d0cc01009 100644 --- a/packages/ui/src/components/_common/page-header-content.tsx +++ b/packages/ui/src/components/_common/page-header-content.tsx @@ -3,22 +3,23 @@ import { FunctionalComponent } from 'vue' import { Downloads, Props as DownloadProps } from './downloads' import { DownloadRestRoutes } from 'camino-common/src/rest' import type { JSX } from 'vue/jsx-runtime' +import { fr } from '@codegouvfr/react-dsfr' export type Props = { nom: string renderButton: (() => JSX.Element) | null - download: Pick<DownloadProps<DownloadRestRoutes>, 'formats' | 'params' | 'downloadRoute' | 'id'> | null + download: Pick<DownloadProps<DownloadRestRoutes>, 'formats' | 'params' | 'downloadRoute' | 'id' | 'downloadTitle'> | null } export const PageContentHeader: FunctionalComponent<Props> = props => { return ( - <div class="fr-grid-row"> - <div class="fr-col-12 fr-col-md-6"> + <div class={fr.cx('fr-grid-row')}> + <div class={fr.cx('fr-col-12', 'fr-col-md-6')}> <h1>{capitalize(props.nom)}</h1> </div> - <div class="fr-col-12 fr-col-md-6" style={{ display: 'flex', flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'flex-end' }}> + <div class={fr.cx('fr-col-12', 'fr-col-md-6')} style={{ display: 'flex', flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'flex-end' }}> {props.download ? <Downloads {...props.download} /> : null} - {props.renderButton !== null ? <div class="fr-ml-1w">{props.renderButton()}</div> : null} + {props.renderButton !== null ? <div class={fr.cx('fr-ml-1w')}>{props.renderButton()}</div> : null} </div> </div> ) diff --git a/packages/ui/src/components/_common/titre-reference-select.tsx b/packages/ui/src/components/_common/titre-reference-select.tsx index 9bfbf9967be6893699f1457cf263067e069531bb..1e53dc3be1ba4258f831d2cc9e728dbaf2417667 100644 --- a/packages/ui/src/components/_common/titre-reference-select.tsx +++ b/packages/ui/src/components/_common/titre-reference-select.tsx @@ -67,7 +67,7 @@ export const TitreReferenceSelect = defineComponent<Props>(props => { ))} {isNullOrUndefined(references.value.find(r => !r.referenceTypeId || !r.nom)) ? ( - <DsfrButton buttonType="tertiary" onClick={referenceAdd} title="Ajouter une référence" icon={'fr-icon-add-line'} /> + <DsfrButton buttonType="tertiary" onClick={referenceAdd} title="Ajouter une référence" icon={{ name: 'fr-icon-add-line', position: 'right' }} /> ) : null} </div> ) diff --git a/packages/ui/src/components/_ui/dsfr-button.stories.tsx b/packages/ui/src/components/_ui/dsfr-button.stories.tsx index f29adb0d40497dbec3b0ad83aaf751fc146037d5..6cab84f8a8b9aa7e5762f2c9e97ed0fd35b24741 100644 --- a/packages/ui/src/components/_ui/dsfr-button.stories.tsx +++ b/packages/ui/src/components/_ui/dsfr-button.stories.tsx @@ -23,7 +23,7 @@ export const All: StoryFn = () => ( </div> ) -export const ButtonWithTextAndIcon: StoryFn = () => <DsfrButton title="Mon title" onClick={onClick} icon="fr-icon-alert-fill" /> +export const ButtonWithTextAndIcon: StoryFn = () => <DsfrButton title="Mon title" onClick={onClick} icon={{ name: 'fr-icon-alert-fill', position: 'right' }} /> export const AllIcon: StoryFn = () => ( <div style={{ display: 'flex', flexDirection: 'column' }}> @@ -40,10 +40,10 @@ export const AllIcon: StoryFn = () => ( export const Link: StoryFn = () => ( <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}> <DsfrLink disabled={false} icon={null} title="Titre" label="Label" to={{ name: 'dashboard', params: {} }} /> - <DsfrLink disabled={false} icon="fr-icon-account-circle-fill" title="Titre" to={{ name: 'dashboard', params: {} }} /> + <DsfrLink disabled={false} icon={{ name: 'fr-icon-account-circle-fill', position: 'right' }} title="Titre" to={{ name: 'dashboard', params: {} }} /> <DsfrLink buttonType="primary" icon={null} disabled={false} title="Titre" to={{ name: 'dashboard', params: {} }} /> - <DsfrLink buttonType="primary" disabled={false} icon="fr-icon-alert-fill" title="Titre" to={{ name: 'dashboard', params: {} }} /> - <DsfrLink buttonType="primary" disabled={false} icon="fr-icon-alert-fill" title="Titre" to={{ name: 'dashboard', params: {} }} label={null} /> + <DsfrLink buttonType="primary" disabled={false} icon={{ name: 'fr-icon-alert-fill', position: 'right' }} title="Titre" to={{ name: 'dashboard', params: {} }} /> + <DsfrLink buttonType="primary" disabled={false} icon={{ name: 'fr-icon-alert-fill', position: 'right' }} title="Titre" to={{ name: 'dashboard', params: {} }} label={null} /> <DsfrLink breadcrumb={true} disabled={false} icon={null} title="Titre" to={{ name: 'dashboard', params: {} }} label={null} /> </div> ) diff --git a/packages/ui/src/components/_ui/dsfr-button.tsx b/packages/ui/src/components/_ui/dsfr-button.tsx index bc0d7145c098586e0f5eec027c46124d279fa3fa..f4bdd0f91b070138b4fa52bb27fe8f925e89ae50 100644 --- a/packages/ui/src/components/_ui/dsfr-button.tsx +++ b/packages/ui/src/components/_ui/dsfr-button.tsx @@ -1,5 +1,5 @@ import { FunctionalComponent, ButtonHTMLAttributes, HTMLAttributes } from 'vue' -import { FrIconClassName } from '@codegouvfr/react-dsfr' +import { fr, FrIconClassName } from '@codegouvfr/react-dsfr' import { CaminoRouterLink } from '../../router/camino-router-link' import { isNotNullNorUndefined } from 'camino-common/src/typescript-tools' @@ -12,10 +12,14 @@ export const buttonSizes = ['sm', 'md', 'lg'] as const type ButtonSize = (typeof buttonSizes)[number] type DsfrButtonProps = { - onClick: () => void + onClick: (e: MouseEvent) => void title: string label?: string - icon?: FrIconClassName + icon?: { + name: FrIconClassName + position: 'left' | 'right' + } + 'aria-controls'?: ButtonHTMLAttributes['aria-controls'] disabled?: boolean buttonType?: ButtonType buttonSize?: ButtonSize @@ -27,8 +31,8 @@ type DsfrButtonProps = { export const DsfrButton: FunctionalComponent<DsfrButtonProps> = (props: DsfrButtonProps) => { const iconClass = [] if (isNotNullNorUndefined(props.icon)) { - iconClass.push('fr-btn--icon-right') - iconClass.push(props.icon) + iconClass.push(props.icon.position === 'left' ? fr.cx('fr-btn--icon-left') : fr.cx('fr-btn--icon-right')) + iconClass.push(props.icon.name) } return ( @@ -38,6 +42,7 @@ export const DsfrButton: FunctionalComponent<DsfrButtonProps> = (props: DsfrButt title={props.title} aria-label={props.title} aria-pressed={props['aria-pressed']} + aria-controls={props['aria-controls']} onClick={props.onClick} type={props.type ?? 'button'} > @@ -46,7 +51,7 @@ export const DsfrButton: FunctionalComponent<DsfrButtonProps> = (props: DsfrButt ) } -type DsfrButtonIconProps = DsfrButtonProps & { icon: FrIconClassName } +type DsfrButtonIconProps = Omit<DsfrButtonProps, 'icon'> & { icon: FrIconClassName } export const DsfrButtonIcon: FunctionalComponent<DsfrButtonIconProps> = (props: DsfrButtonIconProps) => { return ( @@ -67,21 +72,28 @@ type DsfrLinkProps<T extends CaminoRouteNames> = { label?: string | null buttonType?: ButtonType breadcrumb?: true - icon: FrIconClassName | null + icon: { + name: FrIconClassName + position: 'left' | 'right' + } | null + style?: HTMLAttributes['style'] class?: HTMLAttributes['class'] -} & ({ to: CaminoVueRoute<T>; disabled: false } | { href: HTMLAnchorElement['href']; download?: HTMLAnchorElement['download']; target?: HTMLAnchorElement['target']; rel?: HTMLAnchorElement['rel'] }) +} & ( + | { to: CaminoVueRoute<T>; disabled: false } + | { onClick?: () => void; href: HTMLAnchorElement['href']; download?: HTMLAnchorElement['download']; target?: HTMLAnchorElement['target']; rel?: HTMLAnchorElement['rel'] } +) export const DsfrLink = <T extends CaminoRouteNames>(props: DsfrLinkProps<T>): JSX.Element => { const iconClass = [] if (props.icon !== null && props.label !== null) { - iconClass.push(`fr-${props.buttonType ? 'btn' : 'link'}--icon-right`) + iconClass.push(fr.cx(`fr-${props.buttonType ? 'btn' : 'link'}--icon-${props.icon.position}`)) } return ( <> {'to' in props ? ( <CaminoRouterLink - class={[props.class, props.buttonType ? ['fr-btn', `fr-btn--${props.buttonType ?? 'primary'}`] : 'breadcrumb' in props ? 'fr-breadcrumb__link' : 'fr-link', iconClass, props.icon]} + class={[props.class, props.buttonType ? ['fr-btn', `fr-btn--${props.buttonType ?? 'primary'}`] : 'breadcrumb' in props ? 'fr-breadcrumb__link' : 'fr-link', iconClass, props.icon?.name]} isDisabled={props.disabled} title={props.title} to={props.to} @@ -91,13 +103,14 @@ export const DsfrLink = <T extends CaminoRouteNames>(props: DsfrLinkProps<T>): J </CaminoRouterLink> ) : ( <a - class={[props.class, props.buttonType ? ['fr-btn', `fr-btn--${props.buttonType ?? 'primary'}`] : 'fr-link', iconClass, props.icon]} + class={[props.class, props.buttonType ? [fr.cx('fr-btn'), `fr-btn--${props.buttonType ?? 'primary'}`] : fr.cx('fr-link'), iconClass, fr.cx(props.icon?.name)]} title={props.title} href={props.href} download={props.download} target={props.target} style={props.style} rel={props.rel} + onClick={props.onClick} > {isNotNullNorUndefined(props.label) ? props.label : props.title} </a> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories.tsx b/packages/ui/src/components/_ui/dsfr-input-radio.stories.tsx index 9cb0336cf4de25a1922201d6511c64f6abf5c08c..6c6fdbb99338251f7a3326582a0556606a1d1468 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories.tsx +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories.tsx @@ -13,6 +13,7 @@ const valueChangedAction = action('valueChanged') export const Default: StoryFn = () => ( <DsfrInputRadio id="input1" + required={true} legend={{ main: 'Légende' }} valueChanged={valueChangedAction} elements={[ @@ -25,6 +26,7 @@ export const Default: StoryFn = () => ( export const WithDescription: StoryFn = () => ( <DsfrInputRadio + required={true} id="input2" legend={{ main: 'Légende', description: 'description' }} valueChanged={valueChangedAction} @@ -37,6 +39,7 @@ export const WithDescription: StoryFn = () => ( ) export const WithValue: StoryFn = () => ( <DsfrInputRadio + required={true} id="input4" legend={{ main: 'Légende' }} valueChanged={valueChangedAction} @@ -50,6 +53,7 @@ export const WithValue: StoryFn = () => ( ) export const Disabled: StoryFn = () => ( <DsfrInputRadio + required={true} id="input5" disabled={true} legend={{ main: 'Légende' }} @@ -63,6 +67,7 @@ export const Disabled: StoryFn = () => ( ) export const OneElementDisabled: StoryFn = () => ( <DsfrInputRadio + required={true} id="input5" disabled={false} legend={{ main: 'Légende élément 2 désactivé' }} @@ -74,10 +79,10 @@ export const OneElementDisabled: StoryFn = () => ( ]} /> ) -export const Required: StoryFn = () => ( +export const Optional: StoryFn = () => ( <DsfrInputRadio id="input6" - required={true} + required={false} legend={{ main: 'Légende' }} valueChanged={valueChangedAction} elements={[ diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Default.html b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Default.html index 0d2718430dc84f29e110e09194d982d54dd99917..48065eba076aec6bb512fc7a05bd7b695d1bc5d2 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Default.html +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Default.html @@ -1,5 +1,5 @@ <fieldset class="fr-fieldset" id="input1" aria-labelledby="input1-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input1-legend">Légende (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input1-legend">Légende <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Disabled.html b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Disabled.html index 61ce95fb9958d49e82de7847883ceebbc82fe4a2..9dea9d8154127338cba285bd77303c7a96131476 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Disabled.html +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Disabled.html @@ -1,5 +1,5 @@ <fieldset class="fr-fieldset" id="input5" aria-labelledby="input5-legend" style="flex-direction: column; align-items: flex-start;" disabled=""> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input5-legend">Légende (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input5-legend">Légende <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_OneElementDisabled.html b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_OneElementDisabled.html index 46c10fc9412997829dd5b63354d792470df5fca2..6bf4bbfe0d399306ee9edd4d57ae9b36a8d1b92a 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_OneElementDisabled.html +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_OneElementDisabled.html @@ -1,5 +1,5 @@ <fieldset class="fr-fieldset" id="input5" aria-labelledby="input5-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input5-legend">Légende élément 2 désactivé (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input5-legend">Légende élément 2 désactivé <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Required.html b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Optional.html similarity index 95% rename from packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Required.html rename to packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Optional.html index 0f34990bc9a24aae43c027ffb926472738d09e19..c425ff6fb805612cae87a952a253481864031733 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Required.html +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_Optional.html @@ -1,5 +1,5 @@ <fieldset class="fr-fieldset" id="input6" aria-labelledby="input6-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input6-legend">Légende + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input6-legend">Légende (optionnel) <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithDescription.html b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithDescription.html index 0063216f2c3205472e5d9eea8534d76f3ea15729..a52923308b8c1808d6b4bc61e712252259f0d294 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithDescription.html +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithDescription.html @@ -1,5 +1,5 @@ <fieldset class="fr-fieldset" id="input2" aria-labelledby="input2-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input2-legend">Légende (optionnel)<span class="fr-hint-text">description</span></legend> + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input2-legend">Légende <span class="fr-hint-text">description</span></legend> <div class="fr-fieldset__element"> <div class="fr-radio-group"><input type="radio" id="input2-0" name="input2"><label class="fr-label" for="input2-0">checkbox1<span class="fr-hint-text">avec description</span></label></div> </div> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithValue.html b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithValue.html index 0def679d8f7f2ebe0cfe39d7d5e6e2a2a6690ed7..69cc584d944f1d3613148ddf688e36fff8a1e302 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithValue.html +++ b/packages/ui/src/components/_ui/dsfr-input-radio.stories_snapshots_WithValue.html @@ -1,5 +1,5 @@ <fieldset class="fr-fieldset" id="input4" aria-labelledby="input4-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input4-legend">Légende (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="input4-legend">Légende <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/_ui/dsfr-input-radio.tsx b/packages/ui/src/components/_ui/dsfr-input-radio.tsx index 8ef76ff544661b76d7d337326ccba15566b74ea9..875ec28e7faf6eaf3dfd85e498eb3172b0aa2057 100644 --- a/packages/ui/src/components/_ui/dsfr-input-radio.tsx +++ b/packages/ui/src/components/_ui/dsfr-input-radio.tsx @@ -2,16 +2,22 @@ import { isEventWithTarget, random } from '@/utils/vue-tsx-utils' import { isNotNullNorUndefined, isNotNullNorUndefinedNorEmpty } from 'camino-common/src/typescript-tools' import { defineComponent } from 'vue' -type Props<T extends string> = { +export interface RadioElement<T extends string> { + itemId: T + legend: { main: string; description?: string } + disabled?: boolean +} + +interface Props<T extends string> { id?: string legend: { main: string; description?: string } disabled?: boolean - required?: boolean + required: boolean orientation?: 'vertical' | 'horizontal' valueChanged: (value: T) => void initialValue?: T | null size?: 'sm' | 'md' - elements: { itemId: T; legend: { main: string; description?: string }; disabled?: boolean }[] + elements: RadioElement<T>[] } export const DsfrInputRadio = defineComponent(<T extends string>(props: Props<T>) => { diff --git a/packages/ui/src/components/_ui/functional-popup.stories_snapshots_Main.html b/packages/ui/src/components/_ui/functional-popup.stories_snapshots_Main.html index 11d81d6a27d66af52cb3c3713905fdbae8b3dcec..e363f478e37e747857d6c18dfc54fb9a498fc742 100644 --- a/packages/ui/src/components/_ui/functional-popup.stories_snapshots_Main.html +++ b/packages/ui/src/components/_ui/functional-popup.stories_snapshots_Main.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="mainId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="mainId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/_ui/functional-popup.stories_snapshots_NotValid.html b/packages/ui/src/components/_ui/functional-popup.stories_snapshots_NotValid.html index 827ef64ab95f2aaba0cf71596b7948172aa73634..7f5a5e15d281ebe23d3d42071628f5bc46ed6d7c 100644 --- a/packages/ui/src/components/_ui/functional-popup.stories_snapshots_NotValid.html +++ b/packages/ui/src/components/_ui/functional-popup.stories_snapshots_NotValid.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="mainId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="mainId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/_ui/functional-popup.stories_snapshots_SaveError.html b/packages/ui/src/components/_ui/functional-popup.stories_snapshots_SaveError.html index 11d81d6a27d66af52cb3c3713905fdbae8b3dcec..e363f478e37e747857d6c18dfc54fb9a498fc742 100644 --- a/packages/ui/src/components/_ui/functional-popup.stories_snapshots_SaveError.html +++ b/packages/ui/src/components/_ui/functional-popup.stories_snapshots_SaveError.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="mainId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="mainId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/_ui/functional-popup.tsx b/packages/ui/src/components/_ui/functional-popup.tsx index 4b6731ea12b6ca8db534f0a83c7ed23c4083201f..f47660e98e07130aa00d461643c6bec4f82d8961 100644 --- a/packages/ui/src/components/_ui/functional-popup.tsx +++ b/packages/ui/src/components/_ui/functional-popup.tsx @@ -5,22 +5,25 @@ import type { JSX } from 'vue/jsx-runtime' import { CaminoError } from 'camino-common/src/zod-tools' import { createFocusTrap, FocusTrap } from 'focus-trap' import { isNotNullNorUndefined } from 'camino-common/src/typescript-tools' +import { DsfrButton } from './dsfr-button' +import { fr } from '@codegouvfr/react-dsfr' +export type Validate<T> = { + text?: string + action: () => Promise<CaminoError<string> | T> +} interface Props<T> { id?: string title: string content: () => JSX.Element close: () => void - validate: { - text?: string - action: () => Promise<CaminoError<string> | T> - } + validate: Validate<T> canValidate: boolean } export const FunctionalPopup = defineComponent(<T,>(props: Props<T>) => { const canValidate = computed<boolean>(() => { - return props.canValidate + return props.canValidate && validateProcess.value.status !== 'LOADING' }) const dialogRef = ref<HTMLDialogElement | null>(null) const trap = ref<FocusTrap | null>(null) @@ -96,55 +99,64 @@ export const FunctionalPopup = defineComponent(<T,>(props: Props<T>) => { // TODO 2023-11-28 ici on interdit le teleport dans le cas de vitest pour que les snapshots soient présentes. On a pas trouvé mieux à cette date <Teleport to="body" disabled={devMode}> <div> - <dialog ref={dialogRef} id={id} class="fr-modal fr-modal--opened" open={true} aria-modal={true} role="dialog" aria-labelledby={`${id}-title`} onClick={props.close} style={{ zIndex: 1000001 }}> - <div class="fr-container fr-container--fluid fr-container-md" onClick={stopPropagation}> - <div class="fr-grid-row fr-grid-row--center"> - <div class="fr-col-12 fr-col-md-8 fr-col-lg-6"> - <div class="fr-modal__body"> - <div class="fr-modal__header"> - <button class="fr-btn--close fr-btn" aria-controls={id} title="Fermer" onClick={() => props.close()}> + <dialog + ref={dialogRef} + id={id} + class={fr.cx('fr-modal', 'fr-modal--opened')} + open={true} + aria-modal={true} + role="dialog" + aria-labelledby={`${id}-title`} + onClick={props.close} + style={{ zIndex: 1000001 }} + > + <div class={fr.cx('fr-container', 'fr-container--fluid', 'fr-container-md')} onClick={stopPropagation}> + <div class={fr.cx('fr-grid-row', 'fr-grid-row--center')}> + <div class={fr.cx('fr-col-12', 'fr-col-md-8', 'fr-col-lg-6')}> + <div class={fr.cx('fr-modal__body')}> + <div class={fr.cx('fr-modal__header')}> + <button class={fr.cx('fr-btn--close', 'fr-btn')} aria-controls={id} title="Fermer" onClick={() => props.close()}> Fermer </button> </div> - <div class="fr-modal__content"> - <h1 id={`${id}-title`} class="fr-modal__title"> - <span class="fr-icon-arrow-right-line fr-icon--lg" aria-hidden="true"></span> + <div class={fr.cx('fr-modal__content')}> + <h1 id={`${id}-title`} class={fr.cx('fr-modal__title')}> + <span class={fr.cx('fr-icon-arrow-right-line', 'fr-icon--lg')} aria-hidden="true"></span> {props.title} </h1> - <div class="fr-container"> + <div class={fr.cx('fr-container')}> {props.content()} {validateProcess.value.status === 'ERROR' || validateProcess.value.status === 'NEW_ERROR' ? ( - <LoadingElement class="fr-mt-4v" data={validateProcess.value} renderItem={() => null} /> + <LoadingElement class={fr.cx('fr-mt-4v')} data={validateProcess.value} renderItem={() => null} /> ) : null} </div> </div> - <div class="fr-modal__footer"> + <div class={fr.cx('fr-modal__footer')}> <div style={{ display: 'flex', width: '100%', justifyContent: 'end', alignItems: 'center', gap: '1rem' }}> {validateProcess.value.status !== 'ERROR' && validateProcess.value.status !== 'NEW_ERROR' ? <LoadingElement data={validateProcess.value} renderItem={() => null} /> : null} - <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style={{ width: 'auto' }}> + <ul class={fr.cx('fr-btns-group', 'fr-btns-group--right', 'fr-btns-group--inline-reverse', 'fr-btns-group--inline-lg', 'fr-btns-group--icon-left')} style={{ width: 'auto' }}> <li> - <button - class={['fr-btn', 'fr-icon-check-line', 'fr-btn--icon-left', !canValidate.value ? 'disabled' : '']} + <DsfrButton + icon={{ name: 'fr-icon-check-line', position: 'left' }} disabled={!canValidate.value || validateProcess.value.status === 'LOADING'} onClick={e => { e.stopPropagation() return validate() }} - > - {text} - </button> + title={text} + /> </li> <li> - <button - class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" + <DsfrButton + icon={{ name: 'fr-icon-arrow-go-back-fill', position: 'left' }} + buttonType="secondary" disabled={validateProcess.value.status === 'LOADING'} aria-controls={id} onClick={props.close} - > - Annuler - </button> + title="Annuler" + /> </li> </ul> </div> diff --git a/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentObligatoire.html b/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentObligatoire.html index 85c90ed4bd38e18a0e6185444bcd5b062ae9cc69..04aeb0befe7e0a9db755b7e1a60069778d875ade 100644 --- a/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentObligatoire.html +++ b/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentObligatoire.html @@ -33,8 +33,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentOptionnel.html b/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentOptionnel.html index 18e6fc3992a46b6459aa63020d093c2f2fe38bb3..099fe5f0bb1cdca7c90d683a5fb1fbc8a346308e 100644 --- a/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentOptionnel.html +++ b/packages/ui/src/components/activite/add-activite-document-popup.stories_snapshots_DocumentOptionnel.html @@ -33,8 +33,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/activite/depose-popup.stories_snapshots_Default.html b/packages/ui/src/components/activite/depose-popup.stories_snapshots_Default.html index 9d6357c93573d398de390f45d7e3c90435cdd6f2..531ba9f51a14b66a3d915af4a72ac46223da7454 100644 --- a/packages/ui/src/components/activite/depose-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/activite/depose-popup.stories_snapshots_Default.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Déposer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Déposer" aria-label="Déposer" type="button">Déposer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/activite/preview.tsx b/packages/ui/src/components/activite/preview.tsx index 6d50192db2421f6a47f64fb347e437d363bb1602..98e7cfec5bf0ad0564d0398c52085ef3372144d3 100644 --- a/packages/ui/src/components/activite/preview.tsx +++ b/packages/ui/src/components/activite/preview.tsx @@ -96,7 +96,7 @@ export const Preview = defineComponent<Props>(props => { buttonType={props.activite.deposable ? 'secondary' : 'primary'} label={null} title="modifier l'activité" - icon="fr-icon-edit-line" + icon={{ name: 'fr-icon-edit-line', position: 'right' }} to={{ name: 'activiteEdition', params: { activiteId: props.activite.slug } }} disabled={false} /> diff --git a/packages/ui/src/components/activites.stories_snapshots_Full.html b/packages/ui/src/components/activites.stories_snapshots_Full.html index 82a9d335bc78ef60d78d85956e1603fa92b988f5..0974cd32992c67e7342722866052c12f454bc33c 100644 --- a/packages/ui/src/components/activites.stories_snapshots_Full.html +++ b/packages/ui/src/components/activites.stories_snapshots_Full.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Activités</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="downloadActivites" aria-label="Téléchargements" name="downloadActivites"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les activités" aria-label="Télécharger les activités" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/activites.tsx b/packages/ui/src/components/activites.tsx index 8eeecf5d935fe1ced0c66933fbfff4d6e9b699d2..6c42398b97d6146f55fd66530e6f860b4065c365 100644 --- a/packages/ui/src/components/activites.tsx +++ b/packages/ui/src/components/activites.tsx @@ -111,6 +111,7 @@ export const PureActivites = defineComponent<Props>(props => { getData={getData} download={{ id: 'downloadActivites', + downloadTitle: 'Télécharger les activités', downloadRoute: '/activites', formats: activitesDownloadFormats, params: {}, diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AvisDesServices.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AvisDesServices.html index 2c7cd0502a3561db65cf9db0867a8db8afa1f2d5..3b3f2d53cc9a61178fb0a9a7a1126ad2fe8d2e73 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AvisDesServices.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AvisDesServices.html @@ -9,10 +9,10 @@ <!----><button class="fr-btn fr-btn--primary fr-btn--md" disabled="" title="Finaliser l'étape" aria-label="Finaliser l'étape" type="button">Finaliser</button><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AxmDeposableAvecDaeEtAsl.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AxmDeposableAvecDaeEtAsl.html index 0aaca33eaecc4f9c503116ee71d65dbbee0260db..26d7b309223bb7024cd0618e9475c2af42a38532 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AxmDeposableAvecDaeEtAsl.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_AxmDeposableAvecDaeEtAsl.html @@ -8,10 +8,10 @@ <div style="display: flex; gap: 0.25rem;"> <!----><button class="fr-btn fr-btn--primary fr-btn--md" disabled="" title="Finaliser l'étape" aria-label="Finaliser l'étape" type="button">Finaliser</button><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a> <!----> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseDeposable.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseDeposable.html index 79a2765b8fb85e0cff44bb188f7b208f270cdf9d..eafe23fb087cea057ef617e5cb737536e16adf33 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseDeposable.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseDeposable.html @@ -9,10 +9,10 @@ <!----><button class="fr-btn fr-btn--primary fr-btn--md" disabled="" title="Finaliser l'étape" aria-label="Finaliser l'étape" type="button">Finaliser</button><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseNonDeposable.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseNonDeposable.html index dc8385927fef7298bc85a06e12e0980b18a61235..2e957747df16a97331db346ccb418d81e3a4be52 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseNonDeposable.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmMecaniseNonDeposable.html @@ -9,10 +9,10 @@ <!----><button class="fr-btn fr-btn--primary fr-btn--md" disabled="" title="Finaliser l'étape" aria-label="Finaliser l'étape" type="button">Finaliser</button><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmNonMecaniseDeposable.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmNonMecaniseDeposable.html index e9167f34f75854ec8496d52b978492f704153d43..1d9e354eb0c53386a70482e2f119d0c347e4cc9d 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmNonMecaniseDeposable.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeArmNonMecaniseDeposable.html @@ -9,10 +9,10 @@ <!----><button class="fr-btn fr-btn--primary fr-btn--md" disabled="" title="Finaliser l'étape" aria-label="Finaliser l'étape" type="button">Finaliser</button><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeMultipleEntreprisesDocuments.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeMultipleEntreprisesDocuments.html index a279730472619e316c66673e02fc6ff6b59c1754..fe4ba6b5b9ec341f587073d2dcc212d46f2e66cc 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeMultipleEntreprisesDocuments.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeMultipleEntreprisesDocuments.html @@ -10,10 +10,10 @@ <!----><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeNoMap.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeNoMap.html index a5fe0ab74afcf72b38d5421b25f11b805b2d9295..cd52a095452020e80b7a5fa41438f53712a7a803 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeNoMap.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_DemandeNoMap.html @@ -10,10 +10,10 @@ <!----><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_Depot.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_Depot.html index a1aadedc6f7f3c0992c4b4ab222513f721b8a668..4c7d8a6076c83d884ade9e65a7851a8f759ad831 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_Depot.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_Depot.html @@ -10,10 +10,10 @@ <!----><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "enregistrement de la demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "enregistrement de la demande" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "enregistrement de la demande" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "enregistrement de la demande" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_EtapeAvecNoteAvertissement.html b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_EtapeAvecNoteAvertissement.html index 2079e3f517700e13af841480126f33909829ffdd..04de82cc803e237270ee852a76f30002640ab96b 100644 --- a/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_EtapeAvecNoteAvertissement.html +++ b/packages/ui/src/components/demarche/demarche-etape.stories_snapshots_EtapeAvecNoteAvertissement.html @@ -9,10 +9,10 @@ <!----><button class="fr-btn fr-btn--primary fr-btn--md" disabled="" title="Finaliser l'étape" aria-label="Finaliser l'étape" type="button">Finaliser</button><a href="/mocked-href" title="Modifier l’étape" class="fr-btn fr-btn--secondary fr-icon-pencil-line" aria-label="Modifier l’étape">Modifier l’étape</a><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-delete-bin-line" title="Supprimer l’étape" aria-label="Supprimer l’étape" type="button"> <!----> </button> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "Avis des services et commissions consultatives" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/demarche/demarche-etape.tsx b/packages/ui/src/components/demarche/demarche-etape.tsx index 04d90d067aefa10f6bad178102412aac1b6b35c5..1e5ae79440f20fc62263b89d7ad207563e2284e4 100644 --- a/packages/ui/src/components/demarche/demarche-etape.tsx +++ b/packages/ui/src/components/demarche/demarche-etape.tsx @@ -318,7 +318,14 @@ export const DemarcheEtape = defineComponent<Props>(props => { {canEditOrDeleteEtape.value ? ( <> {isBrouillon.value ? <DsfrButton buttonType="primary" label="Finaliser" title="Finaliser l'étape" onClick={deposePopupOpen} disabled={!isDeposable.value} /> : null} - <DsfrLink icon={'fr-icon-pencil-line'} disabled={false} to={{ name: 'etapeEdition', params: { id: props.etape.slug } }} buttonType="secondary" title="Modifier l’étape" label={null} /> + <DsfrLink + icon={{ name: 'fr-icon-pencil-line', position: 'right' }} + disabled={false} + to={{ name: 'etapeEdition', params: { id: props.etape.slug } }} + buttonType="secondary" + title="Modifier l’étape" + label={null} + /> {canDelete.value ? <DsfrButtonIcon icon={'fr-icon-delete-bin-line'} buttonType="secondary" title="Supprimer l’étape" onClick={removePopupOpen} /> : null} </> ) : null} diff --git a/packages/ui/src/components/demarche/demarche-map-layer-controls.tsx b/packages/ui/src/components/demarche/demarche-map-layer-controls.tsx index b58c3a51eb768f0dda65ea78e5832a1f28aa2843..ce725ebbb6b78183ce2df36779b18f5cc839f996 100644 --- a/packages/ui/src/components/demarche/demarche-map-layer-controls.tsx +++ b/packages/ui/src/components/demarche/demarche-map-layer-controls.tsx @@ -106,6 +106,7 @@ export const LayersControl = defineComponent<LayersControlProps>(props => { elements={getEntriesHardcore(baseMapNames).map(([name, layer]) => { return { itemId: layer, legend: { main: name } } })} + required={true} valueChanged={radioValueChanged} legend={{ main: '' }} size="sm" diff --git a/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Depot.html b/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Depot.html index d6b07b2b2b66d2e4af7957d18413be7bc2d811dd..425b2829f959b4c20bc4d4b15c01fc734eb2f0fc 100644 --- a/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Depot.html +++ b/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Depot.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Finaliser</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Finaliser" aria-label="Finaliser" type="button">Finaliser</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Finalisation.html b/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Finalisation.html index d6b07b2b2b66d2e4af7957d18413be7bc2d811dd..425b2829f959b4c20bc4d4b15c01fc734eb2f0fc 100644 --- a/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Finalisation.html +++ b/packages/ui/src/components/demarche/depose-etape-popup.stories_snapshots_Finalisation.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Finaliser</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Finaliser" aria-label="Finaliser" type="button">Finaliser</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/demarche/remove-etape-popup.stories_snapshots_Default.html b/packages/ui/src/components/demarche/remove-etape-popup.stories_snapshots_Default.html index 476984adf6811829b91a913f25c11163c4c0a2d4..29e3fb1fc5abe3e7592539c1638bbd6c87d283af 100644 --- a/packages/ui/src/components/demarche/remove-etape-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/demarche/remove-etape-popup.stories_snapshots_Default.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Supprimer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Supprimer" aria-label="Supprimer" type="button">Supprimer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/demarches/page.stories_snapshots_Demarches.html b/packages/ui/src/components/demarches/page.stories_snapshots_Demarches.html index 009a02b83e06bdc6a84500d238afe38fa2671b9f..ad17cdb91c46507195b75c5b8de6746a49776e1a 100644 --- a/packages/ui/src/components/demarches/page.stories_snapshots_Demarches.html +++ b/packages/ui/src/components/demarches/page.stories_snapshots_Demarches.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Démarches</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="downloadDémarches" aria-label="Téléchargements" name="downloadDémarches"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les démarches" aria-label="Télécharger les démarches" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/demarches/page.stories_snapshots_Loading.html b/packages/ui/src/components/demarches/page.stories_snapshots_Loading.html index f8bb5fbbba673aa86efac7fde320e74a0538291c..6a48ee4e9647d3a29fa447a13382b77f9a2582bb 100644 --- a/packages/ui/src/components/demarches/page.stories_snapshots_Loading.html +++ b/packages/ui/src/components/demarches/page.stories_snapshots_Loading.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Travaux</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="downloadTravaux" aria-label="Téléchargements" name="downloadTravaux"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les travaux" aria-label="Télécharger les travaux" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/demarches/page.stories_snapshots_Travaux.html b/packages/ui/src/components/demarches/page.stories_snapshots_Travaux.html index a09a578cd66c5a521f4c7a4b47a6e5e86857546f..5ace57d41ea4c0193285daaab35e8486ff9be6aa 100644 --- a/packages/ui/src/components/demarches/page.stories_snapshots_Travaux.html +++ b/packages/ui/src/components/demarches/page.stories_snapshots_Travaux.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Travaux</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="downloadTravaux" aria-label="Téléchargements" name="downloadTravaux"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les travaux" aria-label="Télécharger les travaux" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/demarches/page.stories_snapshots_WithError.html b/packages/ui/src/components/demarches/page.stories_snapshots_WithError.html index be40c4d470640d125130e885b0a29e4cff08166f..44449de0a32f5a2dee00d2bdf58a90addcbdd9fd 100644 --- a/packages/ui/src/components/demarches/page.stories_snapshots_WithError.html +++ b/packages/ui/src/components/demarches/page.stories_snapshots_WithError.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Travaux</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="downloadTravaux" aria-label="Téléchargements" name="downloadTravaux"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les travaux" aria-label="Télécharger les travaux" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/demarches/page.tsx b/packages/ui/src/components/demarches/page.tsx index a770bdfecf2c36f060744eb94a1e7fe8c23ad5fb..e8dc78d8be4d698dfa1f92c2e2351d3a0a1b1c71 100644 --- a/packages/ui/src/components/demarches/page.tsx +++ b/packages/ui/src/components/demarches/page.tsx @@ -105,6 +105,7 @@ export const PurePage = defineComponent<PureProps>(props => { nom={props.travaux ? 'Travaux' : 'Démarches'} colonnes={demarchesColonnes} download={{ + downloadTitle: `Télécharger les ${props.travaux ? 'travaux' : 'démarches'}`, id: `download${props.travaux ? 'Travaux' : 'Démarches'}`, downloadRoute: props.travaux ? '/travaux' : '/demarches', formats: demarchesDownloadFormats, diff --git a/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_Default.html b/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_Default.html index 252f764f59a61e4b2caa67323f3fa66d77e55ef4..304ad955d3e6ddededc73138abc096c6d809cf31 100644 --- a/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_Default.html @@ -64,8 +64,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_TypeDeDocumentVerouille.html b/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_TypeDeDocumentVerouille.html index 17c8c77f05ec3f282046a961334480c96a5c62d4..11df3b74385e32a14e47dc9912cb6cae9c104733 100644 --- a/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_TypeDeDocumentVerouille.html +++ b/packages/ui/src/components/entreprise/add-entreprise-document-popup.stories_snapshots_TypeDeDocumentVerouille.html @@ -43,8 +43,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/entreprise/add-entreprise-document-popup.tsx b/packages/ui/src/components/entreprise/add-entreprise-document-popup.tsx index 44579b3d23c06121e2aed047337ffa3915a0c391..da7c34923552141d7834ad6c0abdd671fa187b9e 100644 --- a/packages/ui/src/components/entreprise/add-entreprise-document-popup.tsx +++ b/packages/ui/src/components/entreprise/add-entreprise-document-popup.tsx @@ -1,6 +1,6 @@ -import { EntrepriseId } from 'camino-common/src/entreprise' +import { EntrepriseDocumentId, EntrepriseId } from 'camino-common/src/entreprise' import { computed, defineComponent, ref } from 'vue' -import { FunctionalPopup } from '../_ui/functional-popup' +import { FunctionalPopup, Validate } from '../_ui/functional-popup' import { uiEntrepriseDocumentInputValidator } from './entreprise-api-client' import { DocumentsTypes, EntrepriseDocumentTypeId, EntrepriseDocumentTypeIds, sortedEntrepriseDocumentTypes } from 'camino-common/src/static/documentsTypes' import { CaminoDate } from 'camino-common/src/date' @@ -71,7 +71,7 @@ export const AddEntrepriseDocumentPopup = defineComponent<Props>(props => { } }) - const validate = { + const validate: Validate<{ id: EntrepriseDocumentId } | null> = { action: async () => { if (entrepriseDocumentFile.value !== null) { const tempDocumentName = await props.apiClient.uploadTempDocument(entrepriseDocumentFile.value) diff --git a/packages/ui/src/components/entreprise/add-popup.stories_snapshots_Super.html b/packages/ui/src/components/entreprise/add-popup.stories_snapshots_Super.html index 8ee82297010be039c748942ade6c18f8ddd72d1c..49bae960fb07d4a91058dab723f61deee9cc0a33 100644 --- a/packages/ui/src/components/entreprise/add-popup.stories_snapshots_Super.html +++ b/packages/ui/src/components/entreprise/add-popup.stories_snapshots_Super.html @@ -32,8 +32,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Ok.html b/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Ok.html index bda56d9e0f3df777685fb35445a2b1e64483ffb8..1ef50cbb2b5e8f22a3e83c7007baac515aa8e558 100644 --- a/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Ok.html +++ b/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Ok.html @@ -37,8 +37,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Super.html b/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Super.html index 242a75fee076ab9d55674c4a5dd7a5925d0c764d..2ef9cfb98353a512636ab9027c5a60d8698c758a 100644 --- a/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Super.html +++ b/packages/ui/src/components/entreprise/edit-popup.stories_snapshots_Super.html @@ -39,8 +39,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/entreprise/remove-entreprise-document-popup.stories_snapshots_Default.html b/packages/ui/src/components/entreprise/remove-entreprise-document-popup.stories_snapshots_Default.html index 9251300ff3b24b0bddb845cbc46d8814b651eda5..3b592155d78d6127f52245ffa68fa7f173dd1656 100644 --- a/packages/ui/src/components/entreprise/remove-entreprise-document-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/entreprise/remove-entreprise-document-popup.stories_snapshots_Default.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Supprimer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Supprimer" aria-label="Supprimer" type="button">Supprimer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/entreprises.stories_snapshots_NonConnecte.html b/packages/ui/src/components/entreprises.stories_snapshots_NonConnecte.html index ba5d5000ef2b3e3a7eab6eaca7ab39a74670c308..70bb8d9d31d06bb12033a135542f73ee3d8c0fe4 100644 --- a/packages/ui/src/components/entreprises.stories_snapshots_NonConnecte.html +++ b/packages/ui/src/components/entreprises.stories_snapshots_NonConnecte.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Entreprises</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="entreprisesDownload" aria-label="Téléchargements" name="entreprisesDownload"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les entreprises" aria-label="Télécharger les entreprises" type="button"> + <!----> + </button> + <!----> <div class="fr-ml-1w"><span></span></div> </div> </div> diff --git a/packages/ui/src/components/entreprises.stories_snapshots_canCreateEntreprise.html b/packages/ui/src/components/entreprises.stories_snapshots_canCreateEntreprise.html index ab3a9685744e400592343687a75dfcfc8110581c..2f1daf2f0e75376ec816a4936085feff9f421588 100644 --- a/packages/ui/src/components/entreprises.stories_snapshots_canCreateEntreprise.html +++ b/packages/ui/src/components/entreprises.stories_snapshots_canCreateEntreprise.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Entreprises</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="entreprisesDownload" aria-label="Téléchargements" name="entreprisesDownload"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les entreprises" aria-label="Télécharger les entreprises" type="button"> + <!----> + </button> + <!----> <div class="fr-ml-1w"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-add-line fr-btn--icon-right fr-ml-1w" title="Ajouter une entreprise" aria-label="Ajouter une entreprise" type="button">Ajouter une entreprise</button> <!----> </div> diff --git a/packages/ui/src/components/entreprises.tsx b/packages/ui/src/components/entreprises.tsx index 77fded46a231c90a1b7e00110f9723fc21ea0363..3e0d67dac12b7a03d6fadfc364666aa43b863087 100644 --- a/packages/ui/src/components/entreprises.tsx +++ b/packages/ui/src/components/entreprises.tsx @@ -78,7 +78,7 @@ export const PureEntreprises = defineComponent<Props>(props => { <Liste nom="entreprises" colonnes={entreprisesColonnes} - download={{ id: 'entreprisesDownload', downloadRoute: '/entreprises', formats: entreprisesDownloadFormats, params: {} }} + download={{ id: 'entreprisesDownload', downloadTitle: 'Télécharger les entreprises', downloadRoute: '/entreprises', formats: entreprisesDownloadFormats, params: {} }} getData={getData} listeFiltre={{ filtres: routesDefinitions[props.currentRoute.name].meta.filtres, diff --git a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisDeLaMissionAutoriteEnvironnementaleADesStatutsDifferents.html b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisDeLaMissionAutoriteEnvironnementaleADesStatutsDifferents.html index 6e5142561176ec91a05666e2b70a15c73546de99..d3e2fc98bd1d82a47c5083c4f53503d78db287dc 100644 --- a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisDeLaMissionAutoriteEnvironnementaleADesStatutsDifferents.html +++ b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisDeLaMissionAutoriteEnvironnementaleADesStatutsDifferents.html @@ -68,8 +68,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisObligatoireSuppressionDuStatutNonRenseigne.html b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisObligatoireSuppressionDuStatutNonRenseigne.html index 77cb17052f24b9529b81847acf8a654b1860f195..3f732c5f2ec4b8dad76673910cadb65a27dcd4f2 100644 --- a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisObligatoireSuppressionDuStatutNonRenseigne.html +++ b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_AvisObligatoireSuppressionDuStatutNonRenseigne.html @@ -69,8 +69,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialDejaSauvegarde.html b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialDejaSauvegarde.html index 8fb142833427aeeada2ff7d0db317ffb66bc1907..a21f4c4b1c5c0884e913b5825bd1a40e42e5d285 100644 --- a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialDejaSauvegarde.html +++ b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialDejaSauvegarde.html @@ -71,8 +71,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialTemporaire.html b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialTemporaire.html index 9bfaf74d11922aa3cb5e610129013a1959fe3686..cfe88e47e5995de263dd0b7577408e301d5b80be 100644 --- a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialTemporaire.html +++ b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_DocumentInitialTemporaire.html @@ -71,8 +71,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_SansDocumentInitial.html b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_SansDocumentInitial.html index 66e425a151ae9ea2957713e52297fe0ff889c4e7..27bf245a9c76bcec57c4c89c2a0f5d0b63fe6c33 100644 --- a/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_SansDocumentInitial.html +++ b/packages/ui/src/components/etape/add-etape-avis-popup.stories_snapshots_SansDocumentInitial.html @@ -102,8 +102,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Default.html b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Default.html index 4e7a5b04c7550c704e97dc4d520a971196939176..a238d873891eecc7614ab4375ffb309f156724b8 100644 --- a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Default.html @@ -33,7 +33,7 @@ </div> <div class="fr-fieldset__element" style="order: 2;"> <fieldset class="fr-fieldset" id="radio_271" aria-labelledby="radio_271-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité <!----> </legend> <div class="fr-fieldset__element"> @@ -67,8 +67,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitial.html b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitial.html index 7feff1b7e73ca6bec2cde381735b92e9f02aeb18..4102d3b0614ba3cf1d0368571f4b1da5009c66b9 100644 --- a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitial.html +++ b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitial.html @@ -19,7 +19,7 @@ </div> <div class="fr-fieldset__element" style="order: 2;"> <fieldset class="fr-fieldset" id="radio_271" aria-labelledby="radio_271-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité <!----> </legend> <div class="fr-fieldset__element"> @@ -53,8 +53,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitialAutre.html b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitialAutre.html index 069934babc45251222c2b5724527998ceb0003f3..cd7b2e033f1621a3ed17e2b10e0a6912b657f47a 100644 --- a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitialAutre.html +++ b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_DocumentInitialAutre.html @@ -19,7 +19,7 @@ </div> <div class="fr-fieldset__element" style="order: 2;"> <fieldset class="fr-fieldset" id="radio_271" aria-labelledby="radio_271-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité <!----> </legend> <div class="fr-fieldset__element"> @@ -54,8 +54,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Entreprise.html b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Entreprise.html index 11d54ed752c1623a47d0209367c4f52e537c9e87..11b8d91a0bc1212e40fb626a15f8c5f832d3d4a9 100644 --- a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Entreprise.html +++ b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_Entreprise.html @@ -32,7 +32,7 @@ </div> <div class="fr-fieldset__element" style="order: 2;"> <fieldset class="fr-fieldset" id="radio_271" aria-labelledby="radio_271-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité <!----> </legend> <div class="fr-fieldset__element"> @@ -61,8 +61,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_UnSeulDocumentPossible.html b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_UnSeulDocumentPossible.html index 59b6d5aa56f9df1db44d31f46416184ad091c44e..bced2be9d0d5bf028be4128a3bd858f5097873fe 100644 --- a/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_UnSeulDocumentPossible.html +++ b/packages/ui/src/components/etape/add-etape-document-popup.stories_snapshots_UnSeulDocumentPossible.html @@ -19,7 +19,7 @@ </div> <div class="fr-fieldset__element" style="order: 2;"> <fieldset class="fr-fieldset" id="radio_271" aria-labelledby="radio_271-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_271-legend">Visibilité <!----> </legend> <div class="fr-fieldset__element"> @@ -48,8 +48,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/add-etape-document-popup.tsx b/packages/ui/src/components/etape/add-etape-document-popup.tsx index eb4adafd71e7b95b9a0f5abbd3fda90d184bf0aa..85857faf6b4a9f67ed5d45a00ce2d69875b5a27e 100644 --- a/packages/ui/src/components/etape/add-etape-document-popup.tsx +++ b/packages/ui/src/components/etape/add-etape-document-popup.tsx @@ -97,7 +97,7 @@ export const AddEtapeDocumentPopup = defineComponent<Props>(props => { </div> <div class="fr-fieldset__element" style={{ order: 2 }}> - <DsfrInputRadio legend={{ main: 'Visibilité' }} elements={visibilityChoices.value} initialValue={etapeDocumentVisibility.value} valueChanged={visibilityChange} /> + <DsfrInputRadio legend={{ main: 'Visibilité' }} required={true} elements={visibilityChoices.value} initialValue={etapeDocumentVisibility.value} valueChanged={visibilityChange} /> </div> <div class="fr-fieldset__element" style={{ order: etapeDocumentTypeId.value === DOCUMENTS_TYPES_IDS.autreDocument ? -1 : 3 }}> <DsfrTextarea diff --git a/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_CsvSelected.html b/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_CsvSelected.html index 20eaa8bed726e651e75d1ff9f411443b08778b6e..3dc63c466df41071d184b16684b3f9745058088e 100644 --- a/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_CsvSelected.html +++ b/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_CsvSelected.html @@ -93,7 +93,7 @@ </div> </fieldset> <fieldset class="fr-fieldset" id="radio_670" aria-labelledby="radio_670-legend" style="flex-direction: row; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Type de fichier (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Type de fichier <!----> </legend> <div class="fr-fieldset__element fr-fieldset__element--inline"> @@ -130,8 +130,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Importer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Importer" aria-label="Importer" type="button">Importer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_Default.html b/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_Default.html index 6c0247f0fe9bfd4e2d03843043f3134c6ddfef51..b990461b922ed8566ab5cb198707e9b3c33fcf49 100644 --- a/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/etape/forages-import-popup.stories_snapshots_Default.html @@ -93,7 +93,7 @@ </div> </fieldset> <fieldset class="fr-fieldset" id="radio_670" aria-labelledby="radio_670-legend" style="flex-direction: row; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Type de fichier (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Type de fichier <!----> </legend> <div class="fr-fieldset__element fr-fieldset__element--inline"> @@ -121,8 +121,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Importer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Importer" aria-label="Importer" type="button">Importer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/forages-import-popup.tsx b/packages/ui/src/components/etape/forages-import-popup.tsx index 0d8a3ce473bb8e2bedc53133344e5ece576d4fed..844369121f1505a308789cf4f80fafb4bba13fe6 100644 --- a/packages/ui/src/components/etape/forages-import-popup.tsx +++ b/packages/ui/src/components/etape/forages-import-popup.tsx @@ -44,6 +44,7 @@ export const ForagesImportPopup = defineComponent<Props>(props => { </div> </fieldset> <DsfrInputRadio + required={true} legend={{ main: 'Type de fichier' }} orientation="horizontal" valueChanged={fileTypeSelected} diff --git a/packages/ui/src/components/etape/perimetre-import-popup.stories_snapshots_Default.html b/packages/ui/src/components/etape/perimetre-import-popup.stories_snapshots_Default.html index 592e5ea300095d58f83157d69c349b6131c54f8f..d706b41c6475e30a87a0c51afb7a709e3777f9d7 100644 --- a/packages/ui/src/components/etape/perimetre-import-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/etape/perimetre-import-popup.stories_snapshots_Default.html @@ -91,7 +91,7 @@ </div> </fieldset> <fieldset class="fr-fieldset" id="radio_670" aria-labelledby="radio_670-legend" style="flex-direction: row; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Type de fichier (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Type de fichier <!----> </legend> <div class="fr-fieldset__element fr-fieldset__element--inline"> @@ -121,8 +121,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Importer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Importer" aria-label="Importer" type="button">Importer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/etape/perimetre-import-popup.tsx b/packages/ui/src/components/etape/perimetre-import-popup.tsx index a3955c85098e48a1a37d650537b42a99c62f052b..3fff5b7f33223b2d5b49157d9c12d3acf39cd6de 100644 --- a/packages/ui/src/components/etape/perimetre-import-popup.tsx +++ b/packages/ui/src/components/etape/perimetre-import-popup.tsx @@ -53,6 +53,7 @@ export const PerimetreImportPopup = defineComponent<Props>(props => { </div> </fieldset> <DsfrInputRadio + required={true} legend={{ main: 'Type de fichier' }} orientation="horizontal" valueChanged={fileTypeSelected} diff --git a/packages/ui/src/components/etape/points-import-popup.stories_snapshots_Default.html b/packages/ui/src/components/etape/points-import-popup.stories_snapshots_Default.html index d05698a59866351e09d70ab45b9c11611fd748c0..985887dc35d71bbb8ed84d7366be415a78d37541 100644 --- a/packages/ui/src/components/etape/points-import-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/etape/points-import-popup.stories_snapshots_Default.html @@ -110,8 +110,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Importer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Importer" aria-label="Importer" type="button">Importer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre.stories_snapshots_Lenoncourt.html b/packages/ui/src/components/titre.stories_snapshots_Lenoncourt.html index 27bc6d088b8deec372acb5b0e8892609daec45cc..95cb2a4374c1caac3d2f50037a4ad0fe9e5065cc 100644 --- a/packages/ui/src/components/titre.stories_snapshots_Lenoncourt.html +++ b/packages/ui/src/components/titre.stories_snapshots_Lenoncourt.html @@ -443,10 +443,10 @@ <div style="display: flex; gap: 0.25rem;"> <!----> <!----> - <div style="display: flex;"> - <!----><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger l’ensemble des documents de l'étape "décision de l'autorité administrative" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "décision de l'autorité administrative" dans un fichier .zip" type="button"> + <div style="display: flex; gap: 1rem;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-download-line" title="Télécharger l’ensemble des documents de l'étape "décision de l'autorité administrative" dans un fichier .zip" aria-label="Télécharger l’ensemble des documents de l'étape "décision de l'autorité administrative" dans un fichier .zip" type="button"> <!----> </button> + <!----> </div> </div> </div> diff --git a/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Create.html b/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Create.html index e53b2733ab9cc7367d33adb8e6661c4c70ba3e97..b2ce099352d43811ab97aa70087392abfe815e69 100644 --- a/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Create.html +++ b/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Create.html @@ -34,8 +34,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left disabled" disabled="">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" disabled="" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_DisplayErrorMessage.html b/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_DisplayErrorMessage.html index 80c0a53316ad4c21523629f48e00616e9ba0dc22..d9cb4511040f7ebf89ba5bd9c8eb8a18e0b9a1b3 100644 --- a/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_DisplayErrorMessage.html +++ b/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_DisplayErrorMessage.html @@ -39,8 +39,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Edit.html b/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Edit.html index 864da9146ca663daccf06cf257a842aa13a2b597..97a1f59e11f79b35c04a4bc6331d59010b20c9a7 100644 --- a/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Edit.html +++ b/packages/ui/src/components/titre/demarche-edit-popup.stories_snapshots_Edit.html @@ -39,8 +39,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/demarche-remove-popup.stories_snapshots_Main.html b/packages/ui/src/components/titre/demarche-remove-popup.stories_snapshots_Main.html index 4f82a22f5214a6519640ceafc798a79b573b2703..65d71cfec0ffbc8924b4e24309113d17b35071d3 100644 --- a/packages/ui/src/components/titre/demarche-remove-popup.stories_snapshots_Main.html +++ b/packages/ui/src/components/titre/demarche-remove-popup.stories_snapshots_Main.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Supprimer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Supprimer" aria-label="Supprimer" type="button">Supprimer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/edit-popup.stories_snapshots_DefaultNoReference.html b/packages/ui/src/components/titre/edit-popup.stories_snapshots_DefaultNoReference.html index 1bafa2e150572ba51d532a048f04aa710677dd3f..1f454756901692abc5b15ec3a4d5174bfaa32866 100644 --- a/packages/ui/src/components/titre/edit-popup.stories_snapshots_DefaultNoReference.html +++ b/packages/ui/src/components/titre/edit-popup.stories_snapshots_DefaultNoReference.html @@ -26,8 +26,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/edit-popup.stories_snapshots_OneReference.html b/packages/ui/src/components/titre/edit-popup.stories_snapshots_OneReference.html index 794634876efc09ac3fd21992f8da70fca039fa24..df84e68648e4ad921b377ac350dbf25a763d5006 100644 --- a/packages/ui/src/components/titre/edit-popup.stories_snapshots_OneReference.html +++ b/packages/ui/src/components/titre/edit-popup.stories_snapshots_OneReference.html @@ -50,8 +50,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Enregistrer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Enregistrer" aria-label="Enregistrer" type="button">Enregistrer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/remove-popup.stories_snapshots_Default.html b/packages/ui/src/components/titre/remove-popup.stories_snapshots_Default.html index 64ca3b854f0c48275774186e75e51fb799f4c898..41f1dcb929a3097980ee2dfe561268026e312251 100644 --- a/packages/ui/src/components/titre/remove-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/titre/remove-popup.stories_snapshots_Default.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Supprimer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Supprimer" aria-label="Supprimer" type="button">Supprimer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_Default.html b/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_Default.html index fc2fe6d9d1a720610ca2042211572f6734dbd52c..e4f205c296ed5dd904ea1568dd21fa72e727118f 100644 --- a/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_Default.html +++ b/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_Default.html @@ -8,7 +8,7 @@ <!----> </div><span>Pour la demande Pivot du titulaire Titulaire Pivot quelle est la décision ?</span> <fieldset class="fr-fieldset" id="radio_670" aria-labelledby="radio_670-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Décision (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Décision <!----> </legend> <div class="fr-fieldset__element"> @@ -24,7 +24,7 @@ </fieldset> <div> <fieldset class="fr-fieldset" id="radio_74" aria-labelledby="radio_74-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_74-legend">Quel périmètre acceptez-vous ? (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_74-legend">Quel périmètre acceptez-vous ? <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreAvecSatelliteEquivalent.html b/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreAvecSatelliteEquivalent.html index 983dde9117e2998e887c805d0d9d1e38918c866f..d2699ace4feef254767d2ee9a28e5036fd31bcf3 100644 --- a/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreAvecSatelliteEquivalent.html +++ b/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreAvecSatelliteEquivalent.html @@ -8,7 +8,7 @@ <!----> </div><span>Pour la demande Pivot du titulaire Titulaire Pivot quelle est la décision ?</span> <fieldset class="fr-fieldset" id="radio_670" aria-labelledby="radio_670-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Décision (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Décision <!----> </legend> <div class="fr-fieldset__element"> @@ -24,7 +24,7 @@ </fieldset> <div> <fieldset class="fr-fieldset" id="radio_74" aria-labelledby="radio_74-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_74-legend">Quel périmètre acceptez-vous ? (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_74-legend">Quel périmètre acceptez-vous ? <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreSansSatellite.html b/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreSansSatellite.html index 983dde9117e2998e887c805d0d9d1e38918c866f..d2699ace4feef254767d2ee9a28e5036fd31bcf3 100644 --- a/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreSansSatellite.html +++ b/packages/ui/src/components/titre/resultat-mise-en-concurrence.stories_snapshots_PerimetreSansSatellite.html @@ -8,7 +8,7 @@ <!----> </div><span>Pour la demande Pivot du titulaire Titulaire Pivot quelle est la décision ?</span> <fieldset class="fr-fieldset" id="radio_670" aria-labelledby="radio_670-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Décision (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_670-legend">Décision <!----> </legend> <div class="fr-fieldset__element"> @@ -24,7 +24,7 @@ </fieldset> <div> <fieldset class="fr-fieldset" id="radio_74" aria-labelledby="radio_74-legend" style="flex-direction: column; align-items: flex-start;"> - <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_74-legend">Quel périmètre acceptez-vous ? (optionnel) + <legend class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio_74-legend">Quel périmètre acceptez-vous ? <!----> </legend> <div class="fr-fieldset__element"> diff --git a/packages/ui/src/components/titre/resultat-mise-en-concurrence.tsx b/packages/ui/src/components/titre/resultat-mise-en-concurrence.tsx index fdafd7eabc6308ffad2ef39b0208af5f87816ef5..6dbcd6c67b6afe18a176e2874833ee2380accead 100644 --- a/packages/ui/src/components/titre/resultat-mise-en-concurrence.tsx +++ b/packages/ui/src/components/titre/resultat-mise-en-concurrence.tsx @@ -179,6 +179,7 @@ export const ResultatMiseEnConcurrence = defineComponent<Props>(props => { <DsfrInputRadio legend={{ main: 'Décision' }} initialValue={decision.value} + required={true} elements={[ETAPES_STATUTS.ACCEPTE, ETAPES_STATUTS.REJETE].map(status => ({ itemId: status, legend: { main: capitalize(EtapesStatuts[status].nom) } }))} valueChanged={setDecision} /> @@ -186,6 +187,7 @@ export const ResultatMiseEnConcurrence = defineComponent<Props>(props => { {decision.value === 'acc' ? ( <div> <DsfrInputRadio + required={true} legend={{ main: 'Quel périmètre acceptez-vous ?' }} elements={[ { itemId: 'origin', legend: { main: 'Celui de la demande' } }, diff --git a/packages/ui/src/components/titres.tsx b/packages/ui/src/components/titres.tsx index 862c1a02b0ed111363c30a5af4e5a697c3113a53..88c9e625a0d25e48497310b3b30d588405365fa8 100644 --- a/packages/ui/src/components/titres.tsx +++ b/packages/ui/src/components/titres.tsx @@ -210,7 +210,7 @@ export const Titres = defineComponent({ nom="Titres miniers et autorisations" download={ titresForCarte.value.titres.length > 0 || (titresForTable.value.status === 'LOADED' && titresForTable.value.value.rows.length > 0) - ? { formats: titresDownloadFormats, downloadRoute: '/titres', params: {} } + ? { downloadTitle: 'Télécharger les titres', formats: titresDownloadFormats, downloadRoute: '/titres', params: {} } : null } renderButton={() => <DemandeTitreButton user={user} />} diff --git a/packages/ui/src/components/utilisateur/remove-popup.stories_snapshots_Default.html b/packages/ui/src/components/utilisateur/remove-popup.stories_snapshots_Default.html index 12c60faaa267fc3a979e693c8df10c9b2d85365e..d36a11448de0dac3cefa59b57c0c368f322d2672 100644 --- a/packages/ui/src/components/utilisateur/remove-popup.stories_snapshots_Default.html +++ b/packages/ui/src/components/utilisateur/remove-popup.stories_snapshots_Default.html @@ -19,8 +19,8 @@ <div style="display: flex; width: 100%; justify-content: end; align-items: center; gap: 1rem;"> <!----> <ul class="fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--icon-left" style="width: auto;"> - <li><button class="fr-btn fr-icon-check-line fr-btn--icon-left">Supprimer</button></li> - <li><button class="fr-btn fr-icon-arrow-go-back-fill fr-btn--icon-left fr-btn--secondary" aria-controls="monId">Annuler</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-check-line fr-btn--primary fr-btn--md" title="Supprimer" aria-label="Supprimer" type="button">Supprimer</button></li> + <li><button class="fr-btn fr-btn--icon-left fr-icon-arrow-go-back-fill fr-btn--secondary fr-btn--md" title="Annuler" aria-label="Annuler" aria-controls="monId" type="button">Annuler</button></li> </ul> </div> </div> diff --git a/packages/ui/src/components/utilisateurs.stories_snapshots_Connected.html b/packages/ui/src/components/utilisateurs.stories_snapshots_Connected.html index d502999ccbbb5974629338917c2ba9cef7260d64..18aa7a6a9ce665f5826e612025d633999861fccc 100644 --- a/packages/ui/src/components/utilisateurs.stories_snapshots_Connected.html +++ b/packages/ui/src/components/utilisateurs.stories_snapshots_Connected.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Utilisateurs</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="utilisateursDownload" aria-label="Téléchargements" name="utilisateursDownload"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les utilisateurs" aria-label="Télécharger les utilisateurs" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/utilisateurs.stories_snapshots_Loading.html b/packages/ui/src/components/utilisateurs.stories_snapshots_Loading.html index 74a8a46279f913252f97e5ee2e604d25f96347ee..0a86779e18c51fe8d4c80aedacdd796d103b5ff9 100644 --- a/packages/ui/src/components/utilisateurs.stories_snapshots_Loading.html +++ b/packages/ui/src/components/utilisateurs.stories_snapshots_Loading.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Utilisateurs</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="utilisateursDownload" aria-label="Téléchargements" name="utilisateursDownload"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les utilisateurs" aria-label="Télécharger les utilisateurs" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/utilisateurs.stories_snapshots_WithError.html b/packages/ui/src/components/utilisateurs.stories_snapshots_WithError.html index a5b4d964ab47fb6a9e9c66569433c8a74f229171..a5afb566a21e26bc0bfb1788ac15385b4bfe027b 100644 --- a/packages/ui/src/components/utilisateurs.stories_snapshots_WithError.html +++ b/packages/ui/src/components/utilisateurs.stories_snapshots_WithError.html @@ -5,19 +5,10 @@ <div class="fr-col-12 fr-col-md-6"> <h1>Utilisateurs</h1> </div> - <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"> - <div style="display: flex;"> - <div class="fr-select-group fr-mr-1v"> - <!----><select class="fr-select" id="utilisateursDownload" aria-label="Téléchargements" name="utilisateursDownload"> - <option value="csv">csv</option> - <option value="xlsx">xlsx</option> - <option value="ods">ods</option> - <option selected="" disabled="" hidden="" value="">Choississez un format d'export</option> - </select> - </div><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" disabled="" title="Télécharger (choisissez le format)" aria-label="Télécharger (choisissez le format)" type="button"> - <!----> - </button> - </div> + <div class="fr-col-12 fr-col-md-6" style="display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end;"><button class="fr-btn fr-btn--secondary fr-btn--md fr-icon-file-download-line" title="Télécharger les utilisateurs" aria-label="Télécharger les utilisateurs" type="button"> + <!----> + </button> + <!----> <!----> </div> </div> diff --git a/packages/ui/src/components/utilisateurs.tsx b/packages/ui/src/components/utilisateurs.tsx index 20792545f43b84999fb2cbf6cdd48b3346eb3646..0bb9d6bd4241179ad748ee190725c7848dffddd4 100644 --- a/packages/ui/src/components/utilisateurs.tsx +++ b/packages/ui/src/components/utilisateurs.tsx @@ -51,7 +51,7 @@ export const PureUtilisateurs = defineComponent<Props>(props => { route={props.currentRoute} colonnes={utilisateursColonnes} getData={load} - download={{ id: 'utilisateursDownload', downloadRoute: '/utilisateurs', formats: utilisateursDownloadFormats, params: {} }} + download={{ id: 'utilisateursDownload', downloadTitle: 'Télécharger les utilisateurs', downloadRoute: '/utilisateurs', formats: utilisateursDownloadFormats, params: {} }} renderButton={null} /> ) : (