Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/js/modules/competing/templates/templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ define(['./_module'], function (app) {
function removeProjection(location){
projectionsService.remove($scope.location, {
deleteCheckpointStream: $scope.deleteCheckpoint ? 'yes' : 'no',
deleteStateStream: $scope.deleteState ? 'yes' : 'no'
deleteStateStream: $scope.deleteState ? 'yes' : 'no',
deleteEmittedStreams: $scope.deleteEmittedStreams ? 'yes' : 'no'
})
.success(function () {
msg.success('Projection has been removed');
Expand Down
23 changes: 18 additions & 5 deletions src/js/modules/projections/controllers/ProjectionsNewCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ define(['./_module'], function (app) {
$scope.enabled = true;
$scope.checkpointsDisabled = false;
$scope.checkpoints = false;
$scope.trackEmittedStreams = false;

$scope.save = function () {

Expand All @@ -41,7 +42,8 @@ define(['./_module'], function (app) {
name: $scope.name,
emit: yesOrNo($scope.emit),
checkpoints: yesOrNo($scope.checkpoints),
enabled: yesOrNo($scope.enabled)
enabled: yesOrNo($scope.enabled),
trackemittedstreams: yesOrNo($scope.trackemittedstreams),
};

projectionsService.create($scope.mode, $scope.source, param)
Expand All @@ -56,8 +58,17 @@ define(['./_module'], function (app) {
});
};


var unbindHandler = $scope.$watch('mode', function (newVal, oldVal) {
var unbindEmitHandler = $scope.$watch('emit', function (newVal, oldVal) {
if(newVal == true){
$scope.trackemittedstreams = true;
$scope.trackEmittedStreamsDisabled = false;
} else {
$scope.trackEmittedStreamsDisabled = true;
$scope.trackemittedstreams = false;
}
});

var unbindModeHandler = $scope.$watch('mode', function (newVal, oldVal) {
var isContinuous;
if(newVal !== oldVal) {
isContinuous = newVal === 'continuous';
Expand All @@ -71,9 +82,11 @@ define(['./_module'], function (app) {
}
}
});

$scope.$on('$destroy', function () {
unbindHandler();
unbindEmitHandler();
unbindModeHandler();
});
}
]);
});
});
4 changes: 2 additions & 2 deletions src/js/modules/projections/templates/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.run(['$templateCache', function($templateCache) {
$templateCache.put('projections.item.delete.tpl.html',
'<header class=page-header><h2 class=page-title>Delete Projection</h2><ul class=page-nav><li class=page-nav__item><a ng-click=remove($event) href=#>Confirm Delete</a> <a ui-sref=^.details>Back</a></li></ul></header><table><tbody><tr><td>Name</td><td><span>{{ projection.name }}</span></td></tr><tr><td>State</td><td><span>{{ projection.state }}</span></td></tr><tr><td>Source</td><td><pre>\n' +
'{{ projection.source }}\n' +
' </pre></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteCheckpoint> Delete Checkpoint Stream</label></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteState> Delete State Stream</label></td></tr></tbody></table>');
' </pre></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteCheckpoint> Delete Checkpoint Stream</label></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteState> Delete State Stream</label></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteEmittedStreams> Delete Emitted Streams</label></td></tr></tbody></table>');
}]);
})();

Expand Down Expand Up @@ -90,7 +90,7 @@ try {
}
module.run(['$templateCache', function($templateCache) {
$templateCache.put('projections.new.tpl.html',
'<header class=page-header><h2 class=page-title>New Projection</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><div><a ui-sref=^.standard>You can also post a standard projection</a></div><form novalidate name=newProj ng-submit=save() class=new-projection-form><table><tbody><tr><td>Name</td><td><input ng-model=name required class=form-table name=projName ng-class="{ \'form-table--error\' : newProj.projName.$invalid && !newProj.projName.$pristine }"></td></tr><tr><td>Source</td><td><div ui-ace=aceConfig required ng-model=source></div></td></tr><tr><td>Mode</td><td><select ng-model=mode class=form-table ng-options="obj.value as obj.name for obj in modes"></select></td></tr><tr><td>Checkpoints Enabled</td><td><input type=checkbox ng-model=checkpoints ng-disabled="checkpointsDisabled"></td></tr><tr><td>Emit Enabled</td><td><input type=checkbox ng-model="emit"></td></tr><tr><td>Enabled</td><td><input type=checkbox ng-model="enabled"></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=newProj.$invalid>Create</button></li></ul></form>');
'<header class=page-header><h2 class=page-title>New Projection</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><div><a ui-sref=^.standard>You can also post a standard projection</a></div><form novalidate name=newProj ng-submit=save() class=new-projection-form><table><tbody><tr><td>Name</td><td><input ng-model=name required class=form-table name=projName ng-class="{ \'form-table--error\' : newProj.projName.$invalid && !newProj.projName.$pristine }"></td></tr><tr><td>Source</td><td><div ui-ace=aceConfig required ng-model=source></div></td></tr><tr><td>Mode</td><td><select ng-model=mode class=form-table ng-options="obj.value as obj.name for obj in modes"></select></td></tr><tr><td>Checkpoints Enabled</td><td><input type=checkbox ng-model=checkpoints ng-disabled="checkpointsDisabled"></td></tr><tr><td>Emit Enabled</td><td><input type=checkbox ng-model="emit"></td></tr><tr><td>Track Emitted Streams</td><td><input type=checkbox ng-model=trackemittedstreams ng-disabled="trackEmittedStreamsDisabled"></td></tr><tr><td>Enabled</td><td><input type=checkbox ng-model="enabled"></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=newProj.$invalid>Create</button></li></ul></form>');
}]);
})();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ <h2 class="page-title">Delete Projection</h2>
</label>
</td>
</tr>
<tr>
<td></td>
<td>
<label>
<input type="checkbox" ng-model="deleteEmittedStreams"> Delete Emitted Streams
</label>
</td>
</tr>
</tbody>
</table>

Expand Down
8 changes: 8 additions & 0 deletions src/js/modules/projections/views/projections.new.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ <h2 class="page-title">New Projection</h2>
<input type="checkbox" ng-model="emit" />
</td>
</tr>
<tr>
<td>Track Emitted Streams</td>
<td>
<input type="checkbox"
ng-model="trackemittedstreams"
ng-disabled="trackEmittedStreamsDisabled" />
</td>
</tr>
<tr>
<td>Enabled</td>
<td>
Expand Down