aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-gates/components
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-gates/components')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx15
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx19
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx25
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx17
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx11
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/PermissionItem.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissions.tsx13
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx11
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx9
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsRenderer.tsx13
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx3
20 files changed, 102 insertions, 76 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx
index e2bd83f3f84..7ff06229f15 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx
@@ -33,6 +33,7 @@ import {
removeWhitePageClass
} from '../../../helpers/pages';
import { getQualityGateUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
import '../styles.css';
import Details from './Details';
import List from './List';
@@ -41,7 +42,7 @@ import ListHeader from './ListHeader';
interface State {
canCreate: boolean;
loading: boolean;
- qualityGates: T.QualityGate[];
+ qualityGates: QualityGate[];
}
class App extends React.PureComponent<Pick<WithRouterProps, 'params' | 'router'>, State> {
@@ -86,12 +87,12 @@ class App extends React.PureComponent<Pick<WithRouterProps, 'params' | 'router'>
);
};
- openDefault(qualityGates: T.QualityGate[]) {
+ openDefault(qualityGates: QualityGate[]) {
const defaultQualityGate = qualityGates.find(gate => Boolean(gate.isDefault))!;
this.props.router.replace(getQualityGateUrl(String(defaultQualityGate.id)));
}
- handleSetDefault = (qualityGate: T.QualityGate) => {
+ handleSetDefault = (qualityGate: QualityGate) => {
this.setState(({ qualityGates }) => {
return {
qualityGates: qualityGates.map(candidate => {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx
index c03a1bc871f..7a6bc628c0f 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx
@@ -24,16 +24,17 @@ import { DeleteButton, EditButton } from '../../../components/controls/buttons';
import ConfirmModal from '../../../components/controls/ConfirmModal';
import { getLocalizedMetricName, translate, translateWithParameters } from '../../../helpers/l10n';
import { formatMeasure } from '../../../helpers/measures';
+import { Condition as ConditionType, Metric, QualityGate } from '../../../types/types';
import { getLocalizedMetricNameNoDiffMetric } from '../utils';
import ConditionModal from './ConditionModal';
interface Props {
- condition: T.Condition;
+ condition: ConditionType;
canEdit: boolean;
- metric: T.Metric;
- onRemoveCondition: (Condition: T.Condition) => void;
- onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
- qualityGate: T.QualityGate;
+ metric: Metric;
+ onRemoveCondition: (Condition: ConditionType) => void;
+ onSaveCondition: (newCondition: ConditionType, oldCondition: ConditionType) => void;
+ qualityGate: QualityGate;
updated?: boolean;
}
@@ -51,7 +52,7 @@ export default class Condition extends React.PureComponent<Props, State> {
};
}
- handleUpdateCondition = (newCondition: T.Condition) => {
+ handleUpdateCondition = (newCondition: ConditionType) => {
this.props.onSaveCondition(newCondition, this.props.condition);
};
@@ -71,7 +72,7 @@ export default class Condition extends React.PureComponent<Props, State> {
this.setState({ deleteFormOpen: false });
};
- removeCondition = (condition: T.Condition) => {
+ removeCondition = (condition: ConditionType) => {
deleteCondition({ id: condition.id }).then(
() => this.props.onRemoveCondition(condition),
() => {}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx
index c28d5966448..cb13248790e 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx
@@ -24,25 +24,26 @@ import Radio from '../../../components/controls/Radio';
import { Alert } from '../../../components/ui/Alert';
import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
import { isDiffMetric } from '../../../helpers/measures';
+import { Condition, Metric, QualityGate } from '../../../types/types';
import { getPossibleOperators } from '../utils';
import ConditionOperator from './ConditionOperator';
import MetricSelect from './MetricSelect';
import ThresholdInput from './ThresholdInput';
interface Props {
- condition?: T.Condition;
- metric?: T.Metric;
- metrics?: T.Metric[];
+ condition?: Condition;
+ metric?: Metric;
+ metrics?: Metric[];
header: string;
- onAddCondition: (condition: T.Condition) => void;
+ onAddCondition: (condition: Condition) => void;
onClose: () => void;
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
}
interface State {
error: string;
errorMessage?: string;
- metric?: T.Metric;
+ metric?: Metric;
op?: string;
scope: 'new' | 'overall';
}
@@ -58,7 +59,7 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
};
}
- getSinglePossibleOperator(metric: T.Metric) {
+ getSinglePossibleOperator(metric: Metric) {
const operators = getPossibleOperators(metric);
return Array.isArray(operators) ? undefined : operators;
}
@@ -66,7 +67,7 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
handleFormSubmit = () => {
if (this.state.metric) {
const { condition, qualityGate } = this.props;
- const newCondition: T.Omit<T.Condition, 'id'> = {
+ const newCondition: Omit<Condition, 'id'> = {
metric: this.state.metric.key,
op: this.getSinglePossibleOperator(this.state.metric) || this.state.op,
error: this.state.error
@@ -94,7 +95,7 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
});
};
- handleMetricChange = (metric: T.Metric) => {
+ handleMetricChange = (metric: Metric) => {
this.setState({ metric, op: undefined, error: '' });
};
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx
index 3f70f2149e6..0b249ad49d2 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx
@@ -20,10 +20,11 @@
import * as React from 'react';
import SelectLegacy from '../../../components/controls/SelectLegacy';
import { translate } from '../../../helpers/l10n';
+import { Metric } from '../../../types/types';
import { getPossibleOperators } from '../utils';
interface Props {
- metric: T.Metric;
+ metric: Metric;
onOperatorChange: (op: string) => void;
op?: string;
}
@@ -33,7 +34,7 @@ export default class ConditionOperator extends React.PureComponent<Props> {
this.props.onOperatorChange(value);
};
- getLabel(op: string, metric: T.Metric) {
+ getLabel(op: string, metric: Metric) {
return metric.type === 'RATING'
? translate('quality_gates.operator', op, 'rating')
: translate('quality_gates.operator', op);
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
index 6d5d1fd5fd9..43c01d8f9b2 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
@@ -27,18 +27,25 @@ import { Alert } from '../../../components/ui/Alert';
import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
import { isDiffMetric } from '../../../helpers/measures';
import { MetricKey } from '../../../types/metrics';
+import {
+ AppState,
+ Condition as ConditionType,
+ Dict,
+ Metric,
+ QualityGate
+} from '../../../types/types';
import Condition from './Condition';
import ConditionModal from './ConditionModal';
interface Props {
- appState: Pick<T.AppState, 'branchesEnabled'>;
+ appState: Pick<AppState, 'branchesEnabled'>;
canEdit: boolean;
- conditions: T.Condition[];
- metrics: T.Dict<T.Metric>;
- onAddCondition: (condition: T.Condition) => void;
- onRemoveCondition: (Condition: T.Condition) => void;
- onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
- qualityGate: T.QualityGate;
+ conditions: ConditionType[];
+ metrics: Dict<Metric>;
+ onAddCondition: (condition: ConditionType) => void;
+ onRemoveCondition: (Condition: ConditionType) => void;
+ onSaveCondition: (newCondition: ConditionType, oldCondition: ConditionType) => void;
+ qualityGate: QualityGate;
updatedConditionId?: number;
}
@@ -51,7 +58,7 @@ const FORBIDDEN_METRICS: string[] = [
];
export class Conditions extends React.PureComponent<Props> {
- renderConditionsTable = (conditions: T.Condition[], scope: 'new' | 'overall') => {
+ renderConditionsTable = (conditions: ConditionType[], scope: 'new' | 'overall') => {
const {
qualityGate,
metrics,
@@ -111,7 +118,7 @@ export class Conditions extends React.PureComponent<Props> {
isDiffMetric(condition.metric)
);
- const duplicates: T.Condition[] = [];
+ const duplicates: ConditionType[] = [];
const savedConditions = existingConditions.filter(condition => condition.id != null);
savedConditions.forEach(condition => {
const sameCount = savedConditions.filter(sample => sample.metric === condition.metric).length;
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
index fbace702f0e..7176ad5626f 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
@@ -25,11 +25,12 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
import { translate } from '../../../helpers/l10n';
import { getQualityGateUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
interface Props {
onClose: () => void;
onCopy: () => Promise<void>;
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
router: Pick<Router, 'push'>;
}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
index db52e78926a..db949d401d1 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
@@ -24,10 +24,11 @@ import ConfirmButton from '../../../components/controls/ConfirmButton';
import { Router, withRouter } from '../../../components/hoc/withRouter';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { getQualityGatesUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
interface Props {
onDelete: () => Promise<void>;
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
router: Pick<Router, 'push'>;
}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
index 9b7f5c7cd33..b7a10ee2de6 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
@@ -26,19 +26,20 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
import { translate } from '../../../helpers/l10n';
import { fetchMetrics } from '../../../store/rootActions';
import { getMetrics, Store } from '../../../store/rootReducer';
+import { Condition, Dict, Metric, QualityGate } from '../../../types/types';
import { addCondition, checkIfDefault, deleteCondition, replaceCondition } from '../utils';
import DetailsContent from './DetailsContent';
import DetailsHeader from './DetailsHeader';
interface OwnProps {
id: string;
- onSetDefault: (qualityGate: T.QualityGate) => void;
- qualityGates: T.QualityGate[];
+ onSetDefault: (qualityGate: QualityGate) => void;
+ qualityGates: QualityGate[];
refreshQualityGates: () => Promise<void>;
}
interface StateToProps {
- metrics: T.Dict<T.Metric>;
+ metrics: Dict<Metric>;
}
interface DispatchToProps {
@@ -49,7 +50,7 @@ type Props = StateToProps & DispatchToProps & OwnProps;
interface State {
loading: boolean;
- qualityGate?: T.QualityGate;
+ qualityGate?: QualityGate;
updatedConditionId?: number;
}
@@ -90,7 +91,7 @@ export class Details extends React.PureComponent<Props, State> {
);
};
- handleAddCondition = (condition: T.Condition) => {
+ handleAddCondition = (condition: Condition) => {
this.setState(({ qualityGate }) => {
if (!qualityGate) {
return null;
@@ -103,7 +104,7 @@ export class Details extends React.PureComponent<Props, State> {
});
};
- handleSaveCondition = (newCondition: T.Condition, oldCondition: T.Condition) => {
+ handleSaveCondition = (newCondition: Condition, oldCondition: Condition) => {
this.setState(({ qualityGate }) => {
if (!qualityGate) {
return null;
@@ -116,7 +117,7 @@ export class Details extends React.PureComponent<Props, State> {
});
};
- handleRemoveCondition = (condition: T.Condition) => {
+ handleRemoveCondition = (condition: Condition) => {
this.setState(({ qualityGate }) => {
if (!qualityGate) {
return null;
@@ -135,7 +136,7 @@ export class Details extends React.PureComponent<Props, State> {
return null;
}
this.props.onSetDefault(qualityGate);
- const newQualityGate: T.QualityGate = {
+ const newQualityGate: QualityGate = {
...qualityGate,
actions: { ...qualityGate.actions, delete: false, setAsDefault: false }
};
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
index 07fc3d5179c..9fe3cd10007 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
@@ -21,17 +21,18 @@ import * as React from 'react';
import HelpTooltip from '../../../components/controls/HelpTooltip';
import { Alert } from '../../../components/ui/Alert';
import { translate } from '../../../helpers/l10n';
+import { Condition, Dict, Metric, QualityGate } from '../../../types/types';
import Conditions from './Conditions';
import Projects from './Projects';
import QualityGatePermissions from './QualityGatePermissions';
export interface DetailsContentProps {
isDefault?: boolean;
- metrics: T.Dict<T.Metric>;
- onAddCondition: (condition: T.Condition) => void;
- onRemoveCondition: (Condition: T.Condition) => void;
- onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
- qualityGate: T.QualityGate;
+ metrics: Dict<Metric>;
+ onAddCondition: (condition: Condition) => void;
+ onRemoveCondition: (Condition: Condition) => void;
+ onSaveCondition: (newCondition: Condition, oldCondition: Condition) => void;
+ qualityGate: QualityGate;
updatedConditionId?: number;
}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx
index 5bd11877f2a..f84de737e80 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx
@@ -23,6 +23,7 @@ import { Button } from '../../../components/controls/buttons';
import ModalButton from '../../../components/controls/ModalButton';
import Tooltip from '../../../components/controls/Tooltip';
import { translate } from '../../../helpers/l10n';
+import { QualityGate } from '../../../types/types';
import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
import CopyQualityGateForm from './CopyQualityGateForm';
import DeleteQualityGateForm from './DeleteQualityGateForm';
@@ -30,7 +31,7 @@ import RenameQualityGateForm from './RenameQualityGateForm';
interface Props {
onSetDefault: () => void;
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
refreshItem: () => Promise<void>;
refreshList: () => Promise<void>;
}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
index 873cb4e4870..e7dca0aaa67 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
@@ -21,10 +21,11 @@ import * as React from 'react';
import { Link } from 'react-router';
import { translate } from '../../../helpers/l10n';
import { getQualityGateUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
interface Props {
- qualityGates: T.QualityGate[];
+ qualityGates: QualityGate[];
}
export default function List({ qualityGates }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx
index 089d6fafce2..7a213d430a5 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx
@@ -21,12 +21,13 @@ import { sortBy } from 'lodash';
import * as React from 'react';
import SelectLegacy from '../../../components/controls/SelectLegacy';
import { getLocalizedMetricDomain, translate } from '../../../helpers/l10n';
+import { Metric } from '../../../types/types';
import { getLocalizedMetricNameNoDiffMetric } from '../utils';
interface Props {
- metric?: T.Metric;
- metrics: T.Metric[];
- onMetricChange: (metric: T.Metric) => void;
+ metric?: Metric;
+ metrics: Metric[];
+ onMetricChange: (metric: Metric) => void;
}
interface Option {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/PermissionItem.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/PermissionItem.tsx
index 4c3067e598a..9d2558a05cc 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/PermissionItem.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/PermissionItem.tsx
@@ -22,10 +22,11 @@ import { DeleteButton } from '../../../components/controls/buttons';
import GroupIcon from '../../../components/icons/GroupIcon';
import Avatar from '../../../components/ui/Avatar';
import { Group, isUser } from '../../../types/quality-gates';
+import { UserBase } from '../../../types/types';
export interface PermissionItemProps {
- onClickDelete: (item: T.UserBase | Group) => void;
- item: T.UserBase | Group;
+ onClickDelete: (item: UserBase | Group) => void;
+ item: UserBase | Group;
}
export default function PermissionItem(props: PermissionItemProps) {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx
index ef0b28780ac..f7a57ab5233 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx
@@ -29,10 +29,11 @@ import SelectList, {
SelectListSearchParams
} from '../../../components/controls/SelectList';
import { translate } from '../../../helpers/l10n';
+import { QualityGate } from '../../../types/types';
interface Props {
canEdit?: boolean;
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
}
interface State {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissions.tsx
index 2391486abe1..9844c11fd07 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissions.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissions.tsx
@@ -28,10 +28,11 @@ import {
searchUsers
} from '../../../api/quality-gates';
import { Group, isUser, SearchPermissionsParameters } from '../../../types/quality-gates';
+import { QualityGate, UserBase } from '../../../types/types';
import QualityGatePermissionsRenderer from './QualityGatePermissionsRenderer';
interface Props {
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
}
interface State {
@@ -39,8 +40,8 @@ interface State {
submitting: boolean;
loading: boolean;
showAddModal: boolean;
- permissionToDelete?: T.UserBase | Group;
- users: T.UserBase[];
+ permissionToDelete?: UserBase | Group;
+ users: UserBase[];
}
export default class QualityGatePermissions extends React.Component<Props, State> {
@@ -95,7 +96,7 @@ export default class QualityGatePermissions extends React.Component<Props, State
this.setState({ showAddModal: true });
};
- handleSubmitAddPermission = async (item: T.UserBase | Group) => {
+ handleSubmitAddPermission = async (item: UserBase | Group) => {
const { qualityGate } = this.props;
this.setState({ submitting: true });
@@ -135,11 +136,11 @@ export default class QualityGatePermissions extends React.Component<Props, State
this.setState({ permissionToDelete: undefined });
};
- handleClickDeletePermission = (permissionToDelete?: T.UserBase | Group) => {
+ handleClickDeletePermission = (permissionToDelete?: UserBase | Group) => {
this.setState({ permissionToDelete });
};
- handleConfirmDeletePermission = async (item: T.UserBase | Group) => {
+ handleConfirmDeletePermission = async (item: UserBase | Group) => {
const { qualityGate } = this.props;
let error = false;
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx
index a4ae9357c1b..18155f51d33 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx
@@ -21,20 +21,21 @@ import { debounce } from 'lodash';
import * as React from 'react';
import { searchGroups, searchUsers } from '../../../api/quality-gates';
import { Group, SearchPermissionsParameters } from '../../../types/quality-gates';
+import { QualityGate, UserBase } from '../../../types/types';
import QualityGatePermissionsAddModalRenderer from './QualityGatePermissionsAddModalRenderer';
interface Props {
onClose: () => void;
- onSubmit: (selection: T.UserBase | Group) => void;
- qualityGate: T.QualityGate;
+ onSubmit: (selection: UserBase | Group) => void;
+ qualityGate: QualityGate;
submitting: boolean;
}
interface State {
loading: boolean;
query?: string;
- searchResults: Array<T.UserBase | Group>;
- selection?: T.UserBase | Group;
+ searchResults: Array<UserBase | Group>;
+ selection?: UserBase | Group;
}
const DEBOUNCE_DELAY = 250;
@@ -91,7 +92,7 @@ export default class QualityGatePermissionsAddModal extends React.Component<Prop
}
};
- handleSelection = (selection: T.UserBase | Group) => {
+ handleSelection = (selection: UserBase | Group) => {
this.setState({ selection });
};
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx
index bf1dc1944a5..efbb83991fd 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx
@@ -25,20 +25,21 @@ import GroupIcon from '../../../components/icons/GroupIcon';
import Avatar from '../../../components/ui/Avatar';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { Group, isUser } from '../../../types/quality-gates';
+import { UserBase } from '../../../types/types';
export interface QualityGatePermissionsAddModalRendererProps {
onClose: () => void;
onInputChange: (query: string) => void;
onSubmit: (event: React.SyntheticEvent<HTMLFormElement>) => void;
- onSelection: (selection: T.UserBase | Group) => void;
+ onSelection: (selection: UserBase | Group) => void;
submitting: boolean;
loading: boolean;
query: string;
- searchResults: Array<T.UserBase | Group>;
- selection?: T.UserBase | Group;
+ searchResults: Array<UserBase | Group>;
+ selection?: UserBase | Group;
}
-type Option = (T.UserBase | Group) & { value: string };
+type Option = (UserBase | Group) & { value: string };
export default function QualityGatePermissionsAddModalRenderer(
props: QualityGatePermissionsAddModalRendererProps
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsRenderer.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsRenderer.tsx
index aab84606c75..74dfc7a3851 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsRenderer.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsRenderer.tsx
@@ -24,6 +24,7 @@ import ConfirmModal from '../../../components/controls/ConfirmModal';
import DeferredSpinner from '../../../components/ui/DeferredSpinner';
import { translate } from '../../../helpers/l10n';
import { Group, isUser } from '../../../types/quality-gates';
+import { QualityGate, UserBase } from '../../../types/types';
import PermissionItem from './PermissionItem';
import QualityGatePermissionsAddModal from './QualityGatePermissionsAddModal';
@@ -32,15 +33,15 @@ export interface QualityGatePermissionsRendererProps {
loading: boolean;
onClickAddPermission: () => void;
onCloseAddPermission: () => void;
- onSubmitAddPermission: (item: T.UserBase | Group) => void;
+ onSubmitAddPermission: (item: UserBase | Group) => void;
onCloseDeletePermission: () => void;
- onConfirmDeletePermission: (item: T.UserBase | Group) => void;
- onClickDeletePermission: (item: T.UserBase | Group) => void;
- permissionToDelete?: T.UserBase | Group;
- qualityGate: T.QualityGate;
+ onConfirmDeletePermission: (item: UserBase | Group) => void;
+ onClickDeletePermission: (item: UserBase | Group) => void;
+ permissionToDelete?: UserBase | Group;
+ qualityGate: QualityGate;
showAddModal: boolean;
submitting: boolean;
- users: T.UserBase[];
+ users: UserBase[];
}
export default function QualityGatePermissionsRenderer(props: QualityGatePermissionsRendererProps) {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
index 8113666ba3e..45dad5c864e 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
@@ -23,11 +23,12 @@ import ConfirmModal from '../../../components/controls/ConfirmModal';
import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
import { translate } from '../../../helpers/l10n';
+import { QualityGate } from '../../../types/types';
interface Props {
onClose: () => void;
onRename: () => Promise<void>;
- qualityGate: T.QualityGate;
+ qualityGate: QualityGate;
}
interface State {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx
index 1776243fe98..a2af32073f2 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx
@@ -19,11 +19,12 @@
*/
import * as React from 'react';
import SelectLegacy from '../../../components/controls/SelectLegacy';
+import { Metric } from '../../../types/types';
interface Props {
name: string;
value: string;
- metric: T.Metric;
+ metric: Metric;
onChange: (value: string) => void;
}