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
chore(dashboard): Integrate dashboard app into the SPA bundle #14356
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14356 +/- ##
==========================================
+ Coverage 77.18% 77.76% +0.57%
==========================================
Files 954 957 +3
Lines 48184 51712 +3528
Branches 5977 6494 +517
==========================================
+ Hits 37193 40213 +3020
- Misses 10794 11297 +503
- Partials 197 202 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -159,6 +162,10 @@ export function Menu({ | |||
}: MenuProps) { | |||
const [dropdownOpen, setDropdownOpen] = useState(false); | |||
|
|||
// would useQueryParam here but not all apps provide a router context | |||
const standalone = getUrlParam('standalone', 'boolean'); | |||
if (standalone) return <></>; |
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 this is cool, we'll support standalone=true
for all pages
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.
In the course of writing this I also learned about standalone=2
which removes the dashboard header lol
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 have standalone
be a set of bit flags where each bit is a different feature to remove /s
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.
🤦
@@ -169,13 +182,14 @@ function ListViewCard({ | |||
imgPosition = 'top', | |||
cover, | |||
}: CardProps) { | |||
const Link = url && linkComponent ? linkComponent : AnchorLink; |
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.
Is this just in case this is used outside of a react-router context?
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.
Most list view links still need to be anchor links. It's just the dashboard ones that can be <Link>
s for now.
/testenv up |
@suddjian Ephemeral environment spinning up at http://54.191.158.50:8080. Credentials are |
return ( | ||
<StyledCard | ||
data-test="styled-card" | ||
cover={ | ||
cover || ( | ||
<Cover> | ||
<a href={url}> | ||
<Link to={url!}> |
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.
Maybe we can adda. test to make sure this renders as expected with/without the url?
@@ -139,7 +141,7 @@ function DashboardCard({ | |||
<CardStyles | |||
onClick={() => { | |||
if (!bulkSelectEnabled) { | |||
window.location.href = dashboard.url; | |||
history.push(dashboard.url); |
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.
Let's do an E2E test to go into and out of a dashboard, to make sure we can get hither and yon.
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.
Would be good to have one that hits the dashboard url directly and one that navigates to it via the list view link
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.
Noted a couple opportunities for tests, but in general LGTM!!
Ephemeral environment shutdown and build artifacts deleted. |
* chore(dashboard): Integrate dashboard app into the SPA bundle * fix url params * change variable name * change title correctly * custom css * lint * remove unused file * remove content assertions from dashboard tests * fix case with missing bootstrap data * fix: respect crud views flag * crud views -> spa * remove unused dashboard templates * fix: remove unused variable * fix: missed a spot with the crudViews -> spa * router link to dashboard from dashboard list page * link using the router when in card mode * lint * fix tests, add memory router * remove dashboard app files * split up the bundle a little more * use webpack preload
…#14356) * chore(dashboard): Integrate dashboard app into the SPA bundle * fix url params * change variable name * change title correctly * custom css * lint * remove unused file * remove content assertions from dashboard tests * fix case with missing bootstrap data * fix: respect crud views flag * crud views -> spa * remove unused dashboard templates * fix: remove unused variable * fix: missed a spot with the crudViews -> spa * router link to dashboard from dashboard list page * link using the router when in card mode * lint * fix tests, add memory router * remove dashboard app files * split up the bundle a little more * use webpack preload
…#14356) * chore(dashboard): Integrate dashboard app into the SPA bundle * fix url params * change variable name * change title correctly * custom css * lint * remove unused file * remove content assertions from dashboard tests * fix case with missing bootstrap data * fix: respect crud views flag * crud views -> spa * remove unused dashboard templates * fix: remove unused variable * fix: missed a spot with the crudViews -> spa * router link to dashboard from dashboard list page * link using the router when in card mode * lint * fix tests, add memory router * remove dashboard app files * split up the bundle a little more * use webpack preload
…#14356) * chore(dashboard): Integrate dashboard app into the SPA bundle * fix url params * change variable name * change title correctly * custom css * lint * remove unused file * remove content assertions from dashboard tests * fix case with missing bootstrap data * fix: respect crud views flag * crud views -> spa * remove unused dashboard templates * fix: remove unused variable * fix: missed a spot with the crudViews -> spa * router link to dashboard from dashboard list page * link using the router when in card mode * lint * fix tests, add memory router * remove dashboard app files * split up the bundle a little more * use webpack preload
SUMMARY
/views/App
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
standalone
.ADDITIONAL INFORMATION