Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
292c2e5b
Unverified
Commit
292c2e5b
authored
5 years ago
by
Paul Rosenzweig
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid calling /database/:id/metadata in BrowseApp (#12052)
parent
cd6cec65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/components/BrowseApp.jsx
+44
-34
44 additions, 34 deletions
frontend/src/metabase/components/BrowseApp.jsx
with
44 additions
and
34 deletions
frontend/src/metabase/components/BrowseApp.jsx
+
44
−
34
View file @
292c2e5b
...
...
@@ -32,7 +32,14 @@ export class SchemaBrowser extends React.Component {
<
Box
>
<
Schema
.
ListLoader
query
=
{
{
dbId
}
}
>
{
({
schemas
})
=>
schemas
.
length
>
1
?
(
schemas
.
length
===
1
?
(
<
TableBrowser
{
...
this
.
props
}
params
=
{
{
...
this
.
props
.
params
,
schemaName
:
schemas
[
0
].
name
}
}
// hide the schema since there's only one
showSchemaInHeader
=
{
false
}
/>
)
:
(
<
Box
>
<
BrowseHeader
crumbs
=
{
[
...
...
@@ -40,39 +47,41 @@ export class SchemaBrowser extends React.Component {
{
title
:
<
Database
.
Name
id
=
{
dbId
}
/>
},
]
}
/>
<
Grid
>
{
schemas
.
map
(
schema
=>
(
<
GridItem
w
=
{
ITEM_WIDTHS
}
key
=
{
schema
.
id
}
>
<
Link
to
=
{
`/browse/
${
dbId
}
/schema/
${
schema
.
name
}
`
}
mb
=
{
1
}
hover
=
{
{
color
:
color
(
"
accent2
"
)
}
}
data-metabase-event
=
{
`
${
ANALYTICS_CONTEXT
}
;Schema Click`
}
className
=
"overflow-hidden"
>
<
Card
hoverable
px
=
{
1
}
>
<
Flex
align
=
"center"
>
<
EntityItem
name
=
{
schema
.
name
}
iconName
=
"folder"
iconColor
=
{
color
(
"
accent2
"
)
}
item
=
{
schema
}
/>
<
Box
ml
=
"auto"
>
<
Icon
name
=
"reference"
/>
<
Tooltip
tooltip
=
{
t
`X-ray this schema`
}
>
<
Icon
name
=
"bolt"
mx
=
{
1
}
/>
</
Tooltip
>
</
Box
>
</
Flex
>
</
Card
>
</
Link
>
</
GridItem
>
))
}
</
Grid
>
{
schemas
.
length
===
0
?
(
<
h2
className
=
"full text-centered text-medium"
>
{
t
`This database doesn't have any tables.`
}
</
h2
>
)
:
(
<
Grid
>
{
schemas
.
map
(
schema
=>
(
<
GridItem
w
=
{
ITEM_WIDTHS
}
key
=
{
schema
.
id
}
>
<
Link
to
=
{
`/browse/
${
dbId
}
/schema/
${
schema
.
name
}
`
}
mb
=
{
1
}
hover
=
{
{
color
:
color
(
"
accent2
"
)
}
}
data-metabase-event
=
{
`
${
ANALYTICS_CONTEXT
}
;Schema Click`
}
className
=
"overflow-hidden"
>
<
Card
hoverable
px
=
{
1
}
>
<
Flex
align
=
"center"
>
<
EntityItem
name
=
{
schema
.
name
}
iconName
=
"folder"
iconColor
=
{
color
(
"
accent2
"
)
}
item
=
{
schema
}
/>
<
Box
ml
=
"auto"
>
<
Icon
name
=
"reference"
/>
<
Tooltip
tooltip
=
{
t
`X-ray this schema`
}
>
<
Icon
name
=
"bolt"
mx
=
{
1
}
/>
</
Tooltip
>
</
Box
>
</
Flex
>
</
Card
>
</
Link
>
</
GridItem
>
))
}
</
Grid
>
)
}
</
Box
>
)
:
(
<
TableBrowser
{
...
this
.
props
}
/>
)
}
</
Schema
.
ListLoader
>
...
...
@@ -90,6 +99,7 @@ export class TableBrowser extends React.Component {
const
{
metadata
,
params
:
{
dbId
,
schemaName
},
showSchemaInHeader
=
true
,
}
=
this
.
props
;
return
(
<
Box
>
...
...
@@ -104,7 +114,7 @@ export class TableBrowser extends React.Component {
title
:
<
Database
.
Name
id
=
{
dbId
}
/>,
to
:
`browse/
${
dbId
}
`
,
},
schema
Name
!=
null
&&
{
title
:
schemaName
},
s
howS
chema
InHeader
&&
{
title
:
schemaName
},
]
}
/>
<
Grid
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment