diff --git a/ee/bulk-operations-dashboard/api/controllers/profiles/edit-profile.js b/ee/bulk-operations-dashboard/api/controllers/profiles/edit-profile.js index 4314cf92bf..bede01b44f 100644 --- a/ee/bulk-operations-dashboard/api/controllers/profiles/edit-profile.js +++ b/ee/bulk-operations-dashboard/api/controllers/profiles/edit-profile.js @@ -89,7 +89,7 @@ module.exports = { } else if (!newProfile && !profile.teams){// Undeployed profiles are stored in the app's database. // console.log('editing an undeployed profile!'); profileContents = profile.profileContents; - filename = profile.name + profile.profileType; + filename = profile.name; extension = profile.profileType; } // ╔═╗╔═╗╔═╗╦╔═╗╔╗╔ ╔═╗╦═╗╔═╗╔═╗╦╦ ╔═╗ @@ -137,17 +137,19 @@ module.exports = { }); }// After every added team } else { - // If there is a new profile uploaded, we will need to delete the old profiles, and add the new profile. - for(let team of profile.teams) { - // console.log(`removing ${profile.name} from team id ${team.teamName}`); - await sails.helpers.http.sendHttpRequest.with({ - method: 'DELETE', - baseUrl: sails.config.custom.fleetBaseUrl, - url: `/api/v1/fleet/configuration_profiles/${team.uuid}`, - headers: { - Authorization: `Bearer ${sails.config.custom.fleetApiToken}`, - } - }); + if(profile.teams) { + // If there is a new profile uploaded, we will need to delete the old profiles, and add the new profile. + for(let team of profile.teams) { + // console.log(`removing ${profile.name} from team id ${team.teamName}`); + await sails.helpers.http.sendHttpRequest.with({ + method: 'DELETE', + baseUrl: sails.config.custom.fleetBaseUrl, + url: `/api/v1/fleet/configuration_profiles/${team.uuid}`, + headers: { + Authorization: `Bearer ${sails.config.custom.fleetApiToken}`, + } + }); + } } for(let teamApid of newTeamIds){ // console.log(`Adding ${profile.name} to team id ${teamApid}`); diff --git a/ee/bulk-operations-dashboard/api/controllers/scripts/edit-script.js b/ee/bulk-operations-dashboard/api/controllers/scripts/edit-script.js index fdd3d3d37a..48228bc324 100644 --- a/ee/bulk-operations-dashboard/api/controllers/scripts/edit-script.js +++ b/ee/bulk-operations-dashboard/api/controllers/scripts/edit-script.js @@ -122,15 +122,17 @@ module.exports = { }); } } else { - for(let scriptId of script.teams){ - await sails.helpers.http.sendHttpRequest.with({ - method: 'DELETE', - baseUrl: sails.config.custom.fleetBaseUrl, - url: `/api/v1/fleet/scripts/${scriptId.scriptFleetApid}`, - headers: { - Authorization: `Bearer ${sails.config.custom.fleetApiToken}`, - } - }); + if(script.teams) { + for(let scriptId of script.teams){ + await sails.helpers.http.sendHttpRequest.with({ + method: 'DELETE', + baseUrl: sails.config.custom.fleetBaseUrl, + url: `/api/v1/fleet/scripts/${scriptId.scriptFleetApid}`, + headers: { + Authorization: `Bearer ${sails.config.custom.fleetApiToken}`, + } + }); + } } for(let teamApid of newTeamIds){ // Build a request body for the team. diff --git a/ee/bulk-operations-dashboard/assets/styles/pages/profiles.less b/ee/bulk-operations-dashboard/assets/styles/pages/profiles.less index a3b8db00c9..68e3a3736b 100644 --- a/ee/bulk-operations-dashboard/assets/styles/pages/profiles.less +++ b/ee/bulk-operations-dashboard/assets/styles/pages/profiles.less @@ -213,7 +213,18 @@ margin-right: 8px; } } - + [purpose='delete-button'] { + border-radius: 6px; + background: #D66C7B; + border-color: #D66C7B; + color: #FFF; + } + [purpose='modal-button'] { + border-radius: 6px; + background: #6A67FE; + color: #FFF; + border-color: #6A67FE; + } [purpose='modal-buttons'] { [purpose='cancel-button'] { color: @core-vibrant-blue; diff --git a/ee/bulk-operations-dashboard/assets/styles/pages/scripts.less b/ee/bulk-operations-dashboard/assets/styles/pages/scripts.less index 7eca32352a..9ef71d164a 100644 --- a/ee/bulk-operations-dashboard/assets/styles/pages/scripts.less +++ b/ee/bulk-operations-dashboard/assets/styles/pages/scripts.less @@ -197,6 +197,12 @@ border: 1px solid #dc3545; } } + [purpose='delete-button'] { + border-radius: 6px; + background: #D66C7B; + border-color: #D66C7B; + color: #FFF; + } [purpose='file-upload'] { color: @core-vibrant-blue; display: flex; @@ -209,6 +215,12 @@ margin-right: 8px; } } + [purpose='modal-button'] { + border-radius: 6px; + background: #6A67FE; + color: #FFF; + border-color: #6A67FE; + } [purpose='modal-buttons'] { [purpose='cancel-button'] { color: @core-vibrant-blue; diff --git a/ee/bulk-operations-dashboard/views/pages/profiles.ejs b/ee/bulk-operations-dashboard/views/pages/profiles.ejs index a49b926b62..a7f2989009 100644 --- a/ee/bulk-operations-dashboard/views/pages/profiles.ejs +++ b/ee/bulk-operations-dashboard/views/pages/profiles.ejs @@ -102,7 +102,7 @@
- Save + Save
@@ -119,8 +119,8 @@
- Cancel - Delete + Cancel + Delete
@@ -145,7 +145,7 @@
Cancel - Add + Add
diff --git a/ee/bulk-operations-dashboard/views/pages/scripts.ejs b/ee/bulk-operations-dashboard/views/pages/scripts.ejs index aa2c327aa3..2b00b7771c 100644 --- a/ee/bulk-operations-dashboard/views/pages/scripts.ejs +++ b/ee/bulk-operations-dashboard/views/pages/scripts.ejs @@ -111,7 +111,7 @@ The new scripts file name identifier must match the old scripts’ file name.
- Save + Save
@@ -124,13 +124,13 @@

Delete script

×
-

Delete this script from all teams.

+

Delete this script from all teams.

This will cancel the script from running.

- Cancel - Delete + Cancel + Delete
@@ -155,7 +155,7 @@
Cancel - Add + Add