Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Design for Visualize #6156

Merged
merged 50 commits into from
Mar 15, 2016
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3f1c980
init changes to Visualize Page redesign
stormpython Feb 2, 2016
bbeb13b
Merge branch 'feature/design' of github.com:elastic/kibana into featu…
stormpython Feb 2, 2016
729dbd7
adding more inline styles to break out later
stormpython Feb 2, 2016
b41fbee
more preliminary changes in style for the paginate element
stormpython Feb 3, 2016
3c125d2
cleaning up, moving inline style to less files
stormpython Feb 4, 2016
c9b8d8c
updating css changes to use flexbox instead of bootstrap grid
stormpython Feb 4, 2016
31c51ad
Merge branch 'feature/design' of github.com:elastic/kibana into featu…
stormpython Feb 4, 2016
024835a
initial changes to step 2 process, styling and html changes to step 1
stormpython Feb 5, 2016
e63900a
troubleshooting styling for step 1 and step 2 visualize pages
stormpython Feb 8, 2016
5af3696
adding inline styles to line up with spec
stormpython Feb 9, 2016
d920095
adding background color to pagination numbers
stormpython Feb 9, 2016
1832f2f
adding text color to select text
stormpython Feb 10, 2016
ace35c3
removing inline styles
stormpython Feb 10, 2016
48e8126
Merge remote-tracking branch 'upstream/feature/design' into visualize
stormpython Feb 11, 2016
f072adf
adding media query for step 1, adding flex to saved object finder for…
stormpython Feb 11, 2016
bf5d73e
minor changes
stormpython Feb 11, 2016
dbc9076
cleaning up css, variabilizing colors
stormpython Feb 11, 2016
a70c9e5
adding .empty file
stormpython Feb 11, 2016
68d95b5
replacing #ffffff with @white variable
stormpython Feb 11, 2016
910027a
removing dropdown menu, splitting screen on step_2 as in step_1.html,…
stormpython Feb 11, 2016
ee2b0b0
renaming table header, correcting link function
stormpython Feb 12, 2016
1ea8f64
cleaning up
stormpython Feb 12, 2016
b184e08
removing unused functions that will surely break tests
stormpython Feb 12, 2016
040969c
fixing issue with left column not expanding to match right column in …
stormpython Feb 12, 2016
7bc5573
fixing issue with right column not matching left column on step-1
stormpython Feb 12, 2016
c575789
adding capitalize filter to deal with title words, tweaking padding, …
stormpython Feb 12, 2016
2ba854b
replacing noun with nouns as the placeholder for text input
stormpython Feb 12, 2016
735a197
finishing tests for capitalize filter, adding ability to add non-capi…
stormpython Feb 13, 2016
d38346c
Merge branch 'feature/design' into visualize
stormpython Mar 2, 2016
73c0f9e
working on sorting
stormpython Mar 3, 2016
9382b34
adding sortable hits for saved object finder
stormpython Mar 3, 2016
90990f0
small refactor
stormpython Mar 3, 2016
f41c3a8
refactoring
stormpython Mar 3, 2016
5790cb3
adding comments
stormpython Mar 3, 2016
b5417e9
Merge branch 'feature/design' of github.com:elastic/kibana into visua…
stormpython Mar 8, 2016
2c3eccf
removing spaces
stormpython Mar 8, 2016
a2b92ac
Merge branch 'feature/design' of github.com:elastic/kibana into visua…
stormpython Mar 9, 2016
c6432bc
refactoring less
stormpython Mar 10, 2016
99f4812
refactoring less files
stormpython Mar 10, 2016
7af5419
refactoring less files
stormpython Mar 10, 2016
ba61485
refactoring less and html files
stormpython Mar 10, 2016
344a444
using text-transform in favor or custom capitalize filter
stormpython Mar 10, 2016
cabf785
reverting a small change
stormpython Mar 10, 2016
ad3375e
Merge branch 'feature/design' of github.com:elastic/kibana into visua…
stormpython Mar 10, 2016
6ff4e0d
changes addressing reviewer comments
stormpython Mar 10, 2016
aee024b
addressing reviewer comments
stormpython Mar 11, 2016
18f9f78
add kbn-href
stormpython Mar 11, 2016
c7a412e
fixing padding
stormpython Mar 11, 2016
3bfc088
lining up visualize sidebar with side nav bar as well as fixing hover…
stormpython Mar 14, 2016
f4ee8e3
fixing issue with url query string
stormpython Mar 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 82 additions & 28 deletions src/plugins/kibana/public/visualize/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,98 @@
@import (reference) "~ui/styles/list-group-menu";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move colors out to variables, reuse kibanaGrays

