Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow synthetic default imports #7670

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion app/scripts/modules/amazon/src/common/AwsModalFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { ModalFooter } from 'react-bootstrap';

import { AccountService, UserVerification, IAccountDetails } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import { IDeploymentStrategyAdditionalFieldsProps, HelpField } from '@spinnaker/core';
import { IRollingPushCommand } from './rollingPush.strategy';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { cloneDeep } from 'lodash';
import {
IFunctionModalProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import { FormikFormField, IWizardPageComponent, TextInput, FormValidator } from '@spinnaker/core';
import { FormikProps, FormikErrors } from 'formik';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as classNames from 'classnames';
import React from 'react';
import classNames from 'classnames';
import {
FormikFormField,
CheckboxInput,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import {
FormikFormField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import {
IWizardPageComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FormikFormField, IWizardPageComponent, TextInput, NumberInput, HelpField } from '@spinnaker/core';
import { FormikProps } from 'formik';
import { IAmazonFunctionUpsertCommand } from 'amazon/index';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as React from 'react';
import React from 'react';

import { IWizardPageComponent, FormikFormField, FormValidator, MapEditorInput } from '@spinnaker/core';
import { FormikProps } from 'formik';
import { IAmazonFunctionUpsertCommand } from 'amazon/index';
import { IAmazonFunction } from 'amazon/domain';
import * as _ from 'lodash';
import { awsTagsValidator } from 'amazon/aws.validators';

export interface IFunctionTagsProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Option } from 'react-select';
import { IPromise } from 'angular';
import { Observable, Subject } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import {
Details,
CollapsibleSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Dropdown } from 'react-bootstrap';

import { Application, ApplicationReader, FunctionWriter, SETTINGS, NgReact, ReactInjector } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { isEqual } from 'lodash';

import { ILoadBalancerClusterContainerProps, LoadBalancerClusterContainer } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This is all mercilessly copied from LoadBalancersTag.tsx. This should be cleaned up at some point
// Probably when we convert clusters view to React.

import * as React from 'react';
import * as ReactGA from 'react-ga';
import React from 'react';
import ReactGA from 'react-ga';
import { sortBy } from 'lodash';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { orderBy } from 'lodash';
import { UISref, UISrefActive } from '@uirouter/react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Overridable, IOverridableProps } from '@spinnaker/core';

export interface ITargetGroupDetailsProps extends IOverridableProps {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Button, Modal } from 'react-bootstrap';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import { FormikFormField, CheckboxInput, NumberInput, HelpField } from '@spinnaker/core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { $q } from 'ngimport';
import { SortableContainer, SortableElement, SortableHandle, arrayMove, SortEnd } from 'react-sortable-hoc';
import { difference, flatten, get, some, uniq } from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Modal } from 'react-bootstrap';
import { Form, FormikErrors } from 'formik';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Modal } from 'react-bootstrap';
import { Form } from 'formik';
import { pickBy } from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { cloneDeep, get } from 'lodash';
import { IPromise } from 'angular';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { filter, flatten, groupBy, set, uniq } from 'lodash';
import { FormikErrors, FormikProps } from 'formik';
import { Observable, Subject } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FormikProps } from 'formik';

import { Validators, FormikFormField, NumberInput, HelpField } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { cloneDeep, get } from 'lodash';
import { FormikErrors, FormikValues } from 'formik';
import { IPromise } from 'angular';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FormikProps } from 'formik';

import { FormikFormField, SelectInput, TextInput, NumberInput } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { get } from 'lodash';
import { FormikProps } from 'formik';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import Select, { Option } from 'react-select';
import { Application, Overridable, timestamp, relativeTime } from '@spinnaker/core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as classNames from 'classnames';
import React from 'react';
import classNames from 'classnames';
import { IPromise } from 'angular';
import { chain, isNil, uniq, groupBy } from 'lodash';
import { Field, FormikErrors, FieldProps, FormikProps } from 'formik';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FormikErrors, FormikProps } from 'formik';
import { get, isEqual, uniq, partition } from 'lodash';
import { Subject, Observable } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import * as Validators from './targetGroupValidators';
import {
isNameInUse,
isNameLong,
isValidHealthCheckInterval,
isValidTimeout,
} from 'amazon/loadBalancer/configure/common/targetGroupValidators';

const mockTargetGroup = {
attributes: {
Expand Down Expand Up @@ -52,7 +57,7 @@ describe('Target Group validators', () => {
'us-east-1': [mockTargetGroup.name],
},
};
const actual = Validators.isNameInUse(existingGroups, 'test', 'us-east-1')(mockTargetGroup.name);
const actual = isNameInUse(existingGroups, 'test', 'us-east-1')(mockTargetGroup.name);
expect(actual).toBeTruthy();
});

