Skip to content

Commit

Permalink
feat(core): filter out providers that don't support creating security…
Browse files Browse the repository at this point in the history
… groups (#7370)

* feat(core): filter out providers that don't support creating security groups
  • Loading branch information
clareliguori committed Oct 7, 2019
1 parent 2ef8788 commit 64e47b4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ module.exports = angular
updateSecurityGroups();
};

function createSecurityGroupProviderFilterFn(application, account, provider) {
const sgConfig = provider.securityGroup;
return sgConfig && (sgConfig.CreateSecurityGroupModal || (sgConfig.createSecurityGroupTemplateUrl && sgConfig.createSecurityGroupController));
}

this.createSecurityGroup = function createSecurityGroup() {
ProviderSelectionService.selectProvider(app, 'securityGroup')
ProviderSelectionService.selectProvider(app, 'securityGroup', createSecurityGroupProviderFilterFn)
.then(selectedProvider => {
skinSelectionService.selectSkin(selectedProvider).then(selectedVersion => {
let provider = CloudProviderRegistry.getValue(selectedProvider, 'securityGroup', selectedVersion);
Expand Down

0 comments on commit 64e47b4

Please sign in to comment.