Adding icons to exports

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-10-05 10:52:30 +02:00
parent 60c77eb355
commit 9d5bf806df
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -66,8 +66,10 @@
:key="format" :key="format"
@click="exportParticipants(format)" @click="exportParticipants(format)"
aria-role="listitem" aria-role="listitem"
>{{ format }}</b-dropdown-item
> >
<b-icon :icon="formatToIcon(format)"></b-icon>
{{ format }}
</b-dropdown-item>
</b-dropdown> </b-dropdown>
</div> </div>
</div> </div>
@ -275,6 +277,8 @@ const { isNavigationFailure, NavigationFailureType } = VueRouter;
const PARTICIPANTS_PER_PAGE = 10; const PARTICIPANTS_PER_PAGE = 10;
const MESSAGE_ELLIPSIS_LENGTH = 130; const MESSAGE_ELLIPSIS_LENGTH = 130;
type exportFormat = "CSV" | "PDF" | "ODS";
@Component({ @Component({
apollo: { apollo: {
currentActor: { currentActor: {
@ -414,7 +418,7 @@ export default class Participants extends Vue {
this.checkedRows = []; this.checkedRows = [];
} }
async exportParticipants(type: "CSV" | "PDF" | "ODS"): Promise<void> { async exportParticipants(type: exportFormat): Promise<void> {
try { try {
const { const {
data: { exportEventParticipants }, data: { exportEventParticipants },
@ -454,6 +458,17 @@ export default class Participants extends Vue {
); );
} }
formatToIcon(format: exportFormat): string {
switch (format) {
case "CSV":
return "file-delimited";
case "PDF":
return "file-pdf-box";
case "ODS":
return "google-spreadsheet";
}
}
/** /**
* We can accept participants if at least one of them is not approved * We can accept participants if at least one of them is not approved
*/ */