Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amundsen_dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Surendar Reddy Mangannagari
amundsen_dev
Commits
b382de50
Unverified
Commit
b382de50
authored
Jul 15, 2020
by
Tamika Tannis
Committed by
GitHub
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass product name to query list item UI (#510)
parent
d8d4cb82
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
10 deletions
+24
-10
index.spec.tsx
...atic/js/components/DashboardPage/QueryList/index.spec.tsx
+1
-0
index.tsx
...on/static/js/components/DashboardPage/QueryList/index.tsx
+3
-1
index.spec.tsx
.../js/components/DashboardPage/QueryListItem/index.spec.tsx
+1
-0
index.tsx
...tatic/js/components/DashboardPage/QueryListItem/index.tsx
+13
-6
index.tsx
..._application/static/js/components/DashboardPage/index.tsx
+6
-1
styles.scss
amundsen_application/static/js/components/NavBar/styles.scss
+0
-2
No files found.
amundsen_application/static/js/components/DashboardPage/QueryList/index.spec.tsx
View file @
b382de50
...
...
@@ -7,6 +7,7 @@ import QueryListItem from '../QueryListItem';
const
setup
=
(
propOverrides
?:
Partial
<
QueryListProps
>
)
=>
{
const
props
=
{
product
:
'Mode'
,
queries
:
[],
...
propOverrides
,
};
...
...
amundsen_application/static/js/components/DashboardPage/QueryList/index.tsx
View file @
b382de50
...
...
@@ -5,12 +5,13 @@ import QueryListItem from '../QueryListItem';
import
'./styles.scss'
;
export
interface
QueryListProps
{
product
:
string
;
queries
:
QueryResource
[];
}
class
QueryList
extends
React
.
Component
<
QueryListProps
>
{
render
()
{
const
{
queries
}
=
this
.
props
;
const
{
product
,
queries
}
=
this
.
props
;
if
(
queries
.
length
===
0
)
{
return
null
;
...
...
@@ -19,6 +20,7 @@ class QueryList extends React.Component<QueryListProps> {
const
queryList
=
queries
.
map
(({
name
,
query_text
,
url
})
=>
(
<
QueryListItem
key=
{
`key:${name}`
}
product=
{
product
}
text=
{
query_text
}
url=
{
url
}
name=
{
name
}
...
...
amundsen_application/static/js/components/DashboardPage/QueryListItem/index.spec.tsx
View file @
b382de50
...
...
@@ -6,6 +6,7 @@ import QueryListItem, { QueryListItemProps } from '.';
const
setup
=
(
propOverrides
?:
Partial
<
QueryListItemProps
>
)
=>
{
const
props
:
QueryListItemProps
=
{
product
:
'Mode'
,
text
:
'testQuery'
,
url
:
'http://test.url'
,
name
:
'testName'
,
...
...
amundsen_application/static/js/components/DashboardPage/QueryListItem/index.tsx
View file @
b382de50
import
*
as
React
from
'react'
;
import
{
OverlayTrigger
,
Popover
}
from
'react-bootstrap'
;
import
{
ResourceType
}
from
'interfaces'
;
import
{
getSourceDisplayName
,
getSourceIconClass
}
from
'config/config-utils'
;
import
'./styles.scss'
;
export
interface
QueryListItemProps
{
name
:
string
;
product
:
string
;
text
:
string
;
url
:
string
;
name
:
string
;
}
type
GoToDashboardLinkProps
=
{
product
:
string
;
url
:
string
;
};
const
QUERY_LABEL
=
'Query'
;
const
MODE_LINK_TOOLTIP_TEXT
=
'View in Mode
'
;
const
LINK_TOOLTIP_TEXT
=
'View in
'
;
const
LOADING_QUERY_MESSAGE
=
'Loading Query Component, please wait...'
;
const
LazyComponent
=
React
.
lazy
(()
=>
import
(
'./CodeBlock'
));
const
GoToDashboardLink
=
({
url
}:
GoToDashboardLinkProps
)
=>
{
const
GoToDashboardLink
=
({
product
,
url
}:
GoToDashboardLinkProps
)
=>
{
const
productName
=
getSourceDisplayName
(
product
,
ResourceType
.
dashboard
);
const
popoverHoverFocus
=
(
<
Popover
id=
"popover-trigger-hover-focus"
>
{
MODE_LINK_TOOLTIP_TEXT
}
</
Popover
>
<
Popover
id=
"popover-trigger-hover-focus"
>
{
`${LINK_TOOLTIP_TEXT} ${productName}`
}
</
Popover
>
);
return
(
...
...
@@ -61,7 +68,7 @@ const QueryBlockShimmer = () => {
);
};
const
QueryListItem
=
({
name
,
text
,
url
}:
QueryListItemProps
)
=>
{
const
QueryListItem
=
({
product
,
name
,
text
,
url
}:
QueryListItemProps
)
=>
{
const
[
isExpanded
,
setExpanded
]
=
React
.
useState
(
false
);
const
toggleExpand
=
()
=>
{
setExpanded
(
!
isExpanded
);
...
...
@@ -84,7 +91,7 @@ const QueryListItem = ({ name, text, url }: QueryListItemProps) => {
<
label
className=
"query-list-query-label section-title"
>
{
QUERY_LABEL
}
:
<
div
className=
"query-list-query-content"
>
<
GoToDashboardLink
url=
{
url
}
/>
<
GoToDashboardLink
product=
{
product
}
url=
{
url
}
/>
<
React
.
Suspense
fallback=
{
<
QueryBlockShimmer
/>
}
>
<
LazyComponent
text=
{
text
}
/>
</
React
.
Suspense
>
...
...
amundsen_application/static/js/components/DashboardPage/index.tsx
View file @
b382de50
...
...
@@ -132,7 +132,12 @@ export class DashboardPage extends React.Component<
}
tabInfo
.
push
({
content
:
<
QueryList
queries=
{
this
.
props
.
dashboard
.
queries
}
/>,
content
:
(
<
QueryList
product=
{
this
.
props
.
dashboard
.
product
}
queries=
{
this
.
props
.
dashboard
.
queries
}
/>
),
key
:
'queries'
,
title
:
`Queries (
${
this
.
props
.
dashboard
.
queries
.
length
}
)`
,
});
...
...
amundsen_application/static/js/components/NavBar/styles.scss
View file @
b382de50
...
...
@@ -86,8 +86,6 @@ $avatar-container-size: 40px;
}
}
.logo-icon
{
margin-right
:
$spacer-2
;
max-height
:
32px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment