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
0bebc3e8
Commit
0bebc3e8
authored
9 years ago
by
Kyle Doherty
Browse files
Options
Downloads
Patches
Plain Diff
create icon paths and use in react
parent
eb264e6d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/frontend_client/app/icon_paths.js
+32
-0
32 additions, 0 deletions
resources/frontend_client/app/icon_paths.js
resources/frontend_client/app/query_builder/icon.react.js
+2
-16
2 additions, 16 deletions
resources/frontend_client/app/query_builder/icon.react.js
with
34 additions
and
16 deletions
resources/frontend_client/app/icon_paths.js
0 → 100644
+
32
−
0
View file @
0bebc3e8
'
use strict
'
;
/*
Metabase Icon Paths
-----
These paths represent the current canonical icon set for Metabase.and are referenced by icons
used in both React and Angular components as a central source of truth.
USAGE:
*/
var
ICON_PATHS
=
{
add
:
'
M19,13 L19,2 L14,2 L14,13 L2,13 L2,18 L14,18 L14,30 L19,30 L19,18 L30,18 L30,13 L19,13 Z
'
,
addtodash
:
[
'
M16,31 L16,31 C24.2842712,31 31,24.2842712 31,16 C31,7.71572875 24.2842712,1 16,1 C7.71572875,1 1,7.71572875 1,16 C1,24.2842712 7.71572875,31 16,31 L16,31 Z M16,32 L16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 L16,32 Z
'
,
'
M17,15.5 L17,10 L15,10 L15,15.5 L9.5,15.5 L9.5,17.5 L15,17.5 L15,23 L17,23 L17,17.5 L22.5,17.5 L22.5,15.5 L17,15.5 Z
'
,
],
chevrondown
:
'
M1 12 L16 26 L31 12 L27 8 L16 18 L5 8 z
'
,
chevronright
:
'
M12 1 L26 16 L12 31 L8 27 L18 16 L8 5 z
'
,
check
:
'
M1 14 L5 10 L13 18 L27 4 L31 8 L13 26 z
'
,
close
:
'
M4 8 L8 4 L16 12 L24 4 L28 8 L20 16 L28 24 L24 28 L16 20 L8 28 L4 24 L12 16 z
'
,
download
:
[
'
M17,16.5 L17,8 L15,8 L15,16.5 L11,16.5 L9.93247919,16.5 L10.6158894,17.3200922 L15.6158894,23.3200922 L16,23.781025 L16.3841106,23.3200922 L21.3841106,17.3200922 L22.0675208,16.5 L21,16.5 L17,16.5 L17,16.5 Z
'
,
'
M16,31 L16,31 C24.2842712,31 31,24.2842712 31,16 C31,7.71572875 24.2842712,1 16,1 C7.71572875,1 1,7.71572875 1,16 C1,24.2842712 7.71572875,31 16,31 L16,31 Z M16,32 L16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 L16,32 Z
'
],
expand
:
'
M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z
'
,
filter
:
'
M6.57883011,7.57952565 L1.18660637e-12,-4.86721774e-13 L16,-4.92050845e-13 L9.42116989,7.57952565 L9.42116989,13.5542169 L6.57883011,15 L6.57883011,7.57952565 Z
'
,
};
/* module.exports = ICON_PATHS */
This diff is collapsed.
Click to expand it.
resources/frontend_client/app/query_builder/icon.react.js
+
2
−
16
View file @
0bebc3e8
...
...
@@ -2,20 +2,6 @@
var
Icon
=
React
.
createClass
({
displayName
:
'
Icon
'
,
iconPaths
:
{
addtodash
:
[
'
M16,31 L16,31 C24.2842712,31 31,24.2842712 31,16 C31,7.71572875 24.2842712,1 16,1 C7.71572875,1 1,7.71572875 1,16 C1,24.2842712 7.71572875,31 16,31 L16,31 Z M16,32 L16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 L16,32 Z
'
,
'
M17,15.5 L17,10 L15,10 L15,15.5 L9.5,15.5 L9.5,17.5 L15,17.5 L15,23 L17,23 L17,17.5 L22.5,17.5 L22.5,15.5 L17,15.5 Z
'
,
],
check
:
'
M1 14 L5 10 L13 18 L27 4 L31 8 L13 26 z
'
,
close
:
'
M4 8 L8 4 L16 12 L24 4 L28 8 L20 16 L28 24 L24 28 L16 20 L8 28 L4 24 L12 16 z
'
,
download
:
[
'
M17,16.5 L17,8 L15,8 L15,16.5 L11,16.5 L9.93247919,16.5 L10.6158894,17.3200922 L15.6158894,23.3200922 L16,23.781025 L16.3841106,23.3200922 L21.3841106,17.3200922 L22.0675208,16.5 L21,16.5 L17,16.5 L17,16.5 Z
'
,
'
M16,31 L16,31 C24.2842712,31 31,24.2842712 31,16 C31,7.71572875 24.2842712,1 16,1 C7.71572875,1 1,7.71572875 1,16 C1,24.2842712 7.71572875,31 16,31 L16,31 Z M16,32 L16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 L16,32 Z
'
],
expand
:
'
M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z
'
,
filter
:
'
M6.57883011,7.57952565 L1.18660637e-12,-4.86721774e-13 L16,-4.92050845e-13 L9.42116989,7.57952565 L9.42116989,13.5542169 L6.57883011,15 L6.57883011,7.57952565 Z
'
,
},
getDefaultProps
:
function
()
{
return
{
width
:
32
,
...
...
@@ -24,13 +10,13 @@ var Icon = React.createClass({
};
},
render
:
function
()
{
var
iconPath
=
this
.
iconPaths
[
this
.
props
.
name
],
var
iconPath
=
ICON_PATHS
[
this
.
props
.
name
],
path
;
// handle multi path icons which appear as non strings
if
(
typeof
(
iconPath
)
!=
'
string
'
)
{
// create a path for each path present
path
=
iconPath
.
map
(
function
(
path
)
{
path
=
ICON_PATHS
.
map
(
function
(
path
)
{
return
(
<
path
d
=
{
path
}
/>
)
;
});
}
else
{
...
...
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