Expand All @@ -62,68 +67,68 @@ describe('Target Group validators', () => {
'us-east-1': ['targetgroup2'],
},
};
const actual = Validators.isNameInUse(existingGroups, 'test', 'us-east-1')(mockTargetGroup.name);
const actual = isNameInUse(existingGroups, 'test', 'us-east-1')(mockTargetGroup.name);
expect(actual).toEqual(null);
});
});

describe('of name length', () => {
it('returns an error if the inputted name >32 additional characters (this is prepended to the application name)', () => {
const actual = Validators.isNameLong('application'.length)(`applicationwithareallylongname`);
const actual = isNameLong('application'.length)(`applicationwithareallylongname`);
expect(actual).toBeTruthy();
});

it('returns null if the name is < 32', () => {
const actual = Validators.isNameLong('app'.length)('appwithshortname');
const actual = isNameLong('app'.length)('appwithshortname');
expect(actual).toEqual(null);
});
});

describe('of health check timeout constraints', () => {
it('should have a 6s timeout', () => {
const actual = Validators.isValidTimeout(httpTargetGroup)('8');
const actual = isValidTimeout(httpTargetGroup)('8');
expect(actual).toBeTruthy();
});

it('should be 6s and is valid', () => {
const actual = Validators.isValidTimeout(httpTargetGroup)('6');
const actual = isValidTimeout(httpTargetGroup)('6');
expect(actual).toEqual(null);
});

it('should have a 10s timeout', () => {
const actual = Validators.isValidTimeout(httpsTargetGroup)('9');
const actual = isValidTimeout(httpsTargetGroup)('9');
expect(actual).toBeTruthy();
});

it('should be 10s and is valid', () => {
const actual = Validators.isValidTimeout(httpsTargetGroup)('10');
const actual = isValidTimeout(httpsTargetGroup)('10');
expect(actual).toEqual(null);
});

it('should not have a timeout constraint', () => {
const actual = Validators.isValidTimeout(mockTargetGroup)('10');
const actual = isValidTimeout(mockTargetGroup)('10');
expect(actual).toEqual(null);
});
});

describe('of health check interval', () => {
it('TCPs can have a 10s interval', () => {
const actual = Validators.isValidHealthCheckInterval(tcpTargetGroup)('10');
const actual = isValidHealthCheckInterval(tcpTargetGroup)('10');
expect(actual).toEqual(null);
});

it('TCPs can have a 30s interval', () => {
const actual = Validators.isValidHealthCheckInterval(tcpTargetGroup)('30');
const actual = isValidHealthCheckInterval(tcpTargetGroup)('30');
expect(actual).toEqual(null);
});

it('returns an error when it fails TCP rules', () => {
const actual = Validators.isValidHealthCheckInterval(tcpTargetGroup)('20');
const actual = isValidHealthCheckInterval(tcpTargetGroup)('20');
expect(actual).toBeTruthy();
});

it('is not a TCP protocol target group', () => {
const actual = Validators.isValidHealthCheckInterval(mockTargetGroup)('20');
const actual = isValidHealthCheckInterval(mockTargetGroup)('20');
expect(actual).toEqual(null);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { cloneDeep, get } from 'lodash';
import { FormikErrors } from 'formik';
import { IPromise } from 'angular';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Field, FormikProps } from 'formik';

import { HelpField } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { difference, flatten, uniq } from 'lodash';

import { ValidationMessage, IWizardPageComponent } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { filter, flatten, groupBy, set, uniq } from 'lodash';
import { FormikErrors, FormikProps } from 'formik';
import { Observable, Subject } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Dropdown } from 'react-bootstrap';
import { get, values } from 'lodash';

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/modules/amazon/src/reactShims/aws.ngReact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { angular2react } from 'angular2react';
import IInjectorService = angular.auto.IInjectorService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import { AccountService, ChecklistInput } from '@spinnaker/core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { mock, IHttpBackendService } from 'angular';
import { ShallowWrapper, ReactWrapper, shallow, mount } from 'enzyme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { IPromise } from 'angular';
import { $q } from 'ngimport';
import { ReactSelectProps, HandlerRendererResult, MenuRendererProps, Option, OptionValues } from 'react-select';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { get } from 'lodash';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

import {
Application,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import Select, { Option } from 'react-select';

import { HelpField, IServerGroupCommand, SpelNumberInput } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { IServerGroupCommand, SpelNumberInput } from '@spinnaker/core';

export interface IMinMaxDesiredProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as DOMPurify from 'dompurify';
import React from 'react';
import DOMPurify from 'dompurify';
import { Field, FormikProps } from 'formik';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Field, FormikProps } from 'formik';

import { IServerGroupCommand, IWizardPageComponent } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FormikErrors, FormikProps } from 'formik';

import { IWizardPageComponent, NgReact } from '@spinnaker/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Option } from 'react-select';
import { FormikProps } from 'formik';

Expand Down
Loading