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
82015c02
Commit
82015c02
authored
7 years ago
by
Atte Keinänen
Browse files
Options
Downloads
Patches
Plain Diff
Say "You don't have any saved questions yet" if no questions
parent
6e8481cb
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/questions/containers/QuestionIndex.jsx
+11
-1
11 additions, 1 deletion
frontend/src/metabase/questions/containers/QuestionIndex.jsx
with
11 additions
and
1 deletion
frontend/src/metabase/questions/containers/QuestionIndex.jsx
+
11
−
1
View file @
82015c02
...
...
@@ -2,11 +2,13 @@ import React, { Component } from "react";
import
{
connect
}
from
"
react-redux
"
;
import
{
Link
}
from
"
react-router
"
;
import
Collapse
from
"
react-collapse
"
;
import
cx
from
"
classnames
"
;
import
Icon
from
"
metabase/components/Icon
"
;
import
Button
from
"
metabase/components/Button
"
;
import
DisclosureTriangle
from
"
metabase/components/DisclosureTriangle
"
;
import
TitleAndDescription
from
"
metabase/components/TitleAndDescription
"
;
import
ExpandingSearchField
from
"
../components/ExpandingSearchField
"
;
import
CollectionActions
from
"
../components/CollectionActions
"
;
...
...
@@ -53,8 +55,9 @@ export default class QuestionIndex extends Component {
const
hasQuestions
=
questions
&&
questions
.
length
>
0
;
const
showCollections
=
isAdmin
||
hasCollections
;
const
showQuestions
=
hasQuestions
||
!
showCollections
||
location
.
query
.
f
!=
null
;
const
showNoSavedQuestions
=
!
hasCollections
&&
showCollections
&&
!
showQuestions
;
return
(
<
div
className
=
"relative mx4"
>
<
div
className
=
{
cx
(
"
relative mx4
"
,
{
"
full-height flex flex-column
"
:
showNoSavedQuestions
})
}
>
<
div
className
=
"flex align-center pt4 pb2"
>
<
TitleAndDescription
title
=
{
showCollections
?
"
Collections of Questions
"
:
"
Saved Questions
"
}
/>
<
div
className
=
"flex align-center ml-auto"
>
...
...
@@ -81,6 +84,13 @@ export default class QuestionIndex extends Component {
}
</
div
>
}
{
showNoSavedQuestions
&&
<
div
className
=
"mt2 flex-full flex align-center justify-center"
>
<
h2
className
=
"text-grey-2 text-normal"
>
You don't have any saved questions yet
</
h2
>
</
div
>
}
{
/* only show title if we're showing the questions AND collections, otherwise title goes in the main header */
}
{
showQuestions
&&
showCollections
&&
<
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