-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add export modal to prevent firefox popup blocking behaviour
- Loading branch information
Showing
4 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
resources/js/Components/Common/Reporting/ReportingExportModal.vue
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,53 @@ | ||
<script setup lang="ts"> | ||
import { | ||
ArrowDownTrayIcon, | ||
CheckCircleIcon, | ||
XMarkIcon, | ||
} from '@heroicons/vue/20/solid'; | ||
import { Modal, PrimaryButton } from '@/packages/ui/src'; | ||
const props = defineProps<{ | ||
exportUrl: string | null; | ||
}>(); | ||
const showExportModal = defineModel('show', { default: false }); | ||
function downloadCurrentExport() { | ||
if (props.exportUrl) { | ||
window.open(props.exportUrl, '_blank')?.focus(); | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<Modal | ||
closeable | ||
max-width="lg" | ||
@close="showExportModal = false" | ||
:show="showExportModal"> | ||
<button | ||
class="text-text-tertiary w-6 mx-auto absolute focus-visible:outline-none focus-visible:ring-2 rounded-full focus-visible:ring-white/80 transition focus-visible:text-text-primary hover:text-text-primary top-2 right-2"> | ||
<XMarkIcon @click="showExportModal = false"></XMarkIcon> | ||
</button> | ||
<div class="text-center text-text-primary py-6"> | ||
<div | ||
class="flex items-center font-semibold text-lg justify-center space-x-2 pb-2"> | ||
<CheckCircleIcon | ||
class="text-text-tertiary w-6"></CheckCircleIcon> | ||
<span> Export Successful! </span> | ||
</div> | ||
<div class="text-center text-sm max-w-64 mx-auto"> | ||
<p class="pb-5"> | ||
Your export is ready, you can download it with the button | ||
below. | ||
</p> | ||
<PrimaryButton | ||
:icon="ArrowDownTrayIcon" | ||
@click="downloadCurrentExport" | ||
>Download</PrimaryButton | ||
> | ||
</div> | ||
</div> | ||
</Modal> | ||
</template> | ||
|
||
<style scoped></style> |
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