Skip to content

Commit

Permalink
Merge pull request #6992 from BigFunger/add-data-source-record
Browse files Browse the repository at this point in the history
[add data] Source record UI changes
  • Loading branch information
BigFunger committed Apr 20, 2016
2 parents 36b332f + 99767bd commit 398747b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ app.directive('pipelineOutput', function () {
restrict: 'E',
template: pipelineOutputTemplate,
scope: {
pipeline: '='
pipeline: '=',
samples: '=',
sample: '='
},
controller: function ($scope) {
$scope.collapsed = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ app.directive('sourceData', function () {

$scope.previousLine = function () {
let currentIndex = samples.indexOf($scope.selectedSample);
if (currentIndex <= 0) return;
if (currentIndex <= 0) currentIndex = samples.length;

$scope.selectedSample = samples[currentIndex - 1];
};

$scope.nextLine = function () {
let currentIndex = samples.indexOf($scope.selectedSample);
if (currentIndex >= samples.length - 1) return;
if (currentIndex >= samples.length - 1) currentIndex = -1;

$scope.selectedSample = samples[currentIndex + 1];
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@import (reference) "~ui/styles/variables";
@import (reference) "~ui/styles/mixins";
@import (reference) "~ui/styles/theme";

pipeline-output {
display: block;

Expand All @@ -6,6 +10,7 @@ pipeline-output {

label {
width: 100%;
.flex-parent(1 0 auto);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
@import (reference) "~ui/styles/variables";
@import (reference) "~ui/styles/mixins";
@import (reference) "~ui/styles/theme";

source-data {
flex: 1 0 auto;
display: flex;

button {
flex: 0 0 auto;
width: 40px;
margin-left: 5px;
}

div.controls {
display: flex;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<div class="form-group">
<div class="header-line">
<label>Pipeline Output:</label>
<a
ng-click="collapsed = false"
ng-show="collapsed">expand</a>
<a
ng-click="collapsed = true"
ng-hide="collapsed">collapse</a>
</div>
<pre class="output" ng-class="{ collapsed: collapsed }">{{ pipeline.output | json }}</pre>
<div class="header-line">
<label>Pipeline Output</label>
<source-data
sample="sample"
samples="samples"
disabled="pipeline.hasCompileError">
</source-data>
</div>
<pre class="output">{{ pipeline.output | json }}</pre>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<source-data sample="sample" samples="samples" disabled="pipeline.hasCompileError"></source-data>

<pipeline-output pipeline="pipeline"></pipeline-output>
<pipeline-output pipeline="pipeline" samples="samples" sample="sample"></pipeline-output>

<div class="form-group">
<label>Processor Pipeline:</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
<div class="form-group">
<label>Current Line:</label>
<div class="controls">
<select
class="form-control"
ng-options="sample.message for sample in samples"
ng-model="selectedSample"
ng-disabled="disabled">
</select>
<button
aria-label="Previous Line"
tooltip="Previous Line"
tooltip-append-to-body="true"
ng-click="previousLine()"
type="button"
class="btn btn-xs btn-default"
ng-disabled="disabled">
<i aria-hidden="true" class="fa fa-chevron-left"></i>
</button>
<button
aria-label="Next Line"
tooltip="Next Line"
tooltip-append-to-body="true"
ng-click="nextLine()"
type="button"
class="btn btn-xs btn-default"
ng-disabled="disabled">
<i aria-hidden="true" class="fa fa-chevron-right"></i>
</button>
</div>
</div>
<button
aria-label="Previous Sample Record"
tooltip="Previous Sample Record"
tooltip-append-to-body="true"
ng-click="previousLine()"
type="button"
class="btn btn-xs btn-primary"
ng-disabled="disabled">
<i aria-hidden="true" class="fa fa-caret-left"></i>
</button>
<button
aria-label="Next Sample Record"
tooltip="Next Sample Record"
tooltip-append-to-body="true"
ng-click="nextLine()"
type="button"
class="btn btn-xs btn-primary"
ng-disabled="disabled">
<i aria-hidden="true" class="fa fa-caret-right"></i>
</button>

0 comments on commit 398747b

Please sign in to comment.