This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Fix VIconButton default variant #1255
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a21953a
Fix VIconButton default variant
sarayourfriend b0f9fae
Undo unnecessary code changes
sarayourfriend 02da8ad
Update POT
sarayourfriend 2cc1213
Fix close button position and color
sarayourfriend dadebee
Increase timeout to prevent flakiness
sarayourfriend File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ import { | |
|
||
import { warn } from '~/utils/console' | ||
|
||
import type { ProperlyExtractPropTypes } from '~/types/prop-extraction' | ||
|
||
import VLink from '~/components/VLink.vue' | ||
|
||
const buttonForms = ['VLink', 'button'] as const | ||
|
@@ -63,6 +65,10 @@ const buttonTypes = ['button', 'submit', 'reset'] as const | |
|
||
export type ButtonType = typeof buttonTypes[number] | ||
|
||
export type ButtonProps = ProperlyExtractPropTypes< | ||
NonNullable<typeof VButton['props']> | ||
> | ||
Comment on lines
+68
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be after the declaration of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't decide 😅 I thought putting it before would make it more obvious where it was coming from for someone reading this and wondering how it worked 🤔 type declarations and references can appear in any order in a file so it doesn't cause any integrity issues. |
||
|
||
/** | ||
* A button component that behaves just like a regular HTML `button` element | ||
* aside from pre-applied styles based on the passed in variant. | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { | ||
ExtractPropTypes, | ||
ExtractDefaultPropTypes, | ||
} from '@nuxtjs/composition-api' | ||
|
||
/** | ||
* Correctly extracts optional prop types. | ||
* | ||
* I think this is fixed in the Vue 3 types but hasn't been | ||
* ported back to `@vue/composition-api` so for now we have | ||
* to suffer this ugly type. | ||
*/ | ||
export type ProperlyExtractPropTypes<P> = Omit< | ||
ExtractPropTypes<P>, | ||
keyof ExtractDefaultPropTypes<P> | ||
> & | ||
Partial<ExtractDefaultPropTypes<P>> |
26 changes: 26 additions & 0 deletions
26
test/playwright/visual-regression/content-report-form.spec.ts
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,26 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.describe('content report form', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/image/feb91b13-422d-46fa-8ef4-cbf1e6ddee9b') | ||
}) | ||
|
||
test('unfocused close button', async ({ page }) => { | ||
await page.click('button:has-text("report")', { timeout: 500 }) | ||
const form = page.locator('[data-testid="content-report-popover"]') | ||
|
||
expect(await form.screenshot({ timeout: 500 })).toMatchSnapshot({ | ||
name: 'content-report-unfocused.png', | ||
}) | ||
}) | ||
|
||
test('focused close button', async ({ page }) => { | ||
await page.click('button:has-text("report")', { timeout: 500 }) | ||
const form = page.locator('[data-testid="content-report-popover"]') | ||
|
||
await form.locator('[aria-label="Close"]').focus({ timeout: 500 }) | ||
expect(await form.screenshot()).toMatchSnapshot({ | ||
name: 'content-report-focused.png', | ||
}) | ||
}) | ||
}) |
Binary file added
BIN
+34.9 KB
...gression/content-report-form.spec.ts-snapshots/content-report-focused-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.9 KB
...ession/content-report-form.spec.ts-snapshots/content-report-unfocused-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions
114
test/tapes/detail_images_feb91b13-422d-46fa-8ef4-cbf1e6ddee9b_close.json5
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,114 @@ | ||
{ | ||
meta: { | ||
createdAt: '2022-04-11T12:31:19.362Z', | ||
host: 'https://api.openverse.engineering', | ||
resHumanReadable: true, | ||
}, | ||
req: { | ||
headers: { | ||
accept: 'application/json, text/plain, */*', | ||
connection: 'close', | ||
}, | ||
url: '/v1/images/feb91b13-422d-46fa-8ef4-cbf1e6ddee9b/', | ||
method: 'GET', | ||
body: '', | ||
}, | ||
res: { | ||
status: 200, | ||
headers: { | ||
date: [ | ||
'Mon, 11 Apr 2022 12:31:19 GMT', | ||
], | ||
'content-type': [ | ||
'application/json', | ||
], | ||
'transfer-encoding': [ | ||
'chunked', | ||
], | ||
connection: [ | ||
'close', | ||
], | ||
vary: [ | ||
'Accept-Encoding, Accept, Authorization, Origin', | ||
], | ||
allow: [ | ||
'GET, HEAD, OPTIONS', | ||
], | ||
'x-frame-options': [ | ||
'DENY', | ||
], | ||
'x-content-type-options': [ | ||
'nosniff', | ||
], | ||
'referrer-policy': [ | ||
'same-origin', | ||
], | ||
'cross-origin-opener-policy': [ | ||
'same-origin', | ||
], | ||
'cache-control': [ | ||
'max-age=14400', | ||
], | ||
'cf-cache-status': [ | ||
'HIT', | ||
], | ||
age: [ | ||
'533', | ||
], | ||
'last-modified': [ | ||
'Mon, 11 Apr 2022 12:22:26 GMT', | ||
], | ||
'expect-ct': [ | ||
'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', | ||
], | ||
'strict-transport-security': [ | ||
'max-age=15552000; includeSubDomains; preload', | ||
], | ||
server: [ | ||
'cloudflare', | ||
], | ||
'cf-ray': [ | ||
'6fa3bd128beb0e12-MXP', | ||
], | ||
'alt-svc': [ | ||
'h3=":443"; ma=86400, h3-29=":443"; ma=86400', | ||
], | ||
}, | ||
body: { | ||
id: 'feb91b13-422d-46fa-8ef4-cbf1e6ddee9b', | ||
title: 'Galah in Darwin (Eolophus roseicapilla)', | ||
foreign_landing_url: 'https://www.flickr.com/photos/126953422@N04/40593461235', | ||
creator: 'Graham Winterflood', | ||
creator_url: 'https://www.flickr.com/photos/126953422@N04', | ||
url: 'https://live.staticflickr.com/894/40593461235_b72593df28_b.jpg', | ||
filesize: null, | ||
filetype: null, | ||
license: 'by-sa', | ||
license_version: '2.0', | ||
license_url: 'https://creativecommons.org/licenses/by-sa/2.0/', | ||
provider: 'flickr', | ||
source: 'flickr', | ||
category: null, | ||
tags: [ | ||
{ | ||
name: 'bird', | ||
}, | ||
{ | ||
name: 'canoneos7d', | ||
}, | ||
{ | ||
name: 'eolophusroseicapilla', | ||
}, | ||
{ | ||
name: 'galah', | ||
}, | ||
], | ||
attribution: '"Galah in Darwin (Eolophus roseicapilla)" by Graham Winterflood is licensed under CC-BY-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/2.0/.', | ||
height: 683, | ||
width: 1024, | ||
thumbnail: 'http://localhost:49153/v1/images/feb91b13-422d-46fa-8ef4-cbf1e6ddee9b/thumb/', | ||
detail_url: 'http://localhost:49153/v1/images/feb91b13-422d-46fa-8ef4-cbf1e6ddee9b/', | ||
related_url: 'http://localhost:49153/v1/images/feb91b13-422d-46fa-8ef4-cbf1e6ddee9b/related/', | ||
}, | ||
}, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use the type from active media store here:
openverse-frontend/src/stores/active-media.ts
Line 7 in bccbd13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a different status, this one has "played" instead of "ejected". IIRC there is some distinction, perhaps one for when the player is closed ("ejected") and the other for when the audio has simply finished playing to the end (in which case we show the replay button).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thank you for explaining :)