Skip to content

Commit

Permalink
Merge pull request #219 from openflighthpc/fix/disable-detach
Browse files Browse the repository at this point in the history
Remove detach volume option
  • Loading branch information
timalces authored May 22, 2024
2 parents 6b42e74 + 1a1f08d commit 05740c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
10 changes: 2 additions & 8 deletions app/javascript/canvas/irv/view/RackSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1605,15 +1605,9 @@ class RackSpace {
case 'focusOn':
return this.focusOn(params[1], params[2]);
case 'statusChangeRequest':
let act = false;
if (!['destroy', 'detach'].includes(params[1])) {
act = true;
} else if (params[1] === 'destroy' && confirm(`Are you sure you want to destroy ${params[4]}? This cannot be undone and may prevent the cluster performing correctly.`)) {
act = true;
} else if (params[1] === 'detach' && confirm(`Are you sure you want to detach ${params[4]}? This may impact operation of its associated instance(s).`)) {
act = true;
if (params[1] !== 'destroy' || confirm(`Are you sure you want to destroy ${params[4]}? This cannot be undone.`)) {
return this.requestStatusChange(params[1], params[2], params[3], params[4]);
}
if (act) return this.requestStatusChange(params[1], params[2], params[3], params[4]);
case 'reset':
return Events.dispatchEvent(this.rackEl, 'rackSpaceReset');
case 'clearDeselected':
Expand Down
2 changes: 1 addition & 1 deletion app/models/volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def self.valid_status_action_mappings
{
"IN_PROGRESS" => [],
"FAILED" => %w(destroy),
"ACTIVE" => %w(detach),
"ACTIVE" => [],
"AVAILABLE" => %w(destroy)
}
end
Expand Down
6 changes: 0 additions & 6 deletions app/views/interactive_rack_views/_configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,6 @@
"url" : "internal::statusChangeRequest,destroy,devices,[[device_id]],[[device_name]]",
"availableToBuildStatuses": ["AVAILABLE", "FAILED"],
"rbacAction" : "manage"
},
{
"caption" : "Detach",
"url" : "internal::statusChangeRequest,detach,devices,[[device_id]],[[device_name]]",
"availableToBuildStatuses": ["ACTIVE"],
"rbacAction" : "manage"
}
],
"Network": [
Expand Down

0 comments on commit 05740c7

Please sign in to comment.