Skip to content

Commit

Permalink
chore(lint): eslint --fix react2angular-with-error-boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and mergify[bot] committed Oct 12, 2020
1 parent bd9858d commit defaf19
Show file tree
Hide file tree
Showing 109 changed files with 576 additions and 227 deletions.
@@ -1,3 +1,4 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -7,5 +8,5 @@ export const AMAZON_INSTANCE_INFORMATION_COMPONENT = 'spinnaker.application.amaz

module(AMAZON_INSTANCE_INFORMATION_COMPONENT, []).component(
'amazonInstanceInformation',
react2angular(AmazonInstanceInformation, ['instance']),
react2angular(withErrorBoundary(AmazonInstanceInformation, 'amazonInstanceInformation'), ['instance']),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -7,5 +8,11 @@ export const INSTANCE_STATUS_COMPONENT = 'spinnaker.application.instanceStatus.c

module(INSTANCE_STATUS_COMPONENT, []).component(
'instanceStatus',
react2angular(InstanceStatus, ['healthMetrics', 'healthState', 'metricTypes', 'customHealthUrl', 'privateIpAddress']),
react2angular(withErrorBoundary(InstanceStatus, 'instanceStatus'), [
'healthMetrics',
'healthState',
'metricTypes',
'customHealthUrl',
'privateIpAddress',
]),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -6,5 +7,9 @@ import { LoadBalancerActions } from './LoadBalancerActions';
export const LOAD_BALANCER_ACTIONS = 'spinnaker.amazon.loadBalancer.details.loadBalancerActions.component';
module(LOAD_BALANCER_ACTIONS, []).component(
'loadBalancerActions',
react2angular(LoadBalancerActions, ['app', 'loadBalancer', 'loadBalancerFromParams']),
react2angular(withErrorBoundary(LoadBalancerActions, 'loadBalancerActions'), [
'app',
'loadBalancer',
'loadBalancerFromParams',
]),
);
Expand Up @@ -9,6 +9,7 @@ import {
ReactSelectInput,
IStage,
IStageConfigProps,
withErrorBoundary,
} from '@spinnaker/core';

export interface ICloudFormationChangeSetInfoProps {
Expand Down Expand Up @@ -55,19 +56,19 @@ export const CloudFormationChangeSetInfo = (props: ICloudFormationChangeSetInfoP
className="form-control"
type="text"
value={changeSetName}
onChange={e => modifyChangeSetName(e.target.value)}
onChange={(e) => modifyChangeSetName(e.target.value)}
/>
</StageConfigField>
<StageConfigField label="Execute ChangeSet">
<CheckboxInput checked={executeChangeSet} onChange={e => toggleExecuteChangeSet(e.target.checked)} />
<CheckboxInput checked={executeChangeSet} onChange={(e) => toggleExecuteChangeSet(e.target.checked)} />
</StageConfigField>
{executeChangeSet && (
<StageConfigField label="If ChangeSet contains a replacement" help-key="aws.cloudformation.changeSet.options">
<ReactSelectInput
clearable={false}
value={actionOnReplacement}
options={actionOnReplacementOptions}
onChange={e => modifyActionOnReplacement(e.target.value)}
onChange={(e) => modifyActionOnReplacement(e.target.value)}
/>
</StageConfigField>
)}
Expand All @@ -79,5 +80,8 @@ export const CLOUD_FORMATION_CHANGE_SET_INFO = 'spinnaker.amazon.cloudformation.

module(CLOUD_FORMATION_CHANGE_SET_INFO, []).component(
'cloudFormationChangeSetInfo',
react2angular(CloudFormationChangeSetInfo, ['stage', 'stageconfig']),
react2angular(withErrorBoundary(CloudFormationChangeSetInfo, 'cloudFormationChangeSetInfo'), [
'stage',
'stageconfig',
]),
);
@@ -1,9 +1,14 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { SecurityGroupDetailsCustom } from './securityGroupDetailsCustom';

export const AWS_SECURITY_GROUP_DETAILS_CUSTOM = 'spinnaker.amazon.securityGroups.details.custom.component';
module(AWS_SECURITY_GROUP_DETAILS_CUSTOM, []).component(
'securityGroupDetailsCustom',
react2angular(SecurityGroupDetailsCustom, ['securityGroupDetails', 'ctrl', 'scope']),
react2angular(withErrorBoundary(SecurityGroupDetailsCustom, 'securityGroupDetailsCustom'), [
'securityGroupDetails',
'ctrl',
'scope',
]),
);
@@ -1,7 +1,11 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';

import { IPRangeRules } from './IPRangeRules';

export const AWS_SECURITY_GROUP_IP_RANGE_RULES = 'spinnaker.amazon.securityGroups.details.securityGroups.component';
module(AWS_SECURITY_GROUP_IP_RANGE_RULES, []).component('ipRangeRules', react2angular(IPRangeRules, ['ipRules']));
module(AWS_SECURITY_GROUP_IP_RANGE_RULES, []).component(
'ipRangeRules',
react2angular(withErrorBoundary(IPRangeRules, 'ipRangeRules'), ['ipRules']),
);
@@ -1,9 +1,13 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { CreateScalingPolicyButton } from './CreateScalingPolicyButton';

export const CREATE_SCALING_POLICY_BUTTON = 'spinnaker.amazon.serverGroup.details.scaling.policy.button';
module(CREATE_SCALING_POLICY_BUTTON, []).component(
'createScalingPolicyButton',
react2angular(CreateScalingPolicyButton, ['application', 'serverGroup']),
react2angular(withErrorBoundary(CreateScalingPolicyButton, 'createScalingPolicyButton'), [
'application',
'serverGroup',
]),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { ConfigFileArtifactList } from './ConfigFileArtifactList';
Expand All @@ -6,5 +7,10 @@ export const CONFIG_FILE_ARTIFACT_LIST = 'spinnaker.appengine.configFileArtifact

module(CONFIG_FILE_ARTIFACT_LIST, []).component(
'configFileArtifactList',
react2angular(ConfigFileArtifactList, ['configArtifacts', 'pipeline', 'stage', 'updateConfigArtifacts']),
react2angular(withErrorBoundary(ConfigFileArtifactList, 'configFileArtifactList'), [
'configArtifacts',
'pipeline',
'stage',
'updateConfigArtifacts',
]),
);
3 changes: 2 additions & 1 deletion app/scripts/modules/canary/canary/canaryScore.component.ts
@@ -1,3 +1,4 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -6,5 +7,5 @@ import { CanaryScore } from './CanaryScore';
export const CANARY_SCORE_COMPONENT = 'spinnaker.canary.score.component';
module(CANARY_SCORE_COMPONENT, []).component(
'canaryScore',
react2angular(CanaryScore, ['score', 'health', 'result', 'inverse']),
react2angular(withErrorBoundary(CanaryScore, 'canaryScore'), ['score', 'health', 'result', 'inverse']),
);
3 changes: 2 additions & 1 deletion app/scripts/modules/canary/canary/canaryScores.component.ts
@@ -1,3 +1,4 @@
import { withErrorBoundary } from '@spinnaker/core';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -6,7 +7,7 @@ import { CanaryScores } from './CanaryScores';
export const CANARY_SCORES_CONFIG_COMPONENT = 'spinnaker.core.canaryScores.component';
module(CANARY_SCORES_CONFIG_COMPONENT, []).component(
'canaryScores',
react2angular(CanaryScores, [
react2angular(withErrorBoundary(CanaryScores, 'canaryScores'), [
'onChange',
'successfulHelpFieldId',
'successfulLabel',
Expand Down
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { AccountSelectInput } from './AccountSelectInput';
Expand All @@ -7,5 +8,11 @@ const ngmodule = module(ACCOUNT_SELECT_WRAPPER, []);

ngmodule.component(
'accountSelectWrapper',
react2angular(AccountSelectInput, ['accounts', 'provider', 'readOnly', 'onChange', 'value']),
react2angular(withErrorBoundary(AccountSelectInput, 'accountSelectWrapper'), [
'accounts',
'provider',
'readOnly',
'onChange',
'value',
]),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -6,5 +7,10 @@ import { CustomBannerConfig } from './CustomBannerConfig';
export const CUSTOM_BANNER_CONFIG = 'spinnaker.kubernetes.core.bannerConfig.component';
module(CUSTOM_BANNER_CONFIG, []).component(
'customBannerConfig',
react2angular(CustomBannerConfig, ['bannerConfigs', 'isSaving', 'saveError', 'updateBannerConfigs']),
react2angular(withErrorBoundary(CustomBannerConfig, 'customBannerConfig'), [
'bannerConfigs',
'isSaving',
'saveError',
'updateBannerConfigs',
]),
);
@@ -1,8 +1,9 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { DeleteApplicationSection } from './DeleteApplicationSection';
export const DELETE_APPLICATION_SECTION = 'spinnaker.core.application.config.delete.directive';
module(DELETE_APPLICATION_SECTION, []).component(
'deleteApplicationSection',
react2angular(DeleteApplicationSection, ['application']),
react2angular(withErrorBoundary(DeleteApplicationSection, 'deleteApplicationSection'), ['application']),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import React from 'react';
import { module } from 'angular';
import { react2angular } from 'react2angular';
Expand Down Expand Up @@ -128,5 +129,5 @@ const ManagedResourceConfig = ({ application }: IManagedResourceConfigProps) =>
export const MANAGED_RESOURCE_CONFIG = 'spinnaker.core.managedResourceConfig.component';
module(MANAGED_RESOURCE_CONFIG, []).component(
'managedResourceConfig',
react2angular(ManagedResourceConfig, ['application']),
react2angular(withErrorBoundary(ManagedResourceConfig, 'managedResourceConfig'), ['application']),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import { react2angular } from 'react2angular';

Expand All @@ -6,5 +7,9 @@ import { PermissionsConfigurer } from './PermissionsConfigurer';
export const PERMISSIONS_CONFIGURER_COMPONENT = 'spinnaker.application.permissionsConfigurer.component';
module(PERMISSIONS_CONFIGURER_COMPONENT, []).component(
'permissionsConfigurer',
react2angular(PermissionsConfigurer, ['permissions', 'requiredGroupMembership', 'onPermissionsChange']),
react2angular(withErrorBoundary(PermissionsConfigurer, 'permissionsConfigurer'), [
'permissions',
'requiredGroupMembership',
'onPermissionsChange',
]),
);
3 changes: 2 additions & 1 deletion app/scripts/modules/core/src/artifact/artifactTab.ts
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { ExecutionArtifactTab } from './react/ExecutionArtifactTab';
Expand All @@ -6,5 +7,5 @@ export const EXECUTION_ARTIFACT_TAB = 'spinnaker.core.artifact.artifactTab.compo

module(EXECUTION_ARTIFACT_TAB, []).component(
'executionArtifactTab',
react2angular(ExecutionArtifactTab, ['config', 'stage', 'execution']),
react2angular(withErrorBoundary(ExecutionArtifactTab, 'executionArtifactTab'), ['config', 'stage', 'execution']),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import React from 'react';
import { react2angular } from 'react2angular';
Expand Down Expand Up @@ -47,5 +48,10 @@ export class ArtifactAccountSelector extends React.Component<IArtifactAccountSel
export const ARTIFACT_ACCOUNT_SELECTOR_COMPONENT_REACT = 'spinnaker.core.artifacts.account.selector.react';
module(ARTIFACT_ACCOUNT_SELECTOR_COMPONENT_REACT, []).component(
'artifactAccountSelectorReact',
react2angular(ArtifactAccountSelector, ['accounts', 'className', 'onChange', 'selected']),
react2angular(withErrorBoundary(ArtifactAccountSelector, 'artifactAccountSelectorReact'), [
'accounts',
'className',
'onChange',
'selected',
]),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import React from 'react';
import { react2angular } from 'react2angular';
Expand Down Expand Up @@ -79,7 +80,7 @@ export class ExpectedArtifactEditor extends React.Component<
if (!artifact || !this.props.accounts) {
return [];
}
return this.props.accounts.filter(a => a.types.includes(artifact.type));
return this.props.accounts.filter((a) => a.types.includes(artifact.type));
}

private onSourceChange = (e: IExpectedArtifactSourceOption) => {
Expand Down Expand Up @@ -129,7 +130,7 @@ export class ExpectedArtifactEditor extends React.Component<
const kinds = this.props.kinds || [];
const accounts = this.props.accounts || [];
if (this.props.showAccounts) {
return kinds.filter(k => k.customKind || accounts.find(a => a.types.includes(k.type)));
return kinds.filter((k) => k.customKind || accounts.find((a) => a.types.includes(k.type)));
} else {
return kinds.slice(0);
}
Expand Down Expand Up @@ -208,7 +209,7 @@ module(EXPECTED_ARTIFACT_EDITOR_COMPONENT_REACT, [
EXPECTED_ARTIFACT_SOURCE_SELECTOR_COMPONENT_REACT,
]).component(
'expectedArtifactEditorReact',
react2angular(ExpectedArtifactEditor, [
react2angular(withErrorBoundary(ExpectedArtifactEditor, 'expectedArtifactEditorReact'), [
'default',
'kinds',
'sources',
Expand Down
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import React from 'react';
import { react2angular } from 'react2angular';
Expand Down Expand Up @@ -51,7 +52,7 @@ export class ExpectedArtifactKindSelector extends React.Component<
};

private onChange = (option: IExpectedArtifactKindSelectorOption) => {
const kind = this.props.kinds.find(k => k.key === option.value);
const kind = this.props.kinds.find((k) => k.key === option.value);
this.setState({ selected: option });
this.props.onChange(kind);
};
Expand Down Expand Up @@ -88,5 +89,11 @@ export class ExpectedArtifactKindSelector extends React.Component<
export const EXPECTED_ARTIFACT_KIND_SELECTOR_COMPONENT_REACT = 'spinnaker.core.artifacts.expected.kind.selector.react';
module(EXPECTED_ARTIFACT_KIND_SELECTOR_COMPONENT_REACT, []).component(
'expectedArtifactKindSelectorReact',
react2angular(ExpectedArtifactKindSelector, ['kinds', 'selected', 'onChange', 'showIcons', 'className']),
react2angular(withErrorBoundary(ExpectedArtifactKindSelector, 'expectedArtifactKindSelectorReact'), [
'kinds',
'selected',
'onChange',
'showIcons',
'className',
]),
);
@@ -1,3 +1,4 @@
import { withErrorBoundary } from 'core/presentation/SpinErrorBoundary';
import { module } from 'angular';
import React from 'react';
import { react2angular } from 'react2angular';
Expand Down Expand Up @@ -62,7 +63,7 @@ export class ExpectedArtifactSelector extends React.Component<IExpectedArtifactS
};

private filterExpectedArtifacts(fn: IExpectedArtifactFilter): IExpectedArtifact[] {
return (this.props.expectedArtifacts || []).filter(ea => {
return (this.props.expectedArtifacts || []).filter((ea) => {
const artifact = ExpectedArtifactService.artifactFromExpected(ea);
if (!artifact) {
return false;
Expand All @@ -77,17 +78,17 @@ export class ExpectedArtifactSelector extends React.Component<IExpectedArtifactS
let isIncluded = true;
let isExcluded = false;
if (offeredArtifactTypes && offeredArtifactTypes.length > 0) {
isIncluded = !!offeredArtifactTypes.find(patt => patt.test(artifact.type));
isIncluded = !!offeredArtifactTypes.find((patt) => patt.test(artifact.type));
}
if (excludedArtifactTypes && excludedArtifactTypes.length > 0) {
isExcluded = !!excludedArtifactTypes.find(patt => patt.test(artifact.type));
isExcluded = !!excludedArtifactTypes.find((patt) => patt.test(artifact.type));
}
return isIncluded && !isExcluded;
});
}

public render() {
const options = this.getExpectedArtifacts().map(ea => {
const options = this.getExpectedArtifacts().map((ea) => {
return { value: ea.id, expectedArtifact: ea, requestingNew: false };
});
if (this.props.onRequestCreate) {
Expand Down Expand Up @@ -119,7 +120,7 @@ module(EXPECTED_ARTIFACT_SELECTOR_COMPONENT_REACT, [
ARTIFACT_ACCOUNT_SELECTOR_COMPONENT_REACT,
]).component(
'expectedArtifactSelectorReact',
react2angular(ExpectedArtifactSelector, [
react2angular(withErrorBoundary(ExpectedArtifactSelector, 'expectedArtifactSelectorReact'), [
'expectedArtifacts',
'selected',
'requestingNew',
Expand Down

0 comments on commit defaf19

Please sign in to comment.