Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update report buttons #1004

Merged
merged 7 commits into from May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 7 additions & 11 deletions frontend/src/components/VContentReport/VContentReportButton.vue
@@ -1,15 +1,17 @@
<template>
<VButton
variant="plain"
class="report-button font-semibold text-dark-charcoal-70 hover:underline"
variant="transparent-gray"
size="medium"
has-icon-end
class="label-bold"
>
<span class="text-sr md:hidden md:text-base">{{
<span class="md:hidden">{{
$t("media-details.content-report.short")
}}</span>
<span class="hidden text-sr md:inline md:text-base">{{
<span class="hidden md:inline">{{
$t("media-details.content-report.long")
}}</span>
<VIcon name="flag" class="ms-2" />
<VIcon name="flag" />
</VButton>
</template>

Expand All @@ -24,9 +26,3 @@ export default defineComponent({
components: { VButton, VIcon },
})
</script>

<style scoped>
.report-button {
@apply px-0;
}
</style>
18 changes: 12 additions & 6 deletions frontend/src/components/VContentReport/VContentReportForm.vue
Expand Up @@ -79,7 +79,9 @@
<div class="flex flex-row items-center justify-end gap-4">
<VButton
v-if="allowCancel"
variant="secondary-bordered"
variant="bordered-gray"
size="medium"
class="label-bold"
@click="handleCancel"
>
{{ $t("media-details.content-report.form.cancel") }}
Expand All @@ -89,20 +91,26 @@
v-if="selectedReason === DMCA"
key="dmca"
as="VLink"
variant="secondary-filled"
variant="filled-dark"
size="medium"
class="label-bold"
has-icon-end
show-external-icon
:external-icon-size="6"
:href="DMCA_FORM_URL"
@click="handleDmcaSubmit"
>
{{ $t("media-details.content-report.form.dmca.open") }}
<VIcon :size="4" class="ms-1" name="external-link" />
</VButton>
<VButton
v-else
key="non-dmca"
type="submit"
:disabled="isSubmitDisabled"
:focusable-when-disabled="true"
variant="secondary-filled"
variant="filled-dark"
size="medium"
class="label-bold"
:value="$t('media-details.content-report.form.submit')"
>
{{ $t("media-details.content-report.form.submit") }}
Expand Down Expand Up @@ -133,7 +141,6 @@ import type { AudioDetail, ImageDetail } from "~/types/media"
import { useAnalytics } from "~/composables/use-analytics"

import VButton from "~/components/VButton.vue"
import VIcon from "~/components/VIcon/VIcon.vue"
import VRadio from "~/components/VRadio/VRadio.vue"
import VDmcaNotice from "~/components/VContentReport/VDmcaNotice.vue"
import VReportDescForm from "~/components/VContentReport/VReportDescForm.vue"
Expand All @@ -143,7 +150,6 @@ export default defineComponent({
name: "VContentReportForm",
components: {
VButton,
VIcon,
VLink,
VRadio,
VDmcaNotice,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/VLink.vue
Expand Up @@ -2,7 +2,7 @@
<template>
<NuxtLink
v-if="isNuxtLink"
:class="{ 'inline-flex flex-row items-center gap-2': showExternalIcon }"
:class="{ 'inline-flex w-max items-center gap-x-2': showExternalIcon }"
:to="linkTo"
v-on="$listeners"
@click.native="$emit('click', $event)"
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/image/_id/report.vue
Expand Up @@ -20,11 +20,11 @@
/>
<!-- eslint-enable vue/no-v-html -->
<VButton
variant="secondary-bordered"
variant="bordered-gray"
:href="`/image/${image.id}`"
as="VLink"
size="disabled"
class="p-2 text-sr text-dark-charcoal"
size="medium"
class="label-bold"
>
{{ $t("report.image-details") }}
</VButton>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/tailwind.css
Expand Up @@ -173,7 +173,7 @@ Time - 11px - xs semibold (default leading-tight)
[class*="focus-slim-filled"] {
@apply focus-visible:relative focus-visible:after:pointer-events-none;
/* colored outline */
@apply focus-visible:outline focus-visible:outline-1.5;
@apply focus-visible:outline focus-visible:outline-1.5 focus-visible:outline-offset-0;
/* absolutely positioned overlapping pseudo element with a 1.5px border */
@apply focus-visible:after:absolute focus-visible:after:z-10 focus-visible:after:rounded-inherit;
@apply focus-visible:after:border-1.5 focus-visible:after:border-white;
Expand Down
1 change: 1 addition & 0 deletions frontend/test/playwright/e2e/header-internal.spec.ts
Expand Up @@ -84,6 +84,7 @@ test.describe("Header internal", () => {
await page.goto("/")
await clickMenuButton(page)
await page.getByRole("link", { name: t("navigation.about") }).click()
await page.waitForURL("/about")
await scrollToBottom(page)
const scrollPosition = await page.evaluate(() => window.scrollY)
expect(scrollPosition).toBeGreaterThan(100)
Expand Down
2 changes: 1 addition & 1 deletion frontend/test/playwright/utils/navigation.ts
Expand Up @@ -336,7 +336,7 @@ export const openFirstResult = async (page: Page, mediaType: MediaType) => {
const firstResultHref = await getLocatorHref(firstResult)
await firstResult.click({ position: { x: 32, y: 32 } })
await scrollDownAndUp(page)
await page.waitForURL(firstResultHref)
await page.waitForURL(firstResultHref, { waitUntil: "networkidle" })
await page.mouse.move(0, 0)
}

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -18,29 +18,27 @@ test.describe.configure({ mode: "parallel" })
for (const mediaType of supportedMediaTypes) {
for (const dir of languageDirections) {
test.describe(`${mediaType} ${dir} single-result page snapshots`, () => {
breakpoints.describeEvery(
{ maxDiffPixelRatio: 0.02 },
({ breakpoint, expectSnapshot }) => {
test.beforeEach(async ({ page }) => {
await closeFiltersUsingCookies(page)
await dismissBannersUsingCookies(page)
await setBreakpointCookie(page, breakpoint)

await goToSearchTerm(page, "birds", { dir })
})

test(`from search results`, async ({ page }) => {
// This will include the "Back to results" link.
await openFirstResult(page, mediaType)

await expectSnapshot(
`${mediaType}-${dir}-from-search-results`,
page,
{ fullPage: true }
)
})
}
)
breakpoints.describeEvery(({ breakpoint, expectSnapshot }) => {
test.beforeEach(async ({ page }) => {
await closeFiltersUsingCookies(page)
await dismissBannersUsingCookies(page)
await setBreakpointCookie(page, breakpoint)

await goToSearchTerm(page, "birds", { dir })
})

test(`from search results`, async ({ page }) => {
// This will include the "Back to results" link.
await openFirstResult(page, mediaType)

await expectSnapshot(
`${mediaType}-${dir}-from-search-results`,
page,
{ fullPage: true },
{ maxDiffPixelRatio: 0.02 }
)
})
})
})
}
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.