-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/bundler/angular-rails-templates-1…
….3.1
- Loading branch information
Showing
17 changed files
with
183 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="modal-header"> | ||
<button type="button" class="close btn-core-close" ng-click="ctrl.cancel()" aria-label="Close"></button> | ||
<h3 class="modal-title">Archive This Search Endpoint for Later?</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<p>You're about to put this search endpoint into deep freeze. You'll be able to unarchive it later through the "Archived Search Endpoint" filter in the Search Endpoint Listings.</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button class="btn btn-danger" ng-click="ctrl.ok()">Archive</button> | ||
<button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
app/assets/javascripts/components/delete_search_endpoint/_modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="modal-header"> | ||
<button type="button" class="close btn-core-close" ng-click="ctrl.cancel()" aria-label="Close"></button> | ||
<h3 class="modal-title">Delete This Search Endpoint</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<p>You're about to delete this Search Endpoint forever! If you think you might want it later, use the Archive function instead.</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button class="btn btn-danger" ng-click="ctrl.ok()">Delete</button> | ||
<button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
app/assets/javascripts/components/delete_search_endpoint/delete_search_endpoint.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<a class="action-icon" ng-click="ctrl.openDeleteModal()"> | ||
<i | ||
class="glyphicon glyphicon-trash" | ||
aria-hidden="true" | ||
title="Delete" | ||
alt="Delete" | ||
></i> | ||
</a> |
51 changes: 51 additions & 0 deletions
51
...assets/javascripts/components/delete_search_endpoint/delete_search_endpoint_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'use strict'; | ||
|
||
/*jshint latedef:false*/ | ||
|
||
angular.module('QuepidApp') | ||
.controller('DeleteSearchEndpointCtrl', [ | ||
'$scope', | ||
'$uibModal', | ||
'flash', | ||
'searchEndpointSvc', | ||
function ( | ||
$scope, | ||
$uibModal, | ||
flash, | ||
searchEndpointSvc | ||
) { | ||
var ctrl = this; | ||
|
||
ctrl.thisSearchEndpoint = $scope.thisSearchEndpoint; | ||
ctrl.deleteSearchEndpoint = deleteSearchEndpoint; | ||
ctrl.openDeleteModal = openDeleteModal; | ||
|
||
function deleteSearchEndpoint() { | ||
searchEndpointSvc.deleteSearchEndpoint(ctrl.thisSearchEndpoint).then( | ||
function () { | ||
flash.success = 'Search Endpoint deleted successfully.'; | ||
}, function (data) { | ||
var message = 'Oooops! Could not delete the Search Endpoint. '; | ||
message += data.message; | ||
flash.error = message; | ||
} | ||
); | ||
} | ||
|
||
function openDeleteModal() { | ||
var modalInstance = $uibModal.open({ | ||
templateUrl: 'delete_search_endpoint/_modal.html', | ||
controller: 'DeleteSearchEndpointModalInstanceCtrl', | ||
controllerAs: 'ctrl', | ||
size: 'sm', | ||
resolve: {} | ||
}); | ||
|
||
modalInstance.result.then(function (deleteClicked) { | ||
if( deleteClicked ){ | ||
ctrl.deleteSearchEndpoint(); | ||
} | ||
}); | ||
} | ||
} | ||
]); |
16 changes: 16 additions & 0 deletions
16
app/assets/javascripts/components/delete_search_endpoint/delete_search_endpoint_directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
angular.module('QuepidApp') | ||
.directive('deleteSearchEndpoint', [ | ||
function () { | ||
return { | ||
restrict: 'E', | ||
controller: 'DeleteSearchEndpointCtrl', | ||
controllerAs: 'ctrl', | ||
templateUrl: 'delete_search_endpoint/delete_search_endpoint.html', | ||
scope: { | ||
thisSearchEndpoint: '=', | ||
}, | ||
}; | ||
} | ||
]); |
19 changes: 19 additions & 0 deletions
19
...pts/components/delete_search_endpoint/delete_search_endpoint_modal_instance_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
angular.module('QuepidApp') | ||
.controller('DeleteSearchEndpointModalInstanceCtrl', [ | ||
'$rootScope', | ||
'$uibModalInstance', | ||
function ($rootScope, $uibModalInstance) { | ||
var ctrl = this; | ||
|
||
ctrl.ok = function () { | ||
$uibModalInstance.close(true); | ||
}; | ||
|
||
ctrl.cancel = function () { | ||
$uibModalInstance.close(false); | ||
}; | ||
|
||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
resources :search_endpoints do | ||
member do | ||
get 'clone' | ||
post 'archive' | ||
end | ||
end | ||
|
||
|