-
Notifications
You must be signed in to change notification settings - Fork 202
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
Fix types in VFilters and VContentReport #1030
Conversation
Size Change: -4.32 kB (-1%) Total Size: 844 kB
ℹ️ View Unchanged
|
Full-stack documentation: https://docs.openverse.org/_preview/1030 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
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.
@obulat If you rebase this PR and update svg/index.d.ts
to set the inline type to string
instead of unknown
, does the types issue with SVG imports still persist? I think the SVG import issue is fixed after I merged #951. I tried it locally and it appears to work, but I might be missing something critical about the issue.
@@ -4,7 +4,7 @@ | |||
class="relative flex text-sm leading-5" | |||
:class="labelClasses" | |||
> | |||
<div class="relative"> | |||
<span class="relative block"> |
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.
Only phrasing content is allowed inside of label
, so div
should be replaced with a phrasing span
. (WebStorm was complaining about this)
I rebased the PR and updated its content and description to match what is actually done here now. The renaming of the typings directory fixed the issue for normal SVGs, but the ones that were imported with I also added some changes to make the filters code be detected as |
frontend/src/components/VSelectField/meta/VSelectField.stories.mdx
Outdated
Show resolved
Hide resolved
frontend/src/components/VSelectField/meta/VSelectField.stories.mdx
Outdated
Show resolved
Hide resolved
frontend/src/components/VSelectField/meta/VSelectField.stories.mdx
Outdated
Show resolved
Hide resolved
frontend/src/components/VSelectField/meta/VSelectField.stories.mdx
Outdated
Show resolved
Hide resolved
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.
Nice! LGMT!
51e83f3
to
b5a18ed
Compare
@@ -65,6 +59,7 @@ test.describe("VFilterButton", () => { | |||
pressed: true, | |||
}) | |||
await page.locator("button", { hasText: "Filter" }).focus() | |||
await sleep(500) |
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.
await sleep(500)
Could you add a comment explaining what this wait is for, @obulat? Otherwise it seems like something that could be easily accidentally deleted or forgotten. Perhaps a todo: Remove when buttons are updated
or something as well if that's the case?
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.
I will open a PR based on prepare_old_buttons
branch fixing the filter button focus ring today, so I think a todo comment is not necessary.
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.
LGTM. Made some small doc suggestions.
Co-authored-by: Zack Krida <[email protected]>
* Fix issues in the workflow simplifications of #1054 (#1058) * Retry `up` recipe in case port is occupied (#990) * Fix typo in docs building on `main` (#1067) * Restore Django Admin views (#1065) * Update other references of media count to 700 million (#1098) * Dispatch workflows instead of regular reuse to show deployment runs (#1034) * Use label.yml to determine required labels (#1063) Co-authored-by: Dhruv Bhanushali <[email protected]> * Add `GITHUB_TOKEN` to GitHub CLI step (#1103) * Pass actor for staging deploys with the `-f` flag (#1104) * Bump ipython from 8.11.0 to 8.12.0 in /api (#1113) Bumps [ipython](https://github.com/ipython/ipython) from 8.11.0 to 8.12.0. - [Release notes](https://github.com/ipython/ipython/releases) - [Commits](ipython/ipython@8.11.0...8.12.0) --- updated-dependencies: - dependency-name: ipython dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Absorb `actionlint` into pre-commit (#1028) Co-authored-by: Dhruv Bhanushali <[email protected]> Co-authored-by: sarayourfriend <[email protected]> * Bump orjson from 3.8.8 to 3.8.9 in /api (#1114) Bumps [orjson](https://github.com/ijl/orjson) from 3.8.8 to 3.8.9. - [Release notes](https://github.com/ijl/orjson/releases) - [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md) - [Commits](ijl/orjson@3.8.8...3.8.9) --- updated-dependencies: - dependency-name: orjson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add Sentry to the ingestion server (#1106) * Add a wait to filter button test to fix CI (#1124) * Bump boto3 from 1.26.100 to 1.26.104 in /ingestion_server (#1110) * Bump sentry-sdk from 1.17.0 to 1.18.0 in /api (#1112) * Bump pillow from 9.4.0 to 9.5.0 in /api (#1115) * Update redis Docker tag to v4.0.14 (#1109) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * 🔄 synced file(s) with WordPress/openverse-infrastructure (#1127) Co-authored-by: openverse-bot <null> * Update other references of media count to 700 million (#1100) * Fix prod deployment workflow dispatch call (#1117) * Add a Slack notification job to the CI + CD workflow (#1066) * Fix types in VFilters and VContentReport (#1030) * Move the svgs for radiomark and check to components * Add files to tsconfig and fix types * Mock report service in the unit test * Type svg?inline as vue Component * Better License code type checking * Update frontend/src/components/VFilters/VFilterChecklist.vue * Revert unnecessary changes * Update frontend/src/components/VFilters/VFilterChecklist.vue Co-authored-by: Zack Krida <[email protected]> * Rename `ownValue` to `value_` --------- Co-authored-by: Zack Krida <[email protected]> * Convert VPill and VItemGroup stories to mdx (#1092) * Convert VPill story to MDX * Convert VItemGroup story to mdx * Fixing argTypes issue and fixing the headers * Update ci to use github.token (#1123) * Add `SLACK_WEBHOOK_TYPE` env var to reporting job (#1131) * Add consent decision-making process documentation (#887) * Prepare VButton for updates (#1002) * Rename button sizes and apply some styles only to 'old' buttons * Rename the snapshot tests to v-button-old * Fix VTab focus style * Small fixes (large-old, border, group/button) * Revert VTab focus changes Moved to a different PR * Revert "Revert VTab focus changes" This reverts commit ec9312d. * Use only focus-visible for consistency * Bump boto3 from 1.26.99 to 1.26.105 in /api (#1133) Bumps [boto3](https://github.com/boto/boto3) from 1.26.99 to 1.26.105. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](boto/boto3@1.26.99...1.26.105) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add more docs for Plausible and auto-initialise custom event names (#1122) * Add more docs for Plausible and auto-initialise custom event names * Update existing docs * Add caveat that it is not necessary to run Plausible if not working on custom events * Fix ToC * Add new buttons variants and sizes (#1003) * Add new VButton sizes and variants * Add new Storybook tests * Add border to transparent- buttons * Update bordered and transparent buttons * Update stories * Update snapshots * Remove pressed variants * Add missing snapshots * Fix transparent buttons * Update paddings In accordance with #860 (comment) * Update snapshots * Update frontend/src/components/VButton.vue Co-authored-by: Zack Krida <[email protected]> --------- Co-authored-by: Zack Krida <[email protected]> * Pass `GITHUB_TOKEN` to deploy docs (#1134) * Add context manager and join() --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Dhruv Bhanushali <[email protected]> Co-authored-by: Krystle Salazar <[email protected]> Co-authored-by: Madison Swain-Bowden <[email protected]> Co-authored-by: sarayourfriend <[email protected]> Co-authored-by: Tomvth <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adarsh Rawat <[email protected]> Co-authored-by: Dhruv Bhanushali <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Openverse (Bot) <[email protected]> Co-authored-by: Zack Krida <[email protected]> Co-authored-by: Sepehr Rezaei <[email protected]> Co-authored-by: Sumit Kashyap <[email protected]>
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.0.2 to 3.1.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](pre-commit/pre-commit@v3.0.2...v3.1.1) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description
Related to #951
This PR addresses some of the issues necessary to add files with
lang="ts"
on the script tag totsconfig
to actually type-check them.The SVGs that are used with
svg?inline
are actually Vue components and not the paths (strings), so I typed them accordingly. The import has to be inside the declaration, otherwise the non-?inline
declaration throw "Could not find module declaration" errors.One more change was to mock the ReportService in the unit tests instead of passing the service as a prop. This simplifies the set up and the testing, and re-uses the common pattern for testing services instead of creating a new one that is different from all other services.
The changes here allow us to add
VFilters/**.vue
andVContentReport/**.vue
totsconfig
.Testing Instructions
The CI should pass.
Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin