Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
support include_aliases option while restoring snapshots
Browse files Browse the repository at this point in the history
closes #302
  • Loading branch information
Leonardo Menezes committed Oct 19, 2015
1 parent f6b2531 commit 03b721c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
6 changes: 2 additions & 4 deletions _site/dist/kopf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2008,10 +2008,8 @@ kopf.controller('SnapshotController', ['$scope', 'ConfirmDialogService',
body.indices = $scope.restore_snap.indices.join(',');
}

if (angular.isDefined($scope.restore_snap.include_global_state)) {
body.include_global_state = $scope.restore_snap.include_global_state;
}

$scope.optionalParam(body, $scope.restore_snap, 'include_global_state');
$scope.optionalParam(body, $scope.restore_snap, 'include_aliases');
$scope.optionalParam(body, $scope.restore_snap, 'ignore_unavailable');
$scope.optionalParam(body, $scope.restore_snap, 'rename_replacement');
$scope.optionalParam(body, $scope.restore_snap, 'rename_pattern');
Expand Down
18 changes: 16 additions & 2 deletions _site/partials/snapshot/restore_snapshot.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
</div>
<div class="row">
<div class="form-group col-xs-6">
<div class="form-group col-lg-4">
<label class="form-label">ignore_unavailable</label>

<div class="row">
Expand All @@ -42,7 +42,21 @@
</div>
</div>
</div>
<div class="form-group col-xs-6">
<div class="form-group col-lg-4">
<label class="form-label">include_aliases</label>

<div class="row">
<div class="col-xs-12">
<label class="cluster-map-node-type">
<input type="checkbox" ng-model="restore_snap.include_aliases" ng-true-value="true"> True
</label>
<label class="cluster-map-node-type">
<input type="checkbox" ng-model="restore_snap.include_aliases" ng-true-value="false"> False
</label>
</div>
</div>
</div>
<div class="form-group col-lg-4">
<label class="form-label">include_global_state</label>

<div class="row">
Expand Down
6 changes: 2 additions & 4 deletions src/kopf/controllers/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ kopf.controller('SnapshotController', ['$scope', 'ConfirmDialogService',
body.indices = $scope.restore_snap.indices.join(',');
}

if (angular.isDefined($scope.restore_snap.include_global_state)) {
body.include_global_state = $scope.restore_snap.include_global_state;
}

$scope.optionalParam(body, $scope.restore_snap, 'include_global_state');
$scope.optionalParam(body, $scope.restore_snap, 'include_aliases');
$scope.optionalParam(body, $scope.restore_snap, 'ignore_unavailable');
$scope.optionalParam(body, $scope.restore_snap, 'rename_replacement');
$scope.optionalParam(body, $scope.restore_snap, 'rename_pattern');
Expand Down
4 changes: 4 additions & 0 deletions tests/jasmine/repository.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ describe('SnapshotController', function() {
"indices": ["idx-20140107", "idx-20140108"],
"ignore_unavailable": false,
"include_global_state": false,
"include_aliases": false,
"rename_replacement": "-chicken-",
"rename_pattern": "-",
"snapshot": {"snapshot": "my_snap", "repository": "my_repo"}
Expand All @@ -147,6 +148,7 @@ describe('SnapshotController', function() {
var expected = {
"indices": "idx-20140107,idx-20140108",
"include_global_state": false,
"include_aliases": false,
"ignore_unavailable": false,
"rename_replacement": "-chicken-",
"rename_pattern": "-"
Expand Down Expand Up @@ -175,6 +177,7 @@ describe('SnapshotController', function() {
"indices": ["idx-20140107", "idx-20140108"],
"ignore_unavailable": false,
"include_global_state": false,
"include_aliases": false,
"rename_replacement": "-chicken-",
"rename_pattern": "-",
"snapshot": {"snapshot": "my_snap", "repository": "my_repo"}
Expand All @@ -183,6 +186,7 @@ describe('SnapshotController', function() {
var expected = {
"indices": "idx-20140107,idx-20140108",
"include_global_state": false,
"include_aliases": false,
"ignore_unavailable": false,
"rename_replacement": "-chicken-",
"rename_pattern": "-"
Expand Down

0 comments on commit 03b721c

Please sign in to comment.