From fc95a3c48db9a3d537a2067e010e417634fb0137 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Wed, 8 Feb 2017 12:34:27 -0500 Subject: [PATCH 1/5] Introducing react icons! --- package.json | 3 ++- src/core_plugins/kibana/public/kibana.js | 1 + .../public/visualize/listing/visualize_listing.html | 4 ++-- src/ui/public/react_components.js | 9 +++++++++ tasks/config/licenses.js | 1 + ui_framework/components/icon/kui_icon.js | 6 ++++++ ui_framework/components/icon/plus_icon.js | 6 ++++++ ui_framework/components/icon/trash_icon.js | 6 ++++++ 8 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/ui/public/react_components.js create mode 100644 ui_framework/components/icon/kui_icon.js create mode 100644 ui_framework/components/icon/plus_icon.js create mode 100644 ui_framework/components/icon/trash_icon.js diff --git a/package.json b/package.json index 2f31667cf0b3f..2f242096f5420 100644 --- a/package.json +++ b/package.json @@ -150,6 +150,7 @@ "mkdirp": "0.5.1", "moment": "2.13.0", "moment-timezone": "0.5.4", + "ngreact": "0.3.0", "no-ui-slider": "1.2.0", "node-fetch": "1.3.2", "node-uuid": "1.4.7", @@ -157,6 +158,7 @@ "postcss-loader": "1.2.1", "querystring-browser": "1.0.4", "raw-loader": "0.5.1", + "react": "15.2.0", "request": "2.61.0", "rimraf": "2.4.3", "rison-node": "1.0.0", @@ -232,7 +234,6 @@ "npm": "3.10.10", "portscanner": "1.0.0", "proxyquire": "1.7.10", - "react": "15.2.0", "react-addons-test-utils": "15.2.0", "react-dom": "15.2.0", "react-redux": "4.4.5", diff --git a/src/core_plugins/kibana/public/kibana.js b/src/core_plugins/kibana/public/kibana.js index 5815cc33c2d15..735347013b0f4 100644 --- a/src/core_plugins/kibana/public/kibana.js +++ b/src/core_plugins/kibana/public/kibana.js @@ -7,6 +7,7 @@ import routes from 'ui/routes'; import modules from 'ui/modules'; import kibanaLogoUrl from 'ui/images/kibana.svg'; +import 'ui/react_components'; import 'ui/autoload/all'; import 'plugins/kibana/discover/index'; import 'plugins/kibana/visualize/index'; diff --git a/src/core_plugins/kibana/public/visualize/listing/visualize_listing.html b/src/core_plugins/kibana/public/visualize/listing/visualize_listing.html index a9885114f9b27..e64ed7a14b44f 100644 --- a/src/core_plugins/kibana/public/visualize/listing/visualize_listing.html +++ b/src/core_plugins/kibana/public/visualize/listing/visualize_listing.html @@ -39,7 +39,7 @@ ng-click="listingController.deleteSelectedItems()" tooltip="Delete selected visualizations" > - + @@ -50,7 +50,7 @@ ng-if="listingController.getSelectedItemsCount() === 0" tooltip="Create new visualization" > - + diff --git a/src/ui/public/react_components.js b/src/ui/public/react_components.js new file mode 100644 index 0000000000000..798fd6bbfe766 --- /dev/null +++ b/src/ui/public/react_components.js @@ -0,0 +1,9 @@ +import 'ngreact'; + +import { PlusIcon } from 'ui_framework/components/icon/plus_icon'; +import { TrashIcon } from 'ui_framework/components/icon/trash_icon'; + +import uiModules from 'ui/modules'; +const app = uiModules.get('app/kibana', ['react']); +app.value('PlusIconComponent', PlusIcon); +app.value('TrashIconComponent', TrashIcon); diff --git a/tasks/config/licenses.js b/tasks/config/licenses.js index c43499364018f..0fb4dd012b0fb 100644 --- a/tasks/config/licenses.js +++ b/tasks/config/licenses.js @@ -31,6 +31,7 @@ module.exports = function (grunt) { 'Public domain', 'Unlicense', 'WTFPL', + '(GPL-2.0 OR MIT)', 'new BSD, and MIT' ], overrides: { diff --git a/ui_framework/components/icon/kui_icon.js b/ui_framework/components/icon/kui_icon.js new file mode 100644 index 0000000000000..d88d3efdc50a2 --- /dev/null +++ b/ui_framework/components/icon/kui_icon.js @@ -0,0 +1,6 @@ +import React from 'react'; + +export function KuiIcon({ className }) { + const classNames = ['kuiButton__icon', 'kuiIcon', className]; + return