-
Notifications
You must be signed in to change notification settings - Fork 15.2k
WIP: Templatizing SVG spinner #33782
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
base: master
Are you sure you want to change the base?
Conversation
…ates are flushed before assertions
…async updates after test end
…meout for "can modify columns" test
transform: translate(-50%, -50%); | ||
" | ||
/> | ||
<div class="spinner"> |
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.
Oops... I thought I already pulled in the SVG code here from the actual SVG file, rather than duplicating the code.
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.
This could basically be replaced by
{{ include('path/to/spinner.svg') }}
I think.
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Undocumented Color Variables ▹ view | 🧠 Incorrect | |
Redundant Animation Keyframes ▹ view | 🧠 Incorrect | |
Debug Statement in Production ▹ view | 🧠 Incorrect | |
Remove commented-out code ▹ view | 🧠 Not in scope | |
Missing Accessibility Attributes ▹ view | 🧠 Not in standard | |
Asset Loading Coupled to Component ▹ view | 🧠 Incorrect | |
Inefficient Animation Duration ▹ view | 🧠 Not in standard | |
Inline styles violate separation of concerns ▹ view | 🧠 Not in standard | |
Unexplained SVG Dash Values ▹ view | 🧠 Incorrect | |
Unsanitized SVG Content Injection ▹ view | 🧠 Not in standard |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx | ✅ |
superset/templates/superset/basic.html | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
<animate | ||
attributeName="d" | ||
dur="8s" | ||
repeatCount="indefinite" | ||
values="M 0,0 C 7,16 22,8.7 22,0 22,-8.7 7,-16 0,0 -7,16 -22,8.7 -22,-0 -22,-8.7 -7,-16 0,0 Z; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
attributeName="d" | ||
dur="8s" | ||
repeatCount="indefinite" | ||
values="M 0,0 C 7,16 22,8.7 22,0 22,-8.7 7,-16 0,0 -7,16 -22,8.7 -22,-0 -22,-8.7 -7,-16 0,0 Z; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
const [svgContent, setSvgContent] = useState(''); | ||
|
||
useEffect(() => { | ||
console.log('Loading SVG'); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -38,28 +60,31 @@ | |||
display: block; | |||
} | |||
&.floating { | |||
padding: 0; | |||
/* padding: 0; */ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
aria-label="Loading" | ||
data-test="loading-indicator" | ||
// eslint-disable-next-line react/no-danger | ||
dangerouslySetInnerHTML={{ __html: svgContent }} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
<style> | ||
.spinner svg { | ||
--primary-color: rgb(72, 72, 72); | ||
--accent-color: rgb(80, 165, 197); | ||
overflow: visible; | ||
} | ||
|
||
.spinner { | ||
padding: 10px; | ||
width: 50px; | ||
height: 50px; | ||
overflow: visible; | ||
} | ||
</style> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
--primary-color: rgb(72, 72, 72); | ||
--accent-color: rgb(80, 165, 197); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
<use | ||
href="#morphPath" | ||
stroke="var(--primary-color, inherit)" | ||
stroke-dasharray="108 10" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
<svg | ||
viewBox="-36 -25 72 50" | ||
xmlns="http://www.w3.org/2000/svg" | ||
overflow="visible" | ||
> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
fetch('/static/assets/images/spinner.svg') | ||
.then(response => response.text()) | ||
.then(htmlString => { | ||
setSvgContent(htmlString); | ||
}); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
SUMMARY
Just a sketch to show reusing the SVG spinner animation in jinja AND in the Loader component.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION