From 8dea56b4c70d09fc069add79ab0617bf6bb0e16a Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Tue, 27 Nov 2018 14:13:26 +0100 Subject: SONARCLOUD-176 Allow upgrading to paid organization when provisioning projects * Update UpgradeOrganizationBox component with new cardPlan component * Display upgrade box only when needed * Introduce isDefined type guard * Update repositories selection workflow --- .../src/main/js/components/controls/Modal.tsx | 10 ++++++++-- .../src/main/js/components/controls/Tooltip.tsx | 23 +++++++++++----------- .../main/js/components/controls/react-select.css | 11 +++++++++++ 3 files changed, 30 insertions(+), 14 deletions(-) (limited to 'server/sonar-web/src/main/js/components/controls') diff --git a/server/sonar-web/src/main/js/components/controls/Modal.tsx b/server/sonar-web/src/main/js/components/controls/Modal.tsx index d57ba7d4ea1..14d5ea0de7c 100644 --- a/server/sonar-web/src/main/js/components/controls/Modal.tsx +++ b/server/sonar-web/src/main/js/components/controls/Modal.tsx @@ -25,7 +25,9 @@ ReactModal.setAppElement('#content'); interface OwnProps { medium?: boolean; + noBackdrop?: boolean; large?: boolean; + simple?: true; } type MandatoryProps = Pick; @@ -35,9 +37,13 @@ type Props = Partial & MandatoryProps & OwnProps; export default function Modal(props: Props) { return ( ); diff --git a/server/sonar-web/src/main/js/components/controls/Tooltip.tsx b/server/sonar-web/src/main/js/components/controls/Tooltip.tsx index 802be846f8b..529cb1ed269 100644 --- a/server/sonar-web/src/main/js/components/controls/Tooltip.tsx +++ b/server/sonar-web/src/main/js/components/controls/Tooltip.tsx @@ -207,13 +207,15 @@ export class TooltipInner extends React.Component { handleMouseEnter = () => { this.mouseEnterTimeout = window.setTimeout(() => { - if (this.mounted) { - // for some reason even after the `this.mouseEnterTimeout` is cleared, it still triggers - // to workaround this issue, check that its value is not `undefined` - // (if it's `undefined`, it means the timer has been reset) - if (this.props.visible === undefined && this.mouseEnterTimeout !== undefined) { - this.setState({ visible: true }); - } + // for some reason even after the `this.mouseEnterTimeout` is cleared, it still triggers + // to workaround this issue, check that its value is not `undefined` + // (if it's `undefined`, it means the timer has been reset) + if ( + this.mounted && + this.props.visible === undefined && + this.mouseEnterTimeout !== undefined + ) { + this.setState({ visible: true }); } }, (this.props.mouseEnterDelay || 0) * 1000); @@ -230,10 +232,8 @@ export class TooltipInner extends React.Component { if (!this.mouseIn) { this.mouseLeaveTimeout = window.setTimeout(() => { - if (this.mounted) { - if (this.props.visible === undefined && !this.mouseIn) { - this.setState({ visible: false }); - } + if (this.mounted && this.props.visible === undefined && !this.mouseIn) { + this.setState({ visible: false }); } }, (this.props.mouseLeaveDelay || 0) * 1000); @@ -254,7 +254,6 @@ export class TooltipInner extends React.Component { render() { const { classNameSpace = 'tooltip' } = this.props; - return ( <> {React.cloneElement(this.props.children, { diff --git a/server/sonar-web/src/main/js/components/controls/react-select.css b/server/sonar-web/src/main/js/components/controls/react-select.css index ac5829d0daf..dae9dbd8cd8 100644 --- a/server/sonar-web/src/main/js/components/controls/react-select.css +++ b/server/sonar-web/src/main/js/components/controls/react-select.css @@ -90,6 +90,10 @@ border-color: var(--blue); } +.Select-placeholder { + color: var(--secondFontColor); +} + .Select-placeholder, :not(.Select--multi) > .Select-control .Select-value { bottom: 0; @@ -115,6 +119,13 @@ padding-top: 4px; } +.Select-value .outline-badge, +.Select-option .outline-badge { + height: 20px; + line-height: 19px; + margin-top: 1px; +} + .Select-option svg, .Select-option img, .Select-option [class^='icon-'] { -- cgit v1.2.3