Skip to content

Commit

Permalink
Just Use Prettier™
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and Justin Reynolds committed Apr 10, 2018
1 parent 388f9d6 commit 532ab77
Show file tree
Hide file tree
Showing 1,707 changed files with 40,308 additions and 33,804 deletions.
2 changes: 1 addition & 1 deletion app/scripts/modules/amazon/src/aws.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module(AMAZON_MODULE, [
targetGroupDetailsTemplateUrl: require('./loadBalancer/details/targetGroupDetails.html'),
targetGroupDetailsController: 'awsTargetGroupDetailsCtrl',
ClusterContainer: AmazonLoadBalancerClusterContainer,
LoadBalancersTag: AmazonLoadBalancersTag
LoadBalancersTag: AmazonLoadBalancersTag,
},
securityGroup: {
transformer: 'awsSecurityGroupTransformer',
Expand Down
4 changes: 3 additions & 1 deletion app/scripts/modules/amazon/src/aws.settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export interface IAWSProviderSettings extends IProviderSettings {
disableSpotPricing?: boolean;
}

export const AWSProviderSettings: IAWSProviderSettings = <IAWSProviderSettings>SETTINGS.providers.aws || { defaults: {} };
export const AWSProviderSettings: IAWSProviderSettings = <IAWSProviderSettings>SETTINGS.providers.aws || {
defaults: {},
};
if (AWSProviderSettings) {
AWSProviderSettings.resetToOriginal = SETTINGS.resetProvider('aws');
}
16 changes: 7 additions & 9 deletions app/scripts/modules/amazon/src/cache/cacheConfigurer.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ const angular = require('angular');

import { VPC_READ_SERVICE } from '../vpc/vpc.read.service';

module.exports = angular.module('spinnaker.amazon.cache.initializer', [
VPC_READ_SERVICE,
])
.factory('awsCacheConfigurer', function ($q, subnetReader, vpcReader) {

module.exports = angular
.module('spinnaker.amazon.cache.initializer', [VPC_READ_SERVICE])
.factory('awsCacheConfigurer', function($q, subnetReader, vpcReader) {
let config = Object.create(null);

// cache no longer used; version incremented and retained to clear any existing caches
// remove this cache entry any time after June 2018
config.instanceTypes = {
version: 3
version: 3,
};

// cache no longer used; version incremented and retained to clear any existing caches
Expand All @@ -25,13 +23,13 @@ module.exports = angular.module('spinnaker.amazon.cache.initializer', [

config.subnets = {
version: 2,
initializers: [() => subnetReader.listSubnets() ],
initializers: [() => subnetReader.listSubnets()],
};

config.networks = {
version: 2,
initializers: [() => vpcReader.listVpcs() ],
onReset: [() => vpcReader.resetCache() ],
initializers: [() => vpcReader.listVpcs()],
onReset: [() => vpcReader.resetCache()],
};

return config;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
import { module, IPromise } from 'angular';
import { groupBy, sortBy } from 'lodash';

import { ACCOUNT_SERVICE, AccountService, ICertificate, CERTIFICATE_READ_SERVICE, CertificateReader } from '@spinnaker/core';
import {
ACCOUNT_SERVICE,
AccountService,
ICertificate,
CERTIFICATE_READ_SERVICE,
CertificateReader,
} from '@spinnaker/core';

export interface IAmazonCertificate extends ICertificate {
arn: string;
uploadDate: number;
}

export class AmazonCertificateReader {

constructor(private certificateReader: CertificateReader,
private accountService: AccountService) {
constructor(private certificateReader: CertificateReader, private accountService: AccountService) {
'ngInject';
}

public listCertificates(): IPromise<{ [accountId: number]: IAmazonCertificate[] }> {
return this.certificateReader.listCertificatesByProvider('aws').then((certificates: IAmazonCertificate[]) => {
// This account grouping should really go into clouddriver but since it's not, put it here for now.
return this.accountService.getAllAccountDetailsForProvider('aws').then((allAccountDetails) => {
const accountIdToName = allAccountDetails.reduce((acc, accountDetails) => {
acc[accountDetails.accountId] = accountDetails.name;
return acc;
}, {} as {[id: string]: string});
return this.accountService.getAllAccountDetailsForProvider('aws').then(allAccountDetails => {
const accountIdToName = allAccountDetails.reduce(
(acc, accountDetails) => {
acc[accountDetails.accountId] = accountDetails.name;
return acc;
},
{} as { [id: string]: string },
);

const sortedCertificates = sortBy(certificates, 'serverCertificateName');
return groupBy(sortedCertificates, (cert) => {
return groupBy(sortedCertificates, cert => {
const [, , , , accountId] = cert.arn.split(':');
return accountIdToName[accountId] || 'unknown';
});
Expand All @@ -35,7 +42,7 @@ export class AmazonCertificateReader {
}

export const AMAZON_CERTIFICATE_READ_SERVICE = 'spinnaker.amazon.certificate.read.service';
module(AMAZON_CERTIFICATE_READ_SERVICE, [
ACCOUNT_SERVICE,
CERTIFICATE_READ_SERVICE
]).service('amazonCertificateReader', AmazonCertificateReader);
module(AMAZON_CERTIFICATE_READ_SERVICE, [ACCOUNT_SERVICE, CERTIFICATE_READ_SERVICE]).service(
'amazonCertificateReader',
AmazonCertificateReader,
);
15 changes: 12 additions & 3 deletions app/scripts/modules/amazon/src/common/AwsModalFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,20 @@ export class AwsModalFooter extends React.Component<IAwsModalFooterProps, IAwsMo
return (
<ModalFooter>
<form onSubmit={handleSubmit}>
{requireVerification && <UserVerification expectedValue={account} onValidChange={this.handleVerification}/>}
{requireVerification && <UserVerification expectedValue={account} onValidChange={this.handleVerification} />}
</form>

<button className="btn btn-default" onClick={onCancel}>Cancel</button>
<button type="submit" className="btn btn-primary" onClick={onSubmit} disabled={requireVerification && !verified}>Submit</button>
<button className="btn btn-default" onClick={onCancel}>
Cancel
</button>
<button
type="submit"
className="btn btn-primary"
onClick={onSubmit}
disabled={requireVerification && !verified}
>
Submit
</button>
</ModalFooter>
);
}
Expand Down
4 changes: 1 addition & 3 deletions app/scripts/modules/amazon/src/common/common.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ import { module } from 'angular';
import { AWS_FOOTER_COMPONENT } from './footer.component';

export const COMMON_MODULE = 'spinnaker.amazon.common';
module(COMMON_MODULE, [
AWS_FOOTER_COMPONENT,
]);
module(COMMON_MODULE, [AWS_FOOTER_COMPONENT]);
2 changes: 1 addition & 1 deletion app/scripts/modules/amazon/src/common/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const footerComponent: IComponentOptions = {
</button>
</div>
`,
controller: () => {}
controller: () => {},
};

export const AWS_FOOTER_COMPONENT = 'spinnaker.amazon.footer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ DeploymentStrategyRegistry.registerStrategy({
the principles of immutable infrastructure - but may be necessary in some cases.`,
key: 'rollingpush',
providerRestricted: true,
additionalFields: ['termination.totalRelaunches', 'termination.concurrentRelaunches', 'termination.order', 'termination.relaunchAllInstances'],
additionalFields: [
'termination.totalRelaunches',
'termination.concurrentRelaunches',
'termination.order',
'termination.relaunchAllInstances',
],
additionalFieldsTemplateUrl: require('./additionalFields.html'),
initializationMethod: (command) => {
initializationMethod: command => {
command.termination = command.termination || {
order: 'oldest',
relaunchAllInstances: true,
concurrentRelaunches: 1,
totalRelaunches: command.capacity.max
};
}
order: 'oldest',
relaunchAllInstances: true,
concurrentRelaunches: 1,
totalRelaunches: command.capacity.max,
};
},
});
11 changes: 8 additions & 3 deletions app/scripts/modules/amazon/src/domain/IAmazonLoadBalancer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { IAmazonLoadBalancerSourceData } from './IAmazonLoadBalancerSourceData';
import { ILoadBalancer, ILoadBalancerDeleteCommand, ILoadBalancerUpsertCommand, IInstance, IInstanceCounts, ISubnet } from '@spinnaker/core';
import {
ILoadBalancer,
ILoadBalancerDeleteCommand,
ILoadBalancerUpsertCommand,
IInstance,
IInstanceCounts,
ISubnet,
} from '@spinnaker/core';
import { IAmazonServerGroup } from './IAmazonServerGroup';

export type ClassicListenerProtocol = 'HTTP' | 'HTTPS' | 'TCP' | 'SSL';
Expand Down Expand Up @@ -35,7 +42,6 @@ export interface IAmazonClassicLoadBalancer extends IAmazonLoadBalancer {
healthyThreshold: number;
listeners: IClassicListener[];
unhealthyThreshold: number;

}

export interface IAmazonApplicationLoadBalancer extends IAmazonLoadBalancer {
Expand Down Expand Up @@ -186,7 +192,6 @@ export interface IAmazonClassicLoadBalancerUpsertCommand extends IAmazonLoadBala
unhealthyThreshold?: number;
}


export interface IAmazonApplicationLoadBalancerUpsertCommand extends IAmazonLoadBalancerUpsertCommand {
listeners: IALBListenerDescription[];
targetGroups: IALBTargetGroupDescription[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ export interface IClassicLoadBalancerSourceData extends IAmazonLoadBalancerSourc
target: string;
timeout: number;
unhealthyThreshold: number;
}
};
instances: string[];
listenerDescriptions: { listener: IClassicListenerSourceData, policyNames: string[] }[];
listenerDescriptions: { listener: IClassicListenerSourceData; policyNames: string[] }[];
policies: {
appCookieStickinessPolicies: {
CookieName: string;
Expand All @@ -153,7 +153,7 @@ export interface IClassicLoadBalancerSourceData extends IAmazonLoadBalancerSourc
PolicyName: string;
}[];
otherPolicies: any[];
}
};
sourceSecurityGroup: {
groupName: string;
ownerAlias: string;
Expand Down
38 changes: 33 additions & 5 deletions app/scripts/modules/amazon/src/domain/IScalingPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,42 @@ export type ScalingPolicyAdjustmentType = 'ChangeInCapacity' | 'ExactCapacity' |

export type MetricAggregationType = 'Minimum' | 'Maximum' | 'Average';

export type AlarmComparisonOperator = 'GreaterThanOrEqualToThreshold' | 'GreaterThanThreshold' | 'LessThanThreshold' | 'LessThanOrEqualToThreshold';
export type AlarmComparisonOperator =
| 'GreaterThanOrEqualToThreshold'
| 'GreaterThanThreshold'
| 'LessThanThreshold'
| 'LessThanOrEqualToThreshold';

export type AlarmStatisticType = 'SampleCount' | 'Average' | 'Sum' | 'Minimum' | 'Maximum';

export type StandardUnitType = 'Seconds' | 'Microseconds' | 'Milliseconds' | 'Bytes' | 'Kilobytes' | 'Megabytes' |
'Gigabytes' | 'Terabytes' | 'Bits' | 'Kilobits' | 'Megabits' | 'Gigabits' | 'Terabits' | 'Percent' | 'Count' |
'BytesSecond' | 'KilobytesSecond' | 'MegabytesSecond' | 'GigabytesSecond' | 'TerabytesSecond' | 'BitsSecond' |
'KilobitsSecond' | 'MegabitsSecond' | 'GigabitsSecond' | 'TerabitsSecond' | 'CountSecond' | 'None';
export type StandardUnitType =
| 'Seconds'
| 'Microseconds'
| 'Milliseconds'
| 'Bytes'
| 'Kilobytes'
| 'Megabytes'
| 'Gigabytes'
| 'Terabytes'
| 'Bits'
| 'Kilobits'
| 'Megabits'
| 'Gigabits'
| 'Terabits'
| 'Percent'
| 'Count'
| 'BytesSecond'
| 'KilobytesSecond'
| 'MegabytesSecond'
| 'GigabytesSecond'
| 'TerabytesSecond'
| 'BitsSecond'
| 'KilobitsSecond'
| 'MegabitsSecond'
| 'GigabitsSecond'
| 'TerabitsSecond'
| 'CountSecond'
| 'None';

export interface IStepAdjustment {
metricIntervalLowerBound?: number;
Expand Down
Loading

0 comments on commit 532ab77

Please sign in to comment.