@@ -172,6 +172,7 @@ | |||
{ | |||
"order": [ | |||
"type-annotations", | |||
"instance-variables", | |||
"static-methods", | |||
"lifecycle", | |||
"everything-else", |
@@ -52,7 +52,7 @@ | |||
"@types/jest": "22.0.1", | |||
"@types/jquery": "3.2.11", | |||
"@types/keymaster": "1.6.28", | |||
"@types/lodash": "4.14.80", | |||
"@types/lodash": "4.14.102", | |||
"@types/prop-types": "15.5.2", | |||
"@types/react": "16.0.29", | |||
"@types/react-dom": "16.0.3", | |||
@@ -103,8 +103,8 @@ | |||
"rimraf": "2.6.2", | |||
"style-loader": "0.19.0", | |||
"ts-jest": "22.0.1", | |||
"typescript": "2.6.2", | |||
"typescript-eslint-parser": "12.0.0", | |||
"typescript": "2.7.1", | |||
"typescript-eslint-parser": "13.0.0", | |||
"webpack": "3.8.1", | |||
"webpack-bundle-analyzer": "2.9.0", | |||
"webpack-dev-server": "2.9.3" |
@@ -42,7 +42,7 @@ interface State { | |||
} | |||
class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static childContextTypes = { | |||
branchesEnabled: PropTypes.bool.isRequired, |
@@ -49,7 +49,7 @@ interface State { | |||
} | |||
export class ComponentContainer extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
organizationsEnabled: PropTypes.bool |
@@ -32,7 +32,7 @@ interface State { | |||
} | |||
export default class LocalizationContainer extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class SimpleContainer extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static childContextTypes = { | |||
onSonarCloud: PropTypes.bool |
@@ -41,7 +41,7 @@ interface Props { | |||
} | |||
export default class ComponentNav extends React.PureComponent<Props> { | |||
mounted: boolean; | |||
mounted = false; | |||
componentDidMount() { | |||
this.populateRecentHistory(); |
@@ -46,7 +46,7 @@ interface State { | |||
} | |||
export default class ComponentNavBranch extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
branchesEnabled: PropTypes.bool.isRequired, |
@@ -46,7 +46,7 @@ interface State { | |||
} | |||
export default class ComponentNavBranchesMenu extends React.PureComponent<Props, State> { | |||
private node: HTMLElement | null; | |||
private node?: HTMLElement | null; | |||
static contextTypes = { | |||
router: PropTypes.object |
@@ -46,7 +46,7 @@ interface State { | |||
} | |||
class CreateOrganizationForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object |
@@ -45,7 +45,7 @@ interface State { | |||
} | |||
class UserOrganizations extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { createOrganization: false, loading: true }; | |||
componentDidMount() { |
@@ -32,7 +32,7 @@ interface State { | |||
} | |||
export default class ProjectsContainer extends React.PureComponent<{}, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { | |||
loading: true, | |||
page: 1, |
@@ -33,7 +33,7 @@ interface State { | |||
} | |||
export default class ScannerContext extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = {}; | |||
componentDidMount() { |
@@ -34,7 +34,7 @@ interface State { | |||
} | |||
export default class Stacktrace extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -37,7 +37,7 @@ interface State { | |||
} | |||
export default class Workers extends React.PureComponent<{}, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { | |||
canSetWorkerCount: false, | |||
formOpen: false, |
@@ -37,7 +37,7 @@ interface State { | |||
} | |||
export default class WorkersForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -53,7 +53,7 @@ interface State { | |||
} | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { | |||
loading: true, | |||
breadcrumbs: [], |
@@ -38,7 +38,7 @@ interface Props { | |||
} | |||
export default class Component extends React.PureComponent<Props> { | |||
node: HTMLElement; | |||
node?: HTMLElement | null; | |||
componentDidMount() { | |||
this.handleUpdate(); | |||
@@ -60,12 +60,14 @@ export default class Component extends React.PureComponent<Props> { | |||
} | |||
handleScroll() { | |||
const position = this.node.getBoundingClientRect(); | |||
const { top, bottom } = position; | |||
if (bottom > window.innerHeight - BOTTOM_OFFSET) { | |||
window.scrollTo(0, bottom - window.innerHeight + window.pageYOffset + BOTTOM_OFFSET); | |||
} else if (top < TOP_OFFSET) { | |||
window.scrollTo(0, top + window.pageYOffset - TOP_OFFSET); | |||
if (this.node) { | |||
const position = this.node.getBoundingClientRect(); | |||
const { top, bottom } = position; | |||
if (bottom > window.innerHeight - BOTTOM_OFFSET) { | |||
window.scrollTo(0, bottom - window.innerHeight + window.pageYOffset + BOTTOM_OFFSET); | |||
} else if (top < TOP_OFFSET) { | |||
window.scrollTo(0, top + window.pageYOffset - TOP_OFFSET); | |||
} | |||
} | |||
} | |||
@@ -113,7 +115,7 @@ export default class Component extends React.PureComponent<Props> { | |||
].filter(Boolean) as Array<{ metric: string; type: string }>); | |||
return ( | |||
<tr className={classNames({ selected })} ref={node => (this.node = node as HTMLElement)}> | |||
<tr className={classNames({ selected })} ref={node => (this.node = node)}> | |||
<td className="thin nowrap"> | |||
<span className="spacer-right">{componentAction}</span> | |||
</td> |
@@ -43,7 +43,7 @@ interface State { | |||
} | |||
export default class Search extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object.isRequired |
@@ -39,7 +39,7 @@ interface State { | |||
} | |||
export default class ActivationButton extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -47,7 +47,7 @@ interface State { | |||
} | |||
export default class ActivationFormModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -80,7 +80,7 @@ interface State { | |||
// TODO redirect to default organization's rules page | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
organizationsEnabled: PropTypes.bool, |
@@ -39,7 +39,7 @@ interface State { | |||
} | |||
export default class BulkChange extends React.PureComponent<Props, State> { | |||
closeDropdown: () => void; | |||
closeDropdown?: () => void; | |||
state: State = { modal: false }; | |||
getSelectedProfile = () => { | |||
@@ -52,28 +52,36 @@ export default class BulkChange extends React.PureComponent<Props, State> { | |||
handleActivateClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
this.setState({ action: 'activate', modal: true, profile: undefined }); | |||
}; | |||
handleActivateInProfileClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
this.setState({ action: 'activate', modal: true, profile: this.getSelectedProfile() }); | |||
}; | |||
handleDeactivateClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
this.setState({ action: 'deactivate', modal: true, profile: undefined }); | |||
}; | |||
handleDeactivateInProfileClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
this.setState({ action: 'deactivate', modal: true, profile: this.getSelectedProfile() }); | |||
}; | |||
@@ -50,7 +50,7 @@ interface State { | |||
} | |||
export default class BulkChangeModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class CustomRuleButton extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -52,7 +52,7 @@ interface State { | |||
} | |||
export default class CustomRuleFormModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -54,7 +54,7 @@ interface State { | |||
} | |||
export default class RuleDetails extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -41,7 +41,7 @@ interface State { | |||
} | |||
export default class RuleDetailsCustomRules extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface State { | |||
} | |||
export default class RuleDetailsDescription extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { | |||
description: '', | |||
descriptionForm: false, |
@@ -44,7 +44,7 @@ interface State { | |||
} | |||
export default class RuleDetailsIssues extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -46,7 +46,7 @@ interface State { | |||
} | |||
export default class RuleDetailsProfiles extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
componentDidMount() { | |||
this.mounted = true; |
@@ -38,7 +38,7 @@ interface State { | |||
const LIST_SIZE = 10; | |||
export default class RuleDetailsTagsPopup extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { searchResult: [] }; | |||
componentDidMount() { |
@@ -31,26 +31,32 @@ interface Props { | |||
} | |||
export default class SimilarRulesFilter extends React.PureComponent<Props> { | |||
closeDropdown: () => void; | |||
closeDropdown?: () => void; | |||
handleLanguageClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
this.props.onFilterChange({ languages: [this.props.rule.lang] }); | |||
}; | |||
handleTypeClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
this.props.onFilterChange({ types: [this.props.rule.type] }); | |||
}; | |||
handleSeverityClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
if (this.props.rule.severity) { | |||
this.props.onFilterChange({ severities: [this.props.rule.severity] }); | |||
} | |||
@@ -59,7 +65,9 @@ export default class SimilarRulesFilter extends React.PureComponent<Props> { | |||
handleTagClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => { | |||
event.preventDefault(); | |||
event.currentTarget.blur(); | |||
this.closeDropdown(); | |||
if (this.closeDropdown) { | |||
this.closeDropdown(); | |||
} | |||
const { tag } = event.currentTarget.dataset; | |||
if (tag) { | |||
this.props.onFilterChange({ tags: [tag] }); |
@@ -44,7 +44,7 @@ interface State { | |||
const PAGE_SIZE = 50; | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -31,7 +31,7 @@ interface State { | |||
} | |||
export default class CreateButton extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -33,7 +33,7 @@ interface State { | |||
} | |||
export default class EditButton extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -43,7 +43,7 @@ interface State { | |||
} | |||
export default class Form extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -48,7 +48,7 @@ interface State { | |||
const PAGE_SIZE = 50; | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -32,7 +32,7 @@ interface State { | |||
} | |||
export default class CreateButton extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -35,7 +35,7 @@ interface State { | |||
} | |||
export default class EditButton extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface State { | |||
} | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true, query: '' }; | |||
componentDidMount() { |
@@ -34,7 +34,7 @@ interface State { | |||
} | |||
export default class EditGroup extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface State { | |||
export default class EditMembers extends React.PureComponent<Props, State> { | |||
container?: HTMLElement | null; | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { modal: false }; | |||
componentDidMount() { |
@@ -32,7 +32,7 @@ interface State { | |||
} | |||
export default class Header extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { createModal: false }; | |||
componentDidMount() { |
@@ -48,12 +48,12 @@ type Props = {| | |||
export default class AssigneeFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'assignees'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'assignees'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
if (itemValue === '') { | |||
// unassigned |
@@ -41,12 +41,12 @@ type Props = {| | |||
export default class AuthorFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'authors'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'authors'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { authors } = this.props; | |||
const newValue = sortBy( |
@@ -53,6 +53,8 @@ type Props = {| | |||
export default class CreationDateFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'createdAt'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
@@ -61,8 +63,6 @@ export default class CreationDateFacet extends React.PureComponent { | |||
intl: intlShape | |||
}; | |||
property = 'createdAt'; | |||
hasValue = () => | |||
this.props.createdAfter.length > 0 || | |||
this.props.createdAt.length > 0 || |
@@ -45,12 +45,12 @@ type Props = {| | |||
export default class DirectoryFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'directories'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'directories'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { directories } = this.props; | |||
const newValue = sortBy( |
@@ -45,12 +45,12 @@ type Props = {| | |||
export default class FileFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'files'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'files'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { files } = this.props; | |||
const newValue = sortBy( |
@@ -44,12 +44,12 @@ type Props = {| | |||
export default class LanguageFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'languages'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'languages'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { languages } = this.props; | |||
const newValue = sortBy( |
@@ -44,12 +44,12 @@ type Props = {| | |||
export default class ModuleFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'modules'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'modules'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { modules } = this.props; | |||
const newValue = sortBy( |
@@ -49,12 +49,12 @@ type Props = {| | |||
export default class ProjectFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'projects'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'projects'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { projects } = this.props; | |||
const newValue = sortBy( |
@@ -42,12 +42,12 @@ type Props = {| | |||
export default class ResolutionFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'resolutions'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'resolutions'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
if (itemValue === '') { | |||
// unresolved |
@@ -46,12 +46,12 @@ type Props = {| | |||
export default class RuleFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'rules'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'rules'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { rules } = this.props; | |||
const newValue = sortBy( |
@@ -42,12 +42,12 @@ type Props = {| | |||
export default class SeverityFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'severities'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'severities'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { severities } = this.props; | |||
const newValue = orderBy( |
@@ -41,12 +41,12 @@ type Props = {| | |||
export default class StatusFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'statuses'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'statuses'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { statuses } = this.props; | |||
const newValue = orderBy( |
@@ -46,12 +46,12 @@ type Props = {| | |||
export default class TagFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'tags'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'tags'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { tags } = this.props; | |||
const newValue = sortBy( |
@@ -42,12 +42,12 @@ type Props = {| | |||
export default class TypeFacet extends React.PureComponent { | |||
/*:: props: Props; */ | |||
property = 'types'; | |||
static defaultProps = { | |||
open: true | |||
}; | |||
property = 'types'; | |||
handleItemClick = (itemValue /*: string */) => { | |||
const { types } = this.props; | |||
const newValue = orderBy( |
@@ -63,7 +63,7 @@ interface State { | |||
} | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object.isRequired |
@@ -38,7 +38,7 @@ interface State { | |||
} | |||
export default class LicenseEditionForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { license: '', submitting: false }; | |||
componentDidMount() { |
@@ -48,7 +48,7 @@ interface State { | |||
} | |||
export default class LicenseEditionSet extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class PluginActions extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { acceptTerms: false, loading: false }; | |||
componentDidMount() { |
@@ -34,7 +34,7 @@ interface State { | |||
} | |||
export default class UninstallEditionForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -37,7 +37,7 @@ interface State { | |||
} | |||
export default class BadgeParams extends React.PureComponent<Props> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { badgeMetrics: [] }; | |||
@@ -67,7 +67,7 @@ interface State { | |||
} | |||
export class OverviewApp extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true, measures: [] }; | |||
componentDidMount() { |
@@ -42,7 +42,7 @@ interface State { | |||
const PAGE_SIZE = 3; | |||
export default class AnalysesList extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { analyses: [], loading: true }; | |||
componentDidMount() { |
@@ -33,7 +33,7 @@ interface State { | |||
} | |||
export default class MetaLinks extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = {}; | |||
componentDidMount() { |
@@ -42,7 +42,7 @@ interface State { | |||
} | |||
class MetaQualityProfiles extends React.PureComponent<StateProps & OwnProps, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { deprecatedByKey: {} }; | |||
componentDidMount() { |
@@ -36,9 +36,9 @@ interface State { | |||
} | |||
export default class MetaTags extends React.PureComponent<Props, State> { | |||
card: HTMLDivElement | null; | |||
tagsList: HTMLButtonElement | null; | |||
tagsSelector: HTMLDivElement | null; | |||
card?: HTMLDivElement | null; | |||
tagsList?: HTMLButtonElement | null; | |||
tagsSelector?: HTMLDivElement | null; | |||
state: State = { popupOpen: false, popupPosition: { top: 0, right: 0 } }; | |||
componentDidMount() { |
@@ -37,7 +37,7 @@ type State = { | |||
}; | |||
export default class ApplicationQualityGate extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface State { | |||
} | |||
export default class Activity extends React.PureComponent<Props> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -59,7 +59,7 @@ interface State { | |||
} | |||
export class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -32,7 +32,7 @@ interface State { | |||
} | |||
export default class Report extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -33,7 +33,7 @@ interface State { | |||
} | |||
export default class Subscription extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -43,7 +43,7 @@ interface State { | |||
const BRANCH_LIFETIME_SETTING = 'sonar.dbcleaner.daysBeforeDeletingInactiveShortLivingBranches'; | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -46,7 +46,7 @@ interface State { | |||
} | |||
export default class BranchRow extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { changingLeak: false, deleting: false, renaming: false }; | |||
componentDidMount() { |
@@ -35,7 +35,7 @@ interface State { | |||
} | |||
export default class DeleteBranchModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface State { | |||
const LEAK_PERIOD = 'sonar.leak.period'; | |||
export default class LeakPeriodForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true, submitting: false }; | |||
componentDidMount() { |
@@ -35,7 +35,7 @@ interface State { | |||
export const LONG_BRANCH_PATTERN = 'sonar.branch.longLivedBranches.regex'; | |||
export default class LongBranchesPattern extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { formOpen: false }; | |||
componentDidMount() { |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class RenameBranchModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -35,7 +35,7 @@ interface State { | |||
} | |||
export default class SettingForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -25,7 +25,7 @@ jest.mock('../../../../api/settings', () => ({ | |||
import * as React from 'react'; | |||
import { mount, shallow } from 'enzyme'; | |||
import App from '../App'; | |||
import { Branch, BranchType } from '../../../../app/types'; | |||
import { BranchType, MainBranch, LongLivingBranch, ShortLivingBranch } from '../../../../app/types'; | |||
const getValues = require('../../../../api/settings').getValues as jest.Mock<any>; | |||
@@ -34,7 +34,7 @@ beforeEach(() => { | |||
}); | |||
it('renders sorted list of branches', () => { | |||
const branches: Branch[] = [ | |||
const branches: [MainBranch, LongLivingBranch, ShortLivingBranch] = [ | |||
{ isMain: true, name: 'master' }, | |||
{ isMain: false, name: 'branch-1.0', type: BranchType.LONG }, | |||
{ isMain: false, name: 'branch-1.0', mergeBranch: 'master', type: BranchType.SHORT } |
@@ -45,7 +45,7 @@ interface State { | |||
} | |||
export default class App extends React.PureComponent<Props> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface Option { | |||
} | |||
export default class Form extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -43,7 +43,7 @@ interface State { | |||
} | |||
export default class QualityProfiles extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: true }; | |||
componentDidMount() { |
@@ -33,7 +33,7 @@ interface State { | |||
} | |||
export default class ProfileRow extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -56,7 +56,7 @@ interface State { | |||
} | |||
export default class AllProjects extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object.isRequired |
@@ -47,7 +47,7 @@ interface State { | |||
const LIST_SIZE = 10; | |||
export default class TagsFilter extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -52,7 +52,7 @@ interface State { | |||
} | |||
export default class App extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -48,7 +48,7 @@ interface State { | |||
} | |||
export default class BulkApplyTemplateModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { done: false, loading: true, submitting: false }; | |||
componentDidMount() { |
@@ -47,8 +47,8 @@ interface State { | |||
} | |||
export default class CreateProjectForm extends React.PureComponent<Props, State> { | |||
closeButton: HTMLElement | null; | |||
mounted: boolean; | |||
closeButton?: HTMLElement | null; | |||
mounted = false; | |||
constructor(props: Props) { | |||
super(props); |
@@ -40,7 +40,7 @@ interface State { | |||
} | |||
export default class DeleteModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -39,7 +39,7 @@ interface State { | |||
} | |||
export default class ProjectRowActions extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false, restoreAccessModal: false }; | |||
componentDidMount() { |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class RestoreAccessModal extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -57,8 +57,7 @@ interface State { | |||
} | |||
export default class Search extends React.PureComponent<Props, State> { | |||
input: HTMLInputElement; | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { bulkApplyTemplateModal: false, deleteModal: false }; | |||
getQualifierOptions = () => { |
@@ -37,7 +37,7 @@ interface State { | |||
} | |||
export default class CopyQualityGateForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class CreateQualityGateForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class DeleteConditionForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
state: State = { loading: false }; | |||
componentDidMount() { |
@@ -36,7 +36,7 @@ interface State { | |||
} | |||
export default class DeleteQualityGateForm extends React.PureComponent<Props, State> { | |||
mounted: boolean; | |||
mounted = false; | |||
static contextTypes = { | |||
router: PropTypes.object |