.vis-wizard {
h1 {
margin-top: 45px;
}
}
margin-right: 0;
margin-left: 0;
padding-left: 0;
padding-right: 0;

@media (min-width: @screen-lg) {
.wizard {
padding: 0;
display: flex;

.wizard-vis-type {
.list-group-item();
.list-group-menu .list-group-menu-item();
.wizard-column {
flex: 1;
display: flex;
flex-direction: column;
padding: 0px 2.5px;

.wizard-row {
flex: 1;
background-color: @kibanaGray6;
}
}
}
}

// overrided for tablet and desktop
@media (min-width: @screen-md-min) {
display: flex;
align-items: flex-start;
h3 {
margin-top: 35px;
padding: 0px 15px;
}

&-heading {
flex: 0 0 200px;
display: flex;
align-items: center;
font-size: 1.2em;

.fa {
flex: 0 0 auto;
margin-right: @padding-base-horizontal;
font-size: 1.5em;
text-align: center;
.wizard-row {
.panel {
margin-bottom: 0;
border: none;
}

.panel-default > .panel-heading {
background-color: @kibanaGray6;
}

.list-group {
margin-bottom: 0;

.list-group-item {
border-radius: 0;
border: none;
}
}

h4 {
flex: 1 0 auto;
.striped {
li:nth-child(odd) {
background-color: @white;
}

li:nth-child(even) {
background-color: @kibanaGray6;
}
}
}

&-description {
flex: 1 1 auto;
color: @wizard-vis-type-description-color;
.wizard-type {
flex: 1;
.list-group-item();
.list-group-menu .list-group-menu-item();

border: none;
border-radius: 0;
background-color: @kibanaGray6;

&-heading {
flex: 0 0 200px;
display: flex;
align-items: center;
font-size: 1.2em;

.fa {
flex: 0 0 auto;
margin-right: @padding-base-horizontal;
font-size: 1.5em;
text-align: center;
color: @saved-object-finder-icon-color;
}

h4 {
flex: 1 0 auto;
}
}

&-description {
flex: 1 1 auto;
color: @wizard-vis-type-description-color;
}
}
}


@import "../editor/styles/_editor.less";
42 changes: 20 additions & 22 deletions src/plugins/kibana/public/visualize/wizard/step_1.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<h1>
Create a new visualization <br class="visible-xs">
<span class="pull-right label label-default hidden-xs">Step 1</span>
<span class="label label-default visible-xs">Step 1</span>
</h1>

<div class="wizard-vis-types">
<a class="wizard-vis-type"
ng-repeat="type in visTypes.inTitleOrder"
ng-href="{{ visTypeUrl(type) }}">
<div class="wizard-vis-type-heading">
<i aria-hidden="true" class="fa fa-fw" ng-class="type.icon"></i>
<h4>{{type.title}}</h4>
<div class="wizard">
<div class="wizard-column">
<h3>Create New Visualization</h3>
<div class="wizard-row">
<a class="wizard-type" ng-repeat="type in visTypes.inTitleOrder" ng-href="{{ visTypeUrl(type) }}">
<div class="wizard-type-heading">
<i aria-hidden="true" class="fa fa-fw" ng-class="type.icon"></i>
<h4>{{type.title}}</h4>
</div>
<p class="wizard-type-description">{{type.description}}</p>
</a>
</div>
<p class="wizard-vis-type-description">{{type.description}}</p>
</a>
</div>
<div class="wizard-column">
<h3>Or, Open a Saved Visualization</h3>
<saved-object-finder
title="Saved Visualizations"
type="visualizations"
class="wizard-row">
</saved-object-finder>
</div>
</div>

<h1>Or, open a saved visualization</h1>

<saved-object-finder
title="Saved Visualizations"
type="visualizations">
</saved-object-finder>
53 changes: 21 additions & 32 deletions src/plugins/kibana/public/visualize/wizard/step_2.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
<h1>
Select a search source
<span class="pull-right label label-default hidden-xs">Step 2</span>
<span class="label label-default visible-xs">Step 2</span>
</h1>
<ul class="list-group list-group-menu" ng-switch on="stepTwoMode">
<li ng-click="stepTwoMode='new'"
ng-class="{'active': stepTwoMode=='new'}"
class="list-group-item list-group-menu-item">
From a new search
</li>
<li class="list-group-item" ng-switch-when="new">
<div class="wizard">
<div class="wizard-column">
<h3>From a New Search</h3>
<!-- Index patterns -->
Select an index pattern
<div class="form-group">
<select
class="form-control"
ng-model="indexPattern.selection"
ng-options="pattern as pattern for pattern in indexPattern.list | orderBy:'toString()'">
</select>
<div class="wizard-row">
<div class="panel panel-default">
<div class="panel-heading">Index Patterns</div>
</div>
<ul class="striped list-group">
<li class="list-group-item" ng-repeat="pattern in indexPattern.list | orderBy: 'toString()'">
<a class="index-link" kbn-href="{{ makeUrl(pattern) }}">{{pattern}}</a>
</li>
</ul>
</div>
</li>

<li ng-click="stepTwoMode='saved'"
ng-class="{'active': stepTwoMode=='saved'}"
class="list-group-item list-group-menu-item">
From a saved search
</li>
<li class="list-group-item" ng-switch-when="saved">
</div>
<div class="wizard-column">
<h3>Or, From a Saved Search</h3>
<!-- Saved searches -->
<saved-object-finder
title="Saved Searches"
type="searches"
make-url="step2WithSearchUrl">
title="Saved Searches"
type="searches"
class="wizard-row"
make-url="step2WithSearchUrl">
</saved-object-finder>
</li>
</ul>
</div>
</div>
16 changes: 4 additions & 12 deletions src/plugins/kibana/public/visualize/wizard/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import uiModules from 'ui/modules';


const templateStep = function (num, txt) {
return '<div ng-controller="VisualizeWizardStep' + num + '" class="container vis-wizard">' + txt + '</div>';
return '<div ng-controller="VisualizeWizardStep' + num + '" class="container-fluid vis-wizard">' + txt + '</div>';
};

const module = uiModules.get('app/visualize', ['kibana/courier']);
Expand Down Expand Up @@ -56,16 +56,8 @@ module.controller('VisualizeWizardStep2', function ($route, $scope, $location, t
list: $route.current.locals.indexPatternIds
};

$scope.$watch('stepTwoMode', function (mode) {
if (mode === 'new') {
if ($scope.indexPattern.list && $scope.indexPattern.list.length === 1) {
$scope.indexPattern.selection = $scope.indexPattern.list[0];
}
}
});

$scope.$watch('indexPattern.selection', function (pattern) {
$scope.makeUrl = function (pattern) {
if (!pattern) return;
kbnUrl.change('/visualize/create?type={{type}}&indexPattern={{pattern}}', {type: type, pattern: pattern});
});
return `/visualize/create?type=${type}&indexPattern=${pattern}`;
};
});
17 changes: 17 additions & 0 deletions src/ui/public/directives/saved_object_finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Pr

filterResults();

/**
* Boolean that keeps track of whether hits are sorted ascending (true)
* or descending (false) by title
* @type {Boolean}
*/
self.isAscending = true;

/**
* Sorts saved object finder hits either ascending or descending
* @param {Array} hits Array of saved finder object hits
* @return {Array} Array sorted either ascending or descending
*/
self.sortHits = function (hits) {
self.isAscending = !self.isAscending;
self.hits = self.isAscending ? _.sortBy(hits, 'title') : _.sortBy(hits, 'title').reverse();
};

/**
* Passed the hit objects and will determine if the
* hit should have a url in the UI, returns it if so
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/paginated_table/paginated_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@
<!-- auto-inserted by the paginate directive... -->
<!-- <paginate-controls></paginate-controls> -->
<div class="pagination-container" ng-transclude></div>

</paginate>
71 changes: 44 additions & 27 deletions src/ui/public/partials/saved_object_finder.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
<form role="form">
<div class="form-group finder-form">
<div class="finder-form-options">
<a class="small" ng-click="finder.manageObjects(finder.properties.name)">manage {{finder.properties.nouns}}</a>
<form role="form" class="form-inline">
<div class="container-fluid">
<div class="row">
<div class="input-group form-group finder-form col-md-7">
<span class="input-group-addon">
<i class="fa fa-search"></i>
</span>
<input
input-focus
ng-model="filter"
ng-attr-placeholder="{{finder.properties.nouns}} Filter..."
ng-keydown="finder.filterKeyDown($event)"
class="form-control"
name="filter"
type="text"
autocomplete="off" />
</div>
<div class="finder-hit-count col-md-2">
<span>{{finder.hitCount}} of {{finder.hitCount}}</span>
</div>
<div class="finder-manage-object col-md-2">
<a class="small" ng-click="finder.manageObjects(finder.properties.name)">Manage {{finder.properties.nouns}}</a>
</div>
</div>
<div class="clearfix visible-xs-block"></div>
<input
input-focus
ng-model="filter"
ng-attr-placeholder="{{finder.properties.noun}} Filter"
ng-keydown="finder.filterKeyDown($event)"
class="form-control"
name="filter"
type="text"
autocomplete="off" />

<span class="finder-hit-count"><strong>{{finder.hitCount}}</strong> {{finder.hitCountNoun()}}</span>
</div>
</form>
<paginate list="finder.hits" per-page="{{perPage}}">
<ul
class="list-group list-group-menu"
ng-class="{'select-mode': finder.selector.enabled}">
<paginate list="finder.hits" per-page="20">
<ul class="li-striped list-group list-group-menu" ng-class="{'select-mode': finder.selector.enabled}">

<li class="list-group-item list-group-menu-item">
<span class="paginate-heading">
Name
<i
class="fa"
ng-click="finder.sortHits(finder.hits)"
ng-class="finder.isAscending ? 'fa-caret-up' : 'fa-caret-down'">
</i>
</span>
</li>

<li
class="list-group-item list-group-menu-item"
Expand All @@ -29,19 +45,20 @@
ng-keydown="finder.hitKeyDown($event, page, paginate)"
ng-click="finder.onChoose(hit, $event)">

<a
ng-href="{{finder.makeUrl(hit)}}"
ng-blur="finder.hitBlur($event)"
ng-click="finder.preventClick($event)">

<i aria-hidden="true" class="fa" ng-if="hit.icon" ng-class="hit.icon"></i> {{hit.title}}
<p ng-if="hit.description" ng-bind="hit.description"></p>
<a ng-href="{{finder.makeUrl(hit)}}"
ng-blur="finder.hitBlur($event)"
ng-click="finder.preventClick($event)">
<i aria-hidden="true" class="finder-type fa" ng-if="hit.icon" ng-class="hit.icon"></i>
<span>{{hit.title}}</span>
<p ng-if="hit.description" ng-bind="hit.description"></p>
</a>
</li>

<li
class="list-group-item list-group-no-results"
ng-if="finder.hits.length === 0">
<p ng-bind="'No matching ' + finder.properties.nouns + ' found.'"></p>
</li>

</ul>
</paginate>
Loading