-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Affichage des previews pour les groupements d'indicateurs
- Loading branch information
Showing
8 changed files
with
91 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 10 additions & 30 deletions
40
...iresentransitions.react/src/app/pages/collectivite/Indicateurs/detail/SousIndicateurs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...ons.react/src/app/pages/collectivite/Indicateurs/lists/indicateurs-list/export-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Indicateurs } from '@/api'; | ||
import { | ||
ExportIndicateursPageName, | ||
useExportIndicateurs, | ||
} from '@/app/app/pages/collectivite/Indicateurs/Indicateur/useExportIndicateurs'; | ||
import { Badge } from '@/ui'; | ||
import classNames from 'classnames'; | ||
|
||
type Props = { | ||
definitions?: Indicateurs.domain.IndicateurListItem[]; | ||
pageName: ExportIndicateursPageName; // tracking | ||
isFiltered: boolean; | ||
}; | ||
|
||
const ExportButton = ({ definitions, pageName, isFiltered }: Props) => { | ||
// fonction d'export | ||
const { mutate: exportIndicateurs, isLoading: isDownloadingExport } = | ||
useExportIndicateurs(pageName, definitions); | ||
|
||
return ( | ||
<button | ||
className={classNames('shrink-0 ml-auto', { | ||
'opacity-50': isDownloadingExport, | ||
})} | ||
disabled={isDownloadingExport} | ||
onClick={() => exportIndicateurs()} | ||
> | ||
<Badge | ||
className="py-4" | ||
icon="download-line" | ||
iconPosition="left" | ||
title={ | ||
isFiltered | ||
? 'Exporter le résultat de mon filtre en Excel' | ||
: 'Exporter tous les indicateurs en Excel' | ||
} | ||
state="default" | ||
uppercase={false} | ||
size="sm" | ||
/> | ||
</button> | ||
); | ||
}; | ||
|
||
export default ExportButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters