class ProjectContainer extends React.PureComponent {
props: {
- addGlobalErrorMessage: () => void,
+ addGlobalErrorMessage: (message: string) => void,
children?: React.Element<*>,
location: {
query: { id: string }
mounted: boolean;
state: State;
props: {
- createOrganization: () => Promise<*>,
+ createOrganization: (fields: {}) => Promise<*>,
router: { push: string => void }
};
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-/* @flow */
+// @flow
import $ from 'jquery';
import moment from 'moment';
import React, { Component } from 'react';
export type Props = {
component?: Component,
currentUser: CurrentUser,
- fetchIssues: () => Promise<*>,
+ fetchIssues: ({}) => Promise<*>,
location: { pathname: string, query: { [string]: string } },
onRequestFail: Error => void,
- router: { push: () => void, replace: () => void }
+ router: { push: ({}) => void, replace: ({}) => void }
};
export type State = {
qualifier: string,
visibility: string
},
- onComponentChange: () => void,
+ onComponentChange: (changes: {}) => void,
onRequestFail: Object => void
|};
type Props = {
location: { query: { id: string } },
- fetchProjectActivity: (project: string) => void,
+ fetchProjectActivity: (project: string, filter: ?string) => void,
project: { configuration?: { showHistory: boolean } }
};
import type { Analysis } from '../../../../store/projectActivity/duck';
type Props = {
- addEvent: () => Promise<*>,
+ addEvent: (analysis: string, name: string, category?: string) => Promise<*>,
analysis: Analysis
};
import { translate } from '../../../../helpers/l10n';
type Props = {
- addEvent: () => Promise<*>,
+ addEvent: (analysis: string, name: string, category?: string) => Promise<*>,
analysis: Analysis,
addEventButtonText: string
};
import type { Analysis } from '../../../../store/projectActivity/duck';
type Props = {
- addEvent: () => Promise<*>,
+ addEvent: (analysis: string, version: string) => Promise<*>,
analysis: Analysis
};
import type { Event } from '../../../../store/projectActivity/duck';
type Props = {
- changeEvent: () => Promise<*>,
+ changeEvent: (event: string, name: string) => Promise<*>,
event: Event,
onClose: () => void
};
import { translate } from '../../../../helpers/l10n';
type Props = {
- changeEvent: () => Promise<*>,
+ changeEvent: (event: string, name: string) => Promise<*>,
changeEventButtonText: string,
event: Event,
onClose: () => void
import type { Event } from '../../../../store/projectActivity/duck';
type Props = {
- changeEvent: () => Promise<*>,
+ changeEvent: (event: string, name: string) => Promise<*>,
event: Event,
onClose: () => void
};
type Props = {
analysis: Analysis,
- deleteAnalysis: () => Promise<*>,
+ deleteAnalysis: (project: string, analysis: string) => Promise<*>,
project: string
};
type Props = {
analysis: string,
event: Event,
- deleteEvent: (string, string) => Promise<*>,
+ deleteEvent: (analysis: string, event: string) => Promise<*>,
onClose: () => void
};
type Props = {
analysis: string,
- deleteEvent: (string, string) => Promise<*>,
+ deleteEvent: (analysis: string, event: string) => Promise<*>,
event: Event,
removeEventButtonText: string,
removeEventQuestion: string,
type Props = {
analysis: string,
event: Event,
- deleteEvent: (string, string) => Promise<*>,
+ deleteEvent: (analysis: string, event: string) => Promise<*>,
onClose: () => void
};
const LIST_SIZE = 10;
export default class LanguagesFilter extends React.PureComponent {
- getSearchOptions: () => [{ label: string, value: string }];
props: Props;
property = 'languages';
- getSearchOptions(facet: {}, languages: {}) {
+ getSearchOptions(facet?: {}, languages: {}): Array<{ label: string, value: string }> {
let languageKeys = Object.keys(languages);
if (facet) {
languageKeys = difference(languageKeys, Object.keys(facet));
type Props = {
property: string,
query: {},
- options: [{ label: string, value: string }],
+ options: Array<{ label: string, value: string }>,
router: { push: ({ pathname: string, query?: {} }) => void },
onInputChange?: string => void,
onOpen?: void => void,
const LIST_SIZE = 10;
export default class TagsFilter extends React.PureComponent {
- getSearchOptions: () => [{ label: string, value: string }];
props: Props;
state: State;
property: string;
this.handleSearch = debounce(this.handleSearch.bind(this), 250);
}
- getSearchOptions(facet: {}, tags: Array<string>) {
+ getSearchOptions(facet?: {}, tags: Array<string>): Array<{ label: string, value: string }> {
let tagsCopy = [...tags];
if (facet) {
tagsCopy = difference(tagsCopy, Object.keys(facet));
onRequestFail: Object => void,
organization: ?string,
profiles: Array<Profile>,
- router: { replace: () => void },
+ router: { replace: ({}) => void },
updateProfiles: () => Promise<*>
};
});
};
- loadDuplications = (line: SourceLine, element: HTMLElement) => {
+ loadDuplications = (line: SourceLine) => {
getDuplications(this.props.component).then(r => {
if (this.mounted) {
this.setState(
() => {
// immediately show dropdown popup if there is only one duplicated block
if (r.duplications.length === 1) {
- this.handleDuplicationClick(0, line.line, element);
+ this.handleDuplicationClick(0, line.line);
}
}
);
issues: Array<Issue>,
issuesByLine: { [number]: Array<Issue> },
issueLocationsByLine: { [number]: Array<LinearIssueLocation> },
- loadDuplications: (SourceLine, HTMLElement) => void,
+ loadDuplications: SourceLine => void,
loadSourcesAfter: () => void,
loadSourcesBefore: () => void,
loadingSourcesAfter: boolean,
issues: Array<Issue>,
last: boolean,
line: SourceLine,
- loadDuplications: (SourceLine, HTMLElement) => void,
+ loadDuplications: SourceLine => void,
onClick: (SourceLine, HTMLElement) => void,
onCoverageClick: (SourceLine, HTMLElement) => void,
onDuplicationClick: (number, number) => void,
type Props = {
line: SourceLine,
- onClick: (SourceLine, HTMLElement) => void
+ onClick: SourceLine => void
};
export default class LineDuplications extends React.PureComponent {
handleClick = (e: SyntheticInputEvent) => {
e.preventDefault();
- this.props.onClick(this.props.line, e.target);
+ this.props.onClick(this.props.line);
};
render() {
onFail: Error => void,
onFilter?: (property: string, issue: Issue) => void,
selected: boolean,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
|};
export default class IssueView extends React.PureComponent {
onAssign: string => void,
onChange: Issue => void,
onFail: Error => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
};
type State = {
canAssign: boolean,
onAssign: string => void,
onFail: Error => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
};
export default class IssueAssign extends React.PureComponent {
isOpen: boolean,
issue: Issue,
creationDate: string,
- togglePopup: string => void,
+ togglePopup: (string, boolean | void) => void,
onFail: Error => void
};
isOpen: boolean,
issue: Issue,
setIssueProperty: (string, string, apiCall: (Object) => Promise<*>, string) => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
};
export default class IssueSeverity extends React.PureComponent {
issue: Issue,
onChange: Issue => void,
onFail: Error => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
|};
export default class IssueTags extends React.PureComponent {
currentPopup: string,
onFail: Error => void,
onFilter?: (property: string, issue: Issue) => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
|};
const stopPropagation = (event: Event) => event.stopPropagation();
issue: Issue,
onChange: Issue => void,
onFail: Error => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
};
export default class IssueTransition extends React.PureComponent {
isOpen: boolean,
issue: Issue,
setIssueProperty: (string, string, apiCall: (Object) => Promise<*>, string) => void,
- togglePopup: string => void
+ togglePopup: (string, boolean | void) => void
};
export default class IssueType extends React.PureComponent {
type Props = {|
isOpen: boolean,
issue: Issue,
- togglePopup: string => void,
+ togglePopup: (string, boolean | void) => void,
onFail: Error => void,
onFilter: (property: string, issue: Issue) => void
|};