Skip to content

Commit

Permalink
chore(package): Just Update Prettier™
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Feb 12, 2019
1 parent 6cb740e commit a8c1749
Show file tree
Hide file tree
Showing 60 changed files with 667 additions and 702 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,29 +199,27 @@ export class AmazonLoadBalancersTag extends React.Component<ILoadBalancersTagPro
</HoverablePopover>
)}

{loadBalancers.length === 1 &&
targetGroups.length === 0 && (
<span className="btn-load-balancer">
<LoadBalancerButton
key={loadBalancers[0].name}
label="Load Balancer"
loadBalancer={loadBalancers[0]}
onItemClick={this.showLoadBalancerDetails}
/>
</span>
)}

{targetGroups.length === 1 &&
loadBalancers.length === 0 && (
<span className="btn-load-balancer">
<LoadBalancerButton
key={targetGroups[0].name}
label="Target Group"
loadBalancer={targetGroups[0]}
onItemClick={this.showTargetGroupDetails}
/>
</span>
)}
{loadBalancers.length === 1 && targetGroups.length === 0 && (
<span className="btn-load-balancer">
<LoadBalancerButton
key={loadBalancers[0].name}
label="Load Balancer"
loadBalancer={loadBalancers[0]}
onItemClick={this.showLoadBalancerDetails}
/>
</span>
)}

{targetGroups.length === 1 && loadBalancers.length === 0 && (
<span className="btn-load-balancer">
<LoadBalancerButton
key={targetGroups[0].name}
label="Target Group"
loadBalancer={targetGroups[0]}
onItemClick={this.showTargetGroupDetails}
/>
</span>
)}
</span>
);
}
Expand Down
7 changes: 3 additions & 4 deletions app/scripts/modules/amazon/src/loadBalancer/TargetGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ export class TargetGroup extends React.Component<ITargetGroupProps> {
</UISref>
</UISrefActive>
{showServerGroups && ServerGroups}
{!showServerGroups &&
showInstances && (
<LoadBalancerInstances serverGroups={targetGroup.serverGroups} instances={targetGroup.instances} />
)}
{!showServerGroups && showInstances && (
<LoadBalancerInstances serverGroups={targetGroup.serverGroups} instances={targetGroup.instances} />
)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,19 +841,17 @@ const RuleActions = (props: {
<HelpField id="aws.loadBalancer.oidcAuthentication" />
</>
)}
{props.ruleIndex !== undefined &&
props.ruleIndex >= 0 &&
props.removeRule && (
<a
className="btn btn-sm btn-link clickable"
onClick={() => props.removeRule(props.listener, props.ruleIndex)}
style={{ padding: '0' }}
>
<Tooltip value="Remove Rule">
<i className="far fa-fw fa-trash-alt" />
</Tooltip>
</a>
)}
{props.ruleIndex !== undefined && props.ruleIndex >= 0 && props.removeRule && (
<a
className="btn btn-sm btn-link clickable"
onClick={() => props.removeRule(props.listener, props.ruleIndex)}
style={{ padding: '0' }}
>
<Tooltip value="Remove Rule">
<i className="far fa-fw fa-trash-alt" />
</Tooltip>
</a>
)}
</span>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,24 +370,23 @@ export class LoadBalancerLocation extends React.Component<ILoadBalancerLocationP
application={app}
onChange={() => this.handleSubnetUpdated(values.subnetType)}
/>
{values.vpcId &&
!hideInternalFlag && (
<div className="form-group">
<div className="col-md-3 sm-label-right">
<b>Internal</b> <HelpField id="aws.loadBalancer.internal" />
</div>
<div className="col-md-7 checkbox">
<label>
<Field
name="isInternal"
onChange={this.internalFlagChanged}
render={({ field }: FieldProps) => <input type="checkbox" checked={!!field.value} />}
/>
Create an internal load balancer
</label>
</div>
{values.vpcId && !hideInternalFlag && (
<div className="form-group">
<div className="col-md-3 sm-label-right">
<b>Internal</b> <HelpField id="aws.loadBalancer.internal" />
</div>
)}
<div className="col-md-7 checkbox">
<label>
<Field
name="isInternal"
onChange={this.internalFlagChanged}
render={({ field }: FieldProps) => <input type="checkbox" checked={!!field.value} />}
/>
Create an internal load balancer
</label>
</div>
</div>
)}
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ export class LoadBalancerActions extends React.Component<ILoadBalancerActionsPro
</a>
</li>
)}
{SETTINGS &&
SETTINGS.feature.entityTags && (
<AddEntityTagLinks
component={loadBalancer}
application={app}
entityType="loadBalancer"
onUpdate={this.entityTagUpdate}
/>
)}
{SETTINGS && SETTINGS.feature.entityTags && (
<AddEntityTagLinks
component={loadBalancer}
application={app}
entityType="loadBalancer"
onUpdate={this.entityTagUpdate}
/>
)}
</Dropdown.Menu>
</Dropdown>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ export class AmazonImageSelectInput extends React.Component<IAmazonImageSelector
const searchNoResultsText = lessThanThreeChars
? 'Please enter at least 3 characters'
: isSearching
? 'Searching...'
: noResultsText;
? 'Searching...'
: noResultsText;

