-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the report content popover to a modal (#4701)
* Convert the report popover to a modal Signed-off-by: Olga Bulat <[email protected]> * Fix the standalone report page heading Signed-off-by: Olga Bulat <[email protected]> * Update snapshots Signed-off-by: Olga Bulat <[email protected]> * Hover over the filter Signed-off-by: Olga Bulat <[email protected]> * Improve the UX for submitting reports Signed-off-by: Olga Bulat <[email protected]> * Update the e2e dmca report test Signed-off-by: Olga Bulat <[email protected]> * Address the change requests Signed-off-by: Olga Bulat <[email protected]> --------- Signed-off-by: Olga Bulat <[email protected]>
- Loading branch information
Showing
22 changed files
with
235 additions
and
207 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
64 changes: 64 additions & 0 deletions
64
frontend/src/components/VContentReport/VContentReportModal.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,64 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue" | ||
import { WIP } from "~/constants/content-report" | ||
import { useContentReport } from "~/composables/use-content-report" | ||
import type { AudioDetail, ImageDetail } from "~/types/media" | ||
import VContentReportButton from "~/components/VContentReport/VContentReportButton.vue" | ||
import VContentReportForm from "~/components/VContentReport/VContentReportForm.vue" | ||
import VModal from "~/components/VModal/VModal.vue" | ||
defineProps<{ | ||
/** | ||
* The media item to report. This can either be an audio track or an image. | ||
*/ | ||
media: AudioDetail | ImageDetail | ||
}>() | ||
const modalRef = ref<InstanceType<typeof VModal> | null>(null) | ||
const contentReportFormRef = ref<InstanceType< | ||
typeof VContentReportForm | ||
> | null>(null) | ||
const { status, updateStatus, title } = useContentReport() | ||
const resetForm = () => { | ||
contentReportFormRef.value?.resetForm() | ||
updateStatus(WIP) | ||
} | ||
const close = () => { | ||
resetForm() | ||
modalRef.value?.close() | ||
} | ||
</script> | ||
|
||
<template> | ||
<VModal | ||
ref="modalRef" | ||
:label="$t('mediaDetails.contentReport.long')" | ||
:hide-on-click-outside="true" | ||
variant="centered" | ||
@close="resetForm" | ||
> | ||
<template #trigger="{ a11yProps }"> | ||
<VContentReportButton v-bind="a11yProps" /> | ||
</template> | ||
<template #title> | ||
<h2 class="heading-6" tabindex="-1">{{ title }}</h2> | ||
</template> | ||
<template #default> | ||
<VContentReportForm | ||
ref="contentReportFormRef" | ||
class="p-7 pt-0 sm:p-9" | ||
:media="media" | ||
:status="status" | ||
:allow-cancel="true" | ||
@update-status="updateStatus" | ||
@close="close" | ||
> | ||
</VContentReportForm> | ||
</template> | ||
</VModal> | ||
</template> |
60 changes: 0 additions & 60 deletions
60
frontend/src/components/VContentReport/VContentReportPopover.vue
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.