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
aa44abc8
Commit
aa44abc8
authored
7 years ago
by
Atte Keinänen
Browse files
Options
Downloads
Patches
Plain Diff
Avoid code duplication with new AddMetricButton component
parent
ede87abc
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/query_builder/components/AddMetricModal.jsx
+26
-25
26 additions, 25 deletions
.../src/metabase/query_builder/components/AddMetricModal.jsx
with
26 additions
and
25 deletions
frontend/src/metabase/query_builder/components/AddMetricModal.jsx
+
26
−
25
View file @
aa44abc8
...
...
@@ -4,6 +4,20 @@ import type {TableMetadata} from "metabase/meta/types/Metadata";
import
ModalContent
from
"
metabase/components/ModalContent
"
;
import
EmptyState
from
"
metabase/components/EmptyState
"
;
const
AddMetricButton
=
({
image
,
title
,
description
})
=>
<
div
className
=
"bg-white p2 flex align-center rounded"
style
=
{
{
height
:
"
500px
"
,
border
:
"
1px solid #DCE1E4
"
,
boxShadow
:
"
0 1px 3px 0 #DCE1E4
"
}
}
>
<
EmptyState
message
=
{
<
div
className
=
"mt4"
>
<
h2
className
=
"text-grey-5"
>
{
title
}
</
h2
>
<
p
className
=
"text-grey-4"
>
{
description
}
</
p
>
</
div
>
}
image
=
{
image
}
smallDescription
/>
</
div
>;
export
default
class
AddMetricModal
extends
Component
{
props
:
{
tableMetadata
:
TableMetadata
,
...
...
@@ -19,35 +33,22 @@ export default class AddMetricModal extends Component {
onClose
=
{
onClose
}
className
=
"bg-grey-0"
>
<
div
className
=
"flex-full full ml-auto mr-auto pl1 pr1 mt2 mb2 flex align-center"
style
=
{
{
maxWidth
:
"
1000px
"
}
}
>
<
div
className
=
"flex-full full ml-auto mr-auto pl1 pr1 mt2 mb2 flex align-center"
style
=
{
{
maxWidth
:
"
1000px
"
}
}
>
<
ol
className
=
"flex-full Grid Grid--guttersXXl Grid--full small-Grid--1of2"
>
<
li
className
=
"Grid-cell"
>
<
div
className
=
"bg-white p2 flex align-center rounded"
style
=
{
{
height
:
"
500px
"
,
border
:
"
1px solid #DCE1E4
"
,
boxShadow
:
"
0 1px 3px 0 #DCE1E4
"
}
}
>
<
EmptyState
message
=
{
<
div
className
=
"mt4"
>
<
h2
className
=
"text-grey-5"
>
Add a metric
</
h2
>
<
p
className
=
"text-grey-4"
>
We’ll show you saved metrics that are compatible with the metric you’re currently looking at.
</
p
>
</
div
>
}
image
=
"/app/img/empty_dashboard"
smallDescription
/>
</
div
>
<
AddMetricButton
image
=
"/app/img/empty_dashboard"
title
=
"Add a metric"
description
=
"We’ll show you saved metrics that are compatible with the metric you’re currently looking at."
/>
</
li
>
<
li
className
=
"Grid-cell"
>
<
div
className
=
"bg-white p2 flex align-center rounded"
style
=
{
{
height
:
"
500px
"
,
border
:
"
1px solid #DCE1E4
"
,
boxShadow
:
"
0 1px 3px 0 #DCE1E4
"
}
}
>
<
EmptyState
message
=
{
<
div
className
=
"mt4"
>
<
h2
className
=
"text-grey-5"
>
Create a new metric
</
h2
>
<
p
className
=
"text-grey-4"
>
Couldn’t find the thing you were looking for? If you want something done right, do it yourself, that’s your motto.
</
p
>
</
div
>
}
image
=
"/app/img/empty_dashboard"
smallDescription
/>
</
div
>
<
AddMetricButton
image
=
"/app/img/empty_dashboard"
title
=
"Create a new metric"
description
=
"Couldn’t find the thing you were looking for? If you want something done right, do it yourself, that’s your motto."
/>
</
li
>
</
ol
>
</
div
>
...
...
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