Skip to content

Commit

Permalink
demonstrating flow of data through the wizard steps
Browse files Browse the repository at this point in the history
(cherry picked from commit 4bcc5a1)
  • Loading branch information
Bargs committed Dec 30, 2015
1 parent 52a4ee3 commit 8b5c95d
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
Install filebeat step
<h2>Install filebeat step</h2>

<div>
Results:
<ul>
<li>Logs: {{results[0]}}</li>
<li>Docs: {{results[1]}}</li>
<li>Pattern: {{results[2]}}</li>
</ul>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ var template = require('plugins/kibana/settings/sections/data/directives/install
modules.get('apps/settings')
.directive('installFilebeatStep', function () {
return {
template: template
template: template,
scope: {
results: '='
},
controller: function ($scope) {
var results = $scope.results;
}
};
});

Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Paste samples step
<h2>Paste samples step</h2>

<button ng-click="save({results: 'some sample logs'})">Do Stuff</button>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ var template = require('plugins/kibana/settings/sections/data/directives/paste_s
modules.get('apps/settings')
.directive('pasteSamplesStep', function () {
return {
template: template
template: template,
scope: {
save: '&onSave'
}
};
});

Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
Pattern review step
<h2>Pattern review step</h2>

<div>
Docs: {{docs}}
</div>

<button ng-click="save({results: {id: 'logstash-*', title: 'myFirstIndexPattern'}})">Create an index pattern</button>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ var template = require('plugins/kibana/settings/sections/data/directives/pattern
modules.get('apps/settings')
.directive('patternReviewStep', function () {
return {
template: template
template: template,
scope: {
docs: '=',
save: '&onSave'
}
};
});

Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
Build pipeline step
<h2>Build pipeline step</h2>

<div>
Logs: {{logs}}
</div>

<button ng-click="save({results: {os: 'osx'}})">Build a pipeline</button>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ var template = require('plugins/kibana/settings/sections/data/directives/pipelin
modules.get('apps/settings')
.directive('pipelineStep', function () {
return {
template: template
template: template,
scope: {
logs: '=',
save: '&onSave'
}
};
});

Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
</div>

<div ng-switch="currentStep">
<paste-samples-step ng-switch-when="0"></paste-samples-step>
<pipeline-step ng-switch-when="1"></pipeline-step>
<pattern-review-step ng-switch-when="2"></pattern-review-step>
<install-filebeat-step ng-switch-when="3"></install-filebeat-step>
<paste-samples-step on-save="saveStepResults(0, results)" ng-switch-when="0"></paste-samples-step>
<pipeline-step on-save="saveStepResults(1, results)" logs="stepResults[0]" ng-switch-when="1"></pipeline-step>
<pattern-review-step on-save="saveStepResults(2, results)" docs="stepResults[1]" ng-switch-when="2"></pattern-review-step>
<install-filebeat-step results="stepResults" ng-switch-when="3"></install-filebeat-step>
</div>

<button ng-click="prevStep()">Prev</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ routes.when('/settings/data/filebeat', {
modules.get('apps/settings')
.controller('kbnSettingsDataFilebeat', function ($scope) {
var totalSteps = 4;
var currentStep = 0;
$scope.currentStep = 0;
$scope.stepResults = [];

$scope.currentStep = currentStep;
$scope.nextStep = function () {
if ($scope.currentStep + 1 < totalSteps) {
++$scope.currentStep;
Expand All @@ -32,4 +32,7 @@ modules.get('apps/settings')
$scope.currentStep = step;
};

$scope.saveStepResults = function (step, results) {
$scope.stepResults[step] = results;
};
});

0 comments on commit 8b5c95d

Please sign in to comment.