diff --git a/app/scripts/modules/amazon/src/help/amazon.help.ts b/app/scripts/modules/amazon/src/help/amazon.help.ts index 883d9ae8308..f0f9cd3c210 100644 --- a/app/scripts/modules/amazon/src/help/amazon.help.ts +++ b/app/scripts/modules/amazon/src/help/amazon.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from '@spinnaker/core'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from '@spinnaker/core'; const helpContents: {[key: string]: string} = { 'aws.associateElasticIp.elasticIp': diff --git a/app/scripts/modules/amazon/src/loadBalancer/AmazonLoadBalancersTag.tsx b/app/scripts/modules/amazon/src/loadBalancer/AmazonLoadBalancersTag.tsx index a0252e0ea69..56ca1d091c3 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/AmazonLoadBalancersTag.tsx +++ b/app/scripts/modules/amazon/src/loadBalancer/AmazonLoadBalancersTag.tsx @@ -77,8 +77,8 @@ export class AmazonLoadBalancersTag extends React.Component this.setState({loadBalancers})) - AmazonLoadBalancerDataUtils.populateTargetGroups(props.application, props.serverGroup as IAmazonServerGroup).then((targetGroups: ITargetGroup[]) => this.setState({targetGroups})) + LoadBalancerDataUtils.populateLoadBalancers(props.application, props.serverGroup).then((loadBalancers) => this.setState({ loadBalancers })) + AmazonLoadBalancerDataUtils.populateTargetGroups(props.application, props.serverGroup as IAmazonServerGroup).then((targetGroups: ITargetGroup[]) => this.setState({ targetGroups })) this.loadBalancersRefreshUnsubscribe = props.application.getDataSource('loadBalancers').onRefresh(null, () => { this.forceUpdate(); }); } @@ -86,21 +86,21 @@ export class AmazonLoadBalancersTag extends React.Component): void { diff --git a/app/scripts/modules/amazon/src/loadBalancer/amazonLoadBalancerDataUtils.ts b/app/scripts/modules/amazon/src/loadBalancer/amazonLoadBalancerDataUtils.ts index 0c0862ecafb..3eb9b82d5c4 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/amazonLoadBalancerDataUtils.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/amazonLoadBalancerDataUtils.ts @@ -12,7 +12,7 @@ export class AmazonLoadBalancerDataUtils { } const targetGroup: ITargetGroup = { name: match.name, vpcId: match.vpcId, cloudProvider: match.cloudProvider, account: match.account, region: match.region, loadBalancerNames: match.loadBalancerNames } as ITargetGroup; - targetGroup.instanceCounts = {up: 0, down: 0, succeeded: 0, failed: 0, outOfService: 0, unknown: 0, starting: 0}; + targetGroup.instanceCounts = { up: 0, down: 0, succeeded: 0, failed: 0, outOfService: 0, unknown: 0, starting: 0 }; serverGroup.instances.forEach(instance => { const tgHealth: IAmazonHealth = instance.health.find(h => h.type === 'TargetGroup') as IAmazonHealth; diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.spec.ts b/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.spec.ts index 1b3f412ab57..801ffb39888 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.spec.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.spec.ts @@ -47,15 +47,15 @@ describe('Controller: awsCreateClassicLoadBalancerCtrl', () => { accountService = _accountService_; subnetReader = _subnetReader_; amazonCertificateReader = _amazonCertificateReader_; - const app = applicationModelBuilder.createApplication('app', {key: 'loadBalancers', lazy: true}); + const app = applicationModelBuilder.createApplication('app', { key: 'loadBalancers', lazy: true }); initialize = (loadBalancer: IAmazonClassicLoadBalancer = null) => { if (loadBalancer) { spyOn(awsLoadBalancerTransformer, 'convertClassicLoadBalancerForEditing').and.returnValue(loadBalancer); } controller = $controller('awsCreateClassicLoadBalancerCtrl', { $scope: $scope, - $uibModalInstance: {dismiss: noop, result: {then: noop}}, - infrastructureCaches: { get: () => { return {getStats: () => {return {}; } }; } }, + $uibModalInstance: { dismiss: noop, result: { then: noop } }, + infrastructureCaches: { get: () => { return { getStats: () => {return {}; } }; } }, application: app, loadBalancer: loadBalancer, isNew: loadBalancer === null, @@ -112,7 +112,7 @@ describe('Controller: awsCreateClassicLoadBalancerCtrl', () => { loadBalancer.listeners.push({ externalProtocol: 'SSL', internalProtocol: 'SSL', internalPort: 80, externalPort: 80 }); expect(controller.showSslCertificateNameField()).toBe(true); - loadBalancer.listeners = [{externalProtocol: 'HTTP', internalProtocol: 'HTTP', internalPort: 80, externalPort: 80 }]; + loadBalancer.listeners = [{ externalProtocol: 'HTTP', internalProtocol: 'HTTP', internalPort: 80, externalPort: 80 }]; loadBalancer.listeners.push({ externalProtocol: 'HTTPS', internalProtocol: 'HTTPS', internalPort: 80, externalPort: 80 }); expect(controller.showSslCertificateNameField()).toBe(true); @@ -234,10 +234,10 @@ describe('Controller: awsCreateClassicLoadBalancerCtrl', () => { test: { aws: { 'us-east-1': [ - {name: 'a', id: '1', vpcId: 'vpc-1'}, - {name: 'b', id: '2', vpcId: 'vpc-1'}, - {name: 'c', id: '3', vpcId: 'vpc-1'}, - {name: 'd', id: '4', vpcId: 'vpc-1'}] + { name: 'a', id: '1', vpcId: 'vpc-1' }, + { name: 'b', id: '2', vpcId: 'vpc-1' }, + { name: 'c', id: '3', vpcId: 'vpc-1' }, + { name: 'd', id: '4', vpcId: 'vpc-1' }] } } }; @@ -250,8 +250,8 @@ describe('Controller: awsCreateClassicLoadBalancerCtrl', () => { listeners: [], } as IAmazonClassicLoadBalancer; spyOn(securityGroupReader, 'getAllSecurityGroups').and.returnValue($q.when(availableSecurityGroups)); - spyOn(accountService, 'getAccountDetails').and.returnValue($q.when([{name: 'test'}])); - spyOn(subnetReader, 'listSubnets').and.returnValue($q.when([{account: 'test', region: 'us-east-1', vpcId: 'vpc-1'}])); + spyOn(accountService, 'getAccountDetails').and.returnValue($q.when([{ name: 'test' }])); + spyOn(subnetReader, 'listSubnets').and.returnValue($q.when([{ account: 'test', region: 'us-east-1', vpcId: 'vpc-1' }])); spyOn(amazonCertificateReader, 'listCertificates').and.returnValue($q.when([])); initialize(existingLoadBalancer); $scope.$digest(); @@ -265,20 +265,20 @@ describe('Controller: awsCreateClassicLoadBalancerCtrl', () => { test: { aws: { 'us-east-1': [ - {name: 'a', id: '1', vpcId: 'vpc-1'}, - {name: 'b', id: '2', vpcId: 'vpc-1'}, - {name: 'c', id: '3', vpcId: 'vpc-1'}, - {name: 'd', id: '4', vpcId: 'vpc-1'}, - {name: 'sg-a', id: '5', vpcId: 'vpc-1'}] + { name: 'a', id: '1', vpcId: 'vpc-1' }, + { name: 'b', id: '2', vpcId: 'vpc-1' }, + { name: 'c', id: '3', vpcId: 'vpc-1' }, + { name: 'd', id: '4', vpcId: 'vpc-1' }, + { name: 'sg-a', id: '5', vpcId: 'vpc-1' }] } } }; spyOn(securityGroupReader, 'getAllSecurityGroups').and.returnValue($q.when(availableSecurityGroups)); - spyOn(accountService, 'listAccounts').and.returnValue($q.when([{name: 'test'}])); - spyOn(accountService, 'getAccountDetails').and.returnValue($q.when([{name: 'test'}])); + spyOn(accountService, 'listAccounts').and.returnValue($q.when([{ name: 'test' }])); + spyOn(accountService, 'getAccountDetails').and.returnValue($q.when([{ name: 'test' }])); spyOn(subnetReader, 'listSubnets').and.returnValue($q.when([ - {account: 'test', region: 'us-east-1', vpcId: 'vpc-1', purpose: 'external'} + { account: 'test', region: 'us-east-1', vpcId: 'vpc-1', purpose: 'external' } ])); spyOn(amazonCertificateReader, 'listCertificates').and.returnValue($q.when([])); initialize(); diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.ts b/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.ts index a2e7c876303..2bc86cacce9 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/classic/createClassicLoadBalancer.controller.ts @@ -100,7 +100,7 @@ export class CreateClassicLoadBalancerCtrl extends CreateAmazonLoadBalancerCtrl } public addListener(): void { - this.loadBalancerCommand.listeners.push({internalProtocol: 'HTTP', externalProtocol: 'HTTP', externalPort: 80, internalPort: undefined}); + this.loadBalancerCommand.listeners.push({ internalProtocol: 'HTTP', externalProtocol: 'HTTP', externalPort: 80, internalPort: undefined }); } public listenerProtocolChanged(listener: IClassicListenerDescription): void { diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts b/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts index 7be8e0c9505..76d0577f6ea 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts @@ -227,7 +227,7 @@ export abstract class CreateAmazonLoadBalancerCtrl { const existingNames = this.defaultSecurityGroups.filter((name) => this.existingSecurityGroupNames.includes(name)); this.loadBalancerCommand.securityGroups.forEach((securityGroup) => { if (!this.existingSecurityGroupNames.includes(securityGroup)) { - const matches = filter(this.availableSecurityGroups, {id: securityGroup}); + const matches = filter(this.availableSecurityGroups, { id: securityGroup }); if (matches.length) { existingNames.push(matches[0].name); } else { @@ -270,8 +270,8 @@ export abstract class CreateAmazonLoadBalancerCtrl { region = this.loadBalancerCommand.region; return this.subnetReader.listSubnets().then((subnets) => { return chain(subnets) - .filter({account: account, region: region}) - .reject({target: 'ec2'}) + .filter({ account: account, region: region }) + .reject({ target: 'ec2' }) .value(); }); } diff --git a/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.spec.ts b/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.spec.ts index 03215713489..5c046cd422f 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.spec.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.spec.ts @@ -32,7 +32,7 @@ describe('Controller: LoadBalancerDetailsCtrl', function () { applicationModelBuilder: ApplicationModelBuilder) => { $scope = $rootScope.$new(); $state = _$state_; - const app = applicationModelBuilder.createApplication('app', {key: 'loadBalancers', lazy: true}); + const app = applicationModelBuilder.createApplication('app', { key: 'loadBalancers', lazy: true }); app.loadBalancers.data.push(loadBalancer); controller = $controller(AwsLoadBalancerDetailsController, { $scope: $scope, @@ -67,13 +67,13 @@ describe('Controller: LoadBalancerDetailsCtrl', function () { }); it('should return the first purpose of subnetDetail if there is only one', function () { - const subnetDetails = [{purpose: 'internal(vpc0)'}] as ISubnet[]; + const subnetDetails = [{ purpose: 'internal(vpc0)' }] as ISubnet[]; const result = controller.getFirstSubnetPurpose(subnetDetails); expect(result).toEqual('internal(vpc0)'); }); it('should return the first purpose of subnetDetail if there are multiple', function () { - const subnetDetails = [{purpose: 'internal(vpc0)'}, {purpose: 'internal(vpc1)'}] as ISubnet[]; + const subnetDetails = [{ purpose: 'internal(vpc0)' }, { purpose: 'internal(vpc1)' }] as ISubnet[]; const result = controller.getFirstSubnetPurpose(subnetDetails); expect(result).toEqual('internal(vpc0)'); }); diff --git a/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.ts b/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.ts index cb1f3f28050..b6fa51687b9 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/details/loadBalancerDetails.controller.ts @@ -124,7 +124,7 @@ export class AwsLoadBalancerDetailsController implements IController { return; } this.$state.params.allowModalToStayOpen = true; - this.$state.go('^', null, {location: 'replace'}); + this.$state.go('^', null, { location: 'replace' }); } public extractLoadBalancer(): IPromise { diff --git a/app/scripts/modules/amazon/src/loadBalancer/details/targetGroupDetails.controller.ts b/app/scripts/modules/amazon/src/loadBalancer/details/targetGroupDetails.controller.ts index f76f19af0fb..34146eca3a2 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/details/targetGroupDetails.controller.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/details/targetGroupDetails.controller.ts @@ -43,7 +43,7 @@ export class AwsTargetGroupDetailsController implements IController { return; } this.$state.params.allowModalToStayOpen = true; - this.$state.go('^', null, {location: 'replace'}); + this.$state.go('^', null, { location: 'replace' }); } public extractTargetGroup(): IPromise { diff --git a/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts b/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts index ca1aa719f22..d9b75fac369 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts @@ -101,7 +101,7 @@ export class AwsLoadBalancerTransformer { private normalizeTargetGroup(targetGroup: ITargetGroup): IPromise { this.normalizeServerGroups(targetGroup.serverGroups, targetGroup, 'targetGroups', 'TargetGroup'); - const activeServerGroups = filter(targetGroup.serverGroups, {isDisabled: false}); + const activeServerGroups = filter(targetGroup.serverGroups, { isDisabled: false }); targetGroup.provider = targetGroup.type; targetGroup.instances = chain(activeServerGroups).map('instances').flatten().value(); targetGroup.detachedInstances = chain(activeServerGroups).map('detachedInstances').flatten().value(); @@ -120,7 +120,7 @@ export class AwsLoadBalancerTransformer { serverGroups = flatten(map(appLoadBalancer.targetGroups, 'serverGroups')); } - const activeServerGroups = filter(serverGroups, {isDisabled: false}); + const activeServerGroups = filter(serverGroups, { isDisabled: false }); loadBalancer.provider = loadBalancer.type; loadBalancer.instances = chain(activeServerGroups).map('instances').flatten().value(); loadBalancer.detachedInstances = chain(activeServerGroups).map('detachedInstances').flatten().value(); diff --git a/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.spec.ts b/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.spec.ts index 107708d07a1..ad6439ed04d 100644 --- a/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.spec.ts +++ b/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.spec.ts @@ -158,7 +158,7 @@ describe('Service: awsServerGroupConfiguration', function () { spyOn(keyPairsReader, 'listKeyPairs').and.returnValue($q.when([])); const getAllTypesByRegionSpy = spyOn(awsInstanceTypeService, 'getAllTypesByRegion').and.returnValue($q.when( { 'us-east-1': [ - {name: 'm4.tiny'} + { name: 'm4.tiny' } ] } )); const refreshCacheSpy = spyOn(cacheInitializer, 'refreshCache').and.returnValue($q.when(null)); @@ -206,7 +206,7 @@ describe('Service: awsServerGroupConfiguration', function () { expect(this.command.loadBalancers).toEqual([]); expect(this.command.vpcLoadBalancers).toEqual(['elb-1']); - expect(result).toEqual({ dirty: { }}); + expect(result).toEqual({ dirty: { } }); }); it('matches existing load balancers based on name - VPC', function() { @@ -214,7 +214,7 @@ describe('Service: awsServerGroupConfiguration', function () { const result = service.configureLoadBalancerOptions(this.command); expect(this.command.loadBalancers).toEqual(['elb-1']); - expect(result).toEqual({ dirty: { }}); + expect(result).toEqual({ dirty: { } }); }); it('sets dirty all unmatched load balancers - no VPC', function () { @@ -223,7 +223,7 @@ describe('Service: awsServerGroupConfiguration', function () { const result = service.configureLoadBalancerOptions(this.command); expect(this.command.loadBalancers).toEqual(['elb-2']); - expect(result).toEqual({ dirty: { loadBalancers: ['elb-1']}}); + expect(result).toEqual({ dirty: { loadBalancers: ['elb-1'] } }); }); it('moves load balancers to vpcLoadBalancers when vpc is de-selected', function () { @@ -247,13 +247,13 @@ describe('Service: awsServerGroupConfiguration', function () { let result = service.configureLoadBalancerOptions(this.command); expect(this.command.loadBalancers).toEqual(['elb-1']); - expect(result).toEqual({ dirty: { loadBalancers: ['elb-2']}}); + expect(result).toEqual({ dirty: { loadBalancers: ['elb-2'] } }); this.command.vpcId = 'vpc-2'; result = service.configureLoadBalancerOptions(this.command); expect(this.command.loadBalancers).toEqual([]); - expect(result).toEqual({ dirty: { loadBalancers: ['elb-1']}}); + expect(result).toEqual({ dirty: { loadBalancers: ['elb-1'] } }); }); it('updates filteredData to new region - no VPC', function() { @@ -275,18 +275,18 @@ describe('Service: awsServerGroupConfiguration', function () { test: { aws: { 'us-west-1': [ - { name: 'sg1', id: 'sg-1a', vpcId: null}, - { name: 'sg2', id: 'sg-2a', vpcId: null}, - { name: 'sg3', id: 'sg-3a', vpcId: null}, - { name: 'sg1', id: 'sg-1va', vpcId: 'vpc-1'}, - { name: 'sg2', id: 'sg-2va', vpcId: 'vpc-1'}, - { name: 'sg3', id: 'sg-3va', vpcId: 'vpc-2'} + { name: 'sg1', id: 'sg-1a', vpcId: null }, + { name: 'sg2', id: 'sg-2a', vpcId: null }, + { name: 'sg3', id: 'sg-3a', vpcId: null }, + { name: 'sg1', id: 'sg-1va', vpcId: 'vpc-1' }, + { name: 'sg2', id: 'sg-2va', vpcId: 'vpc-1' }, + { name: 'sg3', id: 'sg-3va', vpcId: 'vpc-2' } ], 'us-east-1': [ - { name: 'sg1', id: 'sg-1c', vpcId: null}, - { name: 'sg2', id: 'sg-2c', vpcId: null}, - { name: 'sg1', id: 'sg-1vc', vpcId: 'vpc-3'}, - { name: 'sg2', id: 'sg-2vc', vpcId: 'vpc-4'} + { name: 'sg1', id: 'sg-1c', vpcId: null }, + { name: 'sg2', id: 'sg-2c', vpcId: null }, + { name: 'sg1', id: 'sg-1vc', vpcId: 'vpc-3' }, + { name: 'sg2', id: 'sg-2vc', vpcId: 'vpc-4' } ] } } @@ -316,7 +316,7 @@ describe('Service: awsServerGroupConfiguration', function () { this.command.vpcId = 'vpc-1'; const result = service.configureSecurityGroupOptions(this.command); expect(this.command.securityGroups).toEqual(['sg-1va', 'sg-2va']); - expect(result).toEqual({ dirty: { }}); + expect(result).toEqual({ dirty: { } }); }); it('matches on name or id, converting to id when name encountered', function() { @@ -324,7 +324,7 @@ describe('Service: awsServerGroupConfiguration', function () { this.command.region = 'us-east-1'; const result = service.configureSecurityGroupOptions(this.command); expect(this.command.securityGroups).toEqual(['sg-1c', 'sg-2c']); - expect(result).toEqual({ dirty: {}}); + expect(result).toEqual({ dirty: {} }); }); it('sets dirty all unmatched security groups - no VPC', function () { @@ -332,7 +332,7 @@ describe('Service: awsServerGroupConfiguration', function () { this.command.region = 'us-east-1'; const result = service.configureSecurityGroupOptions(this.command); expect(this.command.securityGroups).toEqual(['sg-1c', 'sg-2c']); - expect(result).toEqual({ dirty: { securityGroups: ['sg3'] }}); + expect(result).toEqual({ dirty: { securityGroups: ['sg3'] } }); }); it('sets dirty all unmatched security groups - VPC', function () { @@ -340,7 +340,7 @@ describe('Service: awsServerGroupConfiguration', function () { this.command.vpcId = 'vpc-2'; const result = service.configureSecurityGroupOptions(this.command); expect(this.command.securityGroups).toEqual(['sg-3va']); - expect(result).toEqual({ dirty: { securityGroups: ['sg1', 'sg2'] }}); + expect(result).toEqual({ dirty: { securityGroups: ['sg1', 'sg2'] } }); }); it('updates filteredData to new region - no VPC', function() { diff --git a/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts b/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts index 7e720b8622d..bad04304d27 100644 --- a/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts +++ b/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts @@ -255,7 +255,7 @@ export class AwsServerGroupConfigurationService { // isDefault is imperfect, since we don't know what the previous account/region was, but probably a safe bet const isDefault = some(command.backingData.credentialsKeyedByAccount, (c) => c.defaultKeyPair && command.keyPair && command.keyPair.indexOf(c.defaultKeyPair.replace('{{region}}', '')) === 0); const filtered = chain(command.backingData.keyPairs) - .filter({account: command.credentials, region: command.region}) + .filter({ account: command.credentials, region: command.region }) .map('keyName') .value(); if (command.keyPair && filtered.length && !filtered.includes(command.keyPair)) { @@ -341,7 +341,7 @@ export class AwsServerGroupConfigurationService { public configureAvailabilityZones(command: IAmazonServerGroupCommand): void { command.backingData.filtered.availabilityZones = - find(command.backingData.credentialsKeyedByAccount[command.credentials].regions, {name: command.region}).availabilityZones; + find(command.backingData.credentialsKeyedByAccount[command.credentials].regions, { name: command.region }).availabilityZones; } public configureSubnetPurposes(command: IAmazonServerGroupCommand): IServerGroupCommandResult { @@ -351,13 +351,13 @@ export class AwsServerGroupConfigurationService { return result; } filteredData.subnetPurposes = chain(command.backingData.subnets) - .filter({account: command.credentials, region: command.region}) - .reject({target: 'elb'}) - .reject({purpose: null}) + .filter({ account: command.credentials, region: command.region }) + .reject({ target: 'elb' }) + .reject({ purpose: null }) .uniqBy('purpose') .value(); - if (!chain(filteredData.subnetPurposes).some({purpose: command.subnetType}).value()) { + if (!chain(filteredData.subnetPurposes).some({ purpose: command.subnetType }).value()) { command.subnetType = null; result.dirty.subnetType = true; } @@ -367,7 +367,7 @@ export class AwsServerGroupConfigurationService { public getRegionalSecurityGroups(command: IAmazonServerGroupCommand): ISecurityGroup[] { const newSecurityGroups = command.backingData.securityGroups[command.credentials] || { aws: {} }; return chain(newSecurityGroups.aws[command.region]) - .filter({vpcId: command.vpcId || null}) + .filter({ vpcId: command.vpcId || null }) .sortBy('name') .value(); } @@ -379,16 +379,16 @@ export class AwsServerGroupConfigurationService { if (currentOptions && command.securityGroups) { // not initializing - we are actually changing groups const currentGroupNames = command.securityGroups.map((groupId) => { - const match = find(currentOptions, {id: groupId}); + const match = find(currentOptions, { id: groupId }); return match ? match.name : groupId; }); const matchedGroups = command.securityGroups.map((groupId) => { - const securityGroup = find(currentOptions, {id: groupId}) || - find(currentOptions, {name: groupId}); + const securityGroup = find(currentOptions, { id: groupId }) || + find(currentOptions, { name: groupId }); return securityGroup ? securityGroup.name : null; }) - .map((groupName) => find(newRegionalSecurityGroups, {name: groupName})) + .map((groupName) => find(newRegionalSecurityGroups, { name: groupName })) .filter((group) => group); const matchedGroupNames = map(matchedGroups, 'name'); @@ -438,10 +438,10 @@ export class AwsServerGroupConfigurationService { return chain(command.backingData.loadBalancers) .map('accounts') .flattenDeep() - .filter({name: command.credentials}) + .filter({ name: command.credentials }) .map('regions') .flattenDeep() - .filter({name: command.region}) + .filter({ name: command.region }) .map('loadBalancers') .flattenDeep() .value() @@ -518,7 +518,7 @@ export class AwsServerGroupConfigurationService { command.vpcId = null; result.dirty.vpcId = true; } else { - const subnet = find(command.backingData.subnets, {purpose: command.subnetType, account: command.credentials, region: command.region}); + const subnet = find(command.backingData.subnets, { purpose: command.subnetType, account: command.credentials, region: command.region }); command.vpcId = subnet ? subnet.vpcId : null; } extend(result.dirty, this.configureInstanceTypes(command).dirty); @@ -586,9 +586,9 @@ export class AwsServerGroupConfigurationService { const result: IAmazonServerGroupCommandResult = { dirty: {} }; const backingData = command.backingData; if (command.credentials) { - const regionsForAccount: IAccountDetails = backingData.credentialsKeyedByAccount[command.credentials] || {regions: [], defaultKeyPair: null} as IAccountDetails; + const regionsForAccount: IAccountDetails = backingData.credentialsKeyedByAccount[command.credentials] || { regions: [], defaultKeyPair: null } as IAccountDetails; backingData.filtered.regions = regionsForAccount.regions; - if (!some(backingData.filtered.regions, {name: command.region})) { + if (!some(backingData.filtered.regions, { name: command.region })) { command.region = null; result.dirty.region = true; } else { diff --git a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx index 27d794a630f..a2360e6abeb 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx +++ b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx @@ -32,7 +32,7 @@ export class CreateScalingPolicyButton extends React.Component): void { - this.setState({typeSelection: e.currentTarget.id}); + this.setState({ typeSelection: e.currentTarget.id }); } public confirmTypeSelection(): void { diff --git a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts index fa83edc4abf..b9e311e055d 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts +++ b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts @@ -139,7 +139,7 @@ describe('Component: metric selector', () => { { namespace: 'AWS/EC2', name: 'NetworkIn', - dimensions: [ { name: 'AutoScalingGroupName', value: 'asg-v000' }, { name: 'sr', value: '71'} ] + dimensions: [ { name: 'AutoScalingGroupName', value: 'asg-v000' }, { name: 'sr', value: '71' } ] } ])); initialize(); @@ -196,7 +196,7 @@ describe('Component: metric selector', () => { { namespace: 'AWS/EC2', name: 'NetworkIn', - dimensions: [ { name: 'AutoScalingGroupName', value: 'asg-v000' }, { name: 'sr', value: '71'} ] + dimensions: [ { name: 'AutoScalingGroupName', value: 'asg-v000' }, { name: 'sr', value: '71' } ] }, { namespace: 'AWS/EBS', diff --git a/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.spec.ts b/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.spec.ts index 5c4728ac52b..4ad64c0da7b 100644 --- a/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.spec.ts +++ b/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.spec.ts @@ -28,7 +28,7 @@ describe('awsServerGroupTransformer', () => { describe('normalize server group', () => { beforeEach(() => { spyOn(vpcReader, 'listVpcs').and.returnValue($q.when([ - {account: 'test', region: 'us-east-1', id: 'vpc-1', name: 'main'} + { account: 'test', region: 'us-east-1', id: 'vpc-1', name: 'main' } ])); }); @@ -66,7 +66,7 @@ describe('awsServerGroupTransformer', () => { allImageSelection: 'something-packagebase', }, subnetType: null, - application: { name: 'theApp'} + application: { name: 'theApp' } }; let transformed = transformer.convertServerGroupCommandToDeployConfiguration(command); @@ -149,9 +149,9 @@ describe('awsServerGroupTransformer', () => { it('reverse sorts step adjustments by lower bound when none have an upper bound defined', function() { this.test( [ - {scalingAdjustment: 10, metricIntervalLowerBound: 3}, - {scalingAdjustment: 0, metricIntervalLowerBound: 5}, - {scalingAdjustment: -5, metricIntervalLowerBound: 1} + { scalingAdjustment: 10, metricIntervalLowerBound: 3 }, + { scalingAdjustment: 0, metricIntervalLowerBound: 5 }, + { scalingAdjustment: -5, metricIntervalLowerBound: 1 } ], [-5, 10, 0] ); @@ -160,9 +160,9 @@ describe('awsServerGroupTransformer', () => { it('reverse sorts step adjustments by lower bound when some do not have an upper bound defined', function() { this.test( [ - {id: 1, scalingAdjustment: 10, metricIntervalLowerBound: 3, metricIntervalUpperBound: 5}, - {id: 2, scalingAdjustment: 0, metricIntervalLowerBound: 5}, - {id: 3, scalingAdjustment: -5, metricIntervalLowerBound: 1, metricIntervalUpperBound: 3} + { id: 1, scalingAdjustment: 10, metricIntervalLowerBound: 3, metricIntervalUpperBound: 5 }, + { id: 2, scalingAdjustment: 0, metricIntervalLowerBound: 5 }, + { id: 3, scalingAdjustment: -5, metricIntervalLowerBound: 1, metricIntervalUpperBound: 3 } ], [-5, 10, 0] ); @@ -171,9 +171,9 @@ describe('awsServerGroupTransformer', () => { it('reverse sorts step adjustments by upper bound when all have an upper bound defined', function() { this.test( [ - {id: 1, scalingAdjustment: 10, metricIntervalLowerBound: 3, metricIntervalUpperBound: 5}, - {id: 2, scalingAdjustment: 0, metricIntervalLowerBound: 5, metricIntervalUpperBound: 9}, - {id: 3, scalingAdjustment: -5, metricIntervalLowerBound: 1, metricIntervalUpperBound: 0} + { id: 1, scalingAdjustment: 10, metricIntervalLowerBound: 3, metricIntervalUpperBound: 5 }, + { id: 2, scalingAdjustment: 0, metricIntervalLowerBound: 5, metricIntervalUpperBound: 9 }, + { id: 3, scalingAdjustment: -5, metricIntervalLowerBound: 1, metricIntervalUpperBound: 0 } ], [0, 10, -5] ); diff --git a/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts b/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts index 2f3e2915cf4..f8b80e6ab17 100644 --- a/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts +++ b/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts @@ -77,7 +77,7 @@ export class AwsServerGroupTransformer { public convertServerGroupCommandToDeployConfiguration(base: any): any { // use _.defaults to avoid copying the backingData, which is huge and expensive to copy over - const command = defaults({backingData: [], viewState: []}, base); + const command = defaults({ backingData: [], viewState: [] }, base); command.cloudProvider = 'aws'; command.availabilityZones = {}; command.availabilityZones[command.region] = base.availabilityZones; @@ -111,7 +111,7 @@ export class AwsServerGroupTransformer { statistic: 'Average', comparisonOperator: 'GreaterThanThreshold', evaluationPeriods: 1, - dimensions: [{ name: 'AutoScalingGroupName', value: serverGroup.name}], + dimensions: [{ name: 'AutoScalingGroupName', value: serverGroup.name }], period: 60, }], adjustmentType: 'ChangeInCapacity', diff --git a/app/scripts/modules/appengine/common/componentUrlDetails.component.ts b/app/scripts/modules/appengine/common/componentUrlDetails.component.ts index 4f903c26b23..900b393937d 100644 --- a/app/scripts/modules/appengine/common/componentUrlDetails.component.ts +++ b/app/scripts/modules/appengine/common/componentUrlDetails.component.ts @@ -1,7 +1,7 @@ -import {module, IComponentOptions} from 'angular'; +import { module, IComponentOptions } from 'angular'; class AppengineComponentUrlDetailsComponent implements IComponentOptions { - public bindings: any = {component: '<'}; + public bindings: any = { component: '<' }; public template = `
HTTPS
diff --git a/app/scripts/modules/appengine/common/conditionalDescriptionListItem.component.ts b/app/scripts/modules/appengine/common/conditionalDescriptionListItem.component.ts index 4e32e7483b1..488b37547da 100644 --- a/app/scripts/modules/appengine/common/conditionalDescriptionListItem.component.ts +++ b/app/scripts/modules/appengine/common/conditionalDescriptionListItem.component.ts @@ -1,4 +1,4 @@ -import {module, IComponentOptions, IFilterService, IController} from 'angular'; +import { module, IComponentOptions, IFilterService, IController } from 'angular'; class AppengineConditionalDescriptionListItemCtrl implements IController { public label: string; @@ -15,7 +15,7 @@ class AppengineConditionalDescriptionListItemCtrl implements IController { } class AppengineConditionalDescriptionListItem implements IComponentOptions { - public bindings: any = {label: '@', key: '@', component: '<'}; + public bindings: any = { label: '@', key: '@', component: '<' }; public transclude: any = { keyLabel: '?keyText', valueLabel: '?valueLabel', diff --git a/app/scripts/modules/appengine/common/loadBalancerMessage.component.ts b/app/scripts/modules/appengine/common/loadBalancerMessage.component.ts index 4b249dd62e6..d9dff866168 100644 --- a/app/scripts/modules/appengine/common/loadBalancerMessage.component.ts +++ b/app/scripts/modules/appengine/common/loadBalancerMessage.component.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; +import { module } from 'angular'; class AppengineLoadBalancerMessageComponent implements ng.IComponentOptions { - public bindings: any = {showCreateMessage: '<', columnOffset: '@', columns: '@'}; + public bindings: any = { showCreateMessage: '<', columnOffset: '@', columns: '@' }; public templateUrl: string = require('./loadBalancerMessage.component.html'); } diff --git a/app/scripts/modules/appengine/instance/details/details.controller.ts b/app/scripts/modules/appengine/instance/details/details.controller.ts index 78f575c3f13..279a515fc91 100644 --- a/app/scripts/modules/appengine/instance/details/details.controller.ts +++ b/app/scripts/modules/appengine/instance/details/details.controller.ts @@ -28,7 +28,7 @@ interface InstanceContainer { } class AppengineInstanceDetailsController implements IController { - public state = {loading: true}; + public state = { loading: true }; public instance: IAppengineInstance; public instanceIdNotFound: string; public upToolTip = 'An App Engine instance is \'Up\' if a load balancer is directing traffic to its server group.'; @@ -66,14 +66,14 @@ class AppengineInstanceDetailsController implements IController { application: this.app, title: 'Terminating ' + shortName, onTaskComplete: function() { - if (this.$state.includes('**.instanceDetails', {instanceId: instance.name})) { + if (this.$state.includes('**.instanceDetails', { instanceId: instance.name })) { this.$state.go('^'); } } }; const submitMethod = () => { - return this.instanceWriter.terminateInstance(instance, this.app, {cloudProvider: 'appengine'}); + return this.instanceWriter.terminateInstance(instance, this.app, { cloudProvider: 'appengine' }); }; this.confirmationModalService.confirm({ diff --git a/app/scripts/modules/appengine/loadBalancer/configure/wizard/advancedSettings.component.ts b/app/scripts/modules/appengine/loadBalancer/configure/wizard/advancedSettings.component.ts index f28d402bdc2..43fb931c0f6 100644 --- a/app/scripts/modules/appengine/loadBalancer/configure/wizard/advancedSettings.component.ts +++ b/app/scripts/modules/appengine/loadBalancer/configure/wizard/advancedSettings.component.ts @@ -1,8 +1,8 @@ -import { IController, IComponentOptions, module} from 'angular'; -import { AppengineLoadBalancerUpsertDescription} from 'appengine/loadBalancer/transformer'; +import { IController, IComponentOptions, module } from 'angular'; +import { AppengineLoadBalancerUpsertDescription } from 'appengine/loadBalancer/transformer'; class AppengineLoadBalancerAdvancedSettingsCtrl implements IController { - public state = {error: false}; + public state = { error: false }; public loadBalancer: AppengineLoadBalancerUpsertDescription; public disableMigrateTraffic(): boolean { @@ -24,7 +24,7 @@ class AppengineLoadBalancerAdvancedSettingsCtrl implements IController { } class AppengineLoadBalancerAdvancedSettingsComponent implements IComponentOptions { - public bindings: any = {loadBalancer: '=', application: '<'}; + public bindings: any = { loadBalancer: '=', application: '<' }; public template = `
diff --git a/app/scripts/modules/appengine/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts b/app/scripts/modules/appengine/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts index 376e2c94a33..fd2f60d9ab7 100644 --- a/app/scripts/modules/appengine/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts +++ b/app/scripts/modules/appengine/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts @@ -16,7 +16,7 @@ class AppengineAllocationConfigurationRowCtrl implements IController { } class AppengineAllocationConfigurationRowComponent implements IComponentOptions { - public bindings: any = {allocationDescription: '<', removeAllocation: '&', serverGroupOptions: '<', onAllocationChange: '&'}; + public bindings: any = { allocationDescription: '<', removeAllocation: '&', serverGroupOptions: '<', onAllocationChange: '&' }; public template = `
diff --git a/app/scripts/modules/appengine/loadBalancer/configure/wizard/basicSettings.component.ts b/app/scripts/modules/appengine/loadBalancer/configure/wizard/basicSettings.component.ts index 04b4cbfed21..6b4ab8e5d23 100644 --- a/app/scripts/modules/appengine/loadBalancer/configure/wizard/basicSettings.component.ts +++ b/app/scripts/modules/appengine/loadBalancer/configure/wizard/basicSettings.component.ts @@ -15,13 +15,13 @@ class AppengineLoadBalancerSettingsController implements IController { public addAllocation(): void { const remainingServerGroups = this.serverGroupsWithoutAllocation(); if (remainingServerGroups.length) { - this.loadBalancer.splitDescription.allocationDescriptions.push({serverGroupName: remainingServerGroups[0], allocation: 0, locatorType: 'fromExisting'}); + this.loadBalancer.splitDescription.allocationDescriptions.push({ serverGroupName: remainingServerGroups[0], allocation: 0, locatorType: 'fromExisting' }); if (this.loadBalancer.splitDescription.allocationDescriptions.length > 1 && !this.loadBalancer.splitDescription.shardBy) { this.loadBalancer.splitDescription.shardBy = 'IP'; } this.updateServerGroupOptions(); } else if (this.forPipelineConfig) { - this.loadBalancer.splitDescription.allocationDescriptions.push({allocation: 0, locatorType: 'text', serverGroupName: ''}); + this.loadBalancer.splitDescription.allocationDescriptions.push({ allocation: 0, locatorType: 'text', serverGroupName: '' }); } } @@ -67,7 +67,7 @@ class AppengineLoadBalancerSettingsController implements IController { } class AppengineLoadBalancerSettingsComponent implements ng.IComponentOptions { - public bindings: any = {loadBalancer: '=', forPipelineConfig: '<', application: '<'}; + public bindings: any = { loadBalancer: '=', forPipelineConfig: '<', application: '<' }; public controller: any = AppengineLoadBalancerSettingsController; public templateUrl: string = require('./basicSettings.component.html'); } diff --git a/app/scripts/modules/appengine/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts b/app/scripts/modules/appengine/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts index 7391879a9f0..e32db441231 100644 --- a/app/scripts/modules/appengine/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts +++ b/app/scripts/modules/appengine/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts @@ -46,7 +46,7 @@ class AppengineStageAllocationLabelCtrl implements IController { } class AppengineStageAllocationLabel implements IComponentOptions { - public bindings: any = {allocationDescription: '<'}; + public bindings: any = { allocationDescription: '<' }; public controller: any = AppengineStageAllocationLabelCtrl; public template = ``; } diff --git a/app/scripts/modules/appengine/loadBalancer/configure/wizard/wizard.controller.ts b/app/scripts/modules/appengine/loadBalancer/configure/wizard/wizard.controller.ts index 2f0419a89f0..6ea18ec3a8f 100644 --- a/app/scripts/modules/appengine/loadBalancer/configure/wizard/wizard.controller.ts +++ b/app/scripts/modules/appengine/loadBalancer/configure/wizard/wizard.controller.ts @@ -21,7 +21,7 @@ import { import './wizard.less'; class AppengineLoadBalancerWizardController implements IController { - public state = {loading: true}; + public state = { loading: true }; public loadBalancer: AppengineLoadBalancerUpsertDescription; public heading: string; public submitButtonLabel: string; @@ -94,7 +94,7 @@ class AppengineLoadBalancerWizardController implements IController { } private initializeFormValidation(): void { - this.wizardSubFormValidation.config({form: 'form', scope: this.$scope}) + this.wizardSubFormValidation.config({ form: 'form', scope: this.$scope }) .register({ page: 'basic-settings', subForm: 'basicSettingsForm', @@ -108,7 +108,7 @@ class AppengineLoadBalancerWizardController implements IController { } ] }) - .register({page: 'advanced-settings', subForm: 'advancedSettingsForm'}); + .register({ page: 'advanced-settings', subForm: 'advancedSettingsForm' }); } private onTaskComplete(): void { diff --git a/app/scripts/modules/appengine/loadBalancer/details/details.controller.ts b/app/scripts/modules/appengine/loadBalancer/details/details.controller.ts index 4d6ba22edf3..b0fbd7a7587 100644 --- a/app/scripts/modules/appengine/loadBalancer/details/details.controller.ts +++ b/app/scripts/modules/appengine/loadBalancer/details/details.controller.ts @@ -148,7 +148,7 @@ class AppengineLoadBalancerDetailsController implements IController { return; } else { this.$state.params.allowModalToStayOpen = true; - this.$state.go('^', null, {location: 'replace'}); + this.$state.go('^', null, { location: 'replace' }); } } } diff --git a/app/scripts/modules/appengine/loadBalancer/loadBalancer.module.ts b/app/scripts/modules/appengine/loadBalancer/loadBalancer.module.ts index 4503d83321b..68743b79d0e 100644 --- a/app/scripts/modules/appengine/loadBalancer/loadBalancer.module.ts +++ b/app/scripts/modules/appengine/loadBalancer/loadBalancer.module.ts @@ -1,12 +1,12 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {APPENGINE_ALLOCATION_CONFIGURATION_ROW} from './configure/wizard/allocationConfigurationRow.component'; -import {APPENGINE_LOAD_BALANCER_DETAILS_CTRL} from './details/details.controller'; -import {APPENGINE_LOAD_BALANCER_ADVANCED_SETTINGS} from './configure/wizard/advancedSettings.component'; -import {APPENGINE_LOAD_BALANCER_BASIC_SETTINGS} from './configure/wizard/basicSettings.component'; -import {APPENGINE_LOAD_BALANCER_TRANSFORMER} from './transformer'; -import {APPENGINE_LOAD_BALANCER_WIZARD_CTRL} from './configure/wizard/wizard.controller'; -import {APPENGINE_STAGE_ALLOCATION_CONFIGURATION_ROW} from './configure/wizard/stageAllocationConfigurationRow.component'; +import { APPENGINE_ALLOCATION_CONFIGURATION_ROW } from './configure/wizard/allocationConfigurationRow.component'; +import { APPENGINE_LOAD_BALANCER_DETAILS_CTRL } from './details/details.controller'; +import { APPENGINE_LOAD_BALANCER_ADVANCED_SETTINGS } from './configure/wizard/advancedSettings.component'; +import { APPENGINE_LOAD_BALANCER_BASIC_SETTINGS } from './configure/wizard/basicSettings.component'; +import { APPENGINE_LOAD_BALANCER_TRANSFORMER } from './transformer'; +import { APPENGINE_LOAD_BALANCER_WIZARD_CTRL } from './configure/wizard/wizard.controller'; +import { APPENGINE_STAGE_ALLOCATION_CONFIGURATION_ROW } from './configure/wizard/stageAllocationConfigurationRow.component'; export const APPENGINE_LOAD_BALANCER_MODULE = 'spinnaker.appengine.loadBalancer.module'; diff --git a/app/scripts/modules/appengine/loadBalancer/transformer.ts b/app/scripts/modules/appengine/loadBalancer/transformer.ts index 4ff3c1414b2..88d26cd71a1 100644 --- a/app/scripts/modules/appengine/loadBalancer/transformer.ts +++ b/app/scripts/modules/appengine/loadBalancer/transformer.ts @@ -39,10 +39,10 @@ export class AppengineLoadBalancerUpsertDescription implements ILoadBalancerUpse public static convertTrafficSplitToTrafficSplitDescription(split: IAppengineTrafficSplit): IAppengineTrafficSplitDescription { const allocationDescriptions = reduce(split.allocations, (acc: IAppengineAllocationDescription[], allocation: number, serverGroupName: string) => { - return acc.concat({serverGroupName, allocation, locatorType: 'fromExisting'}); + return acc.concat({ serverGroupName, allocation, locatorType: 'fromExisting' }); }, []); - return {shardBy: split.shardBy, allocationDescriptions}; + return { shardBy: split.shardBy, allocationDescriptions }; } constructor(loadBalancer: IAppengineLoadBalancer) { @@ -82,14 +82,14 @@ export class AppengineLoadBalancerTransformer { serverGroup.region = loadBalancer.region; if (serverGroup.detachedInstances) { - serverGroup.detachedInstances = (serverGroup.detachedInstances as any).map((id: string) => ({id})); + serverGroup.detachedInstances = (serverGroup.detachedInstances as any).map((id: string) => ({ id })); } serverGroup.instances = serverGroup.instances .concat(serverGroup.detachedInstances || []) .map((instance: any) => this.transformInstance(instance, loadBalancer)); }); - const activeServerGroups = filter(loadBalancer.serverGroups, {isDisabled: false}); + const activeServerGroups = filter(loadBalancer.serverGroups, { isDisabled: false }); loadBalancer.instances = chain(activeServerGroups).map('instances').flatten().value() as IInstance[]; return this.$q.resolve(loadBalancer); } @@ -122,7 +122,7 @@ export class AppengineLoadBalancerTransformer { acc[camelCase(instance.health.state)]++; } return acc; - }, {up: 0, down: 0, outOfService: 0, succeeded: 0, failed: 0, starting: 0, unknown: 0}).value(); + }, { up: 0, down: 0, outOfService: 0, succeeded: 0, failed: 0, starting: 0, unknown: 0 }).value(); instanceCounts.outOfService += chain(serverGroups).map('detachedInstances').flatten().value().length; return instanceCounts; diff --git a/app/scripts/modules/appengine/pipeline/pipeline.module.ts b/app/scripts/modules/appengine/pipeline/pipeline.module.ts index f9c0c0eabd7..a8b94c10862 100644 --- a/app/scripts/modules/appengine/pipeline/pipeline.module.ts +++ b/app/scripts/modules/appengine/pipeline/pipeline.module.ts @@ -1,12 +1,12 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {APPENGINE_DESTROY_ASG_STAGE} from './stages/destroyAsg/appengineDestroyAsgStage'; -import {APPENGINE_DISABLE_ASG_STAGE} from './stages/disableAsg/appengineDisableAsgStage'; -import {APPENGINE_EDIT_LOAD_BALANCER_STAGE} from './stages/editLoadBalancer/appengineEditLoadBalancerStage'; -import {APPENGINE_ENABLE_ASG_STAGE} from './stages/enableAsg/appengineEnableAsgStage'; -import {APPENGINE_SHRINK_CLUSTER_STAGE} from './stages/shrinkCluster/appengineShrinkClusterStage'; -import {APPENGINE_START_SERVER_GROUP_STAGE} from './stages/startServerGroup/appengineStartServerGroupStage'; -import {APPENGINE_STOP_SERVER_GROUP_STAGE} from './stages/stopServerGroup/appengineStopServerGroupStage'; +import { APPENGINE_DESTROY_ASG_STAGE } from './stages/destroyAsg/appengineDestroyAsgStage'; +import { APPENGINE_DISABLE_ASG_STAGE } from './stages/disableAsg/appengineDisableAsgStage'; +import { APPENGINE_EDIT_LOAD_BALANCER_STAGE } from './stages/editLoadBalancer/appengineEditLoadBalancerStage'; +import { APPENGINE_ENABLE_ASG_STAGE } from './stages/enableAsg/appengineEnableAsgStage'; +import { APPENGINE_SHRINK_CLUSTER_STAGE } from './stages/shrinkCluster/appengineShrinkClusterStage'; +import { APPENGINE_START_SERVER_GROUP_STAGE } from './stages/startServerGroup/appengineStartServerGroupStage'; +import { APPENGINE_STOP_SERVER_GROUP_STAGE } from './stages/stopServerGroup/appengineStopServerGroupStage'; export const APPENGINE_PIPELINE_MODULE = 'spinnaker.appengine.pipeline.module'; diff --git a/app/scripts/modules/appengine/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts b/app/scripts/modules/appengine/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts index cd7a89e7c6e..946b58cf956 100644 --- a/app/scripts/modules/appengine/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts @@ -38,7 +38,7 @@ module(APPENGINE_DESTROY_ASG_STAGE, [ACCOUNT_SERVICE]) }, { type: 'requiredField', fieldName: 'cluster' }, { type: 'requiredField', fieldName: 'target', }, - { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, + { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, ], }); }).controller('appengineDestroyAsgStageCtrl', AppengineDestroyAsgStageCtrl); diff --git a/app/scripts/modules/appengine/pipeline/stages/disableAsg/appengineDisableAsgStage.ts b/app/scripts/modules/appengine/pipeline/stages/disableAsg/appengineDisableAsgStage.ts index 0586935ed0d..a0b44ffa3cb 100644 --- a/app/scripts/modules/appengine/pipeline/stages/disableAsg/appengineDisableAsgStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/disableAsg/appengineDisableAsgStage.ts @@ -47,7 +47,7 @@ module(APPENGINE_DISABLE_ASG_STAGE, [ }, { type: 'requiredField', fieldName: 'cluster' }, { type: 'requiredField', fieldName: 'target', }, - { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, + { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, ], }); }).controller('appengineDisableAsgStageCtrl', AppengineDisableAsgStageCtrl); diff --git a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts index 0d207432a5c..9274af7da3c 100644 --- a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts +++ b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts @@ -5,7 +5,7 @@ import { cloneDeep } from 'lodash'; import { Application, CloudProviderRegistry, ILoadBalancer } from '@spinnaker/core'; class AppengineLoadBalancerChoiceModalCtrl implements IController { - public state = {loading: true}; + public state = { loading: true }; public loadBalancers: ILoadBalancer[]; public selectedLoadBalancer: ILoadBalancer; diff --git a/app/scripts/modules/appengine/pipeline/stages/enableAsg/appengineEnableAsgStage.ts b/app/scripts/modules/appengine/pipeline/stages/enableAsg/appengineEnableAsgStage.ts index 31290672fcc..18386232048 100644 --- a/app/scripts/modules/appengine/pipeline/stages/enableAsg/appengineEnableAsgStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/enableAsg/appengineEnableAsgStage.ts @@ -43,7 +43,7 @@ module(APPENGINE_ENABLE_ASG_STAGE, [ validators: [ { type: 'requiredField', fieldName: 'cluster' }, { type: 'requiredField', fieldName: 'target' }, - { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, + { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, ] }); }).controller('appengineEnableAsgStageCtrl', AppengineEnableAsgStageCtrl); diff --git a/app/scripts/modules/appengine/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts b/app/scripts/modules/appengine/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts index 4a1f33a18d2..a4afec4aa34 100644 --- a/app/scripts/modules/appengine/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts @@ -52,8 +52,8 @@ module(APPENGINE_SHRINK_CLUSTER_STAGE, [ACCOUNT_SERVICE]) executionDetailsUrl: PipelineTemplates.shrinkClusterExecutionDetails, validators: [ { type: 'requiredField', fieldName: 'cluster' }, - { type: 'requiredField', fieldName: 'shrinkToSize', fieldLabel: 'shrink to [X] Server Groups'}, - { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, + { type: 'requiredField', fieldName: 'shrinkToSize', fieldLabel: 'shrink to [X] Server Groups' }, + { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, ], }); }).controller('appengineShrinkClusterStageCtrl', AppengineShrinkClusterStageCtrl); diff --git a/app/scripts/modules/appengine/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts b/app/scripts/modules/appengine/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts index 68711841886..2b78ee48eae 100644 --- a/app/scripts/modules/appengine/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts @@ -42,7 +42,7 @@ module(APPENGINE_START_SERVER_GROUP_STAGE, [ACCOUNT_SERVICE]) validators: [ { type: 'requiredField', fieldName: 'cluster' }, { type: 'requiredField', fieldName: 'target' }, - { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, + { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, ], cloudProvider: 'appengine', }); diff --git a/app/scripts/modules/appengine/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts b/app/scripts/modules/appengine/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts index b0a68fd2331..5a80f1a8564 100644 --- a/app/scripts/modules/appengine/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts @@ -42,7 +42,7 @@ module(APPENGINE_STOP_SERVER_GROUP_STAGE, [ACCOUNT_SERVICE]) validators: [ { type: 'requiredField', fieldName: 'cluster' }, { type: 'requiredField', fieldName: 'target' }, - { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, + { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, ], cloudProvider: 'appengine', }); diff --git a/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts b/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts index 18af3435afa..42bd2dc8d49 100644 --- a/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts +++ b/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts @@ -72,9 +72,9 @@ export class AppengineServerGroupCommandBuilder { .filter(trigger => trigger.type === 'git' || trigger.type === 'jenkins' || trigger.type === 'travis') .map((trigger: IGitTrigger | IBuildTrigger) => { if (trigger.type === 'git') { - return {source: trigger.source, project: trigger.project, slug: trigger.slug, branch: trigger.branch, type: 'git'}; + return { source: trigger.source, project: trigger.project, slug: trigger.slug, branch: trigger.branch, type: 'git' }; } else { - return {master: trigger.master, job: trigger.job, type: trigger.type}; + return { master: trigger.master, job: trigger.job, type: trigger.type }; } }); } diff --git a/app/scripts/modules/appengine/serverGroup/configure/wizard/configFiles.component.ts b/app/scripts/modules/appengine/serverGroup/configure/wizard/configFiles.component.ts index 69bb34126b1..cb37dbcaee6 100644 --- a/app/scripts/modules/appengine/serverGroup/configure/wizard/configFiles.component.ts +++ b/app/scripts/modules/appengine/serverGroup/configure/wizard/configFiles.component.ts @@ -29,7 +29,7 @@ class AppengineConfigFileConfigurerCtrl implements IController { } class AppengineConfigFileConfigurerComponent implements ng.IComponentOptions { - public bindings: any = {command: '='}; + public bindings: any = { command: '=' }; public controller: any = AppengineConfigFileConfigurerCtrl; public template = `
diff --git a/app/scripts/modules/appengine/serverGroup/configure/wizard/dynamicBranchLabel.component.ts b/app/scripts/modules/appengine/serverGroup/configure/wizard/dynamicBranchLabel.component.ts index 696d810daa6..6ac0d78840f 100644 --- a/app/scripts/modules/appengine/serverGroup/configure/wizard/dynamicBranchLabel.component.ts +++ b/app/scripts/modules/appengine/serverGroup/configure/wizard/dynamicBranchLabel.component.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; +import { module } from 'angular'; class AppengineDynamicBranchLabelComponent implements ng.IComponentOptions { - public bindings: any = {trigger: '<'}; + public bindings: any = { trigger: '<' }; public template = ` Resolved at runtime by {{$ctrl.trigger.source}} trigger: {{$ctrl.trigger.project}}/{{$ctrl.trigger.slug}}:{{$ctrl.trigger.branch}} diff --git a/app/scripts/modules/appengine/serverGroup/details/details.controller.ts b/app/scripts/modules/appengine/serverGroup/details/details.controller.ts index 1a5071bbaea..d0907b72840 100644 --- a/app/scripts/modules/appengine/serverGroup/details/details.controller.ts +++ b/app/scripts/modules/appengine/serverGroup/details/details.controller.ts @@ -408,7 +408,7 @@ class AppengineServerGroupDetailsController implements IController { return; } else { this.$state.params.allowModalToStayOpen = true; - this.$state.go('^', null, {location: 'replace'}); + this.$state.go('^', null, { location: 'replace' }); } } diff --git a/app/scripts/modules/appengine/validation/applicationName.validator.ts b/app/scripts/modules/appengine/validation/applicationName.validator.ts index ef73b78b15b..f4f9ec5f74c 100644 --- a/app/scripts/modules/appengine/validation/applicationName.validator.ts +++ b/app/scripts/modules/appengine/validation/applicationName.validator.ts @@ -16,7 +16,7 @@ class AppengineApplicationNameValidator implements IApplicationNameValidator { this.validateSpecialCharacters(name, errors); this.validateLength(name, warnings, errors); } - return {warnings, errors}; + return { warnings, errors }; } private validateSpecialCharacters(name: string, errors: string[]): void { diff --git a/app/scripts/modules/azure/help/azure.help.ts b/app/scripts/modules/azure/help/azure.help.ts index 0f3c61490b5..f91cead00f7 100644 --- a/app/scripts/modules/azure/help/azure.help.ts +++ b/app/scripts/modules/azure/help/azure.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from '@spinnaker/core'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from '@spinnaker/core'; const helpContents: {[key: string]: string} = { 'azure.securityGroup.ingress.description': 'Friendly description of the rule you want to enable (limit 80 chars.)', diff --git a/app/scripts/modules/canary/canary/CanaryScores.tsx b/app/scripts/modules/canary/canary/CanaryScores.tsx index b806a8223f0..8ec1238600f 100644 --- a/app/scripts/modules/canary/canary/CanaryScores.tsx +++ b/app/scripts/modules/canary/canary/CanaryScores.tsx @@ -78,10 +78,10 @@ export class CanaryScores extends React.Component {
-
-
-
-
+
+
+
+
diff --git a/app/scripts/modules/core/src/account/account.service.spec.ts b/app/scripts/modules/core/src/account/account.service.spec.ts index 916ecbb6b05..d1fa3ad23ad 100644 --- a/app/scripts/modules/core/src/account/account.service.spec.ts +++ b/app/scripts/modules/core/src/account/account.service.spec.ts @@ -1,8 +1,8 @@ -import {mock} from 'angular'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {ACCOUNT_SERVICE, AccountService, IAccount} from 'core/account/account.service'; -import {CloudProviderRegistry} from '../cloudProvider/cloudProvider.registry'; -import {SETTINGS} from 'core/config/settings'; +import { mock } from 'angular'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { ACCOUNT_SERVICE, AccountService, IAccount } from 'core/account/account.service'; +import { CloudProviderRegistry } from '../cloudProvider/cloudProvider.registry'; +import { SETTINGS } from 'core/config/settings'; describe('Service: accountService', () => { @@ -29,10 +29,10 @@ describe('Service: accountService', () => { it('should filter the list of accounts by provider when supplied', () => { $http.expectGET(`${API.baseUrl}/credentials`).respond(200, [ - {name: 'test', type: 'aws'}, - {name: 'prod', type: 'aws'}, - {name: 'prod', type: 'gce'}, - {name: 'gce-test', type: 'gce'}, + { name: 'test', type: 'aws' }, + { name: 'prod', type: 'aws' }, + { name: 'prod', type: 'gce' }, + { name: 'gce-test', type: 'gce' }, ]); let accounts: IAccount[] = null; @@ -47,12 +47,12 @@ describe('Service: accountService', () => { it('should return details for each account', function () { $http.expectGET(API.baseUrl + '/credentials').respond(200, [ - {name: 'test', type: 'aws'}, - {name: 'prod', type: 'aws'}, + { name: 'test', type: 'aws' }, + { name: 'prod', type: 'aws' }, ]); - $http.expectGET(API.baseUrl + '/credentials/test').respond(200, {a: 1}); - $http.expectGET(API.baseUrl + '/credentials/prod').respond(200, {a: 2}); + $http.expectGET(API.baseUrl + '/credentials/test').respond(200, { a: 1 }); + $http.expectGET(API.baseUrl + '/credentials/prod').respond(200, { a: 2 }); let details: any = null; accountService.getAllAccountDetailsForProvider('aws').then((results: any) => { @@ -79,12 +79,12 @@ describe('Service: accountService', () => { it('should fall back to an empty array if an exception occurs when getting details for an account', () => { $http.expectGET(`${API.baseUrl}/credentials`).respond(200, [ - {name: 'test', type: 'aws'}, - {name: 'prod', type: 'aws'}, + { name: 'test', type: 'aws' }, + { name: 'prod', type: 'aws' }, ]); $http.expectGET(API.baseUrl + '/credentials/test').respond(500, null); - $http.expectGET(API.baseUrl + '/credentials/prod').respond(200, {a: 2}); + $http.expectGET(API.baseUrl + '/credentials/prod').respond(200, { a: 2 }); let details: any = null; accountService.getAllAccountDetailsForProvider('aws').then((results: any) => { @@ -103,7 +103,7 @@ describe('Service: accountService', () => { beforeEach(() => { registeredProviders = ['aws', 'gce', 'cf']; $http.whenGET(`${API.baseUrl}/credentials`).respond(200, - [{type: 'aws'}, {type: 'gce'}, {type: 'cf'}] + [{ type: 'aws' }, { type: 'gce' }, { type: 'cf' }] ); spyOn(cloudProviderRegistry, 'listRegisteredProviders').and.returnValue(registeredProviders); @@ -126,7 +126,7 @@ describe('Service: accountService', () => { it('should fall back to the defaultProviders if none configured for the application', () => { - const application: any = {attributes: { cloudProviders: [] }}; + const application: any = { attributes: { cloudProviders: [] } }; const test: any = (result: string[]) => expect(result).toEqual(['cf', 'gce']); SETTINGS.defaultProviders = ['gce', 'cf']; accountService.listProviders(application).then(test); @@ -135,7 +135,7 @@ describe('Service: accountService', () => { it('should return the intersection of those configured for the application and those available from the server', () => { - const application: any = {attributes: {cloudProviders: ['gce', 'cf', 'unicron']}}; + const application: any = { attributes: { cloudProviders: ['gce', 'cf', 'unicron'] } }; const test: any = (result: string[]) => expect(result).toEqual(['cf', 'gce']); SETTINGS.defaultProviders = ['aws']; accountService.listProviders(application).then(test); @@ -144,7 +144,7 @@ describe('Service: accountService', () => { it('should return an empty array if none of the app providers are available from the server', () => { - const application: any = {attributes: {cloudProviders: ['lamp', 'ceiling', 'fan']}}; + const application: any = { attributes: { cloudProviders: ['lamp', 'ceiling', 'fan'] } }; const test: any = (result: string[]) => expect(result).toEqual([]); SETTINGS.defaultProviders = ['foo']; accountService.listProviders(application).then(test); @@ -153,7 +153,7 @@ describe('Service: accountService', () => { it('should fall back to all registered available providers if no defaults configured and none configured on app', () => { - const application: any = {attributes: { cloudProviders: [] }}; + const application: any = { attributes: { cloudProviders: [] } }; const test: any = (result: string[]) => expect(result).toEqual(['aws', 'cf', 'gce']); delete SETTINGS.defaultProviders; accountService.listProviders(application).then(test); diff --git a/app/scripts/modules/core/src/account/account.service.ts b/app/scripts/modules/core/src/account/account.service.ts index 8346feefccf..4d9b39fddd7 100644 --- a/app/scripts/modules/core/src/account/account.service.ts +++ b/app/scripts/modules/core/src/account/account.service.ts @@ -1,10 +1,10 @@ -import {chain, intersection, zipObject} from 'lodash'; -import {module} from 'angular'; +import { chain, intersection, zipObject } from 'lodash'; +import { module } from 'angular'; -import {Application} from 'core/application/application.model'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {CLOUD_PROVIDER_REGISTRY, CloudProviderRegistry} from '../cloudProvider/cloudProvider.registry'; -import {SETTINGS} from 'core/config/settings'; +import { Application } from 'core/application/application.model'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { CLOUD_PROVIDER_REGISTRY, CloudProviderRegistry } from '../cloudProvider/cloudProvider.registry'; +import { SETTINGS } from 'core/config/settings'; export interface IRegion { account?: string; diff --git a/app/scripts/modules/core/src/account/accountTag.component.ts b/app/scripts/modules/core/src/account/accountTag.component.ts index eb7a23ed809..40c5b6e373d 100644 --- a/app/scripts/modules/core/src/account/accountTag.component.ts +++ b/app/scripts/modules/core/src/account/accountTag.component.ts @@ -1,6 +1,6 @@ -import {module, IController, IComponentOptions} from 'angular'; +import { module, IController, IComponentOptions } from 'angular'; -import {ACCOUNT_SERVICE, AccountService} from 'core/account/account.service'; +import { ACCOUNT_SERVICE, AccountService } from 'core/account/account.service'; import './accountTag.less'; diff --git a/app/scripts/modules/core/src/analytics/analytics.module.ts b/app/scripts/modules/core/src/analytics/analytics.module.ts index ffe98595caa..81107eea948 100644 --- a/app/scripts/modules/core/src/analytics/analytics.module.ts +++ b/app/scripts/modules/core/src/analytics/analytics.module.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; export const ANALYTICS_MODULE = 'spinnaker.core.analytics'; module(ANALYTICS_MODULE, [ diff --git a/app/scripts/modules/core/src/api/api.service.spec.ts b/app/scripts/modules/core/src/api/api.service.spec.ts index d1c54ab387d..5ceea4fc53c 100644 --- a/app/scripts/modules/core/src/api/api.service.spec.ts +++ b/app/scripts/modules/core/src/api/api.service.spec.ts @@ -1,8 +1,8 @@ import Spy = jasmine.Spy; -import {mock, noop} from 'angular'; -import {AuthenticationInitializer} from '../authentication/authentication.initializer.service'; -import {API_SERVICE, Api} from './api.service'; -import {SETTINGS} from 'core/config/settings'; +import { mock, noop } from 'angular'; +import { AuthenticationInitializer } from '../authentication/authentication.initializer.service'; +import { API_SERVICE, Api } from './api.service'; +import { SETTINGS } from 'core/config/settings'; describe('API Service', function () { let API: Api; @@ -35,7 +35,7 @@ describe('API Service', function () { describe('validate response content-type header', function () { it('responses with non-"application/json" content types should trigger a reauthentication request and reject', function () { spyOn(authenticationInitializer, 'reauthenticateUser').and.callFake(noop); - $httpBackend.expectGET(`${baseUrl}/bad`).respond(200, 'this is the authentication page', {'content-type': 'text/html'}); + $httpBackend.expectGET(`${baseUrl}/bad`).respond(200, 'this is the authentication page', { 'content-type': 'text/html' }); let rejected = false; API.one('bad').get().then(noop, () => rejected = true); @@ -173,8 +173,8 @@ describe('API Service', function () { const first = API.one('bar'); const second = API.one('foo'); - expect(first.config).toEqual({method: '', url: `${baseUrl}/bar`}); - expect(second.config).toEqual({method: '', url: `${baseUrl}/foo`}); + expect(first.config).toEqual({ method: '', url: `${baseUrl}/bar` }); + expect(second.config).toEqual({ method: '', url: `${baseUrl}/foo` }); }); }); @@ -186,7 +186,7 @@ describe('API Service', function () { }); it('should add data to the config if data object passed', function () { - const data = {bar: 'baz'}; + const data = { bar: 'baz' }; const result = API.one('foo').data(data); expected.url = `${baseUrl}/foo`; expected.data = data; @@ -198,12 +198,12 @@ describe('API Service', function () { describe('create a config with params', function () { it('when no params are provided do not alter config', function () { const result = API.one('foo').withParams(); - expect(result.config).toEqual({method: '', url: `${baseUrl}/foo`}); + expect(result.config).toEqual({ method: '', url: `${baseUrl}/foo` }); }); it('when params are provided', function () { - const result = API.one('foo').withParams({one: 1}); - expect(result.config).toEqual({method: '', url: `${baseUrl}/foo`, params: {one: 1} }); + const result = API.one('foo').withParams({ one: 1 }); + expect(result.config).toEqual({ method: '', url: `${baseUrl}/foo`, params: { one: 1 } }); }); }); @@ -219,7 +219,7 @@ describe('API Service', function () { }); it('should set cache to cache object if explicitly set', function () { - const cacheObj = {count: 1}; + const cacheObj = { count: 1 }; const result = API.one('foo').useCache(cacheObj); expect(result.config.cache).toBe(cacheObj); }); @@ -246,7 +246,7 @@ describe('API Service', function () { it('should take a param object with one param', function () { $httpBackend.expectGET(`${baseUrl}/foo/bar?param1=2`).respond(200); - API.one('foo', 'bar').get({param1: 2}); + API.one('foo', 'bar').get({ param1: 2 }); $httpBackend.flush(); }); @@ -254,7 +254,7 @@ describe('API Service', function () { it('should take a param object with multiple params', function () { $httpBackend.expectGET(`${baseUrl}/foo/bar?param1=2¶m2=foo`).respond(200); - API.one('foo', 'bar').get({param1: 2, param2: 'foo'}); + API.one('foo', 'bar').get({ param1: 2, param2: 'foo' }); $httpBackend.flush(); }); @@ -280,7 +280,7 @@ describe('API Service', function () { it('should take a param object with one param', function () { $httpBackend.expectGET(`${baseUrl}/foo/bar?param1=2`).respond(200); - API.one('foo', 'bar').getList({param1: 2}); + API.one('foo', 'bar').getList({ param1: 2 }); $httpBackend.flush(); }); @@ -288,7 +288,7 @@ describe('API Service', function () { it('should take a param object with multiple params', function () { $httpBackend.expectGET(`${baseUrl}/foo/bar?param1=2¶m2=foo`).respond(200); - API.one('foo', 'bar').getList({param1: 2, param2: 'foo'}); + API.one('foo', 'bar').getList({ param1: 2, param2: 'foo' }); $httpBackend.flush(); }); @@ -304,7 +304,7 @@ describe('API Service', function () { }); it('should create the url and POST with data', function () { - const data = {bar: 7}; + const data = { bar: 7 }; $httpBackend.expectPOST(`${baseUrl}/foo`, data).respond(200); API.one('foo').post(data); @@ -323,7 +323,7 @@ describe('API Service', function () { }); it('should create the url and PUT with data', function () { - const data = {bar: 7}; + const data = { bar: 7 }; $httpBackend.expectPUT(`${baseUrl}/foo`, data).respond(200); API.one('foo').put(data); @@ -342,7 +342,7 @@ describe('API Service', function () { }); it('should create the url with params and make a DELETE call', function () { - const params = {bar: 7}; + const params = { bar: 7 }; $httpBackend.expectDELETE(`${baseUrl}/foo?bar=7`).respond(200); API.one('foo').remove(params); diff --git a/app/scripts/modules/core/src/api/api.service.ts b/app/scripts/modules/core/src/api/api.service.ts index d352837a84b..1820afccae1 100644 --- a/app/scripts/modules/core/src/api/api.service.ts +++ b/app/scripts/modules/core/src/api/api.service.ts @@ -1,9 +1,9 @@ -import {module, IHttpService, IPromise, IQResolveReject, IQService, IRequestConfig} from 'angular'; +import { module, IHttpService, IPromise, IQResolveReject, IQService, IRequestConfig } from 'angular'; import { AUTHENTICATION_INITIALIZER_SERVICE, AuthenticationInitializer } from '../authentication/authentication.initializer.service'; -import {SETTINGS} from 'core/config/settings'; +import { SETTINGS } from 'core/config/settings'; interface DefaultParams { timeout: number; diff --git a/app/scripts/modules/core/src/application/ApplicationComponent.tsx b/app/scripts/modules/core/src/application/ApplicationComponent.tsx index 4ac1d24ea53..f3a9e0c6efb 100644 --- a/app/scripts/modules/core/src/application/ApplicationComponent.tsx +++ b/app/scripts/modules/core/src/application/ApplicationComponent.tsx @@ -82,7 +82,7 @@ export class ApplicationComponent extends React.Component

Application Not Found

-

Please check your URL - we can't find any data for {this.props.app.name}.

+

Please check your URL - we can't find any data for {this.props.app.name}.

) : null; diff --git a/app/scripts/modules/core/src/application/application.model.spec.ts b/app/scripts/modules/core/src/application/application.model.spec.ts index c1bbc3f2705..369850f611c 100644 --- a/app/scripts/modules/core/src/application/application.model.spec.ts +++ b/app/scripts/modules/core/src/application/application.model.spec.ts @@ -209,7 +209,7 @@ describe ('Application Model', function () { it('sets default credentials and region from load balancer when only one account/region found', function () { const serverGroups: IServerGroup[] = [], - loadBalancers: ILoadBalancer[] = [{name: 'deck-frontend', cloudProvider: 'gce', vpcId: 'vpc0', region: 'us-central-1', account: 'prod' }], + loadBalancers: ILoadBalancer[] = [{ name: 'deck-frontend', cloudProvider: 'gce', vpcId: 'vpc0', region: 'us-central-1', account: 'prod' }], securityGroupsByApplicationName: any[] = []; configureApplication(serverGroups, loadBalancers, securityGroupsByApplicationName); @@ -220,7 +220,7 @@ describe ('Application Model', function () { it('sets default credentials and region from security group', function () { const serverGroups: any[] = [], loadBalancers: ILoadBalancer[] = [], - securityGroupsByApplicationName: any[] = [{name: 'deck-test', provider: 'cf', accountName: 'test', region: 'us-south-7'}]; + securityGroupsByApplicationName: any[] = [{ name: 'deck-test', provider: 'cf', accountName: 'test', region: 'us-south-7' }]; configureApplication(serverGroups, loadBalancers, securityGroupsByApplicationName); expect(application.defaultCredentials.cf).toBe('test'); @@ -229,8 +229,8 @@ describe ('Application Model', function () { it('does not set defaults when multiple values found for the same provider', function () { const serverGroups: IServerGroup[] = [], - loadBalancers: ILoadBalancer[] = [ {name: 'deck-frontend', cloudProvider: 'aws', vpcId: 'vpcId', region: 'us-west-1', account: 'prod'} ], - securityGroupsByApplicationName: any[] = [{name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-east-1'}]; + loadBalancers: ILoadBalancer[] = [ { name: 'deck-frontend', cloudProvider: 'aws', vpcId: 'vpcId', region: 'us-west-1', account: 'prod' } ], + securityGroupsByApplicationName: any[] = [{ name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-east-1' }]; configureApplication(serverGroups, loadBalancers, securityGroupsByApplicationName); expect(application.defaultCredentials.aws).toBeUndefined(); @@ -239,8 +239,8 @@ describe ('Application Model', function () { it('sets default region or default credentials if possible', function () { const serverGroups: IServerGroup[] = [], - loadBalancers: ILoadBalancer[] = [{name: 'deck-frontend', cloudProvider: 'aws', vpcId: 'vpcId', region: 'us-east-1', account: 'prod'}], - securityGroupsByApplicationName: any[] = [{name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-east-1'}]; + loadBalancers: ILoadBalancer[] = [{ name: 'deck-frontend', cloudProvider: 'aws', vpcId: 'vpcId', region: 'us-east-1', account: 'prod' }], + securityGroupsByApplicationName: any[] = [{ name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-east-1' }]; configureApplication(serverGroups, loadBalancers, securityGroupsByApplicationName); expect(application.defaultCredentials.aws).toBeUndefined(); @@ -249,8 +249,8 @@ describe ('Application Model', function () { it('sets default credentials, even if region cannot be set', function () { const serverGroups: IServerGroup[] = [], - loadBalancers: ILoadBalancer[] = [{name: 'deck-frontend', cloudProvider: 'aws', vpcId: 'vpc0', region: 'us-east-1', account: 'test'}], - securityGroupsByApplicationName: any[] = [{name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-west-1'}]; + loadBalancers: ILoadBalancer[] = [{ name: 'deck-frontend', cloudProvider: 'aws', vpcId: 'vpc0', region: 'us-east-1', account: 'test' }], + securityGroupsByApplicationName: any[] = [{ name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-west-1' }]; configureApplication(serverGroups, loadBalancers, securityGroupsByApplicationName); expect(application.defaultCredentials.aws).toBe('test'); @@ -276,8 +276,8 @@ describe ('Application Model', function () { instanceCounts: { up: 0, down: 0, starting: 0, unknown: 0, outOfService: 0 }, } ], - loadBalancers: ILoadBalancer[] = [{name: 'deck-frontend', account: 'gce-test', cloudProvider: 'gce', region: 'us-central-1', serverGroups: []}], - securityGroupsByApplicationName: any[] = [{name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-west-2'}]; + loadBalancers: ILoadBalancer[] = [{ name: 'deck-frontend', account: 'gce-test', cloudProvider: 'gce', region: 'us-central-1', serverGroups: [] }], + securityGroupsByApplicationName: any[] = [{ name: 'deck-test', provider: 'aws', accountName: 'test', region: 'us-west-2' }]; configureApplication(serverGroups, loadBalancers, securityGroupsByApplicationName); expect(application.defaultCredentials.aws).toBe('test'); diff --git a/app/scripts/modules/core/src/application/application.model.ts b/app/scripts/modules/core/src/application/application.model.ts index bed9e2cd9ca..1d75f40848c 100644 --- a/app/scripts/modules/core/src/application/application.model.ts +++ b/app/scripts/modules/core/src/application/application.model.ts @@ -1,9 +1,9 @@ -import {ILogService, IPromise, IQService, IScope} from 'angular'; -import {map, union, uniq} from 'lodash'; -import {Subject, Subscription} from 'rxjs'; +import { ILogService, IPromise, IQService, IScope } from 'angular'; +import { map, union, uniq } from 'lodash'; +import { Subject, Subscription } from 'rxjs'; -import {ApplicationDataSource} from './service/applicationDataSource'; -import {ICluster} from '../domain/ICluster'; +import { ApplicationDataSource } from './service/applicationDataSource'; +import { ICluster } from '../domain/ICluster'; export class Application { diff --git a/app/scripts/modules/core/src/application/applicationModel.builder.ts b/app/scripts/modules/core/src/application/applicationModel.builder.ts index b9d7163d2e8..8a42e6f9f3d 100644 --- a/app/scripts/modules/core/src/application/applicationModel.builder.ts +++ b/app/scripts/modules/core/src/application/applicationModel.builder.ts @@ -37,7 +37,7 @@ export class ApplicationModelBuilder { public createNotFoundApplication(name: string): Application { const application = new Application(name, this.schedulerFactory.createScheduler(), this.$q, this.$log); - this.addDataSource({key: 'serverGroups', lazy: true}, application); + this.addDataSource({ key: 'serverGroups', lazy: true }, application); application.notFound = true; return application; } diff --git a/app/scripts/modules/core/src/application/config/appConfig.states.ts b/app/scripts/modules/core/src/application/config/appConfig.states.ts index 7476098437d..5f21e3f7fd3 100644 --- a/app/scripts/modules/core/src/application/config/appConfig.states.ts +++ b/app/scripts/modules/core/src/application/config/appConfig.states.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; -import {OverrideRegistry} from 'core/overrideRegistry/override.registry'; -import {INestedState} from 'core/navigation/state.provider'; -import {ApplicationStateProvider, APPLICATION_STATE_PROVIDER} from '../application.state.provider'; +import { module } from 'angular'; +import { OverrideRegistry } from 'core/overrideRegistry/override.registry'; +import { INestedState } from 'core/navigation/state.provider'; +import { ApplicationStateProvider, APPLICATION_STATE_PROVIDER } from '../application.state.provider'; export const APP_CONFIG_STATES = 'spinnaker.core.application.states'; module(APP_CONFIG_STATES, [ diff --git a/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts b/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts index 4f4c508b121..a897086e45f 100644 --- a/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts +++ b/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts @@ -1,8 +1,8 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {Application} from 'core/application/application.model'; -import {APPLICATION_MODEL_BUILDER, ApplicationModelBuilder} from 'core/application/applicationModel.builder'; -import {APPLICATION_DATA_SOURCE_EDITOR, DataSourceEditorController} from './applicationDataSourceEditor.component'; +import { Application } from 'core/application/application.model'; +import { APPLICATION_MODEL_BUILDER, ApplicationModelBuilder } from 'core/application/applicationModel.builder'; +import { APPLICATION_DATA_SOURCE_EDITOR, DataSourceEditorController } from './applicationDataSourceEditor.component'; describe('Component: Application Data Source Editor', () => { @@ -140,7 +140,7 @@ describe('Component: Application Data Source Editor', () => { expect(applicationWriter.updateApplication.calls.mostRecent().args[0]).toEqual({ name: 'app', accounts: ['test'], - dataSources: { enabled: ['optInSource'], disabled: ['optionalSource']} + dataSources: { enabled: ['optInSource'], disabled: ['optionalSource'] } }); $scope.$digest(); diff --git a/app/scripts/modules/core/src/application/config/footer/ConfigSectionFooter.tsx b/app/scripts/modules/core/src/application/config/footer/ConfigSectionFooter.tsx index 04b7680ac1d..6eec06937d3 100644 --- a/app/scripts/modules/core/src/application/config/footer/ConfigSectionFooter.tsx +++ b/app/scripts/modules/core/src/application/config/footer/ConfigSectionFooter.tsx @@ -44,7 +44,7 @@ export class ConfigSectionFooter extends React.Component
-
diff --git a/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts b/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts index 667b85db9af..908523bf738 100644 --- a/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts +++ b/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts @@ -1,6 +1,6 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {CONFIG_SECTION_FOOTER, ConfigSectionFooterController} from './configSectionFooter.component'; +import { CONFIG_SECTION_FOOTER, ConfigSectionFooterController } from './configSectionFooter.component'; describe('Component: ConfigSectionFooter', () => { @@ -39,7 +39,7 @@ describe('Component: ConfigSectionFooter', () => { originalConfig: { exceptions: ([] as any), enabled: false } }, config: { - exceptions: [ {account: 'prod', region: 'us-east-1'} ], + exceptions: [ { account: 'prod', region: 'us-east-1' } ], enabled: true, grouping: 'app' } @@ -59,7 +59,7 @@ describe('Component: ConfigSectionFooter', () => { let data: any; beforeEach(() => { data = { - application: { name: 'deck', attributes: { accounts: ['prod']}}, + application: { name: 'deck', attributes: { accounts: ['prod'] } }, viewState: { originalConfig: { exceptions: [], enabled: false }, originalStringVal: 'original', @@ -68,7 +68,7 @@ describe('Component: ConfigSectionFooter', () => { isDirty: true, }, config: { - exceptions: [ {account: 'prod', region: 'us-east-1'} ], + exceptions: [ { account: 'prod', region: 'us-east-1' } ], enabled: true, grouping: 'app' } diff --git a/app/scripts/modules/core/src/application/config/trafficGuard/trafficGuardConfig.help.ts b/app/scripts/modules/core/src/application/config/trafficGuard/trafficGuardConfig.help.ts index f6b252ed53e..d3126ea9fd5 100644 --- a/app/scripts/modules/core/src/application/config/trafficGuard/trafficGuardConfig.help.ts +++ b/app/scripts/modules/core/src/application/config/trafficGuard/trafficGuardConfig.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from 'core/help/helpContents.registry'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from 'core/help/helpContents.registry'; const helpContents: any[] = [ { diff --git a/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts b/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts index f519acf436b..1223f369508 100644 --- a/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts +++ b/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts @@ -11,13 +11,13 @@ describe('appListExtractorService', function () { applicationModelBuilder: ApplicationModelBuilder; const buildApplication = (serverGroups: any[] = []): Application => { - const application: Application = applicationModelBuilder.createApplication('app', {key: 'serverGroups', lazy: true}); + const application: Application = applicationModelBuilder.createApplication('app', { key: 'serverGroups', lazy: true }); application.getDataSource('serverGroups').data = serverGroups; return application; }; const asResult = (instance: IInstance) => { - const {id, availabilityZone} = instance; + const { id, availabilityZone } = instance; return { id, availabilityZone }; }; @@ -38,12 +38,12 @@ describe('appListExtractorService', function () { describe('Get Monikers from a list of applications', function () { it('should return a filtered list of monikers', function () { - let moniker: IMoniker = { + const moniker: IMoniker = { cluster: 'test-cluster', app: 'test-application' }; - const filterByCluster = (serverGroup:IServerGroup) => serverGroup.moniker.cluster === 'test-cluster' - const applicationA: Application = buildApplication([ {moniker: moniker} ]); + const filterByCluster = (serverGroup: IServerGroup) => serverGroup.moniker.cluster === 'test-cluster' + const applicationA: Application = buildApplication([ { moniker: moniker } ]); const applicationB: Application = buildApplication(); const result = service.getMonikers([applicationA, applicationB], filterByCluster); @@ -52,29 +52,29 @@ describe('appListExtractorService', function () { }); it('should get a empty list for one application w/ no monikers', function () { - const application: Application = buildApplication([ {stack: 'prod'}, {stack: 'test'} ]); + const application: Application = buildApplication([ { stack: 'prod' }, { stack: 'test' } ]); const result = service.getMonikers([application]); expect(result.length).toEqual(0); expect(result).toEqual([]); }); it('should return an list of a single moniker for one application with a moniker', function () { - let moniker: IMoniker = { + const moniker: IMoniker = { cluster: 'test-cluster', app: 'test-application' }; - const application: Application = buildApplication([ {moniker: moniker} ]); + const application: Application = buildApplication([ { moniker: moniker } ]); const result = service.getMonikers([application]); expect(result.length).toEqual(1); expect(result).toEqual([moniker]); }); it('should return a single moniker for two applications but only one has a moniker', function () { - let moniker: IMoniker = { + const moniker: IMoniker = { cluster: 'test-cluster', app: 'test-application' }; - const applicationA: Application = buildApplication([ {moniker: moniker} ]); + const applicationA: Application = buildApplication([ { moniker: moniker } ]); const applicationB: Application = buildApplication(); const result = service.getMonikers([applicationA, applicationB]); expect(result.length).toEqual(1); @@ -94,7 +94,7 @@ describe('appListExtractorService', function () { it('should get a list of 1 aws region for one application w/ one cluster with one server group in one region', function () { - const application: Application = buildApplication([{region: 'us-west-1'}]); + const application: Application = buildApplication([{ region: 'us-west-1' }]); const result = service.getRegions([application]); expect(result.length).toEqual(1); expect(result).toEqual(['us-west-1']); @@ -102,7 +102,7 @@ describe('appListExtractorService', function () { it('should get a list of 2 aws region for one application w/ one cluster with two server groups in 2 region', function () { - const application: Application = buildApplication([{region: 'us-west-1'}, {region: 'us-west-2'}]); + const application: Application = buildApplication([{ region: 'us-west-1' }, { region: 'us-west-2' }]); const result = service.getRegions([application]); expect(result.length).toEqual(2); expect(result).toEqual(['us-west-1', 'us-west-2']); @@ -110,7 +110,7 @@ describe('appListExtractorService', function () { it('should get a unique list of 2 aws region for one application w/ 3 server groups in 2 regions', function () { - const application: Application = buildApplication([{region: 'us-west-1'}, {region: 'us-west-2'}, {region: 'us-west-1'}]); + const application: Application = buildApplication([{ region: 'us-west-1' }, { region: 'us-west-2' }, { region: 'us-west-1' }]); const result = service.getRegions([application]); expect(result.length).toEqual(2); @@ -128,7 +128,7 @@ describe('appListExtractorService', function () { }); it('should get a list of 1 stack for one application w/ one cluster with one server group in one stack', function () { - const application: Application = buildApplication([ {stack: 'prod'} ]); + const application: Application = buildApplication([ { stack: 'prod' } ]); const result = service.getStacks([application]); expect(result.length).toEqual(1); @@ -136,7 +136,7 @@ describe('appListExtractorService', function () { }); it('should get a list of 2 stacks for one application w/ multi cluster with one server group in one stack', function () { - const application: Application = buildApplication([ {stack: 'prod'}, {stack: 'test'} ]); + const application: Application = buildApplication([ { stack: 'prod' }, { stack: 'test' } ]); const result = service.getStacks([application]); expect(result.length).toEqual(2); @@ -144,8 +144,8 @@ describe('appListExtractorService', function () { }); it('should get a list of 2 stacks for two application w/ one cluster each with one server group in one stack', function () { - const applicationA: Application = buildApplication([ {stack: 'prod'} ]); - const applicationB: Application = buildApplication([ {stack: 'mceprod'} ]); + const applicationA: Application = buildApplication([ { stack: 'prod' } ]); + const applicationB: Application = buildApplication([ { stack: 'mceprod' } ]); const result = service.getStacks([applicationA, applicationB]); expect(result.length).toEqual(2); @@ -153,7 +153,7 @@ describe('appListExtractorService', function () { }); it('should get a list of 1 stacks with a filter on the serverGroup name', function () { - const application: Application = buildApplication([ {name: 'foo', stack: 'prod'}, {name: 'bar', stack: 'test'} ]); + const application: Application = buildApplication([ { name: 'foo', stack: 'prod' }, { name: 'bar', stack: 'test' } ]); const filterByBar = (serverGroup: IServerGroup) => serverGroup.name === 'bar'; const result = service.getStacks([application], filterByBar); @@ -173,7 +173,7 @@ describe('appListExtractorService', function () { }); it('should get a list of 1 cluster for one application w/ one cluster', function () { - const application: Application = buildApplication([ {cluster: 'mahe-prod'} ]); + const application: Application = buildApplication([ { cluster: 'mahe-prod' } ]); const result = service.getClusters([application]); expect(result.length).toEqual(1); @@ -181,7 +181,7 @@ describe('appListExtractorService', function () { }); it('should get a list of 2 cluster names for one application w/ multi clusters', function () { - const application: Application = buildApplication([ {cluster: 'mahe-prod'}, {cluster: 'mahe-prestaging'} ]); + const application: Application = buildApplication([ { cluster: 'mahe-prod' }, { cluster: 'mahe-prestaging' } ]); const result = service.getClusters([application]); expect(result.length).toEqual(2); @@ -189,8 +189,8 @@ describe('appListExtractorService', function () { }); it('should get a list of 2 clusters for two application w/ one cluster each', function () { - const applicationA: Application = buildApplication([ {cluster: 'deck-main'} ]); - const applicationB: Application = buildApplication([ {cluster: 'gate-main'} ]); + const applicationA: Application = buildApplication([ { cluster: 'deck-main' } ]); + const applicationB: Application = buildApplication([ { cluster: 'gate-main' } ]); const result = service.getClusters([applicationA, applicationB]); expect(result.length).toEqual(2); @@ -198,7 +198,7 @@ describe('appListExtractorService', function () { }); it('should get a list of 1 cluster with a filter on the cluster name', function () { - const application: Application = buildApplication([ {cluster: 'deck-main'}, {cluster: 'gate-main'} ]); + const application: Application = buildApplication([ { cluster: 'deck-main' }, { cluster: 'gate-main' } ]); const filterByGate = (serverGroup: IServerGroup) => serverGroup.cluster === 'gate-main'; const result = service.getClusters([application], filterByGate); @@ -216,22 +216,22 @@ describe('appListExtractorService', function () { }); it('should get a list of 1 ASG for one application w/ one cluster', function () { - const application: Application = buildApplication([ {name: 'mahe-main-v000'} ]); + const application: Application = buildApplication([ { name: 'mahe-main-v000' } ]); const result = service.getAsgs([application]); expect(result.length).toEqual(1); expect(result).toEqual(['mahe-main-v000']); }); it('should get a list of 2 ASG names for one application w/ multi clusters', function () { - const application: Application = buildApplication([{name: 'mahe-main-v000'}, {name: 'mahe-prestaging-v002'}]); + const application: Application = buildApplication([{ name: 'mahe-main-v000' }, { name: 'mahe-prestaging-v002' }]); const result = service.getAsgs([application]); expect(result.length).toEqual(2); expect(result).toEqual(['mahe-main-v000', 'mahe-prestaging-v002' ]); }); it('should get a list of 2 ASGs for two application w/ one cluster each', function () { - const applicationA: Application = buildApplication([{name: 'mahe-prestaging-v002'}]); - const applicationB: Application = buildApplication([{name: 'deck-main-v002'}]); + const applicationA: Application = buildApplication([{ name: 'mahe-prestaging-v002' }]); + const applicationB: Application = buildApplication([{ name: 'deck-main-v002' }]); const result = service.getAsgs([applicationA, applicationB]); expect(result.length).toEqual(2); expect(result).toEqual(['deck-main-v002', 'mahe-prestaging-v002']); @@ -239,8 +239,8 @@ describe('appListExtractorService', function () { it('should get a list of 1 cluster with a filter on the cluster name', function () { const application: Application = buildApplication([ - {cluster: 'gate-main', name: 'gate-main-v000'}, - {cluster: 'deck-main', name: 'deck-main-v002'} + { cluster: 'gate-main', name: 'gate-main-v000' }, + { cluster: 'deck-main', name: 'deck-main-v002' } ]); const filterByGate = (serverGroup: IServerGroup) => serverGroup.cluster === 'gate-main'; const result = service.getAsgs([application], filterByGate); diff --git a/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.spec.tsx b/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.spec.tsx index 726210db0e4..0a63a5f0e21 100644 --- a/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.spec.tsx +++ b/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.spec.tsx @@ -24,7 +24,7 @@ describe('PermissionsConfigurer', () => { beforeEach(mock.inject(() => { const authenticationService = ReactInjector.authenticationService; spyOn(authenticationService, 'getAuthenticatedUser').and.callFake(() => { - return {roles: ['groupA', 'groupB', 'groupC']}; + return { roles: ['groupA', 'groupB', 'groupC'] }; }); })); @@ -46,7 +46,7 @@ describe('PermissionsConfigurer', () => { it(`populates the 'roleOptions' list with a user's roles minus the roles already used in the permissions object`, () => { const component = createComponent({ - permissions: {READ: ['groupA', 'groupB'], WRITE: ['groupB']}, + permissions: { READ: ['groupA', 'groupB'], WRITE: ['groupB'] }, requiredGroupMembership: null, onPermissionsChange: () => null, }); diff --git a/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.tsx b/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.tsx index fa92ca9659f..064ece419e2 100644 --- a/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.tsx +++ b/app/scripts/modules/core/src/application/modal/PermissionsConfigurer.tsx @@ -33,8 +33,8 @@ export interface IPermissionsConfigurerState { export class PermissionsConfigurer extends React.Component { private static accessTypes: Select.Option[] = [ - {value: 'READ', label: 'Read only'}, - {value: 'READ,WRITE', label: 'Read and write'}, + { value: 'READ', label: 'Read only' }, + { value: 'READ,WRITE', label: 'Read and write' }, ]; constructor(props: IPermissionsConfigurerProps) { @@ -63,7 +63,7 @@ export class PermissionsConfigurer extends React.Component { - permissionRows.push({group, access: 'READ'}); + permissionRows.push({ group, access: 'READ' }); }); permissions.WRITE.forEach(group => { @@ -72,7 +72,7 @@ export class PermissionsConfigurer extends React.Component ({value: role, label: role})); + ).map(role => ({ value: role, label: role })); } private convertRequiredGroupMembershipToPermissions(): IPermissions { @@ -103,11 +103,11 @@ export class PermissionsConfigurer extends React.Component { const accessTypes = row.access.split(','); accessTypes.forEach(type => { @@ -165,7 +165,7 @@ export class PermissionsConfigurer extends React.Component
@@ -399,7 +399,7 @@ export class CreatePipelineModal extends React.Component diff --git a/app/scripts/modules/core/src/delivery/create/ManagedTemplateSelector.tsx b/app/scripts/modules/core/src/delivery/create/ManagedTemplateSelector.tsx index 926f211b32a..62d5e5b539c 100644 --- a/app/scripts/modules/core/src/delivery/create/ManagedTemplateSelector.tsx +++ b/app/scripts/modules/core/src/delivery/create/ManagedTemplateSelector.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import * as Select from 'react-select'; -import {IPipelineTemplate} from 'core/pipeline/config/templates/pipelineTemplate.service'; +import { IPipelineTemplate } from 'core/pipeline/config/templates/pipelineTemplate.service'; import { BindAll } from 'lodash-decorators'; export interface IManagedTemplateSelectorProps { @@ -20,7 +20,7 @@ export class ManagedTemplateSelector extends React.Component @@ -30,7 +30,7 @@ export class ManagedTemplateSelector extends React.Component ({label: t.metadata.name, value: t.id})); + return this.props.templates.map(t => ({ label: t.metadata.name, value: t.id })); } private handleTemplateSelect(option: Select.Option): void { @@ -45,7 +45,7 @@ export class ManagedTemplateSelector extends React.Component t.id === option.value); return (
-
{template.metadata.name}
+
{template.metadata.name}
{template.selfLink && (

{template.selfLink}

)} {template.metadata.owner && (

{template.metadata.owner}

)} {template.metadata.description && (

{template.metadata.description}

)} diff --git a/app/scripts/modules/core/src/delivery/delivery.dataSource.spec.ts b/app/scripts/modules/core/src/delivery/delivery.dataSource.spec.ts index bdff4b13a3d..626dad9aa7c 100644 --- a/app/scripts/modules/core/src/delivery/delivery.dataSource.spec.ts +++ b/app/scripts/modules/core/src/delivery/delivery.dataSource.spec.ts @@ -1,10 +1,10 @@ -import {IQProvider, mock} from 'angular'; +import { IQProvider, mock } from 'angular'; -import {Application} from 'core/application/application.model'; -import {APPLICATION_MODEL_BUILDER, ApplicationModelBuilder} from 'core/application/applicationModel.builder'; -import {APPLICATION_DATA_SOURCE_REGISTRY, ApplicationDataSourceRegistry} from '../application/service/applicationDataSource.registry'; -import {EXECUTION_SERVICE} from './service/execution.service'; -import {PIPELINE_CONFIG_SERVICE, PipelineConfigService} from 'core/pipeline/config/services/pipelineConfig.service'; +import { Application } from 'core/application/application.model'; +import { APPLICATION_MODEL_BUILDER, ApplicationModelBuilder } from 'core/application/applicationModel.builder'; +import { APPLICATION_DATA_SOURCE_REGISTRY, ApplicationDataSourceRegistry } from '../application/service/applicationDataSource.registry'; +import { EXECUTION_SERVICE } from './service/execution.service'; +import { PIPELINE_CONFIG_SERVICE, PipelineConfigService } from 'core/pipeline/config/services/pipelineConfig.service'; describe('Delivery Data Source', function () { @@ -45,7 +45,7 @@ describe('Delivery Data Source', function () { ); function configureApplication() { - applicationDataSourceRegistry.registerDataSource({key: 'serverGroups'}); + applicationDataSourceRegistry.registerDataSource({ key: 'serverGroups' }); application = applicationModelBuilder.createApplication('app', applicationDataSourceRegistry.getDataSources()); application.refresh(); $scope.$digest(); @@ -59,7 +59,7 @@ describe('Delivery Data Source', function () { }); it('loads executions and sets appropriate flags', function () { - spyOn(executionService, 'getExecutions').and.returnValue($q.when([{status: 'SUCCEEDED', stages: []}])); + spyOn(executionService, 'getExecutions').and.returnValue($q.when([{ status: 'SUCCEEDED', stages: [] }])); configureApplication(); application.getDataSource('executions').activate(); $scope.$digest(); diff --git a/app/scripts/modules/core/src/delivery/details/ExecutionDetailsSectionNav.tsx b/app/scripts/modules/core/src/delivery/details/ExecutionDetailsSectionNav.tsx index ab8e173cabf..8905fbebaec 100644 --- a/app/scripts/modules/core/src/delivery/details/ExecutionDetailsSectionNav.tsx +++ b/app/scripts/modules/core/src/delivery/details/ExecutionDetailsSectionNav.tsx @@ -22,12 +22,12 @@ export class ExecutionDetailsSectionNav extends React.Component { const clicked = () => { - ReactGA.event({category: 'Pipeline', action: 'Execution details section selected', label: props.section}); + ReactGA.event({ category: 'Pipeline', action: 'Execution details section selected', label: props.section }); } return (
  • - + {robotToHuman(props.section)} diff --git a/app/scripts/modules/core/src/delivery/details/StageExecutionDetails.tsx b/app/scripts/modules/core/src/delivery/details/StageExecutionDetails.tsx index b804353861e..43226076c06 100644 --- a/app/scripts/modules/core/src/delivery/details/StageExecutionDetails.tsx +++ b/app/scripts/modules/core/src/delivery/details/StageExecutionDetails.tsx @@ -16,7 +16,7 @@ export function stageExecutionDetails(WrappedStageExecutionDetails: React.Compon public updateDetailsSection(): void { const detailsSection = ReactInjector.$stateParams.details; if (this.state.detailsSection !== detailsSection) { - this.setState({detailsSection}); + this.setState({ detailsSection }); } } diff --git a/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.spec.ts b/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.spec.ts index aa9825869b0..04ddba6d88f 100644 --- a/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.spec.ts +++ b/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.spec.ts @@ -57,7 +57,7 @@ describe('executionDetailsSectionService', function() { service.synchronizeSection(['a', 'b']); expect($state.includes).toHaveBeenCalledWith('**.execution'); - expect($state.go).toHaveBeenCalledWith('.', { details: 'a'}, {location: 'replace'}); + expect($state.go).toHaveBeenCalledWith('.', { details: 'a' }, { location: 'replace' }); }); @@ -70,7 +70,7 @@ describe('executionDetailsSectionService', function() { service.synchronizeSection(['a', 'b']); expect($state.includes).toHaveBeenCalledWith('**.execution'); - expect($state.go).toHaveBeenCalledWith('.', { details: 'a'}, {location: 'replace'}); + expect($state.go).toHaveBeenCalledWith('.', { details: 'a' }, { location: 'replace' }); }); it('calls initialization after timeout', function() { diff --git a/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.ts b/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.ts index ed05e154e59..1e44ab19667 100644 --- a/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.ts +++ b/app/scripts/modules/core/src/delivery/details/executionDetailsSection.service.ts @@ -26,7 +26,7 @@ export class ExecutionDetailsSectionService { } if (!this.sectionIsValid(availableSections)) { // use { location: 'replace' } to overwrite the invalid browser history state - this.$state.go('.', { details: details}, { location: 'replace' }); + this.$state.go('.', { details: details }, { location: 'replace' }); } if (onComplete) { this.pendingOnComplete = this.$timeout(onComplete); diff --git a/app/scripts/modules/core/src/delivery/executionBuild/ExecutionBuildNumber.tsx b/app/scripts/modules/core/src/delivery/executionBuild/ExecutionBuildNumber.tsx index 77b2e049265..2bdcdf886cf 100644 --- a/app/scripts/modules/core/src/delivery/executionBuild/ExecutionBuildNumber.tsx +++ b/app/scripts/modules/core/src/delivery/executionBuild/ExecutionBuildNumber.tsx @@ -19,15 +19,15 @@ export class ExecutionBuildNumber extends React.Component) { - ReactGA.event({category: 'Pipeline', action: 'Execution build number clicked - build info'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution build number clicked - build info' }); event.stopPropagation(); } diff --git a/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroup.tsx b/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroup.tsx index 2b7f7417dad..ac613d13782 100644 --- a/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroup.tsx +++ b/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroup.tsx @@ -89,19 +89,19 @@ export class ExecutionGroup extends React.Component { const { executionService, pipelineConfigService } = ReactInjector; - this.setState({triggeringExecution: true}); + this.setState({ triggeringExecution: true }); return pipelineConfigService.triggerPipeline(this.props.application.name, command.pipelineName, command.trigger).then( (newPipelineId) => { const monitor = executionService.waitUntilNewTriggeredPipelineAppears(this.props.application, newPipelineId); - monitor.then(() => this.setState({triggeringExecution: false})); - this.setState({poll: monitor}); + monitor.then(() => this.setState({ triggeringExecution: false })); + this.setState({ poll: monitor }); }, - () => this.setState({triggeringExecution: false})); + () => this.setState({ triggeringExecution: false })); } public triggerPipeline(): void { @@ -144,18 +144,18 @@ export class ExecutionGroup extends React.Component): void { - ReactGA.event({category: 'Pipeline', action: 'Configure pipeline button clicked', label: this.props.group.heading}); + ReactGA.event({ category: 'Pipeline', action: 'Configure pipeline button clicked', label: this.props.group.heading }); this.configure(this.props.group.config.id); e.stopPropagation(); } private handleTriggerClicked(e: React.MouseEvent): void { - ReactGA.event({category: 'Pipeline', action: 'Trigger pipeline button clicked', label: this.props.group.heading}); + ReactGA.event({ category: 'Pipeline', action: 'Trigger pipeline button clicked', label: this.props.group.heading }); this.triggerPipeline(); e.stopPropagation(); } @@ -200,7 +200,7 @@ export class ExecutionGroup extends React.Component { this.state.canTriggerPipelineManually && ( -

    +

    { this.state.triggeringExecution ? Starting Manual Execution… : @@ -220,7 +220,7 @@ export class ExecutionGroup extends React.Component
    {!group.executions.length && ( -
    +
    No executions found matching the selected filters.
    )} diff --git a/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroups.tsx b/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroups.tsx index aed211afa69..9a34e6c8155 100644 --- a/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroups.tsx +++ b/app/scripts/modules/core/src/delivery/executionGroup/ExecutionGroups.tsx @@ -31,11 +31,11 @@ export class ExecutionGroups extends React.Component { this.forceUpdate(); }); - this.groupsUpdatedSubscription = executionFilterService.groupsUpdatedStream.subscribe(() => { this.setState({groups: executionFilterModel.asFilterModel.groups.slice()}); }); + this.groupsUpdatedSubscription = executionFilterService.groupsUpdatedStream.subscribe(() => { this.setState({ groups: executionFilterModel.asFilterModel.groups.slice() }); }); this.stateChangeSuccessSubscription = stateEvents.stateChangeSuccess.subscribe(() => { const detailsShown = this.showingDetails(); if (detailsShown !== this.state.showingDetails) { - this.setState({showingDetails: detailsShown}); + this.setState({ showingDetails: detailsShown }); } }); } diff --git a/app/scripts/modules/core/src/delivery/executionGroup/execution/Execution.tsx b/app/scripts/modules/core/src/delivery/executionGroup/execution/Execution.tsx index 47a2cab1b73..8c1b7403a52 100644 --- a/app/scripts/modules/core/src/delivery/executionGroup/execution/Execution.tsx +++ b/app/scripts/modules/core/src/delivery/executionGroup/execution/Execution.tsx @@ -211,39 +211,39 @@ export class Execution extends React.Component } private handleSourceNoStagesClick(): void { - ReactGA.event({category: 'Pipeline', action: 'Execution source clicked (no stages found)'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution source clicked (no stages found)' }); } private handlePauseClick(event: React.MouseEvent): void { - ReactGA.event({category: 'Pipeline', action: 'Execution pause clicked'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution pause clicked' }); this.pauseExecution(); event.stopPropagation(); } private handleResumeClick(event: React.MouseEvent): void { - ReactGA.event({category: 'Pipeline', action: 'Execution resume clicked'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution resume clicked' }); this.resumeExecution(); event.stopPropagation(); } private handleDeleteClick(event: React.MouseEvent): void { - ReactGA.event({category: 'Pipeline', action: 'Execution delete clicked'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution delete clicked' }); this.deleteExecution(); event.stopPropagation(); } private handleCancelClick(event: React.MouseEvent): void { - ReactGA.event({category: 'Pipeline', action: 'Execution cancel clicked'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution cancel clicked' }); this.cancelExecution(); event.stopPropagation(); } private handleSourceClick(): void { - ReactGA.event({category: 'Pipeline', action: 'Execution source clicked'}); + ReactGA.event({ category: 'Pipeline', action: 'Execution source clicked' }); } private handlePermalinkClick(): void { - ReactGA.event({category: 'Pipeline', action: 'Permalink clicked'}); + ReactGA.event({ category: 'Pipeline', action: 'Permalink clicked' }); } public render() { diff --git a/app/scripts/modules/core/src/delivery/executionGroup/execution/ExecutionMarker.tsx b/app/scripts/modules/core/src/delivery/executionGroup/execution/ExecutionMarker.tsx index 2db58c3b6bf..a9169416539 100644 --- a/app/scripts/modules/core/src/delivery/executionGroup/execution/ExecutionMarker.tsx +++ b/app/scripts/modules/core/src/delivery/executionGroup/execution/ExecutionMarker.tsx @@ -50,12 +50,12 @@ export class ExecutionMarker extends React.Component diff --git a/app/scripts/modules/core/src/delivery/executions/Executions.spec.tsx b/app/scripts/modules/core/src/delivery/executions/Executions.spec.tsx index e0d3f40fae6..ac37e5e60d9 100644 --- a/app/scripts/modules/core/src/delivery/executions/Executions.spec.tsx +++ b/app/scripts/modules/core/src/delivery/executions/Executions.spec.tsx @@ -48,7 +48,7 @@ describe('', () => { beforeEach(mock.inject((_$timeout_: ITimeoutService, $rootScope: IScope, applicationModelBuilder: ApplicationModelBuilder) => { scope = $rootScope.$new(); $timeout = _$timeout_; - application = applicationModelBuilder.createApplication('app', {key: 'executions', lazy: true}, {key: 'pipelineConfigs', lazy: true}); + application = applicationModelBuilder.createApplication('app', { key: 'executions', lazy: true }, { key: 'pipelineConfigs', lazy: true }); })); it('should not set loading flag to false until executions and pipeline configs have been loaded', function () { @@ -71,7 +71,7 @@ describe('', () => { it('should scroll execution into view on initialization if an execution is present in state params', function () { ReactInjector.$stateParams.executionId = 'a'; - initializeApplication({ pipelineConfigs: [], executions: []}); + initializeApplication({ pipelineConfigs: [], executions: [] }); scope.$digest(); expect((ReactInjector.scrollToService.scrollTo as any).calls.count()).toBe(1); diff --git a/app/scripts/modules/core/src/delivery/executions/Executions.tsx b/app/scripts/modules/core/src/delivery/executions/Executions.tsx index bc0c1afad29..51ee844bee9 100644 --- a/app/scripts/modules/core/src/delivery/executions/Executions.tsx +++ b/app/scripts/modules/core/src/delivery/executions/Executions.tsx @@ -117,12 +117,12 @@ export class Executions extends React.Component): void { const value = event.target.value; - ReactGA.event({category: 'Pipelines', action: 'Group By', label: value}); + ReactGA.event({ category: 'Pipelines', action: 'Group By', label: value }); this.state.sortFilter.groupBy = value; this.updateExecutionGroups(); } @@ -227,7 +227,7 @@ export class Executions extends React.Component): void { const value = event.target.value; this.state.sortFilter.count = value; - ReactGA.event({category: 'Pipelines', action: 'Change Count', label: value}); + ReactGA.event({ category: 'Pipelines', action: 'Change Count', label: value }); this.updateExecutionGroups(true); } @@ -237,8 +237,8 @@ export class Executions extends React.Component { @@ -261,7 +261,7 @@ export class Executions extends React.Component
    @@ -278,7 +278,7 @@ export class Executions extends React.Component {triggeringExecution && ( @@ -299,9 +299,9 @@ export class Executions extends React.Component
    -
    + {sortFilter.groupBy && ( -
    +
    @@ -351,7 +351,7 @@ export class Executions extends React.Component )} {loading &&
    } - {app.executions.reloadingForFilters &&
    } + {app.executions.reloadingForFilters &&
    } {!loading && !hasPipelines && (

    No pipelines configured for this application.

    diff --git a/app/scripts/modules/core/src/delivery/filter/ExecutionFilters.tsx b/app/scripts/modules/core/src/delivery/filter/ExecutionFilters.tsx index 516201c77c9..5b0669976ff 100644 --- a/app/scripts/modules/core/src/delivery/filter/ExecutionFilters.tsx +++ b/app/scripts/modules/core/src/delivery/filter/ExecutionFilters.tsx @@ -62,12 +62,12 @@ export class ExecutionFilters extends React.Component { const newIndex = pipelineNames.indexOf(pipeline.name); @@ -163,7 +163,7 @@ export class ExecutionFilters extends React.Component 0 ? 'visible' : 'hidden'}} + style={{ visibility: tags.length > 0 ? 'visible' : 'hidden' }} > Clear All @@ -176,7 +176,7 @@ export class ExecutionFilters extends React.Component
    @@ -234,14 +234,14 @@ const FilterCheckbox = (props: { pipeline: string, visible: boolean, update: () const { pipeline, visible, update } = props; const sortFilter = ReactInjector.executionFilterModel.asFilterModel.sortFilter; const changeHandler = () => { - ReactGA.event({category: 'Pipelines', action: 'Filter: pipeline', label: pipeline}); + ReactGA.event({ category: 'Pipelines', action: 'Filter: pipeline', label: pipeline }); sortFilter.pipeline[pipeline] = !sortFilter.pipeline[pipeline]; update(); }; return ( void }): JSX.Element => { const sortFilter = ReactInjector.executionFilterModel.asFilterModel.sortFilter; const changed = () => { - ReactGA.event({category: 'Pipelines', action: 'Filter: status', label: props.label.toUpperCase()}); + ReactGA.event({ category: 'Pipelines', action: 'Filter: status', label: props.label.toUpperCase() }); sortFilter.status[props.status] = !sortFilter.status[props.status]; props.refresh(); } diff --git a/app/scripts/modules/core/src/delivery/filter/executionFilter.model.ts b/app/scripts/modules/core/src/delivery/filter/executionFilter.model.ts index e176e22c7f2..068555f4ac0 100644 --- a/app/scripts/modules/core/src/delivery/filter/executionFilter.model.ts +++ b/app/scripts/modules/core/src/delivery/filter/executionFilter.model.ts @@ -11,7 +11,7 @@ import { UrlParser } from 'core/navigation/urlParser'; export const filterModelConfig: IFilterConfig[] = [ { model: 'filter', param: 'q', clearValue: '', type: 'string', filterLabel: 'search', }, - { model: 'pipeline', param: 'pipeline', type: 'trueKeyObject', clearValue: {}}, + { model: 'pipeline', param: 'pipeline', type: 'trueKeyObject', clearValue: {} }, { model: 'status', type: 'trueKeyObject', clearValue: {}, }, ]; diff --git a/app/scripts/modules/core/src/delivery/filter/executionFilter.service.spec.ts b/app/scripts/modules/core/src/delivery/filter/executionFilter.service.spec.ts index f22b8c4ad25..7edaad56cae 100644 --- a/app/scripts/modules/core/src/delivery/filter/executionFilter.service.spec.ts +++ b/app/scripts/modules/core/src/delivery/filter/executionFilter.service.spec.ts @@ -1,8 +1,8 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {APPLICATION_MODEL_BUILDER, ApplicationModelBuilder} from 'core/application/applicationModel.builder'; -import {EXECUTION_FILTER_MODEL, ExecutionFilterModel} from 'core/delivery/filter/executionFilter.model'; -import {EXECUTION_FILTER_SERVICE, ExecutionFilterService} from './executionFilter.service'; +import { APPLICATION_MODEL_BUILDER, ApplicationModelBuilder } from 'core/application/applicationModel.builder'; +import { EXECUTION_FILTER_MODEL, ExecutionFilterModel } from 'core/delivery/filter/executionFilter.model'; +import { EXECUTION_FILTER_SERVICE, ExecutionFilterService } from './executionFilter.service'; describe('Service: executionFilterService', function () { @@ -29,8 +29,8 @@ describe('Service: executionFilterService', function () { describe('Sorting', () => { it('sorts pipeline groups by index, always putting strategies at the end, followed by ad-hoc pipelines', () => { - const firstGroup = { config: { index: 1} }; - const secondGroup = { config: { index: 2} }; + const firstGroup = { config: { index: 1 } }; + const secondGroup = { config: { index: 2 } }; const strategy = { config: { index: 0, strategy: true } }; const adHocA = { heading: 'a' }; const adHocB = { heading: 'b' }; diff --git a/app/scripts/modules/core/src/delivery/filter/executionFilter.service.ts b/app/scripts/modules/core/src/delivery/filter/executionFilter.service.ts index 2cac43dd463..870049cb9d8 100644 --- a/app/scripts/modules/core/src/delivery/filter/executionFilter.service.ts +++ b/app/scripts/modules/core/src/delivery/filter/executionFilter.service.ts @@ -119,12 +119,12 @@ export class ExecutionFilterService { !this.executionFilterModel.asFilterModel.sortFilter.filter) { configs .filter((config: any) => !groups[config.name]) - .forEach((config: any) => groups.push({heading: config.name, config: config, executions: [], targetAccounts: this.extractAccounts(config)})); + .forEach((config: any) => groups.push({ heading: config.name, config: config, executions: [], targetAccounts: this.extractAccounts(config) })); } else { configs .filter((config: any) => !groups[config.name] && this.executionFilterModel.asFilterModel.sortFilter.pipeline[config.name]) .forEach((config: any) => { - groups.push({heading: config.name, config: config, executions: [], targetAccounts: this.extractAccounts(config)}); + groups.push({ heading: config.name, config: config, executions: [], targetAccounts: this.extractAccounts(config) }); }); } } diff --git a/app/scripts/modules/core/src/delivery/service/execution.service.spec.ts b/app/scripts/modules/core/src/delivery/service/execution.service.spec.ts index dab02b5064a..a7db8b8a1b6 100644 --- a/app/scripts/modules/core/src/delivery/service/execution.service.spec.ts +++ b/app/scripts/modules/core/src/delivery/service/execution.service.spec.ts @@ -41,16 +41,16 @@ describe('Service: executionService', () => { const executionId = 'abc'; const cancelUrl = [ SETTINGS.gateUrl, 'pipelines', executionId, 'cancel' ].join('/'); const checkUrl = [ SETTINGS.gateUrl, 'pipelines', executionId ].join('/'); - const application: Application = { name: 'deck', executions: { refresh: () => $q.when(null) }} as any; + const application: Application = { name: 'deck', executions: { refresh: () => $q.when(null) } } as any; $httpBackend.expectPUT(cancelUrl).respond(200, []); - $httpBackend.expectGET(checkUrl).respond(200, {id: executionId, status: 'RUNNING'}); + $httpBackend.expectGET(checkUrl).respond(200, { id: executionId, status: 'RUNNING' }); executionService.cancelExecution(application, executionId).then(() => completed = true); $httpBackend.flush(); expect(completed).toBe(false); - $httpBackend.expectGET(checkUrl).respond(200, {id: executionId, status: 'CANCELED'}); + $httpBackend.expectGET(checkUrl).respond(200, { id: executionId, status: 'CANCELED' }); timeout.flush(); $httpBackend.flush(); expect(completed).toBe(true); @@ -79,7 +79,7 @@ describe('Service: executionService', () => { const application: Application = { name: 'deck', executions: { refresh: () => $q.when(null) } } as any; $httpBackend.expectDELETE(deleteUrl).respond(200, []); - $httpBackend.expectGET(checkUrl).respond(200, {id: executionId}); + $httpBackend.expectGET(checkUrl).respond(200, { id: executionId }); executionService.deleteExecution(application, executionId).then(() => completed = true); $httpBackend.flush(); @@ -114,13 +114,13 @@ describe('Service: executionService', () => { const application: Application = { name: 'deck', executions: { refresh: () => $q.when(null) } } as any; $httpBackend.expectPUT(pauseUrl).respond(200, []); - $httpBackend.expectGET(singleExecutionUrl).respond(200, {id: executionId, status: 'RUNNING'}); + $httpBackend.expectGET(singleExecutionUrl).respond(200, { id: executionId, status: 'RUNNING' }); executionService.pauseExecution(application, executionId).then(() => completed = true); $httpBackend.flush(); expect(completed).toBe(false); - $httpBackend.expectGET(singleExecutionUrl).respond(200, {id: executionId, status: 'PAUSED'}); + $httpBackend.expectGET(singleExecutionUrl).respond(200, { id: executionId, status: 'PAUSED' }); timeout.flush(); $httpBackend.flush(); @@ -137,13 +137,13 @@ describe('Service: executionService', () => { const application: Application = { name: 'deck', executions: { refresh: () => $q.when(null) } } as any; $httpBackend.expectPUT(pauseUrl).respond(200, []); - $httpBackend.expectGET(singleExecutionUrl).respond(200, {id: executionId, status: 'PAUSED'}); + $httpBackend.expectGET(singleExecutionUrl).respond(200, { id: executionId, status: 'PAUSED' }); executionService.resumeExecution(application, executionId).then(() => completed = true); $httpBackend.flush(); expect(completed).toBe(false); - $httpBackend.expectGET(singleExecutionUrl).respond(200, {id: executionId, status: 'RUNNING'}); + $httpBackend.expectGET(singleExecutionUrl).respond(200, { id: executionId, status: 'RUNNING' }); timeout.flush(); $httpBackend.flush(); @@ -289,8 +289,8 @@ describe('Service: executionService', () => { describe('removeCompletedExecutionsFromRunningData', () => { it('should remove executions that have completed', () => { - application.executions.data = [ {id: 0, isActive: false}, {id: 1, isActive: false}, {id: 2, isActive: true} ]; - application.runningExecutions.data = [ {id: 1, isActive: true}, {id: 2, isActive: true} ]; + application.executions.data = [ { id: 0, isActive: false }, { id: 1, isActive: false }, { id: 2, isActive: true } ]; + application.runningExecutions.data = [ { id: 1, isActive: true }, { id: 2, isActive: true } ]; executionService.removeCompletedExecutionsFromRunningData(application); expect(application.runningExecutions.data.map((d: any) => d.id)).toEqual([2]); expect(dataUpdated).toBe(true); @@ -299,16 +299,16 @@ describe('Service: executionService', () => { describe('mergeRunningExecutionsIntoExecutions', () => { it('should add running executions to executions, and update if stringVal changed', () => { - application.executions.data = [ {id: 0, isActive: false, stringVal: 'a'}, {id: 2, isActive: true, stringVal: 'b'} ]; - application.runningExecutions.data = [ {id: 1, isActive: true, stringVal: 'c'}, {id: 2, isActive: true, stringVal: 'd'} ]; + application.executions.data = [ { id: 0, isActive: false, stringVal: 'a' }, { id: 2, isActive: true, stringVal: 'b' } ]; + application.runningExecutions.data = [ { id: 1, isActive: true, stringVal: 'c' }, { id: 2, isActive: true, stringVal: 'd' } ]; executionService.mergeRunningExecutionsIntoExecutions(application); expect(application.executions.data.map((d: any) => `${d.id}:${d.stringVal}`)).toEqual(['0:a', '2:d', '1:c']); expect(dataUpdated).toBe(true); }); it('should only call dataUpdated if actual updates occurred', () => { - application.executions.data = [ {id: 0, isActive: false, stringVal: 'a'}, {id: 2, isActive: true, stringVal: 'b'} ]; - application.runningExecutions.data = [ {id: 2, isActive: true, stringVal: 'b'} ]; + application.executions.data = [ { id: 0, isActive: false, stringVal: 'a' }, { id: 2, isActive: true, stringVal: 'b' } ]; + application.runningExecutions.data = [ { id: 2, isActive: true, stringVal: 'b' } ]; executionService.mergeRunningExecutionsIntoExecutions(application); expect(application.executions.data.map((d: any) => `${d.id}:${d.stringVal}`)).toEqual(['0:a', '2:b']); expect(dataUpdated).toBe(false); @@ -320,18 +320,18 @@ describe('Service: executionService', () => { describe('adding executions to applications', () => { let application: Application; beforeEach(() => { - application = { executions: { data: [] }, runningExecutions: { data: [] }} as any; + application = { executions: { data: [] }, runningExecutions: { data: [] } } as any; }); it('should add all executions if there are none on application', () => { - const execs: IExecution[] = [{a: 1}] as any; + const execs: IExecution[] = [{ a: 1 }] as any; const data = executionService.addExecutionsToApplication(application, execs); expect(data).toBe(execs); }); it('should add new executions', () => { - const original = {id: 1, stringVal: 'ac'}; - const newOne = {id: 2, stringVal: 'ab'}; + const original = { id: 1, stringVal: 'ac' }; + const newOne = { id: 2, stringVal: 'ab' }; const execs: IExecution[] = [original, newOne] as any; application.executions.data = [original]; @@ -384,8 +384,8 @@ describe('Service: executionService', () => { }); it('should replace an existing execution if status changes', () => { - const original = {id: 1, stringVal: 'ac', status: 'RUNNING'}; - const updated = {id: 1, stringVal: 'ab', status: 'COMPLETED'}; + const original = { id: 1, stringVal: 'ac', status: 'RUNNING' }; + const updated = { id: 1, stringVal: 'ab', status: 'COMPLETED' }; const execs: IExecution[] = [updated] as any; application.executions.data = [original]; @@ -395,8 +395,8 @@ describe('Service: executionService', () => { }); it('should remove an execution if it is not in the new set', () => { - const transient = {id: 1, stringVal: 'ac'}; - const persistent = {id: 2, stringVal: 'ab'}; + const transient = { id: 1, stringVal: 'ac' }; + const persistent = { id: 2, stringVal: 'ab' }; const execs: IExecution[] = [persistent] as any; application.executions.data = [transient]; @@ -406,7 +406,7 @@ describe('Service: executionService', () => { }); it('should retain running executions, even if they are not in the new set', () => { - const running = {id: 3}; + const running = { id: 3 }; application.executions.data = [running]; application.runningExecutions.data = [running]; @@ -415,9 +415,9 @@ describe('Service: executionService', () => { }); it('should remove multiple executions if not in the new set', () => { - const transient1 = {id: 1, stringVal: 'ac'}; - const persistent = {id: 2, stringVal: 'ab'}; - const transient3 = {id: 3, stringVal: 'ac'}; + const transient1 = { id: 1, stringVal: 'ac' }; + const persistent = { id: 2, stringVal: 'ab' }; + const transient3 = { id: 3, stringVal: 'ac' }; const execs: IExecution[] = [persistent] as any; application.executions.data = [transient1, persistent, transient3]; @@ -428,7 +428,7 @@ describe('Service: executionService', () => { it('should replace the existing executions if application has executions comes back empty', () => { const execs: IExecution[] = []; - application.executions.data = [{a: 1}]; + application.executions.data = [{ a: 1 }]; const data = executionService.addExecutionsToApplication(application, execs); diff --git a/app/scripts/modules/core/src/delivery/service/execution.service.ts b/app/scripts/modules/core/src/delivery/service/execution.service.ts index 6cbd7d1ed38..aea7ee40bf8 100644 --- a/app/scripts/modules/core/src/delivery/service/execution.service.ts +++ b/app/scripts/modules/core/src/delivery/service/execution.service.ts @@ -28,12 +28,12 @@ export class ExecutionService { } public getRunningExecutions(applicationName: string): IPromise { - return this.getFilteredExecutions(applicationName, {statuses: this.activeStatuses, limit: this.runningLimit}); + return this.getFilteredExecutions(applicationName, { statuses: this.activeStatuses, limit: this.runningLimit }); } - private getFilteredExecutions(applicationName: string, {statuses = Object.keys(pickBy(this.executionFilterModel.asFilterModel.sortFilter.status || {}, identity)), limit = this.executionFilterModel.asFilterModel.sortFilter.count} = {}): IPromise { + private getFilteredExecutions(applicationName: string, { statuses = Object.keys(pickBy(this.executionFilterModel.asFilterModel.sortFilter.status || {}, identity)), limit = this.executionFilterModel.asFilterModel.sortFilter.count } = {}): IPromise { const statusString = statuses.map((status) => status.toUpperCase()).join(',') || null; - return this.API.one('applications', applicationName).all('pipelines').getList({ limit: limit, statuses: statusString}) + return this.API.one('applications', applicationName).all('pipelines').getList({ limit: limit, statuses: statusString }) .then((data: IExecution[]) => { if (data) { data.forEach((execution: IExecution) => this.cleanExecutionForDiffing(execution)); diff --git a/app/scripts/modules/core/src/delivery/service/executions.transformer.service.spec.ts b/app/scripts/modules/core/src/delivery/service/executions.transformer.service.spec.ts index 185f9bd0bcb..2f4a0e9b592 100644 --- a/app/scripts/modules/core/src/delivery/service/executions.transformer.service.spec.ts +++ b/app/scripts/modules/core/src/delivery/service/executions.transformer.service.spec.ts @@ -18,7 +18,7 @@ describe('executionTransformerService', function() { it('should flatten stages into summaries', () => { const execution = { stages: [ - { id: 'a', name: 'a'}, + { id: 'a', name: 'a' }, { id: 'b', name: 'b', parentStageId: 'a', syntheticStageOwner: 'STAGE_BEFORE' }, { id: 'c', name: 'c', parentStageId: 'a', syntheticStageOwner: 'STAGE_BEFORE' }, { id: 'd', name: 'd', parentStageId: 'a', syntheticStageOwner: 'STAGE_AFTER' }, @@ -69,13 +69,13 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '1', name: 'bake', status: 'RUNNING' }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE'}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE' }, { id: '2', name: 'deploy' }, { id: '3', name: 'wait' }, - { id: '5', parentStageId: '1', syntheticStageOwner: 'STAGE_BEFORE'}, - { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE'}, - { id: '7', parentStageId: '3', syntheticStageOwner: 'STAGE_BEFORE'}, - { id: '8', parentStageId: '3', syntheticStageOwner: 'STAGE_AFTER'}, + { id: '5', parentStageId: '1', syntheticStageOwner: 'STAGE_BEFORE' }, + { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE' }, + { id: '7', parentStageId: '3', syntheticStageOwner: 'STAGE_BEFORE' }, + { id: '8', parentStageId: '3', syntheticStageOwner: 'STAGE_AFTER' }, ] } as IExecution; transformer.transformExecution({} as Application, execution); @@ -92,8 +92,8 @@ describe('executionTransformerService', function() { { id: '1', name: 'bake', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, { id: '2', name: 'deploy', status: 'RUNNING', startTime: 7 }, { id: '3', name: 'wait', status: 'NOT_STARTED' }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 6}, - { id: '5', parentStageId: '1', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 5, endTime: 6}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 6 }, + { id: '5', parentStageId: '1', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 5, endTime: 6 }, { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'NOT_STARTED' }, { id: '7', parentStageId: '3', syntheticStageOwner: 'STAGE_BEFORE', status: 'NOT_STARTED' }, { id: '8', parentStageId: '3', syntheticStageOwner: 'STAGE_AFTER', status: 'NOT_STARTED' }, @@ -118,7 +118,7 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'CANCELED', startTime: 4, endTime: 6}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'CANCELED', startTime: 4, endTime: 6 }, { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'NOT_STARTED', startTime: 6 }, ] } as IExecution; @@ -130,7 +130,7 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'COMPLETED', startTime: 4, endTime: 6}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'COMPLETED', startTime: 4, endTime: 6 }, { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'NOT_STARTED', startTime: 6 }, ] } as IExecution; @@ -142,7 +142,7 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 6}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 6 }, { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'RUNNING', startTime: 6 }, ] } as IExecution; @@ -154,8 +154,8 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 6}, - { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 9}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 6 }, + { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 4, endTime: 9 }, { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'SUCCEEDED', startTime: 6, endTime: 11 }, ] } as IExecution; @@ -167,8 +167,8 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '1', name: 'bake', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, - { id: '2', parentStageId: '1', syntheticStageOwner: 'STAGE_AFTER', status: 'SUCCEEDED', startTime: 8, endTime: 9}, - { id: '3', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 7, endTime: 8}, + { id: '2', parentStageId: '1', syntheticStageOwner: 'STAGE_AFTER', status: 'SUCCEEDED', startTime: 8, endTime: 9 }, + { id: '3', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 7, endTime: 8 }, { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'RUNNING', startTime: 11 }, { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'NOT_STARTED' }, ] @@ -198,8 +198,8 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'SUCCEEDED', startTime: null, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: null, endTime: 6}, - { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 11, endTime: 9}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: null, endTime: 6 }, + { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED', startTime: 11, endTime: 9 }, { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'SUCCEEDED', startTime: 4, endTime: 11 }, ] } as IExecution; @@ -213,9 +213,9 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'RUNNING', startTime: null, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED'}, - { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'RUNNING'}, - { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'RUNNING'}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED' }, + { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'RUNNING' }, + { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'RUNNING' }, ] } as IExecution; transformer.transformExecution({} as Application, execution); @@ -226,9 +226,9 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'SUCCEEDED', startTime: null, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED'}, - { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED'}, - { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'SUCCEEDED'}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED' }, + { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED' }, + { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'SUCCEEDED' }, ] } as IExecution; transformer.transformExecution({} as Application, execution); @@ -239,9 +239,9 @@ describe('executionTransformerService', function() { const execution = { stages: [ { id: '2', name: 'deploy', status: 'TERMINAL', startTime: null, endTime: 8 }, - { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED'}, - { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED'}, - { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'TERMINAL'}, + { id: '4', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED' }, + { id: '5', parentStageId: '2', syntheticStageOwner: 'STAGE_BEFORE', status: 'SUCCEEDED' }, + { id: '6', parentStageId: '2', syntheticStageOwner: 'STAGE_AFTER', status: 'TERMINAL' }, ] } as IExecution; transformer.transformExecution({} as Application, execution); @@ -266,23 +266,23 @@ describe('executionTransformerService', function() { it('adds buildInfo from deployment details', () => { const execution = { stages: [ deployStage ] } as IExecution; transformer.transformExecution({} as Application, execution); - expect(execution.buildInfo).toEqual({ number: 3, url: 'http://jenkinshost/job/jobName/3'}); + expect(execution.buildInfo).toEqual({ number: 3, url: 'http://jenkinshost/job/jobName/3' }); }); it('adds buildInfo from lastBuild if present', () => { - const execution = { stages: [], trigger: { buildInfo: {lastBuild: lastBuild }}} as IExecution; + const execution = { stages: [], trigger: { buildInfo: { lastBuild: lastBuild } } } as IExecution; transformer.transformExecution({} as Application, execution); expect(execution.buildInfo.number).toBe(4); }); it('adds buildInfo from trigger', () => { - const execution = { stages: [], trigger: { buildInfo: triggerBuild }} as IExecution; + const execution = { stages: [], trigger: { buildInfo: triggerBuild } } as IExecution; transformer.transformExecution({} as Application, execution); expect(execution.buildInfo.number).toBe(6); }); it('adds buildInfo from parent pipeline', () => { - const execution = { stages: [], trigger: { parentExecution: {trigger: {buildInfo: parentBuild }}}} as IExecution; + const execution = { stages: [], trigger: { parentExecution: { trigger: { buildInfo: parentBuild } } } } as IExecution; transformer.transformExecution({} as Application, execution); expect(execution.buildInfo.number).toBe(5); }); @@ -292,7 +292,7 @@ describe('executionTransformerService', function() { execution.trigger.buildInfo.lastBuild = lastBuild; execution.trigger.parentExecution = { trigger: { buildInfo: parentBuild } } as IExecution; transformer.transformExecution({} as Application, execution); - expect(execution.buildInfo).toEqual({ number: 3, url: 'http://jenkinshost/job/jobName/3'}); + expect(execution.buildInfo).toEqual({ number: 3, url: 'http://jenkinshost/job/jobName/3' }); }); it('prefers last build info to parent execution or trigger details', () => { @@ -319,7 +319,7 @@ describe('executionTransformerService', function() { }}; const execution = { stages: [ deployStage ] } as IExecution; transformer.transformExecution({} as Application, execution); - expect(execution.buildInfo).toEqual({ number: 3, url: 'http://custom/url'}); + expect(execution.buildInfo).toEqual({ number: 3, url: 'http://custom/url' }); }); }); }); diff --git a/app/scripts/modules/core/src/delivery/status/ExecutionStatus.spec.tsx b/app/scripts/modules/core/src/delivery/status/ExecutionStatus.spec.tsx index 463e2a8aa60..dcdeae68f58 100644 --- a/app/scripts/modules/core/src/delivery/status/ExecutionStatus.spec.tsx +++ b/app/scripts/modules/core/src/delivery/status/ExecutionStatus.spec.tsx @@ -39,9 +39,9 @@ describe('', () => { } as any; component = getNewExecutionStatus(execution); expect(component.state().parameters).toEqual([ - {key: 'a', value: '"b"'}, - {key: 'b', value: '"c"'}, - {key: 'd', value: '"a"'} + { key: 'a', value: '"b"' }, + { key: 'b', value: '"c"' }, + { key: 'd', value: '"a"' } ]); }); @@ -67,7 +67,7 @@ describe('', () => { } as any; component = getNewExecutionStatus(execution); expect(component.state().parameters).toEqual([ - {key: 'included', value: '"a"'} + { key: 'included', value: '"a"' } ]); }); }); diff --git a/app/scripts/modules/core/src/delivery/status/ExecutionStatus.tsx b/app/scripts/modules/core/src/delivery/status/ExecutionStatus.tsx index 86aea7132b5..69c5fd34113 100644 --- a/app/scripts/modules/core/src/delivery/status/ExecutionStatus.tsx +++ b/app/scripts/modules/core/src/delivery/status/ExecutionStatus.tsx @@ -63,7 +63,7 @@ export class ExecutionStatus extends React.Component + diff --git a/app/scripts/modules/core/src/delivery/triggers/TriggersTag.tsx b/app/scripts/modules/core/src/delivery/triggers/TriggersTag.tsx index 3721bab4c8e..bbf5705451e 100644 --- a/app/scripts/modules/core/src/delivery/triggers/TriggersTag.tsx +++ b/app/scripts/modules/core/src/delivery/triggers/TriggersTag.tsx @@ -39,7 +39,7 @@ export class TriggersTag extends React.Component +
    {displayTriggers} diff --git a/app/scripts/modules/core/src/deploymentStrategy/strategies/rollingredblack/rollingredblack.strategy.ts b/app/scripts/modules/core/src/deploymentStrategy/strategies/rollingredblack/rollingredblack.strategy.ts index 22a43555d0e..ebad3607f45 100644 --- a/app/scripts/modules/core/src/deploymentStrategy/strategies/rollingredblack/rollingredblack.strategy.ts +++ b/app/scripts/modules/core/src/deploymentStrategy/strategies/rollingredblack/rollingredblack.strategy.ts @@ -1,4 +1,4 @@ -import {DeploymentStrategyRegistry} from 'core/deploymentStrategy/deploymentStrategy.registry'; +import { DeploymentStrategyRegistry } from 'core/deploymentStrategy/deploymentStrategy.registry'; DeploymentStrategyRegistry.registerStrategy({ label: 'Rolling Red/Black (Experimental)', diff --git a/app/scripts/modules/core/src/diffs/commitHistory.component.ts b/app/scripts/modules/core/src/diffs/commitHistory.component.ts index b12e8b14e91..51ad3d493e0 100644 --- a/app/scripts/modules/core/src/diffs/commitHistory.component.ts +++ b/app/scripts/modules/core/src/diffs/commitHistory.component.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {IComponentOptions} from 'angular'; +import { IComponentOptions } from 'angular'; export interface ICommit { authorDisplayName: string; diff --git a/app/scripts/modules/core/src/diffs/index.ts b/app/scripts/modules/core/src/diffs/index.ts index 24c952612bd..73a79edea38 100644 --- a/app/scripts/modules/core/src/diffs/index.ts +++ b/app/scripts/modules/core/src/diffs/index.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {VIEW_CHANGES_LINK} from './viewChangesLink.component'; +import { VIEW_CHANGES_LINK } from './viewChangesLink.component'; export const DIFF_MODULE = 'spinnaker.diff.module'; module(DIFF_MODULE, [VIEW_CHANGES_LINK]); diff --git a/app/scripts/modules/core/src/domain/IBuildDiffInfo.ts b/app/scripts/modules/core/src/domain/IBuildDiffInfo.ts index 1a42b06dc34..ed740005570 100644 --- a/app/scripts/modules/core/src/domain/IBuildDiffInfo.ts +++ b/app/scripts/modules/core/src/domain/IBuildDiffInfo.ts @@ -1,4 +1,4 @@ -import {IJenkinsInfo} from './IJenkinsInfo'; +import { IJenkinsInfo } from './IJenkinsInfo'; export interface IBuildDiffInfo { ancestor: string, diff --git a/app/scripts/modules/core/src/domain/IExecutionTrigger.ts b/app/scripts/modules/core/src/domain/IExecutionTrigger.ts index e520e2a189d..188a93a62d3 100644 --- a/app/scripts/modules/core/src/domain/IExecutionTrigger.ts +++ b/app/scripts/modules/core/src/domain/IExecutionTrigger.ts @@ -1,4 +1,4 @@ -import {IExecution} from './IExecution'; +import { IExecution } from './IExecution'; export interface IExecutionTrigger { buildInfo?: any; diff --git a/app/scripts/modules/core/src/domain/IRegionalCluster.ts b/app/scripts/modules/core/src/domain/IRegionalCluster.ts index ea3e1571b8b..d72fb2ec254 100644 --- a/app/scripts/modules/core/src/domain/IRegionalCluster.ts +++ b/app/scripts/modules/core/src/domain/IRegionalCluster.ts @@ -1,4 +1,4 @@ -import {ICluster} from './ICluster'; +import { ICluster } from './ICluster'; export interface IRegionalCluster extends ICluster { region: string; diff --git a/app/scripts/modules/core/src/domain/ISecurityGroup.ts b/app/scripts/modules/core/src/domain/ISecurityGroup.ts index f5cd9836387..ef1a98eed31 100644 --- a/app/scripts/modules/core/src/domain/ISecurityGroup.ts +++ b/app/scripts/modules/core/src/domain/ISecurityGroup.ts @@ -1,4 +1,4 @@ -import {IEntityTags} from './IEntityTags'; +import { IEntityTags } from './IEntityTags'; export interface ILoadBalancerUsage { name: string; diff --git a/app/scripts/modules/core/src/domain/IStageContext.ts b/app/scripts/modules/core/src/domain/IStageContext.ts index 60056a3dc82..748cc1075d8 100644 --- a/app/scripts/modules/core/src/domain/IStageContext.ts +++ b/app/scripts/modules/core/src/domain/IStageContext.ts @@ -1,4 +1,4 @@ -import {IBuildDiffInfo} from './IBuildDiffInfo'; +import { IBuildDiffInfo } from './IBuildDiffInfo'; export interface IStageContext { buildInfo?: IBuildDiffInfo; diff --git a/app/scripts/modules/core/src/domain/IStrategy.ts b/app/scripts/modules/core/src/domain/IStrategy.ts index cc4831fa5bb..727a3148a28 100644 --- a/app/scripts/modules/core/src/domain/IStrategy.ts +++ b/app/scripts/modules/core/src/domain/IStrategy.ts @@ -1,4 +1,4 @@ -import {IPipeline} from './IPipeline'; +import { IPipeline } from './IPipeline'; export interface IStrategy extends IPipeline { strategy: boolean; diff --git a/app/scripts/modules/core/src/entityTag/entityTags.help.ts b/app/scripts/modules/core/src/entityTag/entityTags.help.ts index 30ffddb062a..02f78f84251 100644 --- a/app/scripts/modules/core/src/entityTag/entityTags.help.ts +++ b/app/scripts/modules/core/src/entityTag/entityTags.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from 'core/help/helpContents.registry'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from 'core/help/helpContents.registry'; const helpContents: any[] = [ { diff --git a/app/scripts/modules/core/src/entityTag/entityTags.read.service.spec.ts b/app/scripts/modules/core/src/entityTag/entityTags.read.service.spec.ts index 88194caa34d..5a6b78c2d78 100644 --- a/app/scripts/modules/core/src/entityTag/entityTags.read.service.spec.ts +++ b/app/scripts/modules/core/src/entityTag/entityTags.read.service.spec.ts @@ -1,7 +1,7 @@ import { IHttpBackendService, IQService, ITimeoutService, mock } from 'angular'; -import {EntityTagsReader, ENTITY_TAGS_READ_SERVICE} from './entityTags.read.service'; -import {SETTINGS} from 'core/config/settings'; +import { EntityTagsReader, ENTITY_TAGS_READ_SERVICE } from './entityTags.read.service'; +import { SETTINGS } from 'core/config/settings'; describe('entityTags reader', () => { diff --git a/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts b/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts index b8a07947a56..9fb9698f488 100644 --- a/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts +++ b/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts @@ -1,10 +1,10 @@ -import {module, IQService, IPromise, IDeferred} from 'angular'; -import {countBy, get, uniq} from 'lodash'; +import { module, IQService, IPromise, IDeferred } from 'angular'; +import { countBy, get, uniq } from 'lodash'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {IEntityTags, IEntityTag, ICreationMetadataTag} from '../domain/IEntityTags'; -import {RETRY_SERVICE, RetryService} from 'core/retry/retry.service'; -import {SETTINGS} from 'core/config/settings'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { IEntityTags, IEntityTag, ICreationMetadataTag } from '../domain/IEntityTags'; +import { RETRY_SERVICE, RetryService } from 'core/retry/retry.service'; +import { SETTINGS } from 'core/config/settings'; interface ICollatedIdGroup { entityId: string; diff --git a/app/scripts/modules/core/src/entityTag/notifications/GroupedNotificationList.tsx b/app/scripts/modules/core/src/entityTag/notifications/GroupedNotificationList.tsx index 0eeb4469f8b..f2961e1ca59 100644 --- a/app/scripts/modules/core/src/entityTag/notifications/GroupedNotificationList.tsx +++ b/app/scripts/modules/core/src/entityTag/notifications/GroupedNotificationList.tsx @@ -107,7 +107,7 @@ class AlertsForMessage extends React.Component; } diff --git a/app/scripts/modules/core/src/entityTag/notifications/NotificationList.tsx b/app/scripts/modules/core/src/entityTag/notifications/NotificationList.tsx index 63f47174f12..1feb025f38a 100644 --- a/app/scripts/modules/core/src/entityTag/notifications/NotificationList.tsx +++ b/app/scripts/modules/core/src/entityTag/notifications/NotificationList.tsx @@ -68,7 +68,7 @@ class NotificationActions extends React.Component { public render() { return ( -
    + diff --git a/app/scripts/modules/core/src/filterModel/FilterTags.tsx b/app/scripts/modules/core/src/filterModel/FilterTags.tsx index 77819d61359..a99a89f76f4 100644 --- a/app/scripts/modules/core/src/filterModel/FilterTags.tsx +++ b/app/scripts/modules/core/src/filterModel/FilterTags.tsx @@ -41,14 +41,14 @@ export class FilterTags extends React.Component { tag.clear(); this.props.tagCleared(); - ReactGA.event({category: 'Filter Tags', action: 'Individual tag removed'}); + ReactGA.event({ category: 'Filter Tags', action: 'Individual tag removed' }); }; return ( diff --git a/app/scripts/modules/core/src/forms/buttonBusyIndicator/buttonBusyIndicator.component.ts b/app/scripts/modules/core/src/forms/buttonBusyIndicator/buttonBusyIndicator.component.ts index a1afd6089f3..4d22c662991 100644 --- a/app/scripts/modules/core/src/forms/buttonBusyIndicator/buttonBusyIndicator.component.ts +++ b/app/scripts/modules/core/src/forms/buttonBusyIndicator/buttonBusyIndicator.component.ts @@ -1,4 +1,4 @@ -import {IComponentOptions, module} from 'angular'; +import { IComponentOptions, module } from 'angular'; import './buttonBusyIndicator.component.less'; diff --git a/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts b/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts index 0a5df797c2a..e71d2c2e25d 100644 --- a/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts +++ b/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts @@ -1,5 +1,5 @@ -import {mock} from 'angular'; -import {NUMBER_LIST_COMPONENT, NumberListConstraints} from './numberList.component'; +import { mock } from 'angular'; +import { NUMBER_LIST_COMPONENT, NumberListConstraints } from './numberList.component'; describe('Component: numberList', () => { diff --git a/app/scripts/modules/core/src/healthCounts/HealthCounts.spec.tsx b/app/scripts/modules/core/src/healthCounts/HealthCounts.spec.tsx index a15104897f0..dad422beeba 100644 --- a/app/scripts/modules/core/src/healthCounts/HealthCounts.spec.tsx +++ b/app/scripts/modules/core/src/healthCounts/HealthCounts.spec.tsx @@ -139,12 +139,12 @@ describe('', () => { expect(component.find('.glyphicon-Up-triangle').length).toBe(1); expect(component.find('.glyphicon-Down-triangle').length).toBe(1); container = { up: 3, down: 1 } as IInstanceCounts; - component.setProps({container}); + component.setProps({ container }); expect(component.find('span.unhealthy').text().trim()).toBe('75%'); expect(component.find('.glyphicon-Up-triangle').length).toBe(1); expect(component.find('.glyphicon-Down-triangle').length).toBe(1); container = { up: 4, down: 0 } as IInstanceCounts; - component.setProps({container}); + component.setProps({ container }); expect(component.find('span.healthy').at(1).text().trim()).toBe('100%'); expect(component.find('.glyphicon-Up-triangle').length).toBe(1); expect(component.find('.glyphicon-Down-triangle').length).toBe(0); diff --git a/app/scripts/modules/core/src/help/helpContents.registry.spec.ts b/app/scripts/modules/core/src/help/helpContents.registry.spec.ts index 78a48103e1e..abc15edfa62 100644 --- a/app/scripts/modules/core/src/help/helpContents.registry.spec.ts +++ b/app/scripts/modules/core/src/help/helpContents.registry.spec.ts @@ -1,6 +1,6 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from './helpContents.registry'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from './helpContents.registry'; describe('Help contents registry', () => { diff --git a/app/scripts/modules/core/src/help/helpContents.registry.ts b/app/scripts/modules/core/src/help/helpContents.registry.ts index 34f3d973db9..9f7b454a3a9 100644 --- a/app/scripts/modules/core/src/help/helpContents.registry.ts +++ b/app/scripts/modules/core/src/help/helpContents.registry.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; export class HelpContentsRegistry { private helpFields: Map = new Map(); diff --git a/app/scripts/modules/core/src/help/helpField.component.spec.ts b/app/scripts/modules/core/src/help/helpField.component.spec.ts index 9a6b0f69101..dfd8e340fa4 100644 --- a/app/scripts/modules/core/src/help/helpField.component.spec.ts +++ b/app/scripts/modules/core/src/help/helpField.component.spec.ts @@ -1,7 +1,7 @@ -import {mock, element} from 'angular'; +import { mock, element } from 'angular'; -import {HELP_FIELD_COMPONENT} from './helpField.component'; -import {HelpContentsRegistry} from './helpContents.registry'; +import { HELP_FIELD_COMPONENT } from './helpField.component'; +import { HelpContentsRegistry } from './helpContents.registry'; import IProvideService = angular.auto.IProvideService; describe('Component: helpField', () => { @@ -26,7 +26,7 @@ describe('Component: helpField', () => { mock.module( HELP_FIELD_COMPONENT, ($provide: IProvideService) => { - $provide.constant('helpContents', {'aws.serverGroup.stack': 'expected stack help'}); + $provide.constant('helpContents', { 'aws.serverGroup.stack': 'expected stack help' }); }); }); diff --git a/app/scripts/modules/core/src/help/helpField.component.ts b/app/scripts/modules/core/src/help/helpField.component.ts index 77ebf06aa82..69af076b20f 100644 --- a/app/scripts/modules/core/src/help/helpField.component.ts +++ b/app/scripts/modules/core/src/help/helpField.component.ts @@ -69,7 +69,7 @@ export class HelpFieldCtrl implements IController { // only track the event if the popover was on the screen for a little while, i.e. it wasn't accidentally // moused over if (Date.now() - this.popoverShownStart > 500) { - this.$analytics.eventTrack('Help contents viewed', {category: 'Help', label: this.key || this.content}); + this.$analytics.eventTrack('Help contents viewed', { category: 'Help', label: this.key || this.content }); } this.popoverShownStart = null; } diff --git a/app/scripts/modules/core/src/history/recentHistory.service.spec.ts b/app/scripts/modules/core/src/history/recentHistory.service.spec.ts index ce2bcfda36a..d2847dff923 100644 --- a/app/scripts/modules/core/src/history/recentHistory.service.spec.ts +++ b/app/scripts/modules/core/src/history/recentHistory.service.spec.ts @@ -1,8 +1,8 @@ -import {mock} from 'angular'; -import {range, some} from 'lodash'; +import { mock } from 'angular'; +import { range, some } from 'lodash'; -import {RECENT_HISTORY_SERVICE, RecentHistoryService} from 'core/history/recentHistory.service'; -import {DeckCacheService, ICache} from '../cache/deckCache.service'; +import { RECENT_HISTORY_SERVICE, RecentHistoryService } from 'core/history/recentHistory.service'; +import { DeckCacheService, ICache } from '../cache/deckCache.service'; describe('recent history service', () => { @@ -30,7 +30,7 @@ describe('recent history service', () => { }); it('returns whatever is in cache if something is found, ordered by accessTime', () => { - backingCache.put('whatever', [{accessTime: 1}, {accessTime: 3}, {accessTime: 2}]); + backingCache.put('whatever', [{ accessTime: 1 }, { accessTime: 3 }, { accessTime: 2 }]); expect(service.getItems('whatever').map((item) => { return item.accessTime; })).toEqual([3, 2, 1]); }); }); @@ -40,28 +40,28 @@ describe('recent history service', () => { function initializeCache(count: number) { const start = Date.now() - 1; const currentItems = range(0, count).map((idx: number) => { - return { id: '' + idx, params: {id: idx}, accessTime: start - idx}; + return { id: '' + idx, params: { id: idx }, accessTime: start - idx }; }); backingCache.put('whatever', currentItems); } it('puts items in cache most recent first', () => { initializeCache(2); - service.addItem('whatever', 'state', {id: 'new item'}); + service.addItem('whatever', 'state', { id: 'new item' }); const ids = service.getItems('whatever').map((item) => { return item.params.id; }); expect(ids).toEqual(['new item', 0, 1]); }); it('replaces oldest item if cache is full', () => { initializeCache(15); - service.addItem('whatever', 'state', {id: 'new item'}); + service.addItem('whatever', 'state', { id: 'new item' }); const ids = service.getItems('whatever').map((item) => { return item.params.id; }); expect(ids).toEqual(['new item', 0, 1, 2, 3]); }); it('removes previous entry and adds replacement if params match, ignoring undefined values', () => { initializeCache(3); - service.addItem('whatever', 'state', {id: 1, someUndefinedValue: undefined}); + service.addItem('whatever', 'state', { id: 1, someUndefinedValue: undefined }); const ids = service.getItems('whatever').map((item) => { return item.params.id; }); expect(ids).toEqual([1, 0, 2]); }); @@ -69,13 +69,13 @@ describe('recent history service', () => { it('only matches on specified params if supplied', () => { const start = Date.now() - 1; const currentItems = range(0, 3).map((idx: number) => { - return { params: {id: idx, importantParam: idx, ignoredParam: idx + 1}, accessTime: start - idx}; + return { params: { id: idx, importantParam: idx, ignoredParam: idx + 1 }, accessTime: start - idx }; }); backingCache.put('whatever', currentItems); - service.addItem('whatever', 'state', {id: 1, importantParam: 1, ignoredParam: 1000}, ['importantParam', 'id']); + service.addItem('whatever', 'state', { id: 1, importantParam: 1, ignoredParam: 1000 }, ['importantParam', 'id']); let ids = service.getItems('whatever').map((item) => { return item.params.id; }); expect(ids).toEqual([1, 0, 2]); - service.addItem('whatever', 'state', {id: 1, importantParam: 1, ignoredParam: 1001}, ['ignoredParam']); + service.addItem('whatever', 'state', { id: 1, importantParam: 1, ignoredParam: 1001 }, ['ignoredParam']); ids = service.getItems('whatever').map((item) => { return item.params.id; }); expect(ids).toEqual([1, 1, 0, 2]); }); @@ -85,7 +85,7 @@ describe('recent history service', () => { beforeEach(() => { const start = Date.now() - 1; const currentItems = ['foo', 'bar', 'baz'].map((appName, index) => { - return { params: {application: appName, accessTime: start - index}}; + return { params: { application: appName, accessTime: start - index } }; }); backingCache.put('applications', currentItems); } @@ -100,7 +100,7 @@ describe('recent history service', () => { service.removeByAppName('foo'); const items = service.getItems('applications'); expect(items.length).toBe(2); - expect(some(items, {params: {application: 'foo'}})).toBeFalsy(); + expect(some(items, { params: { application: 'foo' } })).toBeFalsy(); }); }); diff --git a/app/scripts/modules/core/src/instance/Instance.tsx b/app/scripts/modules/core/src/instance/Instance.tsx index 329a7b19e5a..e518f4d6a4a 100644 --- a/app/scripts/modules/core/src/instance/Instance.tsx +++ b/app/scripts/modules/core/src/instance/Instance.tsx @@ -19,7 +19,7 @@ export class Instance extends React.Component { } public onMouseOver(event: React.MouseEvent) { - $(event.target).tooltip({animation: false} as JQueryUI.TooltipOptions).tooltip('show'); + $(event.target).tooltip({ animation: false } as JQueryUI.TooltipOptions).tooltip('show'); } public shouldComponentUpdate(nextProps: IInstanceProps) { diff --git a/app/scripts/modules/core/src/instance/instance.read.service.ts b/app/scripts/modules/core/src/instance/instance.read.service.ts index 4af48b40508..e8820104ccb 100644 --- a/app/scripts/modules/core/src/instance/instance.read.service.ts +++ b/app/scripts/modules/core/src/instance/instance.read.service.ts @@ -15,7 +15,7 @@ export class InstanceReader { } public getConsoleOutput(account: string, region: string, id: string, cloudProvider: string): ng.IPromise { - return this.API.one('instances').all(account).all(region).one(id, 'console').withParams({provider: cloudProvider}).get(); + return this.API.one('instances').all(account).all(region).one(id, 'console').withParams({ provider: cloudProvider }).get(); } } diff --git a/app/scripts/modules/core/src/instance/instance.states.ts b/app/scripts/modules/core/src/instance/instance.states.ts index c021b6733db..a1c5e2d3516 100644 --- a/app/scripts/modules/core/src/instance/instance.states.ts +++ b/app/scripts/modules/core/src/instance/instance.states.ts @@ -1,13 +1,13 @@ -import {module} from 'angular'; +import { module } from 'angular'; import { APPLICATION_STATE_PROVIDER, ApplicationStateProvider, } from 'core/application/application.state.provider'; -import {CloudProviderRegistry} from 'core/cloudProvider/cloudProvider.registry'; -import {INestedState, STATE_CONFIG_PROVIDER, StateConfigProvider} from 'core/navigation/state.provider'; -import {StateParams} from '@uirouter/angularjs'; -import {Application} from 'core/application/application.model'; -import {ApplicationModelBuilder} from '../application/applicationModel.builder'; +import { CloudProviderRegistry } from 'core/cloudProvider/cloudProvider.registry'; +import { INestedState, STATE_CONFIG_PROVIDER, StateConfigProvider } from 'core/navigation/state.provider'; +import { StateParams } from '@uirouter/angularjs'; +import { Application } from 'core/application/application.model'; +import { ApplicationModelBuilder } from '../application/applicationModel.builder'; export const INSTANCE_STATES = 'spinnaker.core.instance.states'; module(INSTANCE_STATES, [ diff --git a/app/scripts/modules/core/src/instance/instance.write.service.spec.ts b/app/scripts/modules/core/src/instance/instance.write.service.spec.ts index c553edc8829..2c68cdb056d 100644 --- a/app/scripts/modules/core/src/instance/instance.write.service.spec.ts +++ b/app/scripts/modules/core/src/instance/instance.write.service.spec.ts @@ -62,7 +62,7 @@ describe('Service: instance writer', function () { launchTime: 2, }; - const application: Application = applicationModelBuilder.createApplication('app', {key: 'serverGroups', lazy: true}); + const application: Application = applicationModelBuilder.createApplication('app', { key: 'serverGroups', lazy: true }); let executedTask: IJob = null; spyOn(taskExecutor, 'executeTask').and.callFake((task: ITaskCommand) => { @@ -100,15 +100,15 @@ describe('Service: instance writer', function () { beforeEach(function () { task = null; serverGroupA = { type: 'aws', cloudProvider: 'aws', name: 'asg-v001', account: 'prod', region: 'us-east-1', cluster: 'asg', instanceCounts: null, instances: [] }; - serverGroupB = { type: 'gce', cloudProvider: 'gce', name: 'asg-v002', account: 'test', region: 'us-west-1', cluster: 'asg', instanceCounts: null, instances: []}; + serverGroupB = { type: 'gce', cloudProvider: 'gce', name: 'asg-v002', account: 'test', region: 'us-west-1', cluster: 'asg', instanceCounts: null, instances: [] }; spyOn(taskExecutor, 'executeTask').and.callFake((command: ITaskCommand) => task = command); }); it('only sends jobs for groups with instances', () => { const application: Application = applicationModelBuilder.createApplication('app'); - addInstance(serverGroupB, {id: 'i-234', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); - addInstance(serverGroupB, {id: 'i-345', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); + addInstance(serverGroupB, { id: 'i-234', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); + addInstance(serverGroupB, { id: 'i-345', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); service.terminateInstances( [getInstanceGroup(serverGroupA), getInstanceGroup(serverGroupB)], application); @@ -127,8 +127,8 @@ describe('Service: instance writer', function () { it('includes additional job properties for terminate and shrink', () => { const application: Application = applicationModelBuilder.createApplication('app'); - addInstance(serverGroupA, {id: 'i-234', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); - addInstance(serverGroupA, {id: 'i-345', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); + addInstance(serverGroupA, { id: 'i-234', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); + addInstance(serverGroupA, { id: 'i-345', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); service.terminateInstancesAndShrinkServerGroups( [getInstanceGroup(serverGroupA)], application); @@ -149,48 +149,48 @@ describe('Service: instance writer', function () { it('includes a useful descriptor on terminate instances', () => { const application: Application = applicationModelBuilder.createApplication('app'); - addInstance(serverGroupA, {id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); + addInstance(serverGroupA, { id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); service.terminateInstances([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Terminate 1 instance'); - addInstance(serverGroupA, {id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1}); + addInstance(serverGroupA, { id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1 }); service.terminateInstances([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Terminate 2 instances'); }); it('includes a useful descriptor on reboot instances', function () { const application: Application = applicationModelBuilder.createApplication('app'); - addInstance(serverGroupA, {id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); + addInstance(serverGroupA, { id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); service.rebootInstances([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Reboot 1 instance'); - addInstance(serverGroupA, {id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1}); + addInstance(serverGroupA, { id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1 }); service.rebootInstances([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Reboot 2 instances'); }); it('includes a useful descriptor on disable in discovery', function () { const application: Application = applicationModelBuilder.createApplication('app'); - addInstance(serverGroupA, {id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); + addInstance(serverGroupA, { id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); service.disableInstancesInDiscovery([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Disable 1 instance in discovery'); - addInstance(serverGroupA, {id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1}); + addInstance(serverGroupA, { id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1 }); service.disableInstancesInDiscovery([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Disable 2 instances in discovery'); }); it('includes a useful descriptor on enable in discovery', function () { const application: Application = applicationModelBuilder.createApplication('app'); - addInstance(serverGroupA, {id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2}); + addInstance(serverGroupA, { id: 'i-123', health: [], healthState: 'Up', zone: 'a', launchTime: 2 }); service.enableInstancesInDiscovery([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Enable 1 instance in discovery'); - addInstance(serverGroupA, {id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1}); + addInstance(serverGroupA, { id: 'i-1234', health: [], healthState: 'Up', zone: 'a', launchTime: 1 }); service.enableInstancesInDiscovery([getInstanceGroup(serverGroupA)], application); expect(task.description).toBe('Enable 2 instances in discovery'); }); diff --git a/app/scripts/modules/core/src/instance/instanceTypeService.spec.ts b/app/scripts/modules/core/src/instance/instanceTypeService.spec.ts index 7dbb0b198d6..eed7841ae7e 100644 --- a/app/scripts/modules/core/src/instance/instanceTypeService.spec.ts +++ b/app/scripts/modules/core/src/instance/instanceTypeService.spec.ts @@ -1,6 +1,6 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {INSTANCE_TYPE_SERVICE, InstanceTypeService, IInstanceTypeCategory} from 'core/instance/instanceType.service'; +import { INSTANCE_TYPE_SERVICE, InstanceTypeService, IInstanceTypeCategory } from 'core/instance/instanceType.service'; describe('Service: instanceTypeService', function () { @@ -13,10 +13,10 @@ describe('Service: instanceTypeService', function () { families: [{ type: 'm3', instanceTypes: [ - {name: 'm3.medium'}, - {name: 'm3.large'}, - {name: 'm3.xlarge'}, - {name: 'm3.2xlarge'} + { name: 'm3.medium' }, + { name: 'm3.large' }, + { name: 'm3.xlarge' }, + { name: 'm3.2xlarge' } ] }] }; @@ -26,10 +26,10 @@ describe('Service: instanceTypeService', function () { families: [{ type: 'r3', instanceTypes: [ - {name: 'r3.large'}, - {name: 'r3.xlarge'}, - {name: 'r3.2xlarge'}, - {name: 'r3.4xlarge'}, + { name: 'r3.large' }, + { name: 'r3.xlarge' }, + { name: 'r3.2xlarge' }, + { name: 'r3.4xlarge' }, ] }] }; @@ -39,8 +39,8 @@ describe('Service: instanceTypeService', function () { families: [{ type: 't2', instanceTypes: [ - {name: 't2.small'}, - {name: 't2.medium'}, + { name: 't2.small' }, + { name: 't2.medium' }, ] }] }; @@ -49,7 +49,7 @@ describe('Service: instanceTypeService', function () { type: 'buildCustom', families: [{ type: 'buildCustom', - instanceTypes: [{name: 'buildCustom', nameRegex: /custom-\d{1,2}-\d{4,6}/}] + instanceTypes: [{ name: 'buildCustom', nameRegex: /custom-\d{1,2}-\d{4,6}/ }] }] }; diff --git a/app/scripts/modules/core/src/interceptor/debug.interceptor.ts b/app/scripts/modules/core/src/interceptor/debug.interceptor.ts index cc1e9ecbdcb..7341d512766 100644 --- a/app/scripts/modules/core/src/interceptor/debug.interceptor.ts +++ b/app/scripts/modules/core/src/interceptor/debug.interceptor.ts @@ -1,6 +1,6 @@ -import {module, IRequestConfig, IHttpInterceptor, IHttpProvider} from 'angular'; -import {$log, $location} from 'ngimport'; -import {JSON_UTILITY_SERVICE, JsonUtilityService} from 'core/utils/json/json.utility.service'; +import { module, IRequestConfig, IHttpInterceptor, IHttpProvider } from 'angular'; +import { $log, $location } from 'ngimport'; +import { JSON_UTILITY_SERVICE, JsonUtilityService } from 'core/utils/json/json.utility.service'; import { BindAll } from 'lodash-decorators'; @BindAll() diff --git a/app/scripts/modules/core/src/interceptor/interceptor.module.ts b/app/scripts/modules/core/src/interceptor/interceptor.module.ts index 3da9cf1be12..fd1fb437a3d 100644 --- a/app/scripts/modules/core/src/interceptor/interceptor.module.ts +++ b/app/scripts/modules/core/src/interceptor/interceptor.module.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {DEBUG_INTERCEPTOR} from './debug.interceptor'; +import { DEBUG_INTERCEPTOR } from './debug.interceptor'; export const INTERCEPTOR_MODULE = 'spinnaker.core.interceptor.module'; module(INTERCEPTOR_MODULE, [ diff --git a/app/scripts/modules/core/src/loadBalancer/LoadBalancersTag.tsx b/app/scripts/modules/core/src/loadBalancer/LoadBalancersTag.tsx index 61702b1b47f..87423b03c73 100644 --- a/app/scripts/modules/core/src/loadBalancer/LoadBalancersTag.tsx +++ b/app/scripts/modules/core/src/loadBalancer/LoadBalancersTag.tsx @@ -69,7 +69,7 @@ export class LoadBalancersTag extends React.Component this.setState({loadBalancers})) + LoadBalancerDataUtils.populateLoadBalancers(props.application, props.serverGroup).then(loadBalancers => this.setState({ loadBalancers })) this.loadBalancersRefreshUnsubscribe = props.application.getDataSource('loadBalancers').onRefresh(null, () => { this.forceUpdate(); }); } @@ -77,13 +77,13 @@ export class LoadBalancersTag extends React.Component): void { diff --git a/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.spec.ts b/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.spec.ts index 34e27ecca3e..2026d7cc609 100644 --- a/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.spec.ts +++ b/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.spec.ts @@ -32,14 +32,14 @@ describe('Service: loadBalancerFilterService', function () { }); beforeEach(function () { - app = modelBuilder.createApplication('app', {key: 'loadBalancers', lazy: true}); + app = modelBuilder.createApplication('app', { key: 'loadBalancers', lazy: true }); app.getDataSource('loadBalancers').data = [ { name: 'elb-1', region: 'us-east-1', account: 'test', vpcName: '', serverGroups: [], - instanceCounts: {down: 0, starting: 0, outOfService: 0 }, usages: {}}, + instanceCounts: { down: 0, starting: 0, outOfService: 0 }, usages: {}}, { name: 'elb-1', region: 'us-west-1', account: 'test', vpcName: 'main', serverGroups: [], - instanceCounts: {down: 0, starting: 0, outOfService: 0 }, usages: {}}, + instanceCounts: { down: 0, starting: 0, outOfService: 0 }, usages: {}}, { name: 'elb-2', region: 'us-east-1', account: 'prod', vpcName: '', serverGroups: [], - instanceCounts: {down: 0, starting: 0, outOfService: 0 }, usages: {}}, + instanceCounts: { down: 0, starting: 0, outOfService: 0 }, usages: {}}, ]; resultJson = [ @@ -55,10 +55,10 @@ describe('Service: loadBalancerFilterService', function () { it('no filter: should be transformed', function (done) { const expected = [ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ] } ]}, ]; service.updateLoadBalancerGroups(app); @@ -95,7 +95,7 @@ describe('Service: loadBalancerFilterService', function () { setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[1] ] } ]} ]); done(); @@ -114,13 +114,13 @@ describe('Service: loadBalancerFilterService', function () { describe('filtering by account type', function () { it('1 account filter: should be transformed showing only prod accounts', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.account = {prod: true}; + loadBalancerFilterModel.asFilterModel.sortFilter.account = { prod: true }; service.updateLoadBalancerGroups(app); setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]} ]); done(); @@ -128,16 +128,16 @@ describe('Service: loadBalancerFilterService', function () { }); it('All account filters: should show all accounts', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.account = {prod: true, test: true}; + loadBalancerFilterModel.asFilterModel.sortFilter.account = { prod: true, test: true }; service.updateLoadBalancerGroups(app); setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ] } ]}, ]); done(); @@ -148,16 +148,16 @@ describe('Service: loadBalancerFilterService', function () { describe('filter by region', function () { it('1 region: should filter by that region', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.region = {'us-east-1' : true}; + loadBalancerFilterModel.asFilterModel.sortFilter.region = { 'us-east-1' : true }; service.updateLoadBalancerGroups(app); setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0] ]} + { heading: 'elb-1', subgroups: [ resultJson[0] ] } ]} ]); done(); @@ -165,16 +165,16 @@ describe('Service: loadBalancerFilterService', function () { }); it('All regions: should show all load balancers', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.region = {'us-east-1' : true, 'us-west-1': true}; + loadBalancerFilterModel.asFilterModel.sortFilter.region = { 'us-east-1' : true, 'us-west-1': true }; service.updateLoadBalancerGroups(app); setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ] } ]} ]); done(); @@ -183,7 +183,7 @@ describe('Service: loadBalancerFilterService', function () { }); describe('filter by healthy state', function () { it('should filter any load balancers with down instances (based on down) if "Up" checked', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.status = {'Up' : true }; + loadBalancerFilterModel.asFilterModel.sortFilter.status = { 'Up' : true }; app.loadBalancers.data[0].instanceCounts.down = 1; app.loadBalancers.data.forEach((loadBalancer: ILoadBalancer) => { loadBalancer.instances = [ { id: 'foo', healthState: 'Up', health: [], launchTime: 0, zone: 'us-east-1a' } ]; @@ -193,10 +193,10 @@ describe('Service: loadBalancerFilterService', function () { setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[1] ] } ]} ]); done(); @@ -204,7 +204,7 @@ describe('Service: loadBalancerFilterService', function () { }); it('should filter any load balancers without down instances (based on down) if "Down" checked', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.status = {'Down' : true }; + loadBalancerFilterModel.asFilterModel.sortFilter.status = { 'Down' : true }; app.loadBalancers.data[0].instanceCounts.down = 1; app.loadBalancers.data.forEach((loadBalancer: ILoadBalancer) => { loadBalancer.instances = [ { id: 'foo', healthState: 'Down', health: [], launchTime: 0, zone: 'us-east-1a' } ]; @@ -214,7 +214,7 @@ describe('Service: loadBalancerFilterService', function () { setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0] ]} + { heading: 'elb-1', subgroups: [ resultJson[0] ] } ]}, ]); done(); @@ -222,7 +222,7 @@ describe('Service: loadBalancerFilterService', function () { }); it('should filter any load balancers with starting instances (based on starting) if "Starting" checked', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.status = {'Starting' : true }; + loadBalancerFilterModel.asFilterModel.sortFilter.status = { 'Starting' : true }; app.loadBalancers.data[0].instanceCounts.starting = 1; app.loadBalancers.data.forEach((loadBalancer: ILoadBalancer) => { loadBalancer.instances = [ { id: 'foo', healthState: 'Starting', health: [], launchTime: 0, zone: 'us-east-1a' } ]; @@ -232,7 +232,7 @@ describe('Service: loadBalancerFilterService', function () { setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0] ]} + { heading: 'elb-1', subgroups: [ resultJson[0] ] } ]}, ]); done(); @@ -248,16 +248,16 @@ describe('Service: loadBalancerFilterService', function () { app.loadBalancers.data[2].type = 'aws'; }); it('should filter by aws if checked', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.providerType = {aws : true}; + loadBalancerFilterModel.asFilterModel.sortFilter.providerType = { aws : true }; service.updateLoadBalancerGroups(app); setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0] ]} + { heading: 'elb-1', subgroups: [ resultJson[0] ] } ]} ]); done(); @@ -271,10 +271,10 @@ describe('Service: loadBalancerFilterService', function () { setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ] } ]} ]); done(); @@ -282,16 +282,16 @@ describe('Service: loadBalancerFilterService', function () { }); it('should not filter if all provider are selected', function (done) { - loadBalancerFilterModel.asFilterModel.sortFilter.providerType = {aws: true, gce: true}; + loadBalancerFilterModel.asFilterModel.sortFilter.providerType = { aws: true, gce: true }; service.updateLoadBalancerGroups(app); setTimeout(() => { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - { heading: 'elb-2', subgroups: [ resultJson[2] ]} + { heading: 'elb-2', subgroups: [ resultJson[2] ] } ]}, { heading: 'test', subgroups: [ - { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ]} + { heading: 'elb-1', subgroups: [ resultJson[0], resultJson[1] ] } ]} ]); done(); @@ -342,7 +342,7 @@ describe('Service: loadBalancerFilterService', function () { app.loadBalancers.data.push({ name: 'elb-3', account: 'prod', region: 'eu-west-1', serverGroups: [], vpcName: '', }); - const newSubGroup = { heading: 'elb-3', subgroups: [{heading: 'eu-west-1', loadBalancer: app.loadBalancers.data[3], serverGroups: [] as IServerGroup[] }]}; + const newSubGroup = { heading: 'elb-3', subgroups: [{ heading: 'eu-west-1', loadBalancer: app.loadBalancers.data[3], serverGroups: [] as IServerGroup[] }] }; service.updateLoadBalancerGroups(app); setTimeout(() => { @@ -370,13 +370,13 @@ describe('Service: loadBalancerFilterService', function () { expect(loadBalancerFilterModel.asFilterModel.groups).toEqual([ { heading: 'prod', subgroups: [ - {heading: 'elb-2', subgroups: [resultJson[2]] } + { heading: 'elb-2', subgroups: [resultJson[2]] } ] }, { heading: 'test', subgroups: [ - {heading: 'elb-1', subgroups: [resultJson[0], resultJson[1]] }, - {heading: 'elb-2', subgroups: [newSubsubGroup] }, + { heading: 'elb-1', subgroups: [resultJson[0], resultJson[1]] }, + { heading: 'elb-2', subgroups: [newSubsubGroup] }, ] } ]); diff --git a/app/scripts/modules/core/src/loadBalancer/filter/loadBalancerFilter.model.ts b/app/scripts/modules/core/src/loadBalancer/filter/loadBalancerFilter.model.ts index 2cd2dd6e87f..1fedd1fac7d 100644 --- a/app/scripts/modules/core/src/loadBalancer/filter/loadBalancerFilter.model.ts +++ b/app/scripts/modules/core/src/loadBalancer/filter/loadBalancerFilter.model.ts @@ -10,7 +10,7 @@ export const filterModelConfig: IFilterConfig[] = [ { model: 'account', param: 'acct', type: 'trueKeyObject' }, { model: 'region', param: 'reg', type: 'trueKeyObject' }, { model: 'stack', param: 'stack', type: 'trueKeyObject', }, - { model: 'status', type: 'trueKeyObject', filterTranslator: {Up: 'Healthy', Down: 'Unhealthy', OutOfService: 'Out of Service'} }, + { model: 'status', type: 'trueKeyObject', filterTranslator: { Up: 'Healthy', Down: 'Unhealthy', OutOfService: 'Out of Service' } }, { model: 'availabilityZone', param: 'zone', type: 'trueKeyObject', filterLabel: 'availability zone' }, { model: 'providerType', type: 'trueKeyObject', filterLabel: 'provider' }, { model: 'showInstances', displayOption: true, type: 'boolean' }, diff --git a/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts b/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts index 4ec12ba88e0..cac05fcd206 100644 --- a/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts +++ b/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts @@ -31,13 +31,13 @@ export class LoadBalancerReader { } public getLoadBalancerDetails(cloudProvider: string, account: string, region: string, name: string): IPromise { - return this.API.all('loadBalancers').all(account).all(region).all(name).withParams({'provider': cloudProvider}).get(); + return this.API.all('loadBalancers').all(account).all(region).all(name).withParams({ 'provider': cloudProvider }).get(); } public listLoadBalancers(cloudProvider: string): IPromise { return this.API.all('loadBalancers') .useCache(this.infrastructureCaches.get('loadBalancers')) - .withParams({provider: cloudProvider}) + .withParams({ provider: cloudProvider }) .getList(); } diff --git a/app/scripts/modules/core/src/loadBalancer/loadBalancerDataUtils.ts b/app/scripts/modules/core/src/loadBalancer/loadBalancerDataUtils.ts index c4b08d4488a..df51fa26c49 100644 --- a/app/scripts/modules/core/src/loadBalancer/loadBalancerDataUtils.ts +++ b/app/scripts/modules/core/src/loadBalancer/loadBalancerDataUtils.ts @@ -10,7 +10,7 @@ export class LoadBalancerDataUtils { } const loadBalancer: ILoadBalancer = { name: match.name, vpcId: match.vpcId, cloudProvider: match.cloudProvider }; - loadBalancer.instanceCounts = {up: 0, down: 0, succeeded: 0, failed: 0, outOfService: 0, unknown: 0, starting: 0}; + loadBalancer.instanceCounts = { up: 0, down: 0, succeeded: 0, failed: 0, outOfService: 0, unknown: 0, starting: 0 }; serverGroup.instances.forEach(instance => { const lbHealth: IHealth = instance.health.find(h => h.type === 'LoadBalancer'); diff --git a/app/scripts/modules/core/src/modal/buttons/modalClose.component.ts b/app/scripts/modules/core/src/modal/buttons/modalClose.component.ts index 052873be4a2..28d7f2b4162 100644 --- a/app/scripts/modules/core/src/modal/buttons/modalClose.component.ts +++ b/app/scripts/modules/core/src/modal/buttons/modalClose.component.ts @@ -1,4 +1,4 @@ -import {module, IComponentOptions} from 'angular'; +import { module, IComponentOptions } from 'angular'; const modalCloseComponent: IComponentOptions = { bindings: { diff --git a/app/scripts/modules/core/src/modal/buttons/submitButton.component.ts b/app/scripts/modules/core/src/modal/buttons/submitButton.component.ts index 58b21730472..de294492330 100644 --- a/app/scripts/modules/core/src/modal/buttons/submitButton.component.ts +++ b/app/scripts/modules/core/src/modal/buttons/submitButton.component.ts @@ -1,4 +1,4 @@ -import {IComponentOptions, module} from 'angular'; +import { IComponentOptions, module } from 'angular'; export class SubmitButtonComponent implements IComponentOptions { public bindings: any = { diff --git a/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts b/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts index d9e33b9e78b..7cb6b74c9ad 100644 --- a/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts +++ b/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {SCROLL_TO_SERVICE, ScrollToService} from 'core/utils/scrollTo/scrollTo.service'; +import { module } from 'angular'; +import { SCROLL_TO_SERVICE, ScrollToService } from 'core/utils/scrollTo/scrollTo.service'; export interface WizardPageState { done: boolean; @@ -75,7 +75,7 @@ export class V2ModalWizardService { markCompleteOnView: false, required: false, }; - this.pageRegistry.push({key: key, label: label, state: state}); + this.pageRegistry.push({ key: key, label: label, state: state }); this.renderPages(); } diff --git a/app/scripts/modules/core/src/naming/naming.service.spec.ts b/app/scripts/modules/core/src/naming/naming.service.spec.ts index 17da72b21b8..a86f3f06ae3 100644 --- a/app/scripts/modules/core/src/naming/naming.service.spec.ts +++ b/app/scripts/modules/core/src/naming/naming.service.spec.ts @@ -1,6 +1,6 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {NAMING_SERVICE, NamingService} from 'core/naming/naming.service'; +import { NAMING_SERVICE, NamingService } from 'core/naming/naming.service'; describe('namingService', function () { beforeEach(function () { @@ -16,37 +16,37 @@ describe('namingService', function () { describe('parseServerGroupName', function () { it('parses server group name with no stack or details', function () { expect(this.namingService.parseServerGroupName('app-v001')) - .toEqual({application: 'app', stack: '', freeFormDetails: '', cluster: 'app'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: '', cluster: 'app' }); expect(this.namingService.parseServerGroupName('app-test-v001')) - .toEqual({application: 'app', stack: 'test', freeFormDetails: '', cluster: 'app-test'}); + .toEqual({ application: 'app', stack: 'test', freeFormDetails: '', cluster: 'app-test' }); expect(this.namingService.parseServerGroupName('app--detail-v001')) - .toEqual({application: 'app', stack: '', freeFormDetails: 'detail', cluster: 'app--detail'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: 'detail', cluster: 'app--detail' }); expect(this.namingService.parseServerGroupName('app--detail-withdashes-v001')) - .toEqual({application: 'app', stack: '', freeFormDetails: 'detail-withdashes', cluster: 'app--detail-withdashes'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: 'detail-withdashes', cluster: 'app--detail-withdashes' }); }); it('parses server group name with no version', function () { expect(this.namingService.parseServerGroupName('app')) - .toEqual({application: 'app', stack: '', freeFormDetails: '', cluster: 'app'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: '', cluster: 'app' }); expect(this.namingService.parseServerGroupName('app-test')) - .toEqual({application: 'app', stack: 'test', freeFormDetails: '', cluster: 'app-test'}); + .toEqual({ application: 'app', stack: 'test', freeFormDetails: '', cluster: 'app-test' }); expect(this.namingService.parseServerGroupName('app--detail')) - .toEqual({application: 'app', stack: '', freeFormDetails: 'detail', cluster: 'app--detail'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: 'detail', cluster: 'app--detail' }); expect(this.namingService.parseServerGroupName('app--detail-withdashes')) - .toEqual({application: 'app', stack: '', freeFormDetails: 'detail-withdashes', cluster: 'app--detail-withdashes'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: 'detail-withdashes', cluster: 'app--detail-withdashes' }); }); }); describe('parseLoadBalancerName', function () { it('parses name with no stack or details', function () { expect(this.namingService.parseLoadBalancerName('app')) - .toEqual({application: 'app', stack: '', freeFormDetails: '', cluster: 'app'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: '', cluster: 'app' }); expect(this.namingService.parseLoadBalancerName('app-test')) - .toEqual({application: 'app', stack: 'test', freeFormDetails: '', cluster: 'app-test'}); + .toEqual({ application: 'app', stack: 'test', freeFormDetails: '', cluster: 'app-test' }); expect(this.namingService.parseLoadBalancerName('app--detail')) - .toEqual({application: 'app', stack: '', freeFormDetails: 'detail', cluster: 'app--detail'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: 'detail', cluster: 'app--detail' }); expect(this.namingService.parseLoadBalancerName('app--detail-withdashes')) - .toEqual({application: 'app', stack: '', freeFormDetails: 'detail-withdashes', cluster: 'app--detail-withdashes'}); + .toEqual({ application: 'app', stack: '', freeFormDetails: 'detail-withdashes', cluster: 'app--detail-withdashes' }); }); }); diff --git a/app/scripts/modules/core/src/naming/naming.service.ts b/app/scripts/modules/core/src/naming/naming.service.ts index 24507eb654d..fe4f6e7d125 100644 --- a/app/scripts/modules/core/src/naming/naming.service.ts +++ b/app/scripts/modules/core/src/naming/naming.service.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; import { padStart, isNil } from 'lodash'; export interface IComponentName { diff --git a/app/scripts/modules/core/src/navigation/customParamTypes.spec.ts b/app/scripts/modules/core/src/navigation/customParamTypes.spec.ts index 277e771d552..8755726318a 100644 --- a/app/scripts/modules/core/src/navigation/customParamTypes.spec.ts +++ b/app/scripts/modules/core/src/navigation/customParamTypes.spec.ts @@ -4,14 +4,14 @@ describe('custom param types', () => { describe('trueKeyObject', () => { it('decodes with or without commas', () => { - expect(trueKeyObjectParamType.decode('a,b')).toEqual({a: true, b: true}); - expect(trueKeyObjectParamType.decode('a')).toEqual({a: true}); + expect(trueKeyObjectParamType.decode('a,b')).toEqual({ a: true, b: true }); + expect(trueKeyObjectParamType.decode('a')).toEqual({ a: true }); }); it('encodes alphabetically, omitting false values', () => { - expect(trueKeyObjectParamType.encode({a: false, c: true, b: true})).toEqual('b,c'); + expect(trueKeyObjectParamType.encode({ a: false, c: true, b: true })).toEqual('b,c'); }); it('encodes to null if no true keys found', () => { - expect(trueKeyObjectParamType.encode({a: false})).toBeNull(); + expect(trueKeyObjectParamType.encode({ a: false })).toBeNull(); }) }); @@ -39,10 +39,10 @@ describe('custom param types', () => { describe('sortKey', () => { it('encodes key', () => { - expect(sortKeyParamType.encode({key: 'a'})).toBe('a'); + expect(sortKeyParamType.encode({ key: 'a' })).toBe('a'); }); it('decodes to key object', () => { - expect(sortKeyParamType.decode('-a')).toEqual({key: '-a'}); + expect(sortKeyParamType.decode('-a')).toEqual({ key: '-a' }); }); }); }); diff --git a/app/scripts/modules/core/src/navigation/urlBuilder.service.ts b/app/scripts/modules/core/src/navigation/urlBuilder.service.ts index 07d971e6d91..fd993135d76 100644 --- a/app/scripts/modules/core/src/navigation/urlBuilder.service.ts +++ b/app/scripts/modules/core/src/navigation/urlBuilder.service.ts @@ -107,8 +107,8 @@ class ApplicationsUrlBuilder implements IUrlBuilder { if (input.project) { result = $state.href( 'home.project.application.insight.clusters', - {application: input.application, project: input.project}, - {inherit: false} + { application: input.application, project: input.project }, + { inherit: false } ); } else { result = $state.href( @@ -116,7 +116,7 @@ class ApplicationsUrlBuilder implements IUrlBuilder { { application: input.application, }, - {inherit: false} + { inherit: false } ); } @@ -151,7 +151,7 @@ class ClustersUrlBuilder implements IUrlBuilder { application: input.application, project: input.project, }, - {inherit: false} + { inherit: false } ); } else { href = $state.href( @@ -159,7 +159,7 @@ class ClustersUrlBuilder implements IUrlBuilder { { application: input.application, }, - {inherit: false} + { inherit: false } ); } @@ -189,9 +189,9 @@ class InstancesUrlBuilder implements IUrlBuilder { instanceId: input.instanceId, provider: input.provider, }, - {inherit: false} + { inherit: false } ); - result = UrlBuilderUtils.buildUrl(href, {q: input.serverGroup, acct: input.account, reg: input.region}); + result = UrlBuilderUtils.buildUrl(href, { q: input.serverGroup, acct: input.account, reg: input.region }); } return result; @@ -212,17 +212,17 @@ class LoadBalancersUrlBuilder implements IUrlBuilder { vpcId: input.vpcId, provider: input.provider, }, - {inherit: false} + { inherit: false } ); - return UrlBuilderUtils.buildUrl(href, {q: input.loadBalancer, reg: input.region, acct: input.account}); + return UrlBuilderUtils.buildUrl(href, { q: input.loadBalancer, reg: input.region, acct: input.account }); } } class ProjectsUrlBuilder implements IUrlBuilder { public build(input: IUrlBuilderInput, $state: StateService) { - return $state.href('home.project.dashboard', {project: input.name}, {inherit: false}); + return $state.href('home.project.dashboard', { project: input.name }, { inherit: false }); } } @@ -258,10 +258,10 @@ class ServerGroupsUrlBuilder implements IUrlBuilder { provider: input.provider, project: input.project, }, - {inherit: false} + { inherit: false } ); - return UrlBuilderUtils.buildUrl(href, {q: input.serverGroup, acct: input.account, reg: input.region}); + return UrlBuilderUtils.buildUrl(href, { q: input.serverGroup, acct: input.account, reg: input.region }); } } @@ -274,7 +274,7 @@ class TaskUrlBuilder implements IUrlBuilder { application: input.application, taskId: input.taskId }, - {inherit: false} + { inherit: false } ); } } @@ -287,7 +287,7 @@ class TasksUrlBuilder implements IUrlBuilder { { application: input.application, }, - {inherit: false} + { inherit: false } ); } } diff --git a/app/scripts/modules/core/src/network/network.read.service.ts b/app/scripts/modules/core/src/network/network.read.service.ts index 97e6a945433..cd305c2c48b 100644 --- a/app/scripts/modules/core/src/network/network.read.service.ts +++ b/app/scripts/modules/core/src/network/network.read.service.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {INFRASTRUCTURE_CACHE_SERVICE, InfrastructureCacheService} from 'core/cache/infrastructureCaches.service'; -import {API_SERVICE, Api} from 'core/api/api.service'; +import { INFRASTRUCTURE_CACHE_SERVICE, InfrastructureCacheService } from 'core/cache/infrastructureCaches.service'; +import { API_SERVICE, Api } from 'core/api/api.service'; export interface INetwork { cloudProvider: string; diff --git a/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.spec.ts b/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.spec.ts index 5aa6fea142f..1307866f000 100644 --- a/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.spec.ts +++ b/app/scripts/modules/core/src/orchestratedItem/orchestratedItem.transformer.spec.ts @@ -14,11 +14,11 @@ describe('orchestratedItem transformer', () => { }); it('returns null when no kato.tasks field in stage context', () => { - expect(getMessage({context: {}})).toBe(null); + expect(getMessage({ context: {} })).toBe(null); }); it('returns null when kato.tasks field in stage context is empty', () => { - expect(getMessage({context: { 'kato.tasks': []}})).toBe(null); + expect(getMessage({ context: { 'kato.tasks': [] } })).toBe(null); }); it('returns null when last kato task has no exception', () => { @@ -40,9 +40,9 @@ describe('orchestratedItem transformer', () => { }); it('returns general exception if present', () => { - expect(getMessage({context: { 'exception': { 'details' : { 'errors': ['E1', 'E2']}}}})).toBe('E1, E2'); - expect(getMessage({context: { 'exception': { 'details' : { 'errors': []}}}})).toBe(null); - expect(getMessage({context: { }})).toBe(null); + expect(getMessage({ context: { 'exception': { 'details' : { 'errors': ['E1', 'E2'] } } } })).toBe('E1, E2'); + expect(getMessage({ context: { 'exception': { 'details' : { 'errors': [] } } } })).toBe(null); + expect(getMessage({ context: { } })).toBe(null); }); it('returns general exception even if a kato task is present', () => { diff --git a/app/scripts/modules/core/src/pipeline/config/CreatePipeline.tsx b/app/scripts/modules/core/src/pipeline/config/CreatePipeline.tsx index cf26f4ef261..e97b67e702d 100644 --- a/app/scripts/modules/core/src/pipeline/config/CreatePipeline.tsx +++ b/app/scripts/modules/core/src/pipeline/config/CreatePipeline.tsx @@ -17,7 +17,7 @@ export interface ICreatePipelineProps { @BindAll() export class CreatePipeline extends React.Component { private dropdownToggled(): void { - ReactGA.event({category: 'Pipelines', action: 'Configure (top level)'}); + ReactGA.event({ category: 'Pipelines', action: 'Configure (top level)' }); } public render() { @@ -27,16 +27,16 @@ export class CreatePipeline extends React.Component { const header = !(hasPipelineConfigs || hasStrategyConfigs) ? (
  • - None yet, click Create + None yet, click Create
  • - ) : hasPipelineConfigs ?
  • PIPELINES
  • - : hasStrategyConfigs ?
  • DEPLOYMENT STRATEGIES
  • + ) : hasPipelineConfigs ?
  • PIPELINES
  • + : hasStrategyConfigs ?
  • DEPLOYMENT STRATEGIES
  • : null; return ( - + Configure @@ -54,7 +54,7 @@ export class CreatePipeline extends React.Component { const Pipeline = (props: { pipeline: any, type: 'pipeline' | 'strategy' }): JSX.Element => { const clicked = () => { - ReactGA.event({category: 'Pipelines', action: `Configure ${props.type} (via top level)`}); + ReactGA.event({ category: 'Pipelines', action: `Configure ${props.type} (via top level)` }); const { $state } = ReactInjector; if (!$state.current.name.includes('.executions.execution')) { $state.go('^.pipelineConfig', { pipelineId: props.pipeline.id }); diff --git a/app/scripts/modules/core/src/pipeline/config/actions/history/diffView.component.ts b/app/scripts/modules/core/src/pipeline/config/actions/history/diffView.component.ts index bb910bd1f9e..0782ec64f9f 100644 --- a/app/scripts/modules/core/src/pipeline/config/actions/history/diffView.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/actions/history/diffView.component.ts @@ -14,7 +14,7 @@ class DiffViewController implements IController { } else { line = e.offsetY / currentTarget.clientHeight * this.diff.summary.total; } - $('pre.history').animate({scrollTop: (line - 3) * 15}, 200); + $('pre.history').animate({ scrollTop: (line - 3) * 15 }, 200); } } diff --git a/app/scripts/modules/core/src/pipeline/config/actions/json/editPipelineJsonModal.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/actions/json/editPipelineJsonModal.controller.spec.ts index 2217760e0ce..ce13dc3feb4 100644 --- a/app/scripts/modules/core/src/pipeline/config/actions/json/editPipelineJsonModal.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/actions/json/editPipelineJsonModal.controller.spec.ts @@ -1,7 +1,7 @@ import { mock, IControllerService } from 'angular'; import { EditPipelineJsonModalCtrl } from './editPipelineJsonModal.controller'; -import { IPipeline} from 'core/domain'; +import { IPipeline } from 'core/domain'; describe('Controller: editPipelineJsonModal', () => { @@ -11,8 +11,8 @@ describe('Controller: editPipelineJsonModal', () => { beforeEach(mock.inject(($controller: IControllerService) => $ctrl = $controller)); function initializeController(pipeline: IPipeline) { - $uibModalInstance = {close: () => {}}; - controller = $ctrl(EditPipelineJsonModalCtrl, {$uibModalInstance, pipeline}); + $uibModalInstance = { close: () => {} }; + controller = $ctrl(EditPipelineJsonModalCtrl, { $uibModalInstance, pipeline }); } it('controller removes name, application, appConfig, all fields and hash keys', () => { @@ -68,7 +68,7 @@ describe('Controller: editPipelineJsonModal', () => { const converted: any = JSON.parse(controller.command.pipelineJSON); converted.application = 'someOtherApp'; converted.name = 'replacedName'; - converted.bar = {updated: true}; + converted.bar = { updated: true }; controller.command.pipelineJSON = JSON.stringify(converted); controller.updatePipeline(); @@ -82,7 +82,7 @@ describe('Controller: editPipelineJsonModal', () => { const pipeline: any = {}; initializeController(pipeline); - controller.command = {pipelineJSON: 'This is not very good JSON', locked: false}; + controller.command = { pipelineJSON: 'This is not very good JSON', locked: false }; controller.updatePipeline(); expect(controller.command.invalid).toBe(true); diff --git a/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts b/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts index 45f5eb60171..a56923cda2a 100644 --- a/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts +++ b/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts @@ -89,9 +89,9 @@ class CopyStageModalCtrl implements IController { .filter((stage: IStage) => !this.uncopiableStageTypes.has(stage.type)) .map((stage: IStage) => { if (this.isStrategyConfig(config)) { - return {strategy: config.name, stage: stage}; + return { strategy: config.name, stage: stage }; } else { - return {pipeline: config.name, stage: stage}; + return { pipeline: config.name, stage: stage }; } }); }); diff --git a/app/scripts/modules/core/src/pipeline/config/copyStage/copyStageCard.component.ts b/app/scripts/modules/core/src/pipeline/config/copyStage/copyStageCard.component.ts index 732119fd5b7..e2d2d1a2b8e 100644 --- a/app/scripts/modules/core/src/pipeline/config/copyStage/copyStageCard.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/copyStage/copyStageCard.component.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; class CopyStageCardComponent implements ng.IComponentOptions { diff --git a/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx b/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx index 12fe885557e..9b67a266194 100644 --- a/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx +++ b/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx @@ -431,7 +431,7 @@ export class PipelineGraph extends React.Component 0 ? maxLabelWidth : 1} height="200"> @@ -442,7 +442,7 @@ export class PipelineGraph extends React.Component {node.childLinks.map((link) => )} diff --git a/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraphNode.tsx b/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraphNode.tsx index 36386aa3169..270a028af30 100644 --- a/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraphNode.tsx +++ b/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraphNode.tsx @@ -155,7 +155,7 @@ export class PipelineGraphNode extends React.Component {GraphNode} {GraphLabel} diff --git a/app/scripts/modules/core/src/pipeline/config/graph/pipelineGraph.service.ts b/app/scripts/modules/core/src/pipeline/config/graph/pipelineGraph.service.ts index 3f02756c6b4..bd34d8edd1e 100644 --- a/app/scripts/modules/core/src/pipeline/config/graph/pipelineGraph.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/graph/pipelineGraph.service.ts @@ -109,7 +109,7 @@ export class PipelineGraphService { phase: 0, root: true, section: 'triggers', - warnings: configWarnings.length ? {messages: configWarnings} : null, + warnings: configWarnings.length ? { messages: configWarnings } : null, }; nodes.push(configNode); diff --git a/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts b/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts index b15b511b5ef..219d4596cb6 100644 --- a/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts @@ -24,146 +24,146 @@ describe('pipelineConfigProvider: API', function() { describe('registration', function() { it('registers triggers', mock.inject(function() { expect(service.getTriggerTypes().length).toBe(0); - configurer.registerTrigger({key: 'cron'} as ITriggerTypeConfig); - configurer.registerTrigger({key: 'pipeline'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'cron' } as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'pipeline' } as ITriggerTypeConfig); expect(service.getTriggerTypes().length).toBe(2); })); it('registers stages', mock.inject(function() { expect(service.getStageTypes().length).toBe(0); - configurer.registerStage({key: 'a'} as IStageTypeConfig); - configurer.registerStage({key: 'b'} as IStageTypeConfig); + configurer.registerStage({ key: 'a' } as IStageTypeConfig); + configurer.registerStage({ key: 'b' } as IStageTypeConfig); expect(service.getStageTypes().length).toBe(2); })); it('provides only non-synthetic stages, non-provider-specific stages', mock.inject(function() { - configurer.registerStage({key: 'a'} as IStageTypeConfig); - configurer.registerStage({key: 'b', synthetic: true} as IStageTypeConfig); - configurer.registerStage({key: 'c', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({key: 'd', provides: 'c'} as IStageTypeConfig); + configurer.registerStage({ key: 'a' } as IStageTypeConfig); + configurer.registerStage({ key: 'b', synthetic: true } as IStageTypeConfig); + configurer.registerStage({ key: 'c', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ key: 'd', provides: 'c' } as IStageTypeConfig); expect(service.getStageTypes().length).toBe(4); expect(service.getConfigurableStageTypes().length).toBe(2); })); it('returns providers for a stage key', mock.inject(function() { - configurer.registerStage({key: 'a'} as IStageTypeConfig); - configurer.registerStage({key: 'b', synthetic: true} as IStageTypeConfig); - configurer.registerStage({key: 'c', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({key: 'd', provides: 'c'} as IStageTypeConfig); - configurer.registerStage({key: 'e', provides: 'c'} as IStageTypeConfig); + configurer.registerStage({ key: 'a' } as IStageTypeConfig); + configurer.registerStage({ key: 'b', synthetic: true } as IStageTypeConfig); + configurer.registerStage({ key: 'c', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ key: 'd', provides: 'c' } as IStageTypeConfig); + configurer.registerStage({ key: 'e', provides: 'c' } as IStageTypeConfig); expect(service.getProvidersFor('c').length).toBe(2); })); it('returns providers of base stage for child key', mock.inject(function() { - configurer.registerStage({key: 'c', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({nameToCheckInTest: 'a', key: 'd', provides: 'c'} as IStageTypeConfig); - configurer.registerStage({nameToCheckInTest: 'b', provides: 'c'} as IStageTypeConfig); + configurer.registerStage({ key: 'c', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ nameToCheckInTest: 'a', key: 'd', provides: 'c' } as IStageTypeConfig); + configurer.registerStage({ nameToCheckInTest: 'b', provides: 'c' } as IStageTypeConfig); const providers = service.getProvidersFor('d'); expect(providers.length).toBe(2); expect(map(providers, 'nameToCheckInTest').sort()).toEqual(['a', 'b']); })); it('augments provider stages with parent keys, labels, manualExecutionHandlers, and descriptions', mock.inject(function() { - const baseStage = {key: 'c', useBaseProvider: true, description: 'c description', label: 'the c', manualExecutionHandler: 'a'}, - augmentedA = {key: 'd', provides: 'c', description: 'c description', label: 'the c', manualExecutionHandler: 'a'} as any, - augmentedB = {key: 'e', provides: 'c', description: 'c description', label: 'the c', manualExecutionHandler: 'a'}, - augmentedC = {key: 'c', provides: 'c', description: 'c description', label: 'the c', manualExecutionHandler: 'a'}; + const baseStage = { key: 'c', useBaseProvider: true, description: 'c description', label: 'the c', manualExecutionHandler: 'a' }, + augmentedA = { key: 'd', provides: 'c', description: 'c description', label: 'the c', manualExecutionHandler: 'a' } as any, + augmentedB = { key: 'e', provides: 'c', description: 'c description', label: 'the c', manualExecutionHandler: 'a' }, + augmentedC = { key: 'c', provides: 'c', description: 'c description', label: 'the c', manualExecutionHandler: 'a' }; configurer.registerStage(baseStage as IStageTypeConfig); - configurer.registerStage({key: 'd', provides: 'c'} as IStageTypeConfig); - configurer.registerStage({key: 'e', provides: 'c'} as IStageTypeConfig); - configurer.registerStage({provides: 'c'} as IStageTypeConfig); + configurer.registerStage({ key: 'd', provides: 'c' } as IStageTypeConfig); + configurer.registerStage({ key: 'e', provides: 'c' } as IStageTypeConfig); + configurer.registerStage({ provides: 'c' } as IStageTypeConfig); const stageTypes = service.getStageTypes(); expect(stageTypes as any[]).toEqual([ baseStage, augmentedA, augmentedB, augmentedC ]); - expect(service.getStageConfig({type: 'd'} as any)).toEqual(augmentedA); + expect(service.getStageConfig({ type: 'd' } as any)).toEqual(augmentedA); })); it('allows provider stages to override of label, description, manualExecutionHandler', mock.inject(function() { - configurer.registerStage({key: 'a', useBaseProvider: true, description: 'a1', label: 'aa', manualExecutionHandler: 'a'} as IStageTypeConfig); - configurer.registerStage({key: 'b', provides: 'a', description: 'b1', label: 'bb', manualExecutionHandler: 'b'} as IStageTypeConfig); - configurer.registerStage({key: 'c', provides: 'a'} as IStageTypeConfig); + configurer.registerStage({ key: 'a', useBaseProvider: true, description: 'a1', label: 'aa', manualExecutionHandler: 'a' } as IStageTypeConfig); + configurer.registerStage({ key: 'b', provides: 'a', description: 'b1', label: 'bb', manualExecutionHandler: 'b' } as IStageTypeConfig); + configurer.registerStage({ key: 'c', provides: 'a' } as IStageTypeConfig); expect(service.getStageTypes() as any[]).toEqual([ - {key: 'a', useBaseProvider: true, description: 'a1', label: 'aa', manualExecutionHandler: 'a'}, - {key: 'b', provides: 'a', description: 'b1', label: 'bb', manualExecutionHandler: 'b'}, - {key: 'c', provides: 'a', description: 'a1', label: 'aa', manualExecutionHandler: 'a'} + { key: 'a', useBaseProvider: true, description: 'a1', label: 'aa', manualExecutionHandler: 'a' }, + { key: 'b', provides: 'a', description: 'b1', label: 'bb', manualExecutionHandler: 'b' }, + { key: 'c', provides: 'a', description: 'a1', label: 'aa', manualExecutionHandler: 'a' } ]); })); it('returns stage config when an alias is supplied', mock.inject(function() { - const config: IStageTypeConfig = {key: 'a', alias: 'a1'} as IStageTypeConfig; + const config: IStageTypeConfig = { key: 'a', alias: 'a1' } as IStageTypeConfig; configurer.registerStage(config); - expect(service.getStageConfig({type: 'a'} as IStage)).toEqual(config); - expect(service.getStageConfig({type: 'a1'} as IStage)).toEqual(config); - expect(service.getStageConfig({type: 'b'} as IStage)).toBe(null); + expect(service.getStageConfig({ type: 'a' } as IStage)).toEqual(config); + expect(service.getStageConfig({ type: 'a1' } as IStage)).toEqual(config); + expect(service.getStageConfig({ type: 'b' } as IStage)).toBe(null); })); }); describe('stage type retrieval', function () { describe('no provider configured', function () { it('adds all providers to stages that do not have any provider configuration', mock.inject(function () { - configurer.registerStage({key: 'a'} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['aws', 'gcp']) as any[]).toEqual([{key: 'a', cloudProviders: ['aws', 'gcp']}]); + configurer.registerStage({ key: 'a' } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['aws', 'gcp']) as any[]).toEqual([{ key: 'a', cloudProviders: ['aws', 'gcp'] }]); })); }); describe('cloud providers configured on stage', function () { it('preserves providers that match passed in providers if configured with cloudProviders', mock.inject(function () { - configurer.registerStage({key: 'a', providesFor: ['aws']} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['aws', 'gcp']) as any[]).toEqual([{key: 'a', providesFor: ['aws'], cloudProviders: ['aws']}]); + configurer.registerStage({ key: 'a', providesFor: ['aws'] } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['aws', 'gcp']) as any[]).toEqual([{ key: 'a', providesFor: ['aws'], cloudProviders: ['aws'] }]); })); it('filters providers to those passed in', mock.inject(function () { - configurer.registerStage({key: 'a', providesFor: ['aws', 'gcp']} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['gcp']) as any[]).toEqual([{key: 'a', providesFor: ['aws', 'gcp'], cloudProviders: ['gcp']}]); + configurer.registerStage({ key: 'a', providesFor: ['aws', 'gcp'] } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['gcp']) as any[]).toEqual([{ key: 'a', providesFor: ['aws', 'gcp'], cloudProviders: ['gcp'] }]); })); it('filters out stages that do not support passed in providers', mock.inject(function () { - configurer.registerStage({key: 'a', providesFor: ['aws', 'gcp']} as IStageTypeConfig); + configurer.registerStage({ key: 'a', providesFor: ['aws', 'gcp'] } as IStageTypeConfig); expect(service.getConfigurableStageTypes(['titus'])).toEqual([]); })); it('filters out stages that do not support passed in providers', mock.inject(function () { - configurer.registerStage({key: 'a', providesFor: ['aws', 'gcp']} as IStageTypeConfig); + configurer.registerStage({ key: 'a', providesFor: ['aws', 'gcp'] } as IStageTypeConfig); expect(service.getConfigurableStageTypes(['titus'])).toEqual([]); })); }); describe('single cloud provider configured on stage', function () { it('retains cloud providers when matching passed in providers', mock.inject(function () { - configurer.registerStage({key: 'a', cloudProvider: 'aws'} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['aws']) as any[]).toEqual([{key: 'a', cloudProvider: 'aws', cloudProviders: ['aws']}]); + configurer.registerStage({ key: 'a', cloudProvider: 'aws' } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['aws']) as any[]).toEqual([{ key: 'a', cloudProvider: 'aws', cloudProviders: ['aws'] }]); })); it('filters stages when provider does not match', mock.inject(function () { - configurer.registerStage({key: 'a', cloudProvider: 'aws'} as IStageTypeConfig); + configurer.registerStage({ key: 'a', cloudProvider: 'aws' } as IStageTypeConfig); expect(service.getConfigurableStageTypes(['gcp'])).toEqual([]); })); }); describe('base stages', function () { it('returns stage implementation providers that match based on cloud provider', mock.inject(function () { - configurer.registerStage({key: 'a', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({key: 'b', provides: 'a', cloudProvider: 'aws'} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['aws']) as any[]).toEqual([{key: 'a', useBaseProvider: true, cloudProviders: ['aws']}]); + configurer.registerStage({ key: 'a', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ key: 'b', provides: 'a', cloudProvider: 'aws' } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['aws']) as any[]).toEqual([{ key: 'a', useBaseProvider: true, cloudProviders: ['aws'] }]); })); it('filters stage implementations with no matching cloud provider', mock.inject(function () { - configurer.registerStage({key: 'a', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({key: 'b', provides: 'a', cloudProvider: 'aws'} as IStageTypeConfig); + configurer.registerStage({ key: 'a', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ key: 'b', provides: 'a', cloudProvider: 'aws' } as IStageTypeConfig); expect(service.getConfigurableStageTypes(['gcp'])).toEqual([]); })); it('aggregates and filters cloud providers', mock.inject(function () { - configurer.registerStage({key: 'a', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({key: 'b', provides: 'a', cloudProvider: 'aws'} as IStageTypeConfig); - configurer.registerStage({key: 'c', provides: 'a', cloudProvider: 'gcp'} as IStageTypeConfig); - configurer.registerStage({key: 'd', provides: 'a', cloudProvider: 'titus'} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['aws', 'titus']) as any[]).toEqual([{key: 'a', useBaseProvider: true, cloudProviders: ['aws', 'titus']}]); + configurer.registerStage({ key: 'a', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ key: 'b', provides: 'a', cloudProvider: 'aws' } as IStageTypeConfig); + configurer.registerStage({ key: 'c', provides: 'a', cloudProvider: 'gcp' } as IStageTypeConfig); + configurer.registerStage({ key: 'd', provides: 'a', cloudProvider: 'titus' } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['aws', 'titus']) as any[]).toEqual([{ key: 'a', useBaseProvider: true, cloudProviders: ['aws', 'titus'] }]); })); it('prefers providesFor to cloudProvider when configured on an implementing stage', mock.inject(function () { - configurer.registerStage({key: 'a', useBaseProvider: true} as IStageTypeConfig); - configurer.registerStage({key: 'b', provides: 'a', cloudProvider: 'aws', providesFor: ['aws', 'gcp', 'titus']} as IStageTypeConfig); - expect(service.getConfigurableStageTypes(['aws', 'titus']) as any[]).toEqual([{key: 'a', useBaseProvider: true, cloudProviders: ['aws', 'titus']}]); + configurer.registerStage({ key: 'a', useBaseProvider: true } as IStageTypeConfig); + configurer.registerStage({ key: 'b', provides: 'a', cloudProvider: 'aws', providesFor: ['aws', 'gcp', 'titus'] } as IStageTypeConfig); + expect(service.getConfigurableStageTypes(['aws', 'titus']) as any[]).toEqual([{ key: 'a', useBaseProvider: true, cloudProviders: ['aws', 'titus'] }]); })); }); @@ -171,35 +171,35 @@ describe('pipelineConfigProvider: API', function() { describe('manualExecutionHandlers', function () { it ('hasManualExecutionHandlerForTriggerType returns false if nothing configured', function () { - configurer.registerTrigger({key: 'a'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'a' } as ITriggerTypeConfig); expect(service.hasManualExecutionHandlerForTriggerType('a')).toBe(false); expect(service.hasManualExecutionHandlerForTriggerType('b')).toBe(false); }); it('hasManualExecutionHandlerForTriggerType returns false if declared but not configured', function () { - configurer.registerTrigger({key: 'a', manualExecutionHandler: 'someHandlerThatDoesNotExist'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'a', manualExecutionHandler: 'someHandlerThatDoesNotExist' } as ITriggerTypeConfig); expect(service.hasManualExecutionHandlerForTriggerType('a')).toBe(false); }); it('hasManualExecutionHandlerForTriggerType returns true if declared and available', function () { - configurer.registerTrigger({key: 'cron', manualExecutionHandler: 'pipelineConfig'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'cron', manualExecutionHandler: 'pipelineConfig' } as ITriggerTypeConfig); expect(service.hasManualExecutionHandlerForTriggerType('cron')).toBe(true); }); it('getManualExecutionHandlerForTriggerType returns null if nothing configured', function () { - configurer.registerTrigger({key: 'a'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'a' } as ITriggerTypeConfig); expect(service.getManualExecutionHandlerForTriggerType('a')).toBe(null); expect(service.getManualExecutionHandlerForTriggerType('b')).toBe(null); }); it('getManualExecutionHandlerForTriggerType returns null if declared but not configured', function () { - configurer.registerTrigger({key: 'a', manualExecutionHandler: 'someHandlerThatDoesNotExist'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'a', manualExecutionHandler: 'someHandlerThatDoesNotExist' } as ITriggerTypeConfig); expect(service.getManualExecutionHandlerForTriggerType('a')).toBe(null); expect(service.getManualExecutionHandlerForTriggerType('b')).toBe(null); }); it('hasManualExecutionHandlerForTriggerType returns handler if declared and available', function () { - configurer.registerTrigger({key: 'cron', manualExecutionHandler: 'pipelineConfig'} as ITriggerTypeConfig); + configurer.registerTrigger({ key: 'cron', manualExecutionHandler: 'pipelineConfig' } as ITriggerTypeConfig); expect(service.getManualExecutionHandlerForTriggerType('cron')).not.toBe(null); expect(Object.keys(service.getManualExecutionHandlerForTriggerType('cron'))).toEqual(Object.keys(service)); }); diff --git a/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts b/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts index 4299ae04378..65ea12b6d25 100644 --- a/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts @@ -1,12 +1,12 @@ -import {IPromise, IQService, module} from 'angular'; -import {sortBy, uniq} from 'lodash'; +import { IPromise, IQService, module } from 'angular'; +import { sortBy, uniq } from 'lodash'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {AUTHENTICATION_SERVICE, AuthenticationService} from 'core/authentication/authentication.service'; -import {VIEW_STATE_CACHE_SERVICE, ViewStateCacheService} from 'core/cache/viewStateCache.service'; -import {ICache} from 'core/cache/deckCache.service'; -import {IStage} from 'core/domain/IStage'; -import {IPipeline} from 'core/domain/IPipeline'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { AUTHENTICATION_SERVICE, AuthenticationService } from 'core/authentication/authentication.service'; +import { VIEW_STATE_CACHE_SERVICE, ViewStateCacheService } from 'core/cache/viewStateCache.service'; +import { ICache } from 'core/cache/deckCache.service'; +import { IStage } from 'core/domain/IStage'; +import { IPipeline } from 'core/domain/IPipeline'; export interface ITriggerPipelineResponse { ref: string; @@ -44,7 +44,7 @@ export class PipelineConfigService { } public getHistory(id: string, count = 20): IPromise { - return this.API.one('pipelineConfigs', id).all('history').withParams({count: count}).getList(); + return this.API.one('pipelineConfigs', id).all('history').withParams({ count: count }).getList(); } public deletePipeline(applicationName: string, pipeline: IPipeline, pipelineName: string): IPromise { diff --git a/app/scripts/modules/core/src/pipeline/config/services/piplineConfig.service.spec.ts b/app/scripts/modules/core/src/pipeline/config/services/piplineConfig.service.spec.ts index 01e33651625..9e3e1242f21 100644 --- a/app/scripts/modules/core/src/pipeline/config/services/piplineConfig.service.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/services/piplineConfig.service.spec.ts @@ -1,11 +1,11 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {API_SERVICE, Api} from 'core/api/api.service'; +import { API_SERVICE, Api } from 'core/api/api.service'; import { PIPELINE_CONFIG_SERVICE, PipelineConfigService } from 'core/pipeline/config/services/pipelineConfig.service'; -import {IStage} from 'core/domain/IStage'; -import {IPipeline} from 'core/domain/IPipeline'; +import { IStage } from 'core/domain/IStage'; +import { IPipeline } from 'core/domain/IPipeline'; describe('pipelineConfigService', () => { @@ -69,9 +69,9 @@ describe('pipelineConfigService', () => { it('clears isNew flags, stage name if not present', () => { const pipeline: IPipeline = buildPipeline({ stages: [ - { name: 'explicit name', type: 'bake', isNew: true}, - { name: null, type: 'bake', isNew: true}, - { name: '', type: 'bake', isNew: true} + { name: 'explicit name', type: 'bake', isNew: true }, + { name: null, type: 'bake', isNew: true }, + { name: '', type: 'bake', isNew: true } ] }); @@ -94,10 +94,10 @@ describe('pipelineConfigService', () => { it('should return pipelines sorted by index', () => { let result: IPipeline[] = null; const fromServer: IPipeline[] = [ - buildPipeline({ id: 'a', name: 'second', application: 'app', index: 1, stages: [], triggers: []}), - buildPipeline({ id: 'b', name: 'last', application: 'app', index: 3, stages: [], triggers: []}), - buildPipeline({ id: 'c', name: 'first', application: 'app', index: 0, stages: []}), - buildPipeline({ id: 'd', name: 'third', application: 'app', index: 2, stages: []}), + buildPipeline({ id: 'a', name: 'second', application: 'app', index: 1, stages: [], triggers: [] }), + buildPipeline({ id: 'b', name: 'last', application: 'app', index: 3, stages: [], triggers: [] }), + buildPipeline({ id: 'c', name: 'first', application: 'app', index: 0, stages: [] }), + buildPipeline({ id: 'd', name: 'third', application: 'app', index: 2, stages: [] }), ]; $http.expectGET(API.baseUrl + '/applications/app/pipelineConfigs').respond(200, fromServer); @@ -112,17 +112,17 @@ describe('pipelineConfigService', () => { it('should fix sort order of pipelines on initialization: 0..n, index collisions sorted alphabetically', () => { const fromServer: IPipeline[] = [ - buildPipeline({ name: 'second', index: 1, stages: []}), - buildPipeline({ name: 'last', index: 5, stages: []}), - buildPipeline({ name: 'first', index: -3, stages: []}), - buildPipeline({ name: 'duplicateIndex', index: 5, stages: []}), + buildPipeline({ name: 'second', index: 1, stages: [] }), + buildPipeline({ name: 'last', index: 5, stages: [] }), + buildPipeline({ name: 'first', index: -3, stages: [] }), + buildPipeline({ name: 'duplicateIndex', index: 5, stages: [] }), ]; const posted: any[] = []; $http.expectGET(API.baseUrl + '/applications/app/pipelineConfigs').respond(200, fromServer); $http.whenPOST(API.baseUrl + '/pipelines', (data: string) => { const json: any = JSON.parse(data); - posted.push({index: json.index, name: json.name}); + posted.push({ index: json.index, name: json.name }); return true; }).respond(200, {}); @@ -155,10 +155,10 @@ describe('pipelineConfigService', () => { }; beforeEach(() => { - a = buildStage({refId: 1}); - b = buildStage({refId: 2}); - c = buildStage({refId: 3}); - d = buildStage({refId: 4}); + a = buildStage({ refId: 1 }); + b = buildStage({ refId: 2 }); + c = buildStage({ refId: 3 }); + d = buildStage({ refId: 4 }); pipeline = buildPipeline({}); pipeline.stages = [a, b, c, d]; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/bake/BakeExecutionLabel.tsx b/app/scripts/modules/core/src/pipeline/config/stages/bake/BakeExecutionLabel.tsx index 9e0d7bb78e2..62390dbab07 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/bake/BakeExecutionLabel.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/bake/BakeExecutionLabel.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import {IExecutionStageSummary} from 'core/domain'; +import { IExecutionStageSummary } from 'core/domain'; export class BakeExecutionLabel extends React.Component<{ stage: IExecutionStageSummary }> { public render() { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/bake/bakery.service.ts b/app/scripts/modules/core/src/pipeline/config/stages/bake/bakery.service.ts index 10cdf0442c7..28e36d63079 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/bake/bakery.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/bake/bakery.service.ts @@ -1,9 +1,9 @@ -import {get, has} from 'lodash'; -import {module} from 'angular'; +import { get, has } from 'lodash'; +import { module } from 'angular'; -import {ACCOUNT_SERVICE, AccountService} from 'core/account/account.service'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {SETTINGS} from 'core/config/settings'; +import { ACCOUNT_SERVICE, AccountService } from 'core/account/account.service'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { SETTINGS } from 'core/config/settings'; export interface IBaseImage { id: string; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/core/ExecutionMarkerIcon.tsx b/app/scripts/modules/core/src/pipeline/config/stages/core/ExecutionMarkerIcon.tsx index 6c118b34583..074dc03f2ee 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/core/ExecutionMarkerIcon.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/core/ExecutionMarkerIcon.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import {IExecutionStageSummary} from 'core/domain/IExecutionStage'; +import { IExecutionStageSummary } from 'core/domain/IExecutionStage'; export interface IExecutionMarkerIconProps { stage: IExecutionStageSummary; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx index c63d32e6c38..7c5fbe8a01b 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx @@ -1,12 +1,12 @@ import * as React from 'react'; import { BindAll } from 'lodash-decorators'; -import {IExecution, IExecutionStage} from 'core/domain'; -import {Application} from 'core/application/application.model'; -import {ReactInjector} from 'core/reactShims'; -import {timePickerTime} from 'core/utils/timeFormatters'; -import {SystemTimezone} from 'core/utils/SystemTimezone'; -import {DAYS_OF_WEEK} from './daysOfWeek'; +import { IExecution, IExecutionStage } from 'core/domain'; +import { Application } from 'core/application/application.model'; +import { ReactInjector } from 'core/reactShims'; +import { timePickerTime } from 'core/utils/timeFormatters'; +import { SystemTimezone } from 'core/utils/SystemTimezone'; +import { DAYS_OF_WEEK } from './daysOfWeek'; export interface IExecutionWindowActionsProps { execution: IExecution; @@ -50,7 +50,7 @@ export class ExecutionWindowActions extends React.Component
    From
    - {timePickerTime({hours: entry.startHour, minutes: entry.startMin})} - to - {timePickerTime({hours: entry.endHour, minutes: entry.endMin})} + {timePickerTime({ hours: entry.startHour, minutes: entry.startMin })} + to + {timePickerTime({ hours: entry.endHour, minutes: entry.endMin })}
    @@ -102,7 +102,7 @@ export class ExecutionWindowActions extends React.Component diff --git a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts index 8cb38cb9052..0a9ba787b9f 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts @@ -95,7 +95,7 @@ class ExecutionWindowAtlasGraphController implements IController { return; } this.chartData.loading = true; - this.$http({ method: 'GET', url: this.getAtlasUrl(), cache: true}) + this.$http({ method: 'GET', url: this.getAtlasUrl(), cache: true }) .then(resp => resp.data) .then((data: any) => { this.maxCount = 0; @@ -191,10 +191,10 @@ class ExecutionWindowAtlasGraphController implements IController { } ], axes: { - x: {key: 'timestamp', type: 'date', ticks: 6}, - y: {ticks: 3, padding: {min: 0, max: 4}}, - x2: {ticks: 0}, - y2: {ticks: 0} + x: { key: 'timestamp', type: 'date', ticks: 6 }, + y: { ticks: 3, padding: { min: 0, max: 4 } }, + x2: { ticks: 0 }, + y2: { ticks: 0 } }, zoom: { x: true, @@ -267,7 +267,7 @@ class ExecutionWindowAtlasGraphController implements IController { .milliseconds(window.displayEnd.getMilliseconds()) .subtract(dayOffset, 'days').toDate().getTime(); - return {start, end}; + return { start, end }; } private getAtlasUrl(): string { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/executionWindowActions.component.ts b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/executionWindowActions.component.ts index 49b44604d98..c9e3ab67471 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/executionWindowActions.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/executionWindowActions.component.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; -import {react2angular} from 'react2angular'; +import { module } from 'angular'; +import { react2angular } from 'react2angular'; -import {ExecutionWindowActions} from './ExecutionWindowActions'; +import { ExecutionWindowActions } from './ExecutionWindowActions'; export const EXECUTION_WINDOW_ACTIONS_COMPONENT = 'spinnaker.core.pipeline.config.stages.executionWindowActions.component'; module(EXECUTION_WINDOW_ACTIONS_COMPONENT, []) diff --git a/app/scripts/modules/core/src/pipeline/config/stages/group/GroupMarkerIcon.tsx b/app/scripts/modules/core/src/pipeline/config/stages/group/GroupMarkerIcon.tsx index 8d477303bc1..07bc448b0cf 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/group/GroupMarkerIcon.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/group/GroupMarkerIcon.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import {IExecutionMarkerIconProps} from '../core/ExecutionMarkerIcon'; +import { IExecutionMarkerIconProps } from '../core/ExecutionMarkerIcon'; export class GroupMarkerIcon extends React.Component { public render() { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/jenkins/JenkinsExecutionLabel.tsx b/app/scripts/modules/core/src/pipeline/config/stages/jenkins/JenkinsExecutionLabel.tsx index 629444b0542..65019e333ff 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/jenkins/JenkinsExecutionLabel.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/jenkins/JenkinsExecutionLabel.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import {IExecutionStageSummary} from 'core/domain'; +import { IExecutionStageSummary } from 'core/domain'; export class JenkinsExecutionLabel extends React.Component<{ stage: IExecutionStageSummary }> { public render() { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentApproval.tsx b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentApproval.tsx index dd7be79a2db..e1553bc2467 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentApproval.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentApproval.tsx @@ -37,7 +37,7 @@ export class ManualJudgmentApproval extends React.Component { const judgmentInput: string = this.state.judgmentInput ? this.state.judgmentInput.value : null; - this.setState({submitting: true, error: false, judgmentDecision}); + this.setState({ submitting: true, error: false, judgmentDecision }); return ReactInjector.manualJudgmentService.provideJudgment(this.props.execution, this.props.stage, judgmentDecision, judgmentInput) .then(() => this.judgmentMade()) .catch(() => this.judgmentFailure()); @@ -50,7 +50,7 @@ export class ManualJudgmentApproval extends React.Component { return {value: o.value, label: o.value}; }); + .map((o: {value: string}) => { return { value: o.value, label: o.value }; }); const showOptions = !['SKIPPED', 'SUCCEEDED'].includes(status) && (!stage.context.judgmentStatus || status === 'RUNNING'); diff --git a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentMarkerIcon.tsx b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentMarkerIcon.tsx index 597f08d9285..49e9df04cb3 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentMarkerIcon.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/ManualJudgmentMarkerIcon.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import {IExecutionMarkerIconProps} from '../core/ExecutionMarkerIcon'; +import { IExecutionMarkerIconProps } from '../core/ExecutionMarkerIcon'; export class ManualJudgmentMarkerIcon extends React.Component { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.component.ts b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.component.ts index 6d6405c6ad8..d1f51f9e545 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.component.ts @@ -1,8 +1,8 @@ -import {module} from 'angular'; -import {react2angular} from 'react2angular'; +import { module } from 'angular'; +import { react2angular } from 'react2angular'; -import {MANUAL_JUDGMENT_SERVICE} from './manualJudgment.service'; -import {ManualJudgmentApproval} from './ManualJudgmentApproval'; +import { MANUAL_JUDGMENT_SERVICE } from './manualJudgment.service'; +import { ManualJudgmentApproval } from './ManualJudgmentApproval'; export const MANUAL_JUDGMENT_COMPONENT = 'spinnaker.core.pipeline.config.stages.manualJudgment.component'; module(MANUAL_JUDGMENT_COMPONENT, [MANUAL_JUDGMENT_SERVICE]) diff --git a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.spec.ts b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.spec.ts index c3386e28a04..e1ce272adbd 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.spec.ts @@ -1,8 +1,8 @@ -import {IDeferred, IHttpBackendService, IQService, IRootScopeService, IScope, mock} from 'angular'; +import { IDeferred, IHttpBackendService, IQService, IRootScopeService, IScope, mock } from 'angular'; -import {SETTINGS} from 'core/config/settings'; -import {MANUAL_JUDGMENT_SERVICE, ManualJudgmentService} from './manualJudgment.service'; -import {ExecutionService} from 'core/delivery/service/execution.service'; +import { SETTINGS } from 'core/config/settings'; +import { MANUAL_JUDGMENT_SERVICE, ManualJudgmentService } from './manualJudgment.service'; +import { ExecutionService } from 'core/delivery/service/execution.service'; describe('Service: manualJudgment', () => { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.ts b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.ts index 7554ccdae0a..250d94910d4 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/manualJudgment/manualJudgment.service.ts @@ -1,7 +1,7 @@ -import {IPromise, module} from 'angular'; +import { IPromise, module } from 'angular'; -import {EXECUTION_SERVICE, ExecutionService} from 'core/delivery/service/execution.service'; -import {IExecution, IExecutionStage} from 'core/domain'; +import { EXECUTION_SERVICE, ExecutionService } from 'core/delivery/service/execution.service'; +import { IExecution, IExecutionStage } from 'core/domain'; export class ManualJudgmentService { constructor(private executionService: ExecutionService) { 'ngInject'; } @@ -11,7 +11,7 @@ export class ManualJudgmentService { const match = result.stages.find((test) => test.id === stage.id); return match && match.status !== 'RUNNING'; }; - return this.executionService.patchExecution(execution.id, stage.id, {judgmentStatus, judgmentInput}) + return this.executionService.patchExecution(execution.id, stage.id, { judgmentStatus, judgmentInput }) .then(() => this.executionService.waitUntilExecutionMatches(execution.id, matcher)); } } diff --git a/app/scripts/modules/core/src/pipeline/config/stages/travis/TravisExecutionLabel.tsx b/app/scripts/modules/core/src/pipeline/config/stages/travis/TravisExecutionLabel.tsx index 41020084577..11e6fbcd169 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/travis/TravisExecutionLabel.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/travis/TravisExecutionLabel.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import {IExecutionStageSummary} from 'core/domain'; +import { IExecutionStageSummary } from 'core/domain'; export class TravisExecutionLabel extends React.Component<{ stage: IExecutionStageSummary }, any> { public render() { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisExecutionDetails.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisExecutionDetails.controller.spec.ts index cbc7949ee75..8b172c96525 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisExecutionDetails.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisExecutionDetails.controller.spec.ts @@ -1,6 +1,6 @@ -import {IScope, IControllerService, IRootScopeService, mock} from 'angular'; +import { IScope, IControllerService, IRootScopeService, mock } from 'angular'; -import {TRAVIS_EXECUTION_DETAILS_CONTROLLER, TravisExecutionDetailsCtrl} from './travisExecutionDetails.controller'; +import { TRAVIS_EXECUTION_DETAILS_CONTROLLER, TravisExecutionDetailsCtrl } from './travisExecutionDetails.controller'; describe('Travis Execution Details Controller:', () => { let $scope: IScope, diff --git a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts index b3aa94daeba..6fa68b2ec69 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts @@ -1,9 +1,9 @@ import Spy = jasmine.Spy; -import {mock, IScope, IQService, IControllerService, IRootScopeService} from 'angular'; +import { mock, IScope, IQService, IControllerService, IRootScopeService } from 'angular'; -import {IgorService} from 'core/ci/igor.service'; -import {IJobConfig, ParameterDefinitionList} from 'core/domain'; -import {TRAVIS_STAGE, TravisStage} from './travisStage'; +import { IgorService } from 'core/ci/igor.service'; +import { IJobConfig, ParameterDefinitionList } from 'core/domain'; +import { TRAVIS_STAGE, TravisStage } from './travisStage'; describe('Travis Stage Controller', () => { let $scope: IScope, @@ -124,9 +124,9 @@ describe('Travis Stage Controller', () => { it('gets job config and adds parameters to scope, setting defaults if present and not overridden', () => { const params: ParameterDefinitionList[] = [ - {name: 'overridden', defaultValue: 'z'}, - {name: 'notSet', defaultValue: 'a'}, - {name: 'noDefault', defaultValue: null} + { name: 'overridden', defaultValue: 'z' }, + { name: 'notSet', defaultValue: 'a' }, + { name: 'noDefault', defaultValue: null } ]; const jobConfig = { parameterDefinitionList: params diff --git a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts index 5a44b5773cd..c1a95b7884f 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts @@ -167,7 +167,7 @@ module(TRAVIS_STAGE, [ }, defaultTimeoutMs: moment.duration(2, 'hours').asMilliseconds(), validators: [ - {type: 'requiredField', fieldName: 'job'}, + { type: 'requiredField', fieldName: 'job' }, ], strategy: true, }); diff --git a/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.spec.ts index 62aae1da463..b401c09715c 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.spec.ts @@ -1,7 +1,7 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {UNMATCHED_STAGE_TYPE_STAGE_CTRL, UnmatchedStageTypeStageCtrl} from './unmatchedStageTypeStage.controller'; -import {JsonUtilityService} from 'core/utils/json/json.utility.service'; +import { UNMATCHED_STAGE_TYPE_STAGE_CTRL, UnmatchedStageTypeStageCtrl } from './unmatchedStageTypeStage.controller'; +import { JsonUtilityService } from 'core/utils/json/json.utility.service'; describe('Controller: UnmatchedStageTypeStageCtrl', () => { let ctrl: UnmatchedStageTypeStageCtrl; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.ts b/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.ts index 681f6712514..995438ccd99 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.ts @@ -1,7 +1,7 @@ -import {module, IController, IScope, isDefined} from 'angular'; -import {cloneDeep, isEqual} from 'lodash'; -import {JSON_UTILITY_SERVICE, JsonUtilityService} from 'core/utils/json/json.utility.service'; -import {IStage} from 'core/domain/IStage'; +import { module, IController, IScope, isDefined } from 'angular'; +import { cloneDeep, isEqual } from 'lodash'; +import { JSON_UTILITY_SERVICE, JsonUtilityService } from 'core/utils/json/json.utility.service'; +import { IStage } from 'core/domain/IStage'; export class UnmatchedStageTypeStageCtrl implements IController { public stageJson: string; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.ts b/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.ts index a79e590d488..57a30623f91 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {PIPELINE_CONFIG_PROVIDER} from 'core/pipeline/config/pipelineConfigProvider'; -import {UNMATCHED_STAGE_TYPE_STAGE_CTRL} from './unmatchedStageTypeStage.controller'; +import { PIPELINE_CONFIG_PROVIDER } from 'core/pipeline/config/pipelineConfigProvider'; +import { UNMATCHED_STAGE_TYPE_STAGE_CTRL } from './unmatchedStageTypeStage.controller'; export const UNMATCHED_STAGE_TYPE_STAGE = 'spinnaker.core.pipeline.stage.unmatchedStageType'; module(UNMATCHED_STAGE_TYPE_STAGE, [ diff --git a/app/scripts/modules/core/src/pipeline/config/stages/wait/SkipWait.tsx b/app/scripts/modules/core/src/pipeline/config/stages/wait/SkipWait.tsx index d96e9aad744..4546ca13fc9 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/wait/SkipWait.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/wait/SkipWait.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; -import {IExecution, IExecutionStage} from 'core/domain'; -import {Application} from 'core/application/application.model'; -import {ReactInjector} from 'core/reactShims'; -import {duration} from 'core/utils/timeFormatters'; -import {OrchestratedItemRunningTime} from 'core/delivery/executionGroup/execution/OrchestratedItemRunningTime'; +import { IExecution, IExecutionStage } from 'core/domain'; +import { Application } from 'core/application/application.model'; +import { ReactInjector } from 'core/reactShims'; +import { duration } from 'core/utils/timeFormatters'; +import { OrchestratedItemRunningTime } from 'core/delivery/executionGroup/execution/OrchestratedItemRunningTime'; export interface ISkipWaitProps { execution: IExecution; @@ -27,7 +27,7 @@ export class SkipWait extends React.Component { } private setRemainingWait = (time: number): void => { - this.setState({remainingWait: duration(this.props.stage.context.waitTime * 1000 - time) }); + this.setState({ remainingWait: duration(this.props.stage.context.waitTime * 1000 - time) }); }; private skipRemainingWait = (e: React.MouseEvent): void => { @@ -82,7 +82,7 @@ export class SkipWait extends React.Component {
    diff --git a/app/scripts/modules/core/src/pipeline/config/stages/wait/skipWait.component.ts b/app/scripts/modules/core/src/pipeline/config/stages/wait/skipWait.component.ts index dbdab15c458..3afcb4017dc 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/wait/skipWait.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/wait/skipWait.component.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; -import {react2angular} from 'react2angular'; +import { module } from 'angular'; +import { react2angular } from 'react2angular'; -import {SkipWait} from './SkipWait'; +import { SkipWait } from './SkipWait'; export const SKIP_WAIT_COMPONENT = 'spinnaker.core.pipeline.config.stages.wait.component'; module(SKIP_WAIT_COMPONENT, []) diff --git a/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts b/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts index 46e971c4684..a67da76ea29 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts @@ -125,8 +125,8 @@ module(WEBHOOK_STAGE, [ templateUrl: require('./webhookStage.html'), executionDetailsUrl: require('./webhookExecutionDetails.html'), validators: [ - {type: 'requiredField', fieldName: 'url'}, - {type: 'requiredField', fieldName: 'method'} + { type: 'requiredField', fieldName: 'url' }, + { type: 'requiredField', fieldName: 'method' } ] }); }).run((pipelineConfig: PipelineConfigProvider, API: Api) => { diff --git a/app/scripts/modules/core/src/pipeline/config/templates/TemplatePlanErrors.tsx b/app/scripts/modules/core/src/pipeline/config/templates/TemplatePlanErrors.tsx index 35d81505aae..99110870631 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/TemplatePlanErrors.tsx +++ b/app/scripts/modules/core/src/pipeline/config/templates/TemplatePlanErrors.tsx @@ -25,7 +25,7 @@ export class TemplatePlanErrors extends React.Component +
    {e.message && (
    Message: {e.message}
    )} {e.severity && (
    Severity: {e.severity}
    )} {e.location && (
    Location: {e.location}
    )} diff --git a/app/scripts/modules/core/src/pipeline/config/templates/VariableError.tsx b/app/scripts/modules/core/src/pipeline/config/templates/VariableError.tsx index e8749dbee00..62c1f0d91a4 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/VariableError.tsx +++ b/app/scripts/modules/core/src/pipeline/config/templates/VariableError.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import {IVariableError} from './inputs/variableInput.service' +import { IVariableError } from './inputs/variableInput.service' export interface IVariableErrorProps { errors: IVariableError[] @@ -14,7 +14,7 @@ export class VariableError extends React.Component {this.props.errors.length > 0 && (
    -
      +
        {this.renderErrors()}
    diff --git a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.spec.ts index 4c8bc8d0968..2fbc8b623db 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.spec.ts @@ -79,7 +79,7 @@ describe('Controller: ConfigurePipelineTemplateModalCtrl', () => { ctrl = $controller('ConfigurePipelineTemplateModalCtrl', { $scope, application, - $uibModalInstance: {close: $q.resolve(null)}, + $uibModalInstance: { close: $q.resolve(null) }, pipelineTemplateConfig: { config: { pipeline: { @@ -126,7 +126,7 @@ describe('Controller: ConfigurePipelineTemplateModalCtrl', () => { const variables = { credentials: 'my-credentials', cloudProvider: 'gce', - someObject: {key: 'value'}, + someObject: { key: 'value' }, someList: ['a'], someInt: 123, }; @@ -277,23 +277,23 @@ describe('Controller: ConfigurePipelineTemplateModalCtrl', () => { let v = createVariable('string', ''); ctrl.handleVariableChange(v); - expect(v.errors).toEqual([{message: 'Field is required.'}]); + expect(v.errors).toEqual([{ message: 'Field is required.' }]); v = createVariable('object', ''); ctrl.handleVariableChange(v); - expect(v.errors).toEqual([{message: 'Field is required.'}]); + expect(v.errors).toEqual([{ message: 'Field is required.' }]); v = createVariable('float', ''); ctrl.handleVariableChange(v); - expect(v.errors).toEqual([{message: 'Field is required.'}]); + expect(v.errors).toEqual([{ message: 'Field is required.' }]); v = createVariable('int', ''); ctrl.handleVariableChange(v); - expect(v.errors).toEqual([{message: 'Field is required.'}]); + expect(v.errors).toEqual([{ message: 'Field is required.' }]); v = createVariable('list', ['']); ctrl.handleVariableChange(v); - expect(v.errors).toEqual([{message: 'Field is required.', key: 0}]); + expect(v.errors).toEqual([{ message: 'Field is required.', key: 0 }]); }); it('validates yaml', () => { diff --git a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts index 84bd51fbb36..9291488230e 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts @@ -33,7 +33,7 @@ export class ConfigurePipelineTemplateModalController implements IController { public pipelineName: string; public variableMetadataGroups: IVariableMetadataGroup[]; public variables: IVariable[]; - public state: IState = {loading: true, error: false, planErrors: null, loadingError: false, noVariables: false}; + public state: IState = { loading: true, error: false, planErrors: null, loadingError: false, noVariables: false }; private template: IPipelineTemplate; private source: string; @@ -60,7 +60,7 @@ export class ConfigurePipelineTemplateModalController implements IController { }) .then(() => this.state.loading = false) .catch(() => { - Object.assign(this.state, {loading: false, error: false, planErrors: null, loadingError: true}); + Object.assign(this.state, { loading: false, error: false, planErrors: null, loadingError: true }); }); } @@ -76,15 +76,15 @@ export class ConfigurePipelineTemplateModalController implements IController { const config = this.buildConfig(); return ReactInjector.pipelineTemplateService.getPipelinePlan(config) .then(plan => { - this.$uibModalInstance.close({plan, config}); + this.$uibModalInstance.close({ plan, config }); }) .catch((response: IHttpPromiseCallbackArg) => { - Object.assign(this.state, {loading: false, error: true, planErrors: response.data && response.data.errors}); + Object.assign(this.state, { loading: false, error: true, planErrors: response.data && response.data.errors }); }); } public dismissError(): void { - Object.assign(this.state, {error: false, planErrors: null, loadingError: false}); + Object.assign(this.state, { error: false, planErrors: null, loadingError: false }); } public buildConfig(): IPipelineTemplateConfig { @@ -100,7 +100,7 @@ export class ConfigurePipelineTemplateModalController implements IController { name: this.pipelineName, application: this.application.name, pipelineConfigId: this.pipelineId, - template: {source: this.source}, + template: { source: this.source }, variables: this.transformVariablesForPipelinePlan(), } } @@ -159,7 +159,7 @@ export class ConfigurePipelineTemplateModalController implements IController { if (group) { group.variableMetadata.push(metadata); } else { - this.variableMetadataGroups.push({name: groupName, variableMetadata: [metadata]}); + this.variableMetadataGroups.push({ name: groupName, variableMetadata: [metadata] }); } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/inputs/ListInput.tsx b/app/scripts/modules/core/src/pipeline/config/templates/inputs/ListInput.tsx index c9f34ee794e..0cce8937148 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/inputs/ListInput.tsx +++ b/app/scripts/modules/core/src/pipeline/config/templates/inputs/ListInput.tsx @@ -1,11 +1,11 @@ -import {module} from 'angular'; +import { module } from 'angular'; import * as React from 'react'; -import {Button} from 'react-bootstrap' +import { Button } from 'react-bootstrap' import { IVariableInputBuilder, VariableInputService, IVariable, IVariableError, IVariableState, IVariableProps } from './variableInput.service'; -import {VariableError} from '../VariableError'; +import { VariableError } from '../VariableError'; import { BindAll } from 'lodash-decorators'; @BindAll() @@ -25,16 +25,16 @@ class ListInput extends React.Component { private createInputFields(): JSX.Element[] { return this.props.variable.value.map((v: string, i: number) => { return ( -
    +
    - + {!this.props.variable.hideErrors && } @@ -51,19 +51,19 @@ class ListInput extends React.Component { return (e: React.ChangeEvent) => { const list = this.props.variable.value.slice(); list[i] = e.target.value; - this.props.onChange({value: list, type: this.props.variable.type, name: this.props.variable.name}); + this.props.onChange({ value: list, type: this.props.variable.type, name: this.props.variable.name }); } } private handleDeleteValue(i: number): void { const list = this.props.variable.value.slice(); list.splice(i, 1); - this.props.onChange({value: list, type: this.props.variable.type, name: this.props.variable.name}); + this.props.onChange({ value: list, type: this.props.variable.type, name: this.props.variable.name }); } private handleAddValue(): void { const list = this.props.variable.value.slice().concat(['']); - this.props.onChange({value: list, type: this.props.variable.type, name: this.props.variable.name}); + this.props.onChange({ value: list, type: this.props.variable.type, name: this.props.variable.name }); } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/inputs/NumberInput.tsx b/app/scripts/modules/core/src/pipeline/config/templates/inputs/NumberInput.tsx index 1a1818ead95..92810a196e9 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/inputs/NumberInput.tsx +++ b/app/scripts/modules/core/src/pipeline/config/templates/inputs/NumberInput.tsx @@ -1,11 +1,11 @@ -import {module} from 'angular'; +import { module } from 'angular'; import * as React from 'react'; import { IVariableInputBuilder, VariableInputService, IVariable, IVariableState, IVariableProps } from './variableInput.service'; import { BindAll } from 'lodash-decorators'; -import {VariableError} from '../VariableError'; +import { VariableError } from '../VariableError'; @BindAll() class NumberInput extends React.Component { @@ -27,7 +27,7 @@ class NumberInput extends React.Component { private extractValue(e: React.ChangeEvent) { const value: string = e.target.value; // Comes back from input as a string, not a number. - this.props.onChange({value, type: this.props.variable.type, name: this.props.variable.name}); + this.props.onChange({ value, type: this.props.variable.type, name: this.props.variable.name }); } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/inputs/ObjectInput.tsx b/app/scripts/modules/core/src/pipeline/config/templates/inputs/ObjectInput.tsx index c222983b22b..96ff794ef3e 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/inputs/ObjectInput.tsx +++ b/app/scripts/modules/core/src/pipeline/config/templates/inputs/ObjectInput.tsx @@ -1,8 +1,8 @@ -import {module} from 'angular'; +import { module } from 'angular'; import * as React from 'react'; -import {IVariableInputBuilder, VariableInputService, IVariable, IVariableProps, IVariableState} from './variableInput.service'; +import { IVariableInputBuilder, VariableInputService, IVariable, IVariableProps, IVariableState } from './variableInput.service'; import { BindAll } from 'lodash-decorators'; -import {VariableError} from '../VariableError'; +import { VariableError } from '../VariableError'; @BindAll() class ObjectInput extends React.Component { @@ -23,7 +23,7 @@ class ObjectInput extends React.Component { } private extractValue(e: React.ChangeEvent): void { - this.props.onChange({value: e.target.value, type: this.props.variable.type, name: this.props.variable.name}); + this.props.onChange({ value: e.target.value, type: this.props.variable.type, name: this.props.variable.name }); } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/inputs/StringInput.tsx b/app/scripts/modules/core/src/pipeline/config/templates/inputs/StringInput.tsx index 58b4e1580d8..b663489ffef 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/inputs/StringInput.tsx +++ b/app/scripts/modules/core/src/pipeline/config/templates/inputs/StringInput.tsx @@ -1,10 +1,10 @@ -import {module} from 'angular'; +import { module } from 'angular'; import * as React from 'react'; import { IVariableInputBuilder, VariableInputService, IVariable, IVariableProps, IVariableState } from './variableInput.service'; import { BindAll } from 'lodash-decorators'; -import {VariableError} from '../VariableError'; +import { VariableError } from '../VariableError'; @BindAll() class StringInput extends React.Component { @@ -25,7 +25,7 @@ class StringInput extends React.Component { } private extractValue(e: React.ChangeEvent) { - this.props.onChange({value: e.target.value, type: this.props.variable.type, name: this.props.variable.name}); + this.props.onChange({ value: e.target.value, type: this.props.variable.type, name: this.props.variable.name }); } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/inputs/variableInput.service.ts b/app/scripts/modules/core/src/pipeline/config/templates/inputs/variableInput.service.ts index 9b0b32c6de1..eef0fcad7c0 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/inputs/variableInput.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/inputs/variableInput.service.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import {module} from 'angular'; +import { module } from 'angular'; export interface IVariable { name: string; diff --git a/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts b/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts index a90b9e041e1..bfa2786e2ea 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts @@ -80,7 +80,7 @@ export class PipelineTemplateService { } public getPipelineTemplateFromSourceUrl(source: string): IPromise { - return this.API.one('pipelineTemplates').one('resolve').withParams({source}).get() + return this.API.one('pipelineTemplates').one('resolve').withParams({ source }).get() .then((template: IPipelineTemplate) => { template.selfLink = source; return template; @@ -88,11 +88,11 @@ export class PipelineTemplateService { } public getPipelinePlan(config: IPipelineTemplateConfig): IPromise { - return this.API.one('pipelines').one('start').post(Object.assign({}, config, {plan: true})); + return this.API.one('pipelines').one('start').post(Object.assign({}, config, { plan: true })); } public getPipelineTemplatesByScope(scope: string): IPromise { - return this.API.one('pipelineTemplates').withParams({scope}).get(); + return this.API.one('pipelineTemplates').withParams({ scope }).get(); } public getPipelineTemplatesByScopes(scopes: string[]): IPromise { diff --git a/app/scripts/modules/core/src/pipeline/config/templates/validators/list.validator.ts b/app/scripts/modules/core/src/pipeline/config/templates/validators/list.validator.ts index 6e4f485570a..4f8e9b87a46 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/validators/list.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/validators/list.validator.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; -import {IVariableValidator, VariableValidatorService} from './variableValidator.service'; -import {IVariable, IVariableError} from '../inputs/variableInput.service'; +import { module } from 'angular'; +import { IVariableValidator, VariableValidatorService } from './variableValidator.service'; +import { IVariable, IVariableError } from '../inputs/variableInput.service'; class ListValidator implements IVariableValidator { @@ -11,7 +11,7 @@ class ListValidator implements IVariableValidator { public validate(variable: IVariable, errors: IVariableError[]): void { (variable.value as string[] || []).forEach((listElement, i) => { if (!listElement) { - errors.push({message: 'Field is required.', key: i}); + errors.push({ message: 'Field is required.', key: i }); } }); } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/validators/number.validator.ts b/app/scripts/modules/core/src/pipeline/config/templates/validators/number.validator.ts index 1ef9111dec6..1ccf4b104ea 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/validators/number.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/validators/number.validator.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; -import {IVariableValidator, VariableValidatorService} from './variableValidator.service'; -import {IVariable, IVariableError} from '../inputs/variableInput.service'; +import { module } from 'angular'; +import { IVariableValidator, VariableValidatorService } from './variableValidator.service'; +import { IVariable, IVariableError } from '../inputs/variableInput.service'; class NumberValidator implements IVariableValidator { @@ -10,11 +10,11 @@ class NumberValidator implements IVariableValidator { public validate(variable: IVariable, errors: IVariableError[]): void { if (!variable.value) { - errors.push({message: 'Field is required.'}); + errors.push({ message: 'Field is required.' }); } if (variable.type === 'int' && typeof variable.value === 'string' && variable.value.split('.').length > 1) { - errors.push({message: 'Must be an integer.'}); + errors.push({ message: 'Must be an integer.' }); } } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/validators/object.validator.ts b/app/scripts/modules/core/src/pipeline/config/templates/validators/object.validator.ts index 262530bbde4..808185db329 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/validators/object.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/validators/object.validator.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; -import {load} from 'js-yaml'; -import {IVariableValidator, VariableValidatorService} from './variableValidator.service'; -import {IVariable, IVariableError} from '../inputs/variableInput.service'; +import { module } from 'angular'; +import { load } from 'js-yaml'; +import { IVariableValidator, VariableValidatorService } from './variableValidator.service'; +import { IVariable, IVariableError } from '../inputs/variableInput.service'; class ObjectValidator implements IVariableValidator { @@ -11,12 +11,12 @@ class ObjectValidator implements IVariableValidator { public validate(variable: IVariable, errors: IVariableError[]): void { if (!variable.value) { - errors.push({message: 'Field is required.'}); + errors.push({ message: 'Field is required.' }); } try { load(variable.value); } catch (e) { - errors.push({message: e.message}); + errors.push({ message: e.message }); } } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/validators/string.validator.ts b/app/scripts/modules/core/src/pipeline/config/templates/validators/string.validator.ts index 4ca5316741f..c876f60c9ab 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/validators/string.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/validators/string.validator.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; -import {IVariableValidator, VariableValidatorService} from './variableValidator.service'; -import {IVariable, IVariableError} from '../inputs/variableInput.service'; +import { module } from 'angular'; +import { IVariableValidator, VariableValidatorService } from './variableValidator.service'; +import { IVariable, IVariableError } from '../inputs/variableInput.service'; class StringValidator implements IVariableValidator { @@ -10,7 +10,7 @@ class StringValidator implements IVariableValidator { public validate(variable: IVariable, errors: IVariableError[]): void { if (!variable.value) { - errors.push({message: 'Field is required.'}); + errors.push({ message: 'Field is required.' }); } } } diff --git a/app/scripts/modules/core/src/pipeline/config/templates/validators/variableValidator.service.ts b/app/scripts/modules/core/src/pipeline/config/templates/validators/variableValidator.service.ts index 1c1545079d9..1ede4b79f10 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/validators/variableValidator.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/validators/variableValidator.service.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {IVariable, IVariableError} from '../inputs/variableInput.service'; +import { module } from 'angular'; +import { IVariable, IVariableError } from '../inputs/variableInput.service'; export interface IVariableValidator { handles: (type: string) => boolean; diff --git a/app/scripts/modules/core/src/pipeline/config/templates/variable.component.ts b/app/scripts/modules/core/src/pipeline/config/templates/variable.component.ts index cfcab7dead0..6c54ff2033e 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/variable.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/variable.component.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; -import {react2angular} from 'react2angular'; -import {Variable} from './Variable'; +import { module } from 'angular'; +import { react2angular } from 'react2angular'; +import { Variable } from './Variable'; export const VARIABLE = 'spinnaker.core.pipelineTemplate.variable.component'; module(VARIABLE, []) diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.component.ts b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.component.ts index 651d792d2d1..fa2b2e4d698 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.component.ts @@ -40,7 +40,7 @@ class ArtifactCtrl implements IController { this.description = config.description; const ctrl = config.controller; - const controller = this.$controller(ctrl, {artifact: this.artifact}); + const controller = this.$controller(ctrl, { artifact: this.artifact }); const scope = this.$rootScope.$new(); const controllerAs = config.controllerAs; if (controllerAs) { @@ -56,7 +56,7 @@ class ArtifactCtrl implements IController { } class ArtifactComponent implements IComponentOptions { - public bindings: any = {artifact: '='}; + public bindings: any = { artifact: '=' }; public controller: any = ArtifactCtrl; public controllerAs = 'ctrl'; public template = ` diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/runAsUserSelector.component.ts b/app/scripts/modules/core/src/pipeline/config/triggers/runAsUserSelector.component.ts index dc9fc92fd81..1f3e5617633 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/runAsUserSelector.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/runAsUserSelector.component.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; class RunAsUserSelectorComponent implements ng.IComponentOptions { public bindings: any = { diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts index 2da09f1a1d7..8aa6c3b480b 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts @@ -1,9 +1,9 @@ -import {mock, IScope, IQService, IControllerService, IRootScopeService} from 'angular'; -import {find} from 'lodash'; +import { mock, IScope, IQService, IControllerService, IRootScopeService } from 'angular'; +import { find } from 'lodash'; -import {IgorService} from 'core/ci/igor.service'; -import {IBuildTrigger} from 'core/domain/ITrigger'; -import {TRAVIS_TRIGGER, TravisTrigger} from './travisTrigger.module'; +import { IgorService } from 'core/ci/igor.service'; +import { IBuildTrigger } from 'core/domain/ITrigger'; +import { TRAVIS_TRIGGER, TravisTrigger } from './travisTrigger.module'; describe('Controller: travisTrigger', () => { let $scope: IScope, @@ -32,7 +32,7 @@ describe('Controller: travisTrigger', () => { describe('updateJobsList', () => { it('gets list of jobs when initialized with a trigger with a master and sets loading states', () => { const jobs = ['some_job', 'some_other_job'], - trigger = {master: 'travis', job: 'some_job'}; + trigger = { master: 'travis', job: 'some_job' }; spyOn(igorService, 'listJobsForMaster').and.returnValue($q.when(jobs)); spyOn(igorService, 'listMasters').and.returnValue($q.when(['travis'])); @@ -61,7 +61,7 @@ describe('Controller: travisTrigger', () => { }; spyOn(igorService, 'listJobsForMaster').and.callFake((master: string) => { - return $q.when(find([masterA, masterB], {name: master}).jobs); + return $q.when(find([masterA, masterB], { name: master }).jobs); }); spyOn(igorService, 'listMasters').and.returnValue($q.when(['masterA', 'masterB'])); diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerExecutionHandler.spec.ts b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerExecutionHandler.spec.ts index ea14fb67f63..96f9351329a 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerExecutionHandler.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerExecutionHandler.spec.ts @@ -1,6 +1,6 @@ -import {mock, IScope, IRootScopeService} from 'angular'; +import { mock, IScope, IRootScopeService } from 'angular'; -import {TRAVIS_TRIGGER} from './travisTrigger.module'; +import { TRAVIS_TRIGGER } from './travisTrigger.module'; describe('Travis Trigger: ExecutionHandler', () => { @@ -15,7 +15,7 @@ describe('Travis Trigger: ExecutionHandler', () => { it('returns job and master as label', () => { let label: string = null; - handler.formatLabel({job: 'a', master: 'b'}).then((result: string) => label = result); + handler.formatLabel({ job: 'a', master: 'b' }).then((result: string) => label = result); $scope.$digest(); expect(label).toBe('(Travis) b: a'); }); diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts index d7f64657d37..107ac6ff412 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts @@ -1,9 +1,9 @@ -import {mock, IScope, IQProvider, IQService, IControllerService, IRootScopeService} from 'angular'; +import { mock, IScope, IQProvider, IQService, IControllerService, IRootScopeService } from 'angular'; -import {IgorService} from 'core/ci/igor.service'; -import {IBuild} from 'core/domain/IBuild'; -import {IBuildTrigger} from 'core/domain/ITrigger'; -import {TRAVIS_TRIGGER_OPTIONS_COMPONENT, TravisTriggerOptionsController} from './travisTriggerOptions.component'; +import { IgorService } from 'core/ci/igor.service'; +import { IBuild } from 'core/domain/IBuild'; +import { IBuildTrigger } from 'core/domain/ITrigger'; +import { TRAVIS_TRIGGER_OPTIONS_COMPONENT, TravisTriggerOptionsController } from './travisTriggerOptions.component'; interface ICommand { trigger: IBuildTrigger; @@ -45,7 +45,7 @@ describe('Travis Trigger: TravisTriggerOptionsCtrl', () => { const ctrl = $ctrl(TravisTriggerOptionsController, { igorService: igorService, $scope: $scope, - }, {command: command}); + }, { command: command }); ctrl.$onInit(); return ctrl; }; @@ -64,7 +64,7 @@ describe('Travis Trigger: TravisTriggerOptionsCtrl', () => { }); it('sets build to first one available when returned on initialization', function () { - const build: IBuild = {number: 1, result: 'SUCCESS', building: null, duration: null, name: null, timestamp: null, url: null, artifacts: null}; + const build: IBuild = { number: 1, result: 'SUCCESS', building: null, duration: null, name: null, timestamp: null, url: null, artifacts: null }; spyOn(igorService, 'listBuildsForJob').and.returnValue($q.when([build])); const controller = initialize(); @@ -91,9 +91,9 @@ describe('Travis Trigger: TravisTriggerOptionsCtrl', () => { }); it('re-initializes when trigger changes', function () { - const firstBuild: IBuild = {number: '1', result: 'SUCCESS'}, - secondBuild: IBuild = {number: '3', result: 'SUCCESS'}, - secondTrigger: IBuildTrigger = {type: 'travis', master: 'b', job: 'c'}; + const firstBuild: IBuild = { number: '1', result: 'SUCCESS' }, + secondBuild: IBuild = { number: '3', result: 'SUCCESS' }, + secondTrigger: IBuildTrigger = { type: 'travis', master: 'b', job: 'c' }; spyOn(igorService, 'listBuildsForJob').and.callFake((_master: string, job: string) => { let builds: IBuild[] = []; diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.ts b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.ts index 7cef870c5e7..32896682916 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.ts @@ -1,7 +1,7 @@ -import {module, IScope, IComponentOptions} from 'angular'; +import { module, IScope, IComponentOptions } from 'angular'; -import {IGOR_SERVICE, IgorService} from 'core/ci/igor.service'; -import {IBuild} from 'core/domain/IBuild'; +import { IGOR_SERVICE, IgorService } from 'core/ci/igor.service'; +import { IBuild } from 'core/domain/IBuild'; export interface ITravisTriggerOptionsViewState { buildsLoading: boolean; diff --git a/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts b/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts index 81c99b418f2..f0b3cca27c3 100644 --- a/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts @@ -217,8 +217,8 @@ describe('pipelineConfigValidator', () => { }); pipeline = buildPipeline( [ - {type: 'withValidation', refId: 1, requisiteStageRefIds: []}, - {type: 'no-validation', refId: 2, requisiteStageRefIds: []} + { type: 'withValidation', refId: 1, requisiteStageRefIds: [] }, + { type: 'no-validation', refId: 2, requisiteStageRefIds: [] } ] ); }); @@ -229,8 +229,8 @@ describe('pipelineConfigValidator', () => { expect(validationResults.stages[0].messages).toEqual(['need a prereq']); pipeline.stages = [ - {name: 'a', type: 'wrongType', refId: 1, requisiteStageRefIds: []}, - {name: 'b', type: 'withValidation', refId: 2, requisiteStageRefIds: [1]} + { name: 'a', type: 'wrongType', refId: 1, requisiteStageRefIds: [] }, + { name: 'b', type: 'withValidation', refId: 2, requisiteStageRefIds: [1] } ]; validate(); @@ -244,9 +244,9 @@ describe('pipelineConfigValidator', () => { expect(validationResults.hasWarnings).toBe(false); pipeline.stages = [ - {name: 'a', type: 'prereq', refId: 1, requisiteStageRefIds: []}, - {name: 'b', type: 'somethingElse', refId: 2, requisiteStageRefIds: [1]}, - {name: 'c', type: 'withValidation', refId: 3, requisiteStageRefIds: [2]} + { name: 'a', type: 'prereq', refId: 1, requisiteStageRefIds: [] }, + { name: 'b', type: 'somethingElse', refId: 2, requisiteStageRefIds: [1] }, + { name: 'c', type: 'withValidation', refId: 3, requisiteStageRefIds: [2] } ]; validate(); @@ -259,10 +259,10 @@ describe('pipelineConfigValidator', () => { expect(validationResults.hasWarnings).toBe(false); pipeline.stages = [ - {name: 'a', type: 'withValidation', refId: 1, requisiteStageRefIds: []} + { name: 'a', type: 'withValidation', refId: 1, requisiteStageRefIds: [] } ]; pipeline.triggers = [ - {type: 'prereq', enabled: true} + { type: 'prereq', enabled: true } ]; validate(); @@ -275,11 +275,11 @@ describe('pipelineConfigValidator', () => { expect(validationResults.hasWarnings).toBe(false); pipeline.stages = [ - {name: 'a', type: 'noValidation', refId: 1, requisiteStageRefIds: []}, - {name: 'b', type: 'withValidation', refId: 2, requisiteStageRefIds: [1]} + { name: 'a', type: 'noValidation', refId: 1, requisiteStageRefIds: [] }, + { name: 'b', type: 'withValidation', refId: 2, requisiteStageRefIds: [1] } ]; pipeline.triggers = [ - {type: 'alsoNotValidation', enabled: true} + { type: 'alsoNotValidation', enabled: true } ]; validate(); @@ -372,8 +372,8 @@ describe('pipelineConfigValidator', () => { pipeline = buildPipeline( [ - {type: 'withValidation', refId: 1, requisiteStageRefIds: []}, - {type: 'no-validation', refId: 2, requisiteStageRefIds: []} + { type: 'withValidation', refId: 1, requisiteStageRefIds: [] }, + { type: 'no-validation', refId: 2, requisiteStageRefIds: [] } ] ); @@ -383,8 +383,8 @@ describe('pipelineConfigValidator', () => { pipeline = buildPipeline( [ - {type: 'wrongType', refId: 1, requisiteStageRefIds: []}, - {type: 'withValidation', refId: 2, requisiteStageRefIds: [1]} + { type: 'wrongType', refId: 1, requisiteStageRefIds: [] }, + { type: 'withValidation', refId: 2, requisiteStageRefIds: [1] } ] ); @@ -398,9 +398,9 @@ describe('pipelineConfigValidator', () => { pipeline = buildPipeline( [ - {type: 'prereq', refId: 1, requisiteStageRefIds: []}, - {type: 'somethingElse', refId: 2, requisiteStageRefIds: [1]}, - {type: 'withValidation', refId: 3, requisiteStageRefIds: [2]} + { type: 'prereq', refId: 1, requisiteStageRefIds: [] }, + { type: 'somethingElse', refId: 2, requisiteStageRefIds: [1] }, + { type: 'withValidation', refId: 3, requisiteStageRefIds: [2] } ] ); @@ -425,8 +425,8 @@ describe('pipelineConfigValidator', () => { pipeline = buildPipeline( [ - {type: 'three', refId: 1, requisiteStageRefIds: []}, - {type: 'withValidation', refId: 2, requisiteStageRefIds: [1]} + { type: 'three', refId: 1, requisiteStageRefIds: [] }, + { type: 'withValidation', refId: 2, requisiteStageRefIds: [1] } ] ); @@ -440,9 +440,9 @@ describe('pipelineConfigValidator', () => { pipeline = buildPipeline( [ - {type: 'two', refId: 1, requisiteStageRefIds: []}, - {type: 'somethingElse', refId: 2, requisiteStageRefIds: [1]}, - {type: 'withValidation', refId: 3, requisiteStageRefIds: [2]} + { type: 'two', refId: 1, requisiteStageRefIds: [] }, + { type: 'somethingElse', refId: 2, requisiteStageRefIds: [1] }, + { type: 'withValidation', refId: 3, requisiteStageRefIds: [2] } ] ); @@ -515,19 +515,19 @@ describe('pipelineConfigValidator', () => { validate(); expect(validationResults.stages.length).toBe(1); - pipeline.stages[0]['foo'] = { bar: { baz: null }}; + pipeline.stages[0]['foo'] = { bar: { baz: null } }; validate(); expect(validationResults.stages.length).toBe(1); - pipeline.stages[0]['foo'] = { bar: { baz: '' }}; + pipeline.stages[0]['foo'] = { bar: { baz: '' } }; validate(); expect(validationResults.stages.length).toBe(1); - pipeline.stages[0]['foo'] = { bar: { baz: 0 }}; + pipeline.stages[0]['foo'] = { bar: { baz: 0 } }; validate(); expect(validationResults.hasWarnings).toBe(false); - pipeline.stages[0]['foo'] = { bar: { baz: 'ok' }}; + pipeline.stages[0]['foo'] = { bar: { baz: 'ok' } }; validate(); expect(validationResults.hasWarnings).toBe(false); }); @@ -575,7 +575,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -597,7 +597,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -619,7 +619,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', freeFormDetails: 'main', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', freeFormDetails: 'main', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -641,7 +641,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'main', freeFormDetails: 'foo', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', stack: 'main', freeFormDetails: 'foo', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -663,7 +663,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -685,8 +685,8 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] }}, - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-west-1': [] }} + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] } }, + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-west-1': [] } } ] }, { @@ -708,14 +708,14 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-east-1': [] } } ] }, { type: 'deploy', refId: 2, clusters: [ - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-west-1': [] }} + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-west-1': [] } } ] }, { @@ -737,7 +737,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'prod', stack: 'main', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'prod', stack: 'main', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -760,7 +760,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-west-1': [] }} + { application: 'deck', account: 'test', stack: 'main', availabilityZones: { 'us-west-1': [] } } ] }, { @@ -783,7 +783,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -806,7 +806,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', stack: 'staging', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', stack: 'staging', availabilityZones: { 'us-east-1': [] } } ] }, { @@ -829,7 +829,7 @@ describe('pipelineConfigValidator', () => { type: 'deploy', refId: 1, clusters: [ - { application: 'deck', account: 'test', freeFormDetails: 'foo', availabilityZones: { 'us-east-1': [] }} + { application: 'deck', account: 'test', freeFormDetails: 'foo', availabilityZones: { 'us-east-1': [] } } ] }, { diff --git a/app/scripts/modules/core/src/pipeline/config/validation/targetImpedance.validator.ts b/app/scripts/modules/core/src/pipeline/config/validation/targetImpedance.validator.ts index 116fc2442cd..252e128ecf7 100644 --- a/app/scripts/modules/core/src/pipeline/config/validation/targetImpedance.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/validation/targetImpedance.validator.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; import { PIPELINE_CONFIG_SERVICE, @@ -8,8 +8,8 @@ import { IStageOrTriggerValidator, IValidatorConfig, PipelineConfigValidator, PIPELINE_CONFIG_VALIDATOR } from './pipelineConfig.validator'; -import {NAMING_SERVICE, NamingService} from 'core/naming/naming.service'; -import {IPipeline, IStage, IStageOrTriggerTypeConfig} from 'core/domain'; +import { NAMING_SERVICE, NamingService } from 'core/naming/naming.service'; +import { IPipeline, IStage, IStageOrTriggerTypeConfig } from 'core/domain'; export interface ITargetImpedanceValidationConfig extends IValidatorConfig { stageTypes?: string[]; diff --git a/app/scripts/modules/core/src/presentation/LabelComponent.tsx b/app/scripts/modules/core/src/presentation/LabelComponent.tsx index a18bc09b2d5..b644c390e54 100644 --- a/app/scripts/modules/core/src/presentation/LabelComponent.tsx +++ b/app/scripts/modules/core/src/presentation/LabelComponent.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import {IStage} from 'core/domain'; +import { IStage } from 'core/domain'; export interface ILabelComponentProps { stage: IStage; diff --git a/app/scripts/modules/core/src/presentation/navigation/pageNavigationState.ts b/app/scripts/modules/core/src/presentation/navigation/pageNavigationState.ts index 26e5842ffe3..339247e8b51 100644 --- a/app/scripts/modules/core/src/presentation/navigation/pageNavigationState.ts +++ b/app/scripts/modules/core/src/presentation/navigation/pageNavigationState.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; export interface INavigationPage { key: string; diff --git a/app/scripts/modules/core/src/presentation/navigation/pageNavigator.component.spec.ts b/app/scripts/modules/core/src/presentation/navigation/pageNavigator.component.spec.ts index 954ea87faaa..945fea9e387 100644 --- a/app/scripts/modules/core/src/presentation/navigation/pageNavigator.component.spec.ts +++ b/app/scripts/modules/core/src/presentation/navigation/pageNavigator.component.spec.ts @@ -1,9 +1,9 @@ import * as $ from 'jquery'; -import {mock} from 'angular'; +import { mock } from 'angular'; -import {PAGE_NAVIGATOR_COMPONENT} from './pageNavigator.component'; -import {INavigationPage} from './pageNavigationState'; -import {ScrollToService} from '../../utils/scrollTo/scrollTo.service'; +import { PAGE_NAVIGATOR_COMPONENT } from './pageNavigator.component'; +import { INavigationPage } from './pageNavigationState'; +import { ScrollToService } from '../../utils/scrollTo/scrollTo.service'; describe('Component: Page Navigator', () => { @@ -56,7 +56,7 @@ describe('Component: Page Navigator', () => { it('renders pages conditionally based on visible flag', () => { const pages = [ - { key: '1', label: 'Page 1', visible: true}, + { key: '1', label: 'Page 1', visible: true }, { key: '2', label: 'Page 2', visible: false } ]; initialize(pages); diff --git a/app/scripts/modules/core/src/presentation/replace.filter.ts b/app/scripts/modules/core/src/presentation/replace.filter.ts index 263440e5fca..58d6478df97 100644 --- a/app/scripts/modules/core/src/presentation/replace.filter.ts +++ b/app/scripts/modules/core/src/presentation/replace.filter.ts @@ -1,4 +1,4 @@ -import {module, isDefined, ILogService} from 'angular'; +import { module, isDefined, ILogService } from 'angular'; function replace($log: ILogService): Function { return (str: string, regExStr: string, replaceValue: string) => { diff --git a/app/scripts/modules/core/src/projects/dashboard/pipeline/ProjectPipeline.tsx b/app/scripts/modules/core/src/projects/dashboard/pipeline/ProjectPipeline.tsx index c4d64970c9f..e933ce39172 100644 --- a/app/scripts/modules/core/src/projects/dashboard/pipeline/ProjectPipeline.tsx +++ b/app/scripts/modules/core/src/projects/dashboard/pipeline/ProjectPipeline.tsx @@ -34,11 +34,11 @@ export class ProjectPipeline extends React.Component lb.name === loadBalancer.name)) { - securityGroup.usages.loadBalancers.push({name: loadBalancer.name}); + securityGroup.usages.loadBalancers.push({ name: loadBalancer.name }); } securityGroups.push(securityGroup); } catch (e) { @@ -143,7 +143,7 @@ export class SecurityGroupReader { } }); - return {notFoundCaught, securityGroups}; + return { notFoundCaught, securityGroups }; } private addNameBasedSecurityGroups(application: Application, @@ -161,7 +161,7 @@ export class SecurityGroupReader { } }); - return {notFoundCaught, securityGroups}; + return { notFoundCaught, securityGroups }; } private addServerGroupSecurityGroups(application: Application): ISecurityGroupProcessorResult { @@ -189,7 +189,7 @@ export class SecurityGroupReader { } }); - return {notFoundCaught, securityGroups}; + return { notFoundCaught, securityGroups }; } private clearCacheAndRetryAttachingSecurityGroups(application: Application, @@ -324,7 +324,7 @@ export class SecurityGroupReader { .one(account) .one(region) .one(id) - .withParams({provider, vpcId}) + .withParams({ provider, vpcId }) .get() .then((details: ISecurityGroupDetail) => { @@ -366,7 +366,7 @@ export class SecurityGroupReader { group.account = account; }); }); - securityGroups.push({account, provider, securityGroups: groupsByProvider[provider]}); + securityGroups.push({ account, provider, securityGroups: groupsByProvider[provider] }); }); }); @@ -385,7 +385,7 @@ export class SecurityGroupReader { if (!searchResults || !searchResults.results) { this.$log.warn('WARNING: Gate security group endpoint appears to be down.'); } else { - result = filter(searchResults.results, {application: applicationName}); + result = filter(searchResults.results, { application: applicationName }); } return result; diff --git a/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts b/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts index 36d439b9f53..578bdada9fd 100644 --- a/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts @@ -13,7 +13,7 @@ describe('Component: deployInitializer', () => { ctrl = $componentController( 'deployInitializer', {}, - {application, command: { viewState: {} }, cloudProvider: 'aws' } + { application, command: { viewState: {} }, cloudProvider: 'aws' } ); ctrl.$onInit(); }; @@ -33,7 +33,7 @@ describe('Component: deployInitializer', () => { describe('template initialization', () => { it('creates separate template options for each account and region of a cluster', () => { - application = applicationModelBuilder.createApplication('app', {key: 'serverGroups', lazy: true}); + application = applicationModelBuilder.createApplication('app', { key: 'serverGroups', lazy: true }); application.getDataSource('serverGroups').data = [ { name: 'sg1', diff --git a/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandBuilder.service.ts b/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandBuilder.service.ts index 6e60e882a0d..0f37519321a 100644 --- a/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandBuilder.service.ts +++ b/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandBuilder.service.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; import { Application } from 'core/application/application.model'; import { IMoniker } from 'core/naming/IMoniker'; diff --git a/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandRegistry.provider.ts b/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandRegistry.provider.ts index 9a93135edc6..2dfff75ff5b 100644 --- a/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandRegistry.provider.ts +++ b/app/scripts/modules/core/src/serverGroup/configure/common/serverGroupCommandRegistry.provider.ts @@ -1,5 +1,5 @@ -import {cloneDeep} from 'lodash'; -import {module} from 'angular'; +import { cloneDeep } from 'lodash'; +import { module } from 'angular'; export interface IWatchConfig { property: string; diff --git a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts index 3b62b7efb15..981f9341101 100644 --- a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts @@ -1,4 +1,4 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; import { SCALING_ACTIVITIES_CTRL, ScalingActivitiesCtrl, IScalingEventSummary, diff --git a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts index 716ae38be7c..137edb4feeb 100644 --- a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts +++ b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts @@ -56,7 +56,7 @@ export class ScalingActivitiesCtrl implements IController { } catch (e) { // I don't imagine this would happen but let's not blow up the world if it does. } - events.push({description: entry.description, availabilityZone: availabilityZone}); + events.push({ description: entry.description, availabilityZone: availabilityZone }); }); results.push({ cause: group[0].cause, diff --git a/app/scripts/modules/core/src/serverGroup/details/serverGroupWarningMessage.service.spec.ts b/app/scripts/modules/core/src/serverGroup/details/serverGroupWarningMessage.service.spec.ts index f7c1cf12c3e..7dd9c4ec3af 100644 --- a/app/scripts/modules/core/src/serverGroup/details/serverGroupWarningMessage.service.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/details/serverGroupWarningMessage.service.spec.ts @@ -1,12 +1,12 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; import { ServerGroupWarningMessageService, SERVER_GROUP_WARNING_MESSAGE_SERVICE } from './serverGroupWarningMessage.service'; -import {ApplicationModelBuilder, APPLICATION_MODEL_BUILDER} from 'core/application/applicationModel.builder'; +import { ApplicationModelBuilder, APPLICATION_MODEL_BUILDER } from 'core/application/applicationModel.builder'; import { IServerGroup } from 'core/domain'; -import {Application} from 'core/application/application.model'; -import {IConfirmationModalParams} from 'core/confirmationModal/confirmationModal.service'; +import { Application } from 'core/application/application.model'; +import { IConfirmationModalParams } from 'core/confirmationModal/confirmationModal.service'; describe('serverGroupWarningMessageService', () => { let service: ServerGroupWarningMessageService, @@ -117,7 +117,7 @@ describe('serverGroupWarningMessageService', () => { cloudProvider: 'aws', cluster: 'foo', instanceCounts: { up: 1, down: 0, succeeded: 0, failed: 0, unknown: 0, outOfService: 0, starting: 0 }, - instances: [{id: 'a', launchTime: 1, zone: 'b', health: null}], + instances: [{ id: 'a', launchTime: 1, zone: 'b', health: null }], name: 'foo-v000', region: 'us-east-1', type: 'a' @@ -127,7 +127,7 @@ describe('serverGroupWarningMessageService', () => { cloudProvider: 'aws', cluster: 'foo', instanceCounts: { up: 0, down: 1, succeeded: 0, failed: 0, unknown: 0, outOfService: 0, starting: 0 }, - instances: [{id: 'a', launchTime: 1, zone: 'b', health: null}], + instances: [{ id: 'a', launchTime: 1, zone: 'b', health: null }], name: 'foo-v001', region: 'us-east-1', type: 'a' @@ -142,7 +142,7 @@ describe('serverGroupWarningMessageService', () => { serverGroups: [serverGroup, down] } ]; - const params: IConfirmationModalParams = {account: 'prod'}; + const params: IConfirmationModalParams = { account: 'prod' }; service.addDisableWarningMessage(app, serverGroup, params); expect(params.body).toBeDefined(); expect(params.body.includes('
  • ')).toBe(false); @@ -156,7 +156,7 @@ describe('serverGroupWarningMessageService', () => { cloudProvider: 'aws', cluster: 'foo', instanceCounts: { up: 1, down: 0, succeeded: 0, failed: 0, unknown: 0, outOfService: 0, starting: 0 }, - instances: [{id: 'a', launchTime: 1, zone: 'b', health: null}], + instances: [{ id: 'a', launchTime: 1, zone: 'b', health: null }], name: 'foo-v000', region: 'us-east-1', type: 'a' @@ -171,7 +171,7 @@ describe('serverGroupWarningMessageService', () => { serverGroups: [serverGroup] } ]; - const params: IConfirmationModalParams = {account: 'prod'}; + const params: IConfirmationModalParams = { account: 'prod' }; service.addDisableWarningMessage(app, serverGroup, params); expect(params.body).toBeDefined(); expect(params.body.includes('
  • ')).toBe(false); @@ -185,7 +185,7 @@ describe('serverGroupWarningMessageService', () => { cloudProvider: 'aws', cluster: 'foo', instanceCounts: { up: 1, down: 0, succeeded: 0, failed: 0, unknown: 0, outOfService: 0, starting: 0 }, - instances: [{id: 'a', launchTime: 1, zone: 'b', health: null}], + instances: [{ id: 'a', launchTime: 1, zone: 'b', health: null }], name: 'foo-v000', region: 'us-east-1', type: 'a' @@ -206,7 +206,7 @@ describe('serverGroupWarningMessageService', () => { cloudProvider: 'aws', cluster: 'foo', instanceCounts: { up: 1, down: 0, succeeded: 0, failed: 0, unknown: 0, outOfService: 0, starting: 0 }, - instances: [{id: 'b', launchTime: 1, zone: 'b', health: null}], + instances: [{ id: 'b', launchTime: 1, zone: 'b', health: null }], name: 'foo-v002', region: 'us-east-1', type: 'a' @@ -221,7 +221,7 @@ describe('serverGroupWarningMessageService', () => { serverGroups: [serverGroup, omitted, included] } ]; - const params: IConfirmationModalParams = {account: 'prod'}; + const params: IConfirmationModalParams = { account: 'prod' }; service.addDisableWarningMessage(app, serverGroup, params); expect(params.body).toBeDefined(); expect(params.body.includes('foo-v000')).toBe(false); // this is the target, so should not be included diff --git a/app/scripts/modules/core/src/serverGroup/metrics/cloudMetrics.read.service.ts b/app/scripts/modules/core/src/serverGroup/metrics/cloudMetrics.read.service.ts index c2a653c77f5..d109f1b7105 100644 --- a/app/scripts/modules/core/src/serverGroup/metrics/cloudMetrics.read.service.ts +++ b/app/scripts/modules/core/src/serverGroup/metrics/cloudMetrics.read.service.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {API_SERVICE, Api} from 'core/api/api.service'; +import { API_SERVICE, Api } from 'core/api/api.service'; import { ICloudMetricDescriptor, ICloudMetricStatistics } from 'core/domain'; export class CloudMetricsReader { diff --git a/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts b/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts index 2555e592706..1d4cf03aaf4 100644 --- a/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts @@ -63,7 +63,7 @@ describe('serverGroupWriter', function () { $httpBackend.expectPOST(`${API.baseUrl}/applications/app/tasks`, (body: string) => { submitted = JSON.parse(body); return true; - }).respond(200, {ref: '/1'}); + }).respond(200, { ref: '/1' }); const application: TestApplication = applicationModelBuilder.createApplication('app', applicationDataSourceRegistry.getDataSources()); diff --git a/app/scripts/modules/core/src/serviceAccount/serviceAccount.service.ts b/app/scripts/modules/core/src/serviceAccount/serviceAccount.service.ts index 0fb14d81382..aebd6b98ebd 100644 --- a/app/scripts/modules/core/src/serviceAccount/serviceAccount.service.ts +++ b/app/scripts/modules/core/src/serviceAccount/serviceAccount.service.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {SETTINGS} from 'core/config/settings'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { SETTINGS } from 'core/config/settings'; export class ServiceAccountService { constructor(private $q: ng.IQService, private API: Api) { 'ngInject'; } diff --git a/app/scripts/modules/core/src/subnet/subnet.read.service.spec.ts b/app/scripts/modules/core/src/subnet/subnet.read.service.spec.ts index 83b2b9a7620..cb00f7ebab5 100644 --- a/app/scripts/modules/core/src/subnet/subnet.read.service.spec.ts +++ b/app/scripts/modules/core/src/subnet/subnet.read.service.spec.ts @@ -1,8 +1,8 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {API_SERVICE, Api} from 'core/api/api.service'; -import {SUBNET_READ_SERVICE, SubnetReader} from 'core/subnet/subnet.read.service'; -import {ISubnet} from 'core/domain'; +import { API_SERVICE, Api } from 'core/api/api.service'; +import { SUBNET_READ_SERVICE, SubnetReader } from 'core/subnet/subnet.read.service'; +import { ISubnet } from 'core/domain'; describe('subnetReader', function() { diff --git a/app/scripts/modules/core/src/subnet/subnet.read.service.ts b/app/scripts/modules/core/src/subnet/subnet.read.service.ts index 4d7a1c88f30..df0645aa730 100644 --- a/app/scripts/modules/core/src/subnet/subnet.read.service.ts +++ b/app/scripts/modules/core/src/subnet/subnet.read.service.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; -import {INFRASTRUCTURE_CACHE_SERVICE, InfrastructureCacheService} from 'core/cache/infrastructureCaches.service'; -import {API_SERVICE, Api} from 'core/api/api.service'; +import { module } from 'angular'; +import { INFRASTRUCTURE_CACHE_SERVICE, InfrastructureCacheService } from 'core/cache/infrastructureCaches.service'; +import { API_SERVICE, Api } from 'core/api/api.service'; import { ISubnet } from 'core/domain'; export class SubnetReader { diff --git a/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts b/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts index 8f9c30979e4..c7c4100d695 100644 --- a/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts +++ b/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts @@ -47,7 +47,7 @@ describe('Service: taskMonitorBuilder', () => { const operation = () => $q.when(task); const monitor = taskMonitorBuilder.buildTaskMonitor({ - application: applicationModelBuilder.createApplication('app', {key: 'runningTasks', lazy: true}), + application: applicationModelBuilder.createApplication('app', { key: 'runningTasks', lazy: true }), title: 'some task', modalInstance: { result: $q.defer().promise } as IModalServiceInstance, onTaskComplete: () => completeCalled = true, @@ -80,7 +80,7 @@ describe('Service: taskMonitorBuilder', () => { const task = { failureMessage: 'it failed' }; const operation = () => $q.reject(task); const monitor = taskMonitorBuilder.buildTaskMonitor({ - application: applicationModelBuilder.createApplication('app', {key: 'runningTasks', lazy: true}), + application: applicationModelBuilder.createApplication('app', { key: 'runningTasks', lazy: true }), title: 'a task', modalInstance: { result: $q.defer().promise } as IModalServiceInstance, onTaskComplete: () => completeCalled = true, @@ -104,7 +104,7 @@ describe('Service: taskMonitorBuilder', () => { const operation = () => $q.when(task); const monitor = taskMonitorBuilder.buildTaskMonitor({ - application: applicationModelBuilder.createApplication('app', {key: 'runningTasks', lazy: true}), + application: applicationModelBuilder.createApplication('app', { key: 'runningTasks', lazy: true }), title: 'a task', modalInstance: { result: $q.defer().promise } as IModalServiceInstance, onTaskComplete: () => completeCalled = true, diff --git a/app/scripts/modules/core/src/task/task.dataSource.spec.ts b/app/scripts/modules/core/src/task/task.dataSource.spec.ts index bb5e5948368..5d47d75d227 100644 --- a/app/scripts/modules/core/src/task/task.dataSource.spec.ts +++ b/app/scripts/modules/core/src/task/task.dataSource.spec.ts @@ -1,9 +1,9 @@ -import {mock} from 'angular'; +import { mock } from 'angular'; -import {Application} from 'core/application/application.model'; -import {APPLICATION_MODEL_BUILDER} from 'core/application/applicationModel.builder'; -import {APPLICATION_DATA_SOURCE_REGISTRY} from '../application/service/applicationDataSource.registry'; -import {TASK_READ_SERVICE, TaskReader} from 'core/task/task.read.service'; +import { Application } from 'core/application/application.model'; +import { APPLICATION_MODEL_BUILDER } from 'core/application/applicationModel.builder'; +import { APPLICATION_DATA_SOURCE_REGISTRY } from '../application/service/applicationDataSource.registry'; +import { TASK_READ_SERVICE, TaskReader } from 'core/task/task.read.service'; describe('Task Data Source', function () { @@ -35,7 +35,7 @@ describe('Task Data Source', function () { function configureApplication() { - applicationDataSourceRegistry.registerDataSource({key: 'serverGroups'}); + applicationDataSourceRegistry.registerDataSource({ key: 'serverGroups' }); application = applicationModelBuilder.createApplication('app', applicationDataSourceRegistry.getDataSources()); application.refresh(); application.getDataSource('tasks').activate(); diff --git a/app/scripts/modules/core/src/task/task.read.service.ts b/app/scripts/modules/core/src/task/task.read.service.ts index 4d885afbdf7..954e501caf3 100644 --- a/app/scripts/modules/core/src/task/task.read.service.ts +++ b/app/scripts/modules/core/src/task/task.read.service.ts @@ -15,7 +15,7 @@ export class TaskReader { public getTasks(applicationName: string, statuses: string[] = []): ng.IPromise { return this.API.one('applications', applicationName).all('tasks') - .getList({statuses: statuses.join(',')}) + .getList({ statuses: statuses.join(',') }) .then((tasks: ITask[]) => { tasks.forEach(task => this.setTaskProperties(task)); return tasks.filter(task => !task.getValueFor('dryRun')); diff --git a/app/scripts/modules/core/src/task/task.states.ts b/app/scripts/modules/core/src/task/task.states.ts index cfa1b4c677c..bf738d33aaa 100644 --- a/app/scripts/modules/core/src/task/task.states.ts +++ b/app/scripts/modules/core/src/task/task.states.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {INestedState} from 'core/navigation/state.provider'; +import { INestedState } from 'core/navigation/state.provider'; import { APPLICATION_STATE_PROVIDER, ApplicationStateProvider, } from 'core/application/application.state.provider'; diff --git a/app/scripts/modules/core/src/task/task.write.service.spec.ts b/app/scripts/modules/core/src/task/task.write.service.spec.ts index 50ff7d8f9e1..9708b120f2c 100644 --- a/app/scripts/modules/core/src/task/task.write.service.spec.ts +++ b/app/scripts/modules/core/src/task/task.write.service.spec.ts @@ -43,17 +43,17 @@ describe('Service: taskWriter', () => { let completed = false; $httpBackend.expectPUT(cancelUrl).respond(200, []); - $httpBackend.expectGET(checkUrl).respond(200, {id: taskId}); + $httpBackend.expectGET(checkUrl).respond(200, { id: taskId }); taskWriter.cancelTask(application, taskId).then(() => completed = true); $httpBackend.flush(); expect(completed).toBe(false); - $httpBackend.expectGET(checkUrl).respond(200, {id: taskId}); + $httpBackend.expectGET(checkUrl).respond(200, { id: taskId }); timeout.flush(); $httpBackend.flush(); - $httpBackend.expectGET(checkUrl).respond(200, {status: 'CANCELED' }); + $httpBackend.expectGET(checkUrl).respond(200, { status: 'CANCELED' }); timeout.flush(); $httpBackend.flush(); expect(completed).toBe(true); @@ -72,7 +72,7 @@ describe('Service: taskWriter', () => { taskWriter.deleteTask(taskId).then(() => completed = true); // first check: task is still present - $httpBackend.expectGET(checkUrl).respond(200, [{id: taskId}]); + $httpBackend.expectGET(checkUrl).respond(200, [{ id: taskId }]); $httpBackend.flush(); expect(completed).toBe(false); diff --git a/app/scripts/modules/core/src/task/taskExecutor.ts b/app/scripts/modules/core/src/task/taskExecutor.ts index 93ca15d8a96..7052b96e7e4 100644 --- a/app/scripts/modules/core/src/task/taskExecutor.ts +++ b/app/scripts/modules/core/src/task/taskExecutor.ts @@ -30,7 +30,7 @@ export class TaskExecutor { } public executeTask(taskCommand: ITaskCommand): IPromise { - const owner: any = taskCommand.application || taskCommand.project || { name: 'ad-hoc'}; + const owner: any = taskCommand.application || taskCommand.project || { name: 'ad-hoc' }; if (taskCommand.application && taskCommand.application.name) { taskCommand.application = taskCommand.application.name; } diff --git a/app/scripts/modules/core/src/utils/clipboard/copyToClipboard.component.ts b/app/scripts/modules/core/src/utils/clipboard/copyToClipboard.component.ts index 03e82305171..198ecca87b0 100644 --- a/app/scripts/modules/core/src/utils/clipboard/copyToClipboard.component.ts +++ b/app/scripts/modules/core/src/utils/clipboard/copyToClipboard.component.ts @@ -1,4 +1,4 @@ -import {IController, IComponentOptions, IScope, ITimeoutService, module} from 'angular'; +import { IController, IComponentOptions, IScope, ITimeoutService, module } from 'angular'; import * as Clipboard from 'clipboard'; import './copyToClipboard.component.less'; diff --git a/app/scripts/modules/core/src/utils/json/json.utility.service.spec.ts b/app/scripts/modules/core/src/utils/json/json.utility.service.spec.ts index eddf71352c9..29eff7e49b5 100644 --- a/app/scripts/modules/core/src/utils/json/json.utility.service.spec.ts +++ b/app/scripts/modules/core/src/utils/json/json.utility.service.spec.ts @@ -1,5 +1,5 @@ -import {mock} from 'angular'; -import {JSON_UTILITY_SERVICE, JsonUtilityService, IJsonDiff} from './json.utility.service'; +import { mock } from 'angular'; +import { JSON_UTILITY_SERVICE, JsonUtilityService, IJsonDiff } from './json.utility.service'; describe('jsonUtilityService', () => { @@ -16,7 +16,7 @@ describe('jsonUtilityService', () => { const right = `{"num": 2, "str": "a", "arr": ["b", "c"], "obj": {"a": 1, "c": 4, "b": 2, "arr": [1, 3, 2, 4]}}`; const result: IJsonDiff = jsonService.diff(left, right, true); - expect(result.summary).toEqual({additions: 5, removals: 4, unchanged: 14, total: 23}); + expect(result.summary).toEqual({ additions: 5, removals: 4, unchanged: 14, total: 23 }); expect(result.changeBlocks.length).toBe(8); expect(result.details.length).toBe(23); expect(result.details.map(d => d.text)).toEqual([ diff --git a/app/scripts/modules/core/src/utils/json/json.utility.service.ts b/app/scripts/modules/core/src/utils/json/json.utility.service.ts index f031f36261e..e950f8262a0 100644 --- a/app/scripts/modules/core/src/utils/json/json.utility.service.ts +++ b/app/scripts/modules/core/src/utils/json/json.utility.service.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {isPlainObject, isArray, isNumber, isString} from 'lodash'; +import { module } from 'angular'; +import { isPlainObject, isArray, isNumber, isString } from 'lodash'; const DiffMatchPatch = require('expose-loader?diff_match_patch!diff-match-patch'); @@ -100,17 +100,17 @@ export class JsonUtilityService { if (diff[0] === 1) { type = 'add'; additions += lines.length; - changeBlocks.push({type: type, lines: lines.length, start: total, height: null, top: null}); + changeBlocks.push({ type: type, lines: lines.length, start: total, height: null, top: null }); } if (diff[0] === -1) { type = 'remove'; removals += lines.length; - changeBlocks.push({type: type, lines: lines.length, start: total, height: null, top: null}); + changeBlocks.push({ type: type, lines: lines.length, start: total, height: null, top: null }); } if (diff[0] === 0) { unchanged += lines.length; } - lines.forEach((l: string) => diffLines.push({type: type, text: l})); + lines.forEach((l: string) => diffLines.push({ type: type, text: l })); total += lines.length; }); changeBlocks.forEach(b => { diff --git a/app/scripts/modules/core/src/utils/renderIfFeature.component.ts b/app/scripts/modules/core/src/utils/renderIfFeature.component.ts index 1741a999000..59c943aae86 100644 --- a/app/scripts/modules/core/src/utils/renderIfFeature.component.ts +++ b/app/scripts/modules/core/src/utils/renderIfFeature.component.ts @@ -12,7 +12,7 @@ class RenderIfFeatureController implements ng.IController { } class RenderIfFeatureComponent implements IComponentOptions { - public bindings: any = {feature: '@'}; + public bindings: any = { feature: '@' }; public controller: any = RenderIfFeatureController; public transclude = true; public template = ``; diff --git a/app/scripts/modules/core/src/utils/scrollTo/scrollTo.service.ts b/app/scripts/modules/core/src/utils/scrollTo/scrollTo.service.ts index 55767374d41..08d649eedad 100644 --- a/app/scripts/modules/core/src/utils/scrollTo/scrollTo.service.ts +++ b/app/scripts/modules/core/src/utils/scrollTo/scrollTo.service.ts @@ -16,7 +16,7 @@ export class ScrollToService { const content: JQuery = scrollableContainer ? elem.closest(scrollableContainer) : $('body'); if (content.length) { const top: number = content.scrollTop() + elem.offset().top - offset; - content.animate({scrollTop: top + 'px'}, 200); + content.animate({ scrollTop: top + 'px' }, 200); } } }, delay); diff --git a/app/scripts/modules/core/src/utils/timeFormatters.spec.ts b/app/scripts/modules/core/src/utils/timeFormatters.spec.ts index 8075087573a..bf6de5339a3 100644 --- a/app/scripts/modules/core/src/utils/timeFormatters.spec.ts +++ b/app/scripts/modules/core/src/utils/timeFormatters.spec.ts @@ -29,24 +29,24 @@ describe('Filter: timeFormatters', function() { it('returns nothing when invalid values are provided', function() { expect(filter()).toBe('-'); expect(filter({})).toBe('-'); - expect(filter({invalidField: 2})).toBe('-'); - expect(filter({h: 2})).toBe('-'); - expect(filter({h: 2, m: 1})).toBe('-'); - expect(filter({hours: 2, m: 1})).toBe('-'); - expect(filter({h: 2, minutes: 1})).toBe('-'); - expect(filter({hours: 'pasta', minutes: 1})).toBe('-'); - expect(filter({hours: 11, minutes: 'copy'})).toBe('-'); + expect(filter({ invalidField: 2 })).toBe('-'); + expect(filter({ h: 2 })).toBe('-'); + expect(filter({ h: 2, m: 1 })).toBe('-'); + expect(filter({ hours: 2, m: 1 })).toBe('-'); + expect(filter({ h: 2, minutes: 1 })).toBe('-'); + expect(filter({ hours: 'pasta', minutes: 1 })).toBe('-'); + expect(filter({ hours: 11, minutes: 'copy' })).toBe('-'); }); it('handles string inputs', function() { - expect(filter({hours: '10', minutes: '30'})).toBe('10:30'); - expect(filter({hours: '10', minutes: 30})).toBe('10:30'); - expect(filter({hours: 10, minutes: '30'})).toBe('10:30'); + expect(filter({ hours: '10', minutes: '30' })).toBe('10:30'); + expect(filter({ hours: '10', minutes: 30 })).toBe('10:30'); + expect(filter({ hours: 10, minutes: '30' })).toBe('10:30'); }); it('prefixes hours, minutes with zeros if necessary', function() { - expect(filter({hours: 1, minutes: 30})).toBe('01:30'); - expect(filter({hours: 10, minutes: 5})).toBe('10:05'); + expect(filter({ hours: 1, minutes: 30 })).toBe('01:30'); + expect(filter({ hours: 10, minutes: 5 })).toBe('10:05'); }); }); diff --git a/app/scripts/modules/core/src/utils/uuid.service.spec.ts b/app/scripts/modules/core/src/utils/uuid.service.spec.ts index 97a220efc29..554481b935d 100644 --- a/app/scripts/modules/core/src/utils/uuid.service.spec.ts +++ b/app/scripts/modules/core/src/utils/uuid.service.spec.ts @@ -1,5 +1,5 @@ -import {isString, range} from 'lodash'; -import {UUIDGenerator} from './uuid.service'; +import { isString, range } from 'lodash'; +import { UUIDGenerator } from './uuid.service'; describe('UUID Service', () => { diff --git a/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.spec.ts b/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.spec.ts index 6423f3df7f5..a885f65d992 100644 --- a/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.spec.ts +++ b/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.spec.ts @@ -1,6 +1,6 @@ -import {mock, IHttpBackendService} from 'angular'; -import {SETTINGS} from 'core/config/settings'; -import {WHATS_NEW_READ_SERVICE, WhatsNewReader, IGistApiResponse, IWhatsNewContents} from './whatsNew.read.service'; +import { mock, IHttpBackendService } from 'angular'; +import { SETTINGS } from 'core/config/settings'; +import { WHATS_NEW_READ_SERVICE, WhatsNewReader, IGistApiResponse, IWhatsNewContents } from './whatsNew.read.service'; describe('Service: whatsNew reader ', () => { let reader: WhatsNewReader; @@ -50,7 +50,7 @@ describe('Service: whatsNew reader ', () => { }); it('returns null when gist fetch fails', () => { - let result: IWhatsNewContents = {contents: 'fail', lastUpdated: 'never'}; + let result: IWhatsNewContents = { contents: 'fail', lastUpdated: 'never' }; $http.expectGET(url).respond(404, {}); reader.getWhatsNewContents().then(function(data) { result = data; diff --git a/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.ts b/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.ts index 8c23077701d..8e7ed952404 100644 --- a/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.ts +++ b/app/scripts/modules/core/src/whatsNew/whatsNew.read.service.ts @@ -1,5 +1,5 @@ -import {module, IHttpService, ILogService, IPromise, IHttpPromiseCallbackArg, IQService} from 'angular'; -import {SETTINGS} from 'core/config/settings'; +import { module, IHttpService, ILogService, IPromise, IHttpPromiseCallbackArg, IQService } from 'angular'; +import { SETTINGS } from 'core/config/settings'; export interface IGistApiResponse { // There are many other fields in the real response object. diff --git a/app/scripts/modules/core/src/widgets/notifier/notifier.service.ts b/app/scripts/modules/core/src/widgets/notifier/notifier.service.ts index 7a0adeb7a06..352d7249d3b 100644 --- a/app/scripts/modules/core/src/widgets/notifier/notifier.service.ts +++ b/app/scripts/modules/core/src/widgets/notifier/notifier.service.ts @@ -24,7 +24,7 @@ export class NotifierService { } public clear(key: string): void { - this.stream.next({action: 'remove', key}); + this.stream.next({ action: 'remove', key }); } } diff --git a/app/scripts/modules/core/src/widgets/widgets.module.ts b/app/scripts/modules/core/src/widgets/widgets.module.ts index 181e5cf13aa..5f0de0df5df 100644 --- a/app/scripts/modules/core/src/widgets/widgets.module.ts +++ b/app/scripts/modules/core/src/widgets/widgets.module.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; +import { module } from 'angular'; -import {SPINNER_WRAPPER} from './Spinner'; +import { SPINNER_WRAPPER } from './Spinner'; export const WIDGETS_MODULE = 'spinnaker.core.widgets'; module(WIDGETS_MODULE, [ diff --git a/app/scripts/modules/docker/src/image/docker.image.reader.service.ts b/app/scripts/modules/docker/src/image/docker.image.reader.service.ts index db05e6260cc..52262ac7f1e 100644 --- a/app/scripts/modules/docker/src/image/docker.image.reader.service.ts +++ b/app/scripts/modules/docker/src/image/docker.image.reader.service.ts @@ -28,7 +28,7 @@ export class DockerImageReaderService implements IImageReader { return this.API.all('images').one(credentials) .one(region) .one(imageName) - .withParams({provider: 'docker'}) + .withParams({ provider: 'docker' }) .get() .then((results: IDockerImage[]) => results && results.length ? results[0] : null) .catch((): IDockerImage => null); diff --git a/app/scripts/modules/google/src/address/address.reader.ts b/app/scripts/modules/google/src/address/address.reader.ts index 3a43915e6be..ce889317ca5 100644 --- a/app/scripts/modules/google/src/address/address.reader.ts +++ b/app/scripts/modules/google/src/address/address.reader.ts @@ -40,7 +40,7 @@ class GceAddressReader { return this.listAddresses(null /* region */).then(addresses => addresses.filter(address => address.region === region)); } else { return this.searchService - .search({q: '', type: 'addresses'}, this.infrastructureCaches.get('addresses')) + .search({ q: '', type: 'addresses' }, this.infrastructureCaches.get('addresses')) .then((searchResults: ISearchResults) => { if (searchResults && searchResults.results) { return searchResults.results diff --git a/app/scripts/modules/google/src/certificate/certificate.reader.ts b/app/scripts/modules/google/src/certificate/certificate.reader.ts index 246a0d5e4a1..9fc52fede92 100644 --- a/app/scripts/modules/google/src/certificate/certificate.reader.ts +++ b/app/scripts/modules/google/src/certificate/certificate.reader.ts @@ -20,7 +20,7 @@ export class GceCertificateReader { public listCertificates(): IPromise { return this.searchService - .search({q: '', type: 'sslCertificates'}, this.infrastructureCaches.get('certificates')) + .search({ q: '', type: 'sslCertificates' }, this.infrastructureCaches.get('certificates')) .then((searchResults: ISearchResults) => { if (searchResults && searchResults.results) { return searchResults.results.filter(certificate => certificate.provider === 'gce'); diff --git a/app/scripts/modules/google/src/healthCheck/healthCheck.read.service.ts b/app/scripts/modules/google/src/healthCheck/healthCheck.read.service.ts index e59d4fec8dc..f943c61a8fb 100644 --- a/app/scripts/modules/google/src/healthCheck/healthCheck.read.service.ts +++ b/app/scripts/modules/google/src/healthCheck/healthCheck.read.service.ts @@ -28,7 +28,7 @@ export class GceHealthCheckReader { return this.listHealthChecks().then(healthChecks => healthChecks.filter(healthCheck => healthCheck.healthCheckType === type)); } else { return this.searchService - .search({q: '', type: 'healthChecks'}, this.infrastructureCaches.get('healthChecks')) + .search({ q: '', type: 'healthChecks' }, this.infrastructureCaches.get('healthChecks')) .then((searchResults: ISearchResults) => { if (searchResults && searchResults.results) { const healthChecks = searchResults.results.filter(result => result.provider === 'gce') diff --git a/app/scripts/modules/google/src/help/gce.help.ts b/app/scripts/modules/google/src/help/gce.help.ts index ab8181089c7..f88deb29fd2 100644 --- a/app/scripts/modules/google/src/help/gce.help.ts +++ b/app/scripts/modules/google/src/help/gce.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from '@spinnaker/core'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from '@spinnaker/core'; const helpContents: {[key: string]: string} = { 'gce.httpLoadBalancer.certificate': 'The name of an SSL certificate. If specified, Spinnaker will create an HTTPS load balancer.', diff --git a/app/scripts/modules/google/src/loadBalancer/configure/choice/loadBalancerTypeToWizardMap.constant.ts b/app/scripts/modules/google/src/loadBalancer/configure/choice/loadBalancerTypeToWizardMap.constant.ts index a0b1650cd21..d363458581f 100644 --- a/app/scripts/modules/google/src/loadBalancer/configure/choice/loadBalancerTypeToWizardMap.constant.ts +++ b/app/scripts/modules/google/src/loadBalancer/configure/choice/loadBalancerTypeToWizardMap.constant.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; export interface IGceLoadBalancerWizardConfig { label: string; diff --git a/app/scripts/modules/google/src/loadBalancer/configure/common/addressSelector.component.ts b/app/scripts/modules/google/src/loadBalancer/configure/common/addressSelector.component.ts index 5b6c1d420d2..3cea508365c 100644 --- a/app/scripts/modules/google/src/loadBalancer/configure/common/addressSelector.component.ts +++ b/app/scripts/modules/google/src/loadBalancer/configure/common/addressSelector.component.ts @@ -1,5 +1,5 @@ -import {module, IComponentOptions, IController} from 'angular'; -import {IGceAddress} from 'google/address/address.reader'; +import { module, IComponentOptions, IController } from 'angular'; +import { IGceAddress } from 'google/address/address.reader'; class GceAddressSelectorCtrl implements IController { public selectedAddress: IGceAddress; @@ -12,7 +12,7 @@ class GceAddressSelectorCtrl implements IController { public $onInit(): void { this.selectedAddress = this.addressList.find(address => address.address === this.initialIpAddress); if (!this.selectedAddress) { - this.selectedAddress = {address: this.initialIpAddress, account: this.account}; + this.selectedAddress = { address: this.initialIpAddress, account: this.account }; } } } diff --git a/app/scripts/modules/google/src/loadBalancer/configure/internal/gceCreateInternalLoadBalancer.controller.ts b/app/scripts/modules/google/src/loadBalancer/configure/internal/gceCreateInternalLoadBalancer.controller.ts index c46bb78dd2c..20a8d732f50 100644 --- a/app/scripts/modules/google/src/loadBalancer/configure/internal/gceCreateInternalLoadBalancer.controller.ts +++ b/app/scripts/modules/google/src/loadBalancer/configure/internal/gceCreateInternalLoadBalancer.controller.ts @@ -143,11 +143,11 @@ class InternalLoadBalancerCtrl extends CommonGceLoadBalancerCtrl implements ICon this.accountUpdated(); - this.wizardSubFormValidation.config({scope: this.$scope, form: 'form'}) - .register({page: 'location', subForm: 'locationForm'}) - .register({page: 'listener', subForm: 'listenerForm'}) - .register({page: 'healthCheck', subForm: 'healthCheckForm'}) - .register({page: 'advancedSettings', subForm: 'advancedSettingsForm'}); + this.wizardSubFormValidation.config({ scope: this.$scope, form: 'form' }) + .register({ page: 'location', subForm: 'locationForm' }) + .register({ page: 'listener', subForm: 'listenerForm' }) + .register({ page: 'healthCheck', subForm: 'healthCheckForm' }) + .register({ page: 'advancedSettings', subForm: 'advancedSettingsForm' }); this.taskMonitor = this.taskMonitorBuilder.buildTaskMonitor({ application: this.application, diff --git a/app/scripts/modules/google/src/loadBalancer/configure/ssl/gceCreateSslLoadBalancer.controller.ts b/app/scripts/modules/google/src/loadBalancer/configure/ssl/gceCreateSslLoadBalancer.controller.ts index dde3088de7b..ff03a7fef33 100644 --- a/app/scripts/modules/google/src/loadBalancer/configure/ssl/gceCreateSslLoadBalancer.controller.ts +++ b/app/scripts/modules/google/src/loadBalancer/configure/ssl/gceCreateSslLoadBalancer.controller.ts @@ -143,11 +143,11 @@ class SslLoadBalancerCtrl extends CommonGceLoadBalancerCtrl implements IControll this.accountUpdated(); - this.wizardSubFormValidation.config({scope: this.$scope, form: 'form'}) - .register({page: 'location', subForm: 'locationForm'}) - .register({page: 'listener', subForm: 'listenerForm'}) - .register({page: 'healthCheck', subForm: 'healthCheckForm'}) - .register({page: 'advancedSettings', subForm: 'advancedSettingsForm'}); + this.wizardSubFormValidation.config({ scope: this.$scope, form: 'form' }) + .register({ page: 'location', subForm: 'locationForm' }) + .register({ page: 'listener', subForm: 'listenerForm' }) + .register({ page: 'healthCheck', subForm: 'healthCheckForm' }) + .register({ page: 'advancedSettings', subForm: 'advancedSettingsForm' }); this.taskMonitor = this.taskMonitorBuilder.buildTaskMonitor({ application: this.application, diff --git a/app/scripts/modules/google/src/loadBalancer/configure/tcp/gceCreateTcpLoadBalancer.controller.ts b/app/scripts/modules/google/src/loadBalancer/configure/tcp/gceCreateTcpLoadBalancer.controller.ts index 10e062db20c..dfc16cd88f6 100644 --- a/app/scripts/modules/google/src/loadBalancer/configure/tcp/gceCreateTcpLoadBalancer.controller.ts +++ b/app/scripts/modules/google/src/loadBalancer/configure/tcp/gceCreateTcpLoadBalancer.controller.ts @@ -140,11 +140,11 @@ class TcpLoadBalancerCtrl extends CommonGceLoadBalancerCtrl implements ng.ICompo this.accountUpdated(); - this.wizardSubFormValidation.config({scope: this.$scope, form: 'form'}) - .register({page: 'location', subForm: 'locationForm'}) - .register({page: 'listener', subForm: 'listenerForm'}) - .register({page: 'healthCheck', subForm: 'healthCheckForm'}) - .register({page: 'advancedSettings', subForm: 'advancedSettingsForm'}); + this.wizardSubFormValidation.config({ scope: this.$scope, form: 'form' }) + .register({ page: 'location', subForm: 'locationForm' }) + .register({ page: 'listener', subForm: 'listenerForm' }) + .register({ page: 'healthCheck', subForm: 'healthCheckForm' }) + .register({ page: 'advancedSettings', subForm: 'advancedSettingsForm' }); this.taskMonitor = this.taskMonitorBuilder.buildTaskMonitor({ application: this.application, diff --git a/app/scripts/modules/google/src/loadBalancer/details/backendService/backendService.component.ts b/app/scripts/modules/google/src/loadBalancer/details/backendService/backendService.component.ts index c058f8e187e..818d6e1b84c 100644 --- a/app/scripts/modules/google/src/loadBalancer/details/backendService/backendService.component.ts +++ b/app/scripts/modules/google/src/loadBalancer/details/backendService/backendService.component.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; class GceBackendServiceDetailsComponent implements ng.IComponentOptions { public bindings: any = { diff --git a/app/scripts/modules/google/src/loadBalancer/details/backendService/sessionAffinity.filter.ts b/app/scripts/modules/google/src/loadBalancer/details/backendService/sessionAffinity.filter.ts index e54cd850d17..9240e6b8dce 100644 --- a/app/scripts/modules/google/src/loadBalancer/details/backendService/sessionAffinity.filter.ts +++ b/app/scripts/modules/google/src/loadBalancer/details/backendService/sessionAffinity.filter.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {sessionAffinityModelToViewMap} from '../../configure/common/sessionAffinityNameMaps'; +import { module } from 'angular'; +import { sessionAffinityModelToViewMap } from '../../configure/common/sessionAffinityNameMaps'; function gceSessionAffinityFilter() { return function (modelValue: string): string { diff --git a/app/scripts/modules/google/src/loadBalancer/httpLoadBalancerUtils.service.ts b/app/scripts/modules/google/src/loadBalancer/httpLoadBalancerUtils.service.ts index e032cc32fb6..5da31114f67 100644 --- a/app/scripts/modules/google/src/loadBalancer/httpLoadBalancerUtils.service.ts +++ b/app/scripts/modules/google/src/loadBalancer/httpLoadBalancerUtils.service.ts @@ -1,6 +1,6 @@ -import {module} from 'angular'; -import {uniq} from 'lodash'; -import {IGceLoadBalancer, IGceHttpLoadBalancer} from 'google/domain/loadBalancer'; +import { module } from 'angular'; +import { uniq } from 'lodash'; +import { IGceLoadBalancer, IGceHttpLoadBalancer } from 'google/domain/loadBalancer'; export class GceHttpLoadBalancerUtils { diff --git a/app/scripts/modules/google/src/loadBalancer/loadBalancer.setTransformer.ts b/app/scripts/modules/google/src/loadBalancer/loadBalancer.setTransformer.ts index e20185a627c..b3698c4f978 100644 --- a/app/scripts/modules/google/src/loadBalancer/loadBalancer.setTransformer.ts +++ b/app/scripts/modules/google/src/loadBalancer/loadBalancer.setTransformer.ts @@ -1,8 +1,8 @@ import { module } from 'angular'; import { cloneDeep, groupBy, map, partition } from 'lodash'; -import {GCE_HTTP_LOAD_BALANCER_UTILS, GceHttpLoadBalancerUtils} from 'google/loadBalancer/httpLoadBalancerUtils.service'; -import {IGceLoadBalancer, IGceHttpLoadBalancer} from 'google/domain/loadBalancer'; +import { GCE_HTTP_LOAD_BALANCER_UTILS, GceHttpLoadBalancerUtils } from 'google/loadBalancer/httpLoadBalancerUtils.service'; +import { IGceLoadBalancer, IGceHttpLoadBalancer } from 'google/domain/loadBalancer'; export class GceLoadBalancerSetTransformer { diff --git a/app/scripts/modules/google/src/securityGroup/securityGroupHelpText.service.spec.ts b/app/scripts/modules/google/src/securityGroup/securityGroupHelpText.service.spec.ts index 5b0c252bf06..af729d78160 100644 --- a/app/scripts/modules/google/src/securityGroup/securityGroupHelpText.service.spec.ts +++ b/app/scripts/modules/google/src/securityGroup/securityGroupHelpText.service.spec.ts @@ -1,5 +1,5 @@ -import {mock} from 'angular'; -import {GCE_SECURITY_GROUP_HELP_TEXT_SERVICE, GceSecurityGroupHelpTextService} from './securityGroupHelpText.service'; +import { mock } from 'angular'; +import { GCE_SECURITY_GROUP_HELP_TEXT_SERVICE, GceSecurityGroupHelpTextService } from './securityGroupHelpText.service'; describe('Service: gceSecurityGroupHelpTextService', () => { diff --git a/app/scripts/modules/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts b/app/scripts/modules/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts index efc2e7fecfb..b46595ef287 100644 --- a/app/scripts/modules/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts +++ b/app/scripts/modules/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts @@ -21,7 +21,7 @@ class GceDiskConfigurerController implements IComponentController { this.setPersistentDisks(); if (this.getLocalSSDDisks().length && !get(this.command, 'viewState.instanceTypeDetails.storage.localSSDSupported')) { - this.updateDisks({disks: this.sortDisks(this.getPersistentDisks())}); + this.updateDisks({ disks: this.sortDisks(this.getPersistentDisks()) }); } } @@ -41,13 +41,13 @@ class GceDiskConfigurerController implements IComponentController { } disks = this.sortDisks(disks); - this.updateDisks({disks}); + this.updateDisks({ disks }); } public handlePersistentDiskChange(): void { let disks = this.persistentDisks.concat(this.getLocalSSDDisks()); disks = this.sortDisks(disks); - this.updateDisks({disks}); + this.updateDisks({ disks }); } public addPersistentDisk(): void { diff --git a/app/scripts/modules/google/src/serverGroup/configure/wizard/autoHealingPolicy/autoHealingPolicySelector.component.ts b/app/scripts/modules/google/src/serverGroup/configure/wizard/autoHealingPolicy/autoHealingPolicySelector.component.ts index 2e938964d85..523022c9fca 100644 --- a/app/scripts/modules/google/src/serverGroup/configure/wizard/autoHealingPolicy/autoHealingPolicySelector.component.ts +++ b/app/scripts/modules/google/src/serverGroup/configure/wizard/autoHealingPolicy/autoHealingPolicySelector.component.ts @@ -12,19 +12,19 @@ class GceAutoHealingPolicySelector implements IController { public $onInit(): void { if (this.autoHealingPolicy && this.autoHealingPolicy.maxUnavailable) { if (typeof this.autoHealingPolicy.maxUnavailable.fixed === 'number') { - this.viewState = {maxUnavailableMetric: 'fixed'}; + this.viewState = { maxUnavailableMetric: 'fixed' }; } else if (typeof this.autoHealingPolicy.maxUnavailable.percent === 'number') { - this.viewState = {maxUnavailableMetric: 'percent'}; + this.viewState = { maxUnavailableMetric: 'percent' }; } } if (!this.autoHealingPolicy) { - this.setAutoHealingPolicy({autoHealingPolicy: {initialDelaySec: 300}}); + this.setAutoHealingPolicy({ autoHealingPolicy: { initialDelaySec: 300 } }); } } public $onDestroy(): void { - this.setAutoHealingPolicy({autoHealingPolicy: null}); + this.setAutoHealingPolicy({ autoHealingPolicy: null }); } public manageMaxUnavailableMetric(selectedMetric: string): void { diff --git a/app/scripts/modules/google/src/serverGroup/configure/wizard/customInstance/CustomInstanceConfigurer.tsx b/app/scripts/modules/google/src/serverGroup/configure/wizard/customInstance/CustomInstanceConfigurer.tsx index f010c149c70..f55e0307989 100644 --- a/app/scripts/modules/google/src/serverGroup/configure/wizard/customInstance/CustomInstanceConfigurer.tsx +++ b/app/scripts/modules/google/src/serverGroup/configure/wizard/customInstance/CustomInstanceConfigurer.tsx @@ -20,8 +20,8 @@ export interface ICustomInstanceConfigurerProps { @BindAll() export class CustomInstanceConfigurer extends React.Component { public render() { - const vCpuOptions: Select.Option[] = (this.props.vCpuList || []).map(vCpu => ({label: vCpu + '', value: vCpu})); - const memoryOptions: Select.Option[] = (this.props.memoryList || []).map(memory => ({label: memory + '', value: memory})); + const vCpuOptions: Select.Option[] = (this.props.vCpuList || []).map(vCpu => ({ label: vCpu + '', value: vCpu })); + const memoryOptions: Select.Option[] = (this.props.memoryList || []).map(memory => ({ label: memory + '', value: memory })); const selectedVCpuCountLabel = this.props.selectedVCpuCount ? this.props.selectedVCpuCount + '' : null; const selectedMemoryLabel = this.props.selectedMemory ? this.props.selectedMemory + '' : null; @@ -36,12 +36,12 @@ export class CustomInstanceConfigurer extends React.Component
  • -
    +
    Memory (Gb) @@ -50,7 +50,7 @@ export class CustomInstanceConfigurer extends React.Component
    @@ -61,11 +61,11 @@ export class CustomInstanceConfigurer extends React.Component Health Check diff --git a/app/scripts/modules/google/src/serverGroup/details/autoHealingPolicy/modal/upsertAutoHealingPolicy.modal.controller.ts b/app/scripts/modules/google/src/serverGroup/details/autoHealingPolicy/modal/upsertAutoHealingPolicy.modal.controller.ts index 0721148101b..e768d6537b9 100644 --- a/app/scripts/modules/google/src/serverGroup/details/autoHealingPolicy/modal/upsertAutoHealingPolicy.modal.controller.ts +++ b/app/scripts/modules/google/src/serverGroup/details/autoHealingPolicy/modal/upsertAutoHealingPolicy.modal.controller.ts @@ -46,7 +46,7 @@ class GceUpsertAutoHealingPolicyModalCtrl implements IController { this.gceHealthCheckReader.listHealthChecks('HTTP') .then((healthChecks) => { this.httpHealthChecks = chain(healthChecks) - .filter({account: this.serverGroup.account}) + .filter({ account: this.serverGroup.account }) .map('name') .value() as string[]; }); diff --git a/app/scripts/modules/kubernetes/common/keyValueDetails.component.ts b/app/scripts/modules/kubernetes/common/keyValueDetails.component.ts index 6c7aa0864ab..5da34acd658 100644 --- a/app/scripts/modules/kubernetes/common/keyValueDetails.component.ts +++ b/app/scripts/modules/kubernetes/common/keyValueDetails.component.ts @@ -1,4 +1,4 @@ -import {module} from 'angular'; +import { module } from 'angular'; class KubernetesKeyValueDetailsComponent implements ng.IComponentOptions { public bindings: any = { diff --git a/app/scripts/modules/kubernetes/container/lifecycleHook.component.ts b/app/scripts/modules/kubernetes/container/lifecycleHook.component.ts index df8db496e97..7c44cb26164 100644 --- a/app/scripts/modules/kubernetes/container/lifecycleHook.component.ts +++ b/app/scripts/modules/kubernetes/container/lifecycleHook.component.ts @@ -43,7 +43,7 @@ class KubernetesLifecycleHookConfigurerCtrl implements IController { } else { this.handler = null; this.execActionCommandsViewValue = null; - this.onHandlerChange({handler: null}); + this.onHandlerChange({ handler: null }); } } @@ -63,11 +63,11 @@ class KubernetesLifecycleHookConfigurerCtrl implements IController { public onHandlerTypeChange(): void { switch (this.handler.type) { case 'EXEC': - this.handler.execAction = {commands: []}; + this.handler.execAction = { commands: [] }; delete this.handler.httpGetAction; break; case 'HTTP': - this.handler.httpGetAction = {path: '/', port: null, host: null, uriScheme: 'HTTP', httpHeaders: []}; + this.handler.httpGetAction = { path: '/', port: null, host: null, uriScheme: 'HTTP', httpHeaders: [] }; delete this.handler.execAction; delete this.execActionCommandsViewValue; break; @@ -75,7 +75,7 @@ class KubernetesLifecycleHookConfigurerCtrl implements IController { } public addHttpHeader(): void { - this.handler.httpGetAction.httpHeaders.push({name: '', value: ''}); + this.handler.httpGetAction.httpHeaders.push({ name: '', value: '' }); } public deleteHttpHeader(index: number): void { @@ -87,8 +87,8 @@ class KubernetesLifecycleHookConfigurerCtrl implements IController { private initializeHandler(): void { if (!this.handler) { - this.handler = {type: 'EXEC', execAction: {commands: []}}; - this.onHandlerChange({handler: this.handler}); + this.handler = { type: 'EXEC', execAction: { commands: [] } }; + this.onHandlerChange({ handler: this.handler }); } else if (this.handler.type === 'EXEC') { this.execActionCommandsViewValue = this.handler.execAction.commands.join(' '); } diff --git a/app/scripts/modules/kubernetes/container/securityContext/seLinuxOptionsSelector.component.ts b/app/scripts/modules/kubernetes/container/securityContext/seLinuxOptionsSelector.component.ts index a7b5447e67f..bba5b6a4918 100644 --- a/app/scripts/modules/kubernetes/container/securityContext/seLinuxOptionsSelector.component.ts +++ b/app/scripts/modules/kubernetes/container/securityContext/seLinuxOptionsSelector.component.ts @@ -1,4 +1,4 @@ -import {IController, IComponentOptions, module} from 'angular'; +import { IController, IComponentOptions, module } from 'angular'; interface ISeLinuxField { label: string; diff --git a/app/scripts/modules/kubernetes/container/securityContext/securityContextSelector.component.ts b/app/scripts/modules/kubernetes/container/securityContext/securityContextSelector.component.ts index 6eaa07da636..f0991b19725 100644 --- a/app/scripts/modules/kubernetes/container/securityContext/securityContextSelector.component.ts +++ b/app/scripts/modules/kubernetes/container/securityContext/securityContextSelector.component.ts @@ -1,8 +1,8 @@ -import { IController, IComponentOptions, module} from 'angular'; +import { IController, IComponentOptions, module } from 'angular'; import './securityContextSelector.component.less'; -import {KUBERNETES_SE_LINUX_OPTIONS_SELECTOR} from './seLinuxOptionsSelector.component'; -import {KUBERNETES_CAPABILITIES_SELECTOR} from './capabilitiesSelector.component'; +import { KUBERNETES_SE_LINUX_OPTIONS_SELECTOR } from './seLinuxOptionsSelector.component'; +import { KUBERNETES_CAPABILITIES_SELECTOR } from './capabilitiesSelector.component'; interface ISecurityContextField { label: string; diff --git a/app/scripts/modules/kubernetes/help/kubernetes.help.ts b/app/scripts/modules/kubernetes/help/kubernetes.help.ts index 6687a307910..1fff8a8f12e 100644 --- a/app/scripts/modules/kubernetes/help/kubernetes.help.ts +++ b/app/scripts/modules/kubernetes/help/kubernetes.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from '@spinnaker/core'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from '@spinnaker/core'; const helpContents: {[key: string]: string} = { 'kubernetes.serverGroup.stack': '(Optional) One of the core naming components of a cluster, used to create vertical stacks of dependent services for integration testing.', diff --git a/app/scripts/modules/kubernetes/serverGroup/details/lifecycleHookDetails.component.ts b/app/scripts/modules/kubernetes/serverGroup/details/lifecycleHookDetails.component.ts index d1ad3882021..4e3e22b5e69 100644 --- a/app/scripts/modules/kubernetes/serverGroup/details/lifecycleHookDetails.component.ts +++ b/app/scripts/modules/kubernetes/serverGroup/details/lifecycleHookDetails.component.ts @@ -1,7 +1,7 @@ -import {module} from 'angular'; +import { module } from 'angular'; class KubernetesLifecycleHookDetails implements ng.IComponentOptions { - public bindings: any = {handler: '<'}; + public bindings: any = { handler: '<' }; public template = `
    Type
    {{$ctrl.handler.type === 'EXEC' ? 'exec' : 'httpGet'}}
    diff --git a/app/scripts/modules/kubernetes/v2/manifest/wizard/basicSettings.component.ts b/app/scripts/modules/kubernetes/v2/manifest/wizard/basicSettings.component.ts index 56dc7d4aaf1..bd9c71e13ca 100644 --- a/app/scripts/modules/kubernetes/v2/manifest/wizard/basicSettings.component.ts +++ b/app/scripts/modules/kubernetes/v2/manifest/wizard/basicSettings.component.ts @@ -7,7 +7,7 @@ class KubernetesManifestBasicSettingsCtrl implements IController { } class KubernetesManifestBasicSettingsComponent implements IComponentOptions { - public bindings: any = {command: '='}; + public bindings: any = { command: '=' }; public controller: any = KubernetesManifestBasicSettingsCtrl; public controllerAs = 'ctrl'; public template = ` diff --git a/app/scripts/modules/kubernetes/v2/manifest/wizard/manifestEntry.component.ts b/app/scripts/modules/kubernetes/v2/manifest/wizard/manifestEntry.component.ts index c278fc33020..c27fd67413c 100644 --- a/app/scripts/modules/kubernetes/v2/manifest/wizard/manifestEntry.component.ts +++ b/app/scripts/modules/kubernetes/v2/manifest/wizard/manifestEntry.component.ts @@ -9,7 +9,7 @@ class KubernetesManifestCtrl implements IController { } class KubernetesManifestEntryComponent implements IComponentOptions { - public bindings: any = {command: '='}; + public bindings: any = { command: '=' }; public controller: any = KubernetesManifestCtrl; public controllerAs = 'ctrl'; public template = ` diff --git a/app/scripts/modules/openstack/help/openstack.help.ts b/app/scripts/modules/openstack/help/openstack.help.ts index 546e32c69f6..a86d361753a 100644 --- a/app/scripts/modules/openstack/help/openstack.help.ts +++ b/app/scripts/modules/openstack/help/openstack.help.ts @@ -1,5 +1,5 @@ -import {module} from 'angular'; -import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from '@spinnaker/core'; +import { module } from 'angular'; +import { HELP_CONTENTS_REGISTRY, HelpContentsRegistry } from '@spinnaker/core'; const helpContents: {[key: string]: string} = { 'openstack.loadBalancer.detail': '(Optional) A string of free-form alphanumeric characters; by convention, we recommend using "frontend".', diff --git a/package.json b/package.json index bab0ba98bac..6ca8cd3868d 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,7 @@ "style-loader": "^0.17.0", "ts-loader": "^2.3.4", "tslint": "^5.7.0", + "tslint-eslint-rules": "^4.1.1", "tslint-loader": "^3.4.3", "tslint-react": "^3.2.0", "typescript": "^2.5.2", diff --git a/tslint.json b/tslint.json index 0d77e0bda03..d301d3bb1bd 100644 --- a/tslint.json +++ b/tslint.json @@ -1,5 +1,5 @@ { - "extends": ["tslint-react"], + "extends": ["tslint-eslint-rules", "tslint-react"], "rules": { "class-name": true, "comment-format": [ @@ -46,6 +46,7 @@ "no-unused-expression": [true, "allow-fast-null-checks"], "no-use-before-declare": false, "no-var-keyword": true, + "object-curly-spacing": "always", "object-literal-sort-keys": false, "one-line": [ true, diff --git a/yarn.lock b/yarn.lock index d4a006e987f..0b1e87e971e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2293,6 +2293,13 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" +doctrine@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523" + dependencies: + esutils "^1.1.6" + isarray "0.0.1" + doctrine@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" @@ -2723,6 +2730,10 @@ estree-walker@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa" +esutils@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375" + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -6665,10 +6676,22 @@ ts-loader@^2.3.4: loader-utils "^1.0.2" semver "^5.0.1" +tslib@^1.0.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6" + tslib@^1.6.1, tslib@^1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.7.1.tgz#bc8004164691923a79fe8378bbeb3da2017538ec" +tslint-eslint-rules@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-4.1.1.tgz#7c30e7882f26bc276bff91d2384975c69daf88ba" + dependencies: + doctrine "^0.7.2" + tslib "^1.0.0" + tsutils "^1.4.0" + tslint-loader@^3.4.3: version "3.5.3" resolved "https://registry.yarnpkg.com/tslint-loader/-/tslint-loader-3.5.3.tgz#343f74122d94f356b689457d3f59f64a69ab606f" @@ -6700,6 +6723,10 @@ tslint@^5.7.0: tslib "^1.7.1" tsutils "^2.8.1" +tsutils@^1.4.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" + tsutils@^2.8.0, tsutils@^2.8.1: version "2.8.2" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.8.2.tgz#2c1486ba431260845b0ac6f902afd9d708a8ea6a"