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
c631797a
Commit
c631797a
authored
9 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Section name. Move label button
parent
8d9669e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/questions/components/Item.jsx
+4
-4
4 additions, 4 deletions
frontend/src/questions/components/Item.jsx
frontend/src/questions/selectors.js
+17
-7
17 additions, 7 deletions
frontend/src/questions/selectors.js
with
21 additions
and
11 deletions
frontend/src/questions/components/Item.jsx
+
4
−
4
View file @
c631797a
...
...
@@ -26,6 +26,10 @@ const Item = ({ id, name, created, by, selected, favorite, archived, icon, label
</
div
>
<
ItemBody
id
=
{
id
}
name
=
{
name
}
labels
=
{
labels
}
created
=
{
created
}
by
=
{
by
}
/>
<
div
className
=
{
S
.
rightIcons
}
>
<
LabelPopover
triggerElement
=
{
<
Icon
className
=
{
S
.
tagIcon
}
name
=
"grid"
width
=
{
20
}
height
=
{
20
}
/>
}
item
=
{
{
id
,
labels
}
}
/>
<
Icon
className
=
{
S
.
favoriteIcon
}
name
=
"star"
width
=
{
20
}
height
=
{
20
}
onClick
=
{
()
=>
setFavorited
(
id
,
!
favorite
)
}
/>
</
div
>
<
div
className
=
{
S
.
extraIcons
}
>
...
...
@@ -38,10 +42,6 @@ const ItemBody = pure(({ id, name, labels, created, by }) =>
<
div
className
=
{
S
.
itemTitle
}
>
<
span
className
=
{
S
.
itemName
}
>
{
name
}
</
span
>
<
Labels
labels
=
{
labels
}
/>
<
LabelPopover
triggerElement
=
{
<
Icon
className
=
{
S
.
tagIcon
}
name
=
"grid"
/>
}
item
=
{
{
id
,
labels
}
}
/>
</
div
>
<
div
className
=
{
S
.
itemSubtitle
}
>
{
"
Created
"
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/questions/selectors.js
+
17
−
7
View file @
c631797a
import
{
createSelector
}
from
'
reselect
'
;
import
moment
from
"
moment
"
;
import
_
from
"
underscore
"
;
import
visualizations
from
"
metabase/visualizations
"
;
...
...
@@ -91,10 +92,6 @@ export const getAllAreSelected = createSelector(
selectedCount
===
visibleCount
&&
visibleCount
>
0
)
// FIXME:
export
const
getSectionName
=
(
state
,
props
)
=>
sections
[
0
].
name
;
const
sections
=
[
{
id
:
"
all
"
,
name
:
"
All questions
"
,
icon
:
"
star
"
},
{
id
:
"
favorites
"
,
name
:
"
Favorites
"
,
icon
:
"
star
"
},
...
...
@@ -106,11 +103,13 @@ const sections = [
export
const
getSections
=
(
state
)
=>
sections
;
export
const
getTopics
=
(
state
)
=>
[];
export
const
getEditingLabelId
=
(
state
)
=>
state
.
labels
.
editing
;
export
const
getLabels
=
createSelector
(
[(
state
)
=>
state
.
labels
.
entities
.
labels
,
(
state
)
=>
state
.
labels
.
labels
],
(
labelEntities
,
labelIds
)
=>
labelIds
.
map
(
id
=>
labelEntities
[
id
])
)
)
;
const
getLabelCountsForSelectedEntities
=
createSelector
(
[
getSelectedEntities
],
...
...
@@ -123,7 +122,7 @@ const getLabelCountsForSelectedEntities = createSelector(
}
return
counts
;
}
)
)
;
export
const
getLabelsWithSelectedState
=
createSelector
(
[
getLabels
,
getSelectedCount
,
getLabelCountsForSelectedEntities
],
...
...
@@ -138,4 +137,15 @@ export const getLabelsWithSelectedState = createSelector(
}))
)
export
const
getEditingLabelId
=
(
state
)
=>
state
.
labels
.
editing
;
export
const
getSectionName
=
createSelector
(
[
getSection
,
getSlug
,
getSections
,
getLabels
],
(
sectionId
,
slug
,
sections
,
labels
)
=>
{
if
(
sectionId
===
"
label
"
)
{
let
label
=
_
.
findWhere
(
labels
,
{
slug
:
slug
});
return
label
&&
label
.
name
}
else
{
let
section
=
_
.
findWhere
(
sections
,
{
id
:
sectionId
});
return
section
&&
section
.
name
}
}
);
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