return (
<div className="col-md-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ module.exports = angular
// Might be worth feature flagging this if it turns out other folks are hard-coding these values
const reservedTags = ['spinnaker:application', 'spinnaker:stack', 'spinnaker:details'];
if (serverGroup.asg.tags) {
serverGroup.asg.tags.filter(t => !reservedTags.includes(t.key)).forEach(tag => {
existingTags[tag.key] = tag.value;
});
serverGroup.asg.tags
.filter(t => !reservedTags.includes(t.key))
.forEach(tag => {
existingTags[tag.key] = tag.value;
});
}

var command = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,58 +86,57 @@ export class CapacitySelector extends React.Component<ICapacitySelectorProps> {
</div>

{/* // TODO: Test this in a clone server group dialog or an edit pipeline dialog */}
{!readOnlyFields.useSourceCapacity &&
command.viewState.mode === 'editPipeline' && (
<div className="form-group">
<div className="col-md-3 sm-label-right">Capacity</div>
<div className="col-md-9 radio">
<label>
<input
type="radio"
checked={command.useSourceCapacity}
value="true"
id="useSourceCapacityTrue"
onChange={this.useSourceCapacityUpdated}
{!readOnlyFields.useSourceCapacity && command.viewState.mode === 'editPipeline' && (
<div className="form-group">
<div className="col-md-3 sm-label-right">Capacity</div>
<div className="col-md-9 radio">
<label>
<input
type="radio"
checked={command.useSourceCapacity}
value="true"
id="useSourceCapacityTrue"
onChange={this.useSourceCapacityUpdated}
/>
Copy the capacity from the current server group
<HelpField id="serverGroupCapacity.useSourceCapacityTrue" />
</label>
</div>
{command.useSourceCapacity && (
<div className="col-md-9 col-md-offset-3 radio" style={{ paddingLeft: '35px' }}>
<div>
If no current server group is found,
<Select
clearable={false}
value={!!command.preferSourceCapacity}
options={this.preferSourceCapacityOptions}
onChange={this.preferSourceCapacityChanged}
/>
Copy the capacity from the current server group
<HelpField id="serverGroupCapacity.useSourceCapacityTrue" />
</label>
</div>
{command.useSourceCapacity && (
<div className="col-md-9 col-md-offset-3 radio" style={{ paddingLeft: '35px' }}>
</div>
{command.preferSourceCapacity && (
<div>
If no current server group is found,
<Select
clearable={false}
value={!!command.preferSourceCapacity}
options={this.preferSourceCapacityOptions}
onChange={this.preferSourceCapacityChanged}
/>
<b>Fallback values</b>
<MinMaxDesired command={command} fieldChanged={this.capacityFieldChanged} />
</div>
{command.preferSourceCapacity && (
<div>
<b>Fallback values</b>
<MinMaxDesired command={command} fieldChanged={this.capacityFieldChanged} />
</div>
)}
</div>
)}

<div className="col-md-9 col-md-offset-3 radio">
<label>
<input
type="radio"
checked={!command.useSourceCapacity}
value="false"
id="useSourceCapacityFalse"
onChange={this.useSourceCapacityUpdated}
/>
Let me specify the capacity
<HelpField id="serverGroupCapacity.useSourceCapacityFalse" />
</label>
)}
</div>
)}

<div className="col-md-9 col-md-offset-3 radio">
<label>
<input
type="radio"
checked={!command.useSourceCapacity}
value="false"
id="useSourceCapacityFalse"
onChange={this.useSourceCapacityUpdated}
/>
Let me specify the capacity
<HelpField id="serverGroupCapacity.useSourceCapacityFalse" />
</label>
</div>
)}
</div>
)}

{(!command.useSourceCapacity || command.viewState.mode !== 'editPipeline') && (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,13 @@ export class ServerGroupBasicSettings
</label>
</div>
</div>
{!values.viewState.disableStrategySelection &&
values.selectedProvider && (
<DeploymentStrategySelector
command={values}
onFieldChange={this.onStrategyFieldChange}
onStrategyChange={this.strategyChanged}
/>
)}
{!values.viewState.disableStrategySelection && values.selectedProvider && (
<DeploymentStrategySelector
command={values}
onFieldChange={this.onStrategyFieldChange}
onStrategyChange={this.strategyChanged}
/>
)}
{!values.viewState.hideClusterNamePreview && (
<div className="form-group">
<div className="col-md-12">
Expand All @@ -340,26 +339,24 @@ export class ServerGroupBasicSettings
{createsNewCluster && <span> (new cluster)</span>}
</strong>
</p>
{!createsNewCluster &&
values.viewState.mode === 'create' &&
latestServerGroup && (
<div className="text-left">
<p>There is already a server group in this cluster. Do you want to clone it?</p>
<p>
Cloning copies the entire configuration from the selected server group, allowing you to modify
whichever fields (e.g. image) you need to change in the new server group.
</p>
<p>
To clone a server group, select "Clone" from the "Server Group Actions" menu in the details
view of the server group.
</p>
<p>
<a className="clickable" onClick={this.navigateToLatestServerGroup}>
Go to details for {latestServerGroup.name}
</a>
</p>
</div>
)}
{!createsNewCluster && values.viewState.mode === 'create' && latestServerGroup && (
<div className="text-left">
<p>There is already a server group in this cluster. Do you want to clone it?</p>
<p>
Cloning copies the entire configuration from the selected server group, allowing you to modify
whichever fields (e.g. image) you need to change in the new server group.
</p>
<p>
To clone a server group, select "Clone" from the "Server Group Actions" menu in the details view
of the server group.
</p>
<p>
<a className="clickable" onClick={this.navigateToLatestServerGroup}>
Go to details for {latestServerGroup.name}
</a>
</p>
</div>
)}
</h5>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ export class ServerGroupInstanceType extends React.Component<IServerGroupInstanc
onProfileChanged={this.instanceProfileChanged}
/>
<div style={{ padding: '0 15px' }}>
{values.viewState.instanceProfile &&
values.viewState.instanceProfile !== 'custom' && (
<InstanceTypeSelector command={values} onTypeChanged={this.instanceTypeChanged} />
)}
{values.viewState.instanceProfile && values.viewState.instanceProfile !== 'custom' && (
<InstanceTypeSelector command={values} onTypeChanged={this.instanceTypeChanged} />
)}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,15 @@ export class ServerGroupLoadBalancers
</div>
{!values.vpcId && (
<div className="form-group">
{!hasVpcLoadBalancers &&
!showVpcLoadBalancers && (
<div>
<div className="col-md-8 col-md-offset-3">
<a className="clickable" onClick={() => this.setState({ showVpcLoadBalancers: true })}>
Add VPC Load Balancers
</a>
</div>
{!hasVpcLoadBalancers && !showVpcLoadBalancers && (
<div>
<div className="col-md-8 col-md-offset-3">
<a className="clickable" onClick={() => this.setState({ showVpcLoadBalancers: true })}>
Add VPC Load Balancers
</a>
</div>
)}
</div>
)}
{hasVpcLoadBalancers && (
<div>
<div className="col-md-4 sm-label-right">
Expand Down
Loading

0 comments on commit a8c1749

Please sign in to comment.