diff --git a/app/authenticated/cluster/cis/scan/controller.js b/app/authenticated/cluster/cis/scan/controller.js index ebf61ca2d..19c41f399 100644 --- a/app/authenticated/cluster/cis/scan/controller.js +++ b/app/authenticated/cluster/cis/scan/controller.js @@ -49,7 +49,7 @@ export default Controller.extend({ runningClusterScans: computed.filterBy('clusterScans', 'isRunning', true), - isRKE: computed.alias('scope.currentCluster.isRKE'), + isRKE: computed.alias('scope.currentCluster.isRKE'), actions: { runScan() { get(this, 'scope.currentCluster').doAction('runSecurityScan', { @@ -59,7 +59,7 @@ export default Controller.extend({ } }, disableRunScanButton: computed('runningClusterScans', 'scope.currentCluster.systemProject', function() { - return get(this, 'runningClusterScans') || !get(this, 'scope.currentCluster.systemProject'); + return get(this, 'runningClusterScans.length') > 0 || !get(this, 'scope.currentCluster.systemProject'); }), bulkActionHandler: computed(function() { diff --git a/app/authenticated/cluster/cis/scan/detail/controller.js b/app/authenticated/cluster/cis/scan/detail/controller.js index 08f5cf61b..ba30e091a 100644 --- a/app/authenticated/cluster/cis/scan/detail/controller.js +++ b/app/authenticated/cluster/cis/scan/detail/controller.js @@ -62,7 +62,7 @@ export default Controller.extend({ }, disableRunScanButton: computed('runningClusterScans', 'scope.currentCluster.systemProject', function() { - return get(this, 'runningClusterScans') || !get(this, 'scope.currentCluster.systemProject'); + return get(this, 'runningClusterScans.length') > 0 || !get(this, 'scope.currentCluster.systemProject'); }), tests: computed('model.scan.report', 'securityScanConfig.skipList', function() { diff --git a/lib/shared/addon/security-scan-config/service.js b/lib/shared/addon/security-scan-config/service.js index 466e072b0..15087f95b 100644 --- a/lib/shared/addon/security-scan-config/service.js +++ b/lib/shared/addon/security-scan-config/service.js @@ -77,7 +77,7 @@ export default Service.extend({ return; } - if (!Array.isArray(parsed.skip[version])) { + if (parsed.skip[version] && !Array.isArray(parsed.skip[version])) { throw new Error("Security Scan Config didin't contain the 'skip' array."); } } catch (error) { @@ -145,7 +145,14 @@ export default Service.extend({ editSkipList(newValue) { const version = get(this, 'report.version'); - const newSkipListObject = { skip: { [version]: newValue } }; + + const existingSkip = get(this, 'parsedSecurityScanConfig.skip') || {}; + const newSkipListObject = { + skip: { + ...existingSkip, + [version]: newValue + } + }; const newConfig = { [get(this, 'FILE_KEY')]: JSON.stringify(newSkipListObject) }; this.editSecurityScanConfig(newConfig);