Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 66 additions & 10 deletions src/cloud/components/SeriesCardinalityIncreaseForm.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,97 @@
// Libraries
import React, {FC} from 'react'
import React, {FC, useState} from 'react'
import {useDispatch, useSelector} from 'react-redux'

// Components
import {
Form,
Button,
Heading,
TextArea,
Button,
ButtonType,
ButtonShape,
InfluxColors,
ComponentSize,
ComponentColor,
HeadingElement,
ComponentStatus,
} from '@influxdata/clockface'

// Actions
import {showOverlay, dismissOverlay} from 'src/overlays/actions/overlays'

// Selectors
import {selectQuartzIdentity} from 'src/identity/selectors'

export const SeriesCardinalityIncreaseForm: FC = () => {
const dispatch = useDispatch()
const quartzIdentity = useSelector(selectQuartzIdentity)
const {org: identityOrg} = quartzIdentity.currentIdentity

const [requestDetails, setRequestDetails] = useState('')

const handleDetailsValidation = (value: string): string | null => {
if (!value) {
return 'Request details are required'
}
return null
}

const isFormValid = (): boolean => {
return Boolean(requestDetails)
}

const handleSubmit = (): void => {
window.open(`https://support.influxdata.com/s/login`)
const orgName = identityOrg.name
const orgID = identityOrg.id

dispatch(
showOverlay(
'contact-support',
{
subject: `[Org: ${orgName}] [Org Id: ${orgID}] Request Series Cardinality Limit Increase`,
description: requestDetails,
},
dismissOverlay
)
)
}

return (
<div>
<Form onSubmit={handleSubmit}>
<Form.Divider lineColor={InfluxColors.Grey15} />
<Heading element={HeadingElement.H4}>
Request Series Cardinality Limit Increase
</Heading>
<p>
To request a series cardinality limit increase, please contact our
support team.
</p>
<Form.ValidationElement
label="Request Details"
validationFunc={handleDetailsValidation}
value={requestDetails}
required={true}
>
{status => (
<TextArea
name="Request Details"
placeholder="Tell us how much series cardinality you need, your use-case details, what you've tried so far, and why you need an increase."
status={status}
value={requestDetails}
onChange={e => setRequestDetails(e.target.value)}
testID="cardinality-request-details"
rows={10}
/>
)}
</Form.ValidationElement>
<Button
shape={ButtonShape.Default}
onClick={handleSubmit}
type={ButtonType.Submit}
size={ComponentSize.Medium}
color={ComponentColor.Primary}
className="rate-alert--request-increase-button"
text="Submit Request"
status={
isFormValid() ? ComponentStatus.Default : ComponentStatus.Disabled
}
/>
</div>
</Form>
)
}
56 changes: 46 additions & 10 deletions src/cloud/components/WriteLimitOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,55 @@
import React, {useContext, FC} from 'react'
import React, {useState, useContext, FC} from 'react'
import {useDispatch, useSelector} from 'react-redux'

import {
OverlayContainer,
Overlay,
Form,
Heading,
Input,
HeadingElement,
Button,
ButtonType,
ButtonShape,
ComponentSize,
ComponentColor,
ComponentStatus,
InputType,
} from '@influxdata/clockface'

import {OverlayContext} from 'src/overlays/components/OverlayController'
import {showOverlay, dismissOverlay} from 'src/overlays/actions/overlays'

// Reporting
import {event} from 'src/cloud/utils/reporting'
// Selectors
import {selectQuartzIdentity} from 'src/identity/selectors'

// Design
import './WriteLimitOverlay.scss'

const WriteLimitOverlay: FC = () => {
const [limitReason, setLimitReason] = useState('')

const {onClose} = useContext(OverlayContext)
const dispatch = useDispatch()
const quartzIdentity = useSelector(selectQuartzIdentity)
const {org: identityOrg} = quartzIdentity.currentIdentity

const handleSubmit = (): void => {
event('limit.requestincrease.writes')
const orgName = identityOrg.name
const orgID = identityOrg.id

window.open(`https://support.influxdata.com/s/login`)
dispatch(
showOverlay(
'contact-support',
{
subject: `[Org: ${orgName}] [Org Id: ${orgID}] Request Query Write Limit Increase`,
description: limitReason,
},
dismissOverlay
)
)
}

return (
<OverlayContainer
maxWidth={760}
Expand All @@ -40,14 +62,23 @@ const WriteLimitOverlay: FC = () => {
wrapText={true}
/>
<Overlay.Body className="limits-increasewrites--body">
<div className="limits-increasewrites--form">
<Form onSubmit={handleSubmit} className="limits-increasewrites--form">
<Heading element={HeadingElement.H4}>
Request Query Write Limit Increase
</Heading>
<p>
To request a write limit increase, please contact our support team.
</p>
</div>
<Form.Element label="Request Details" required={true}>
<Input
name="Write Limit Increase"
placeholder="Tell us how much you need your write limit raised and your use-case details"
required={true}
autoFocus={true}
value={limitReason}
onChange={e => setLimitReason(e.target.value)}
testID="rate-alert-form-amount"
type={InputType.Text}
/>
</Form.Element>
</Form>
</Overlay.Body>
<Overlay.Footer>
<Button
Expand All @@ -65,6 +96,11 @@ const WriteLimitOverlay: FC = () => {
color={ComponentColor.Primary}
className="rate-alert--request-increase-button"
text="Submit Request"
status={
limitReason.length
? ComponentStatus.Default
: ComponentStatus.Disabled
}
/>
</Overlay.Footer>
</OverlayContainer>
Expand Down
4 changes: 2 additions & 2 deletions src/cloud/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const RATE_LIMIT_ERROR_STATUS = 429

export const RATE_LIMIT_ERROR_TEXT =
'Oops. It looks like you have exceeded the query limits allowed as part of your plan. If you would like to increase your query limits, reach out at support.influxdata.com.'
'Oops. It looks like you have exceeded the query limits allowed as part of your plan. If you would like to increase your query limits, please use the Contact Support option in the Help menu.'

export const ASSET_LIMIT_ERROR_STATUS = 403

export const ASSET_LIMIT_ERROR_TEXT =
'Oops. It looks like you have exceeded the asset limits allowed as part of your plan. If you would like to increase your limits, reach out at support.influxdata.com.'
'Oops. It looks like you have exceeded the asset limits allowed as part of your plan. If you would like to increase your limits, please use the Contact Support option in the Help menu.'

export const REQUEST_TIMEOUT_STATUS = 408
export const GATEWAY_TIMEOUT_STATUS = 504
31 changes: 18 additions & 13 deletions src/identity/components/OrganizationListTab/OrganizationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {FC} from 'react'
import {useDispatch} from 'react-redux'
import {
FlexBox,
FlexDirection,
Expand All @@ -7,8 +8,8 @@ import {
ResourceCard,
} from '@influxdata/clockface'

// Utils
import {SafeBlankLink} from 'src/utils/SafeBlankLink'
// Actions
import {showOverlay, dismissOverlay} from 'src/overlays/actions/overlays'

// Styles
import './OrganizationCard.scss'
Expand All @@ -22,17 +23,6 @@ interface OrgCardProps {
regionName: string
}

const tooltipContent = (
<p>
Organizations can be reactivated within 7 days of deletion. Contact support
at{' '}
<SafeBlankLink href="https://support.influxdata.com/s/login">
https://support.influxdata.com/s/login
</SafeBlankLink>{' '}
to reactivate.
</p>
)

export const OrganizationCard: FC<OrgCardProps> = ({
name,
isActive,
Expand All @@ -41,8 +31,23 @@ export const OrganizationCard: FC<OrgCardProps> = ({
regionCode,
regionName,
}) => {
const dispatch = useDispatch()
const isOrgSuspended = provisioningStatus === 'suspended'

const handleContactSupport = () => {
dispatch(showOverlay('contact-support', null, dismissOverlay))
}

const tooltipContent = (
<p>
Organizations can be reactivated within 7 days of deletion. Please{' '}
<a href="#" onClick={handleContactSupport}>
contact support
</a>{' '}
to reactivate.
</p>
)

return (
<ResourceCard
className={
Expand Down
2 changes: 1 addition & 1 deletion src/onboarding/containers/LoginPageContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class LoginPageContents extends PureComponent<Props> {
this.setState({...errors, emailError})
} else {
const emailError =
'We have been notified of an issue while accessing your account. If this issue persists, please contact support at support.influxdata.com'
'We have been notified of an issue while accessing your account. If this issue persists, please use the Contact Support option in the Help menu'
this.setState({...errors, emailError})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import {notify} from 'src/shared/actions/notifications'
import {OverlayContext} from 'src/overlays/components/OverlayController'
import {reportErrorThroughHoneyBadger} from 'src/shared/utils/errors'

// Actions
import {showOverlay, dismissOverlay} from 'src/overlays/actions/overlays'

// Eventing
import {DeleteOrgOverlay, multiOrgTag} from 'src/identity/events/multiOrgEvents'
import {event} from 'src/cloud/utils/reporting'
Expand All @@ -61,20 +64,6 @@ const linkStyle = {
textDecoration: 'underline',
}

const SupportLink = (): JSX.Element => {
return (
<a
data-testid="go-to-new-org--link"
href="https://support.influxdata.com/s/login"
style={linkStyle}
target="_blank"
rel="noopener noreferrer"
>
https://support.influxdata.com/s/login
</a>
)
}

export const SuspendPaidOrgOverlay: FC = () => {
const account = useSelector(selectCurrentAccount)
const org = useSelector(selectCurrentOrg)
Expand All @@ -90,6 +79,26 @@ export const SuspendPaidOrgOverlay: FC = () => {
const orgDeleteInProgress = deleteButtonStatus === ComponentStatus.Loading
const onClickCancel = orgDeleteInProgress ? noop : onClose

const handleContactSupport = () => {
dispatch(showOverlay('contact-support', null, dismissOverlay))
}

const SupportLink = (): JSX.Element => {
return (
<span style={linkStyle}>
Please{' '}
<a
href="#"
onClick={handleContactSupport}
style={{color: 'white', textDecoration: 'underline'}}
>
contact support
</a>{' '}
to reach our support team.
</span>
)
}

const toggleAcceptedTerms = () => {
const currentAcceptanceStatus = !userAcceptedTerms
setUserAcceptedTerms(currentAcceptanceStatus)
Expand Down
4 changes: 1 addition & 3 deletions src/pageLayout/containers/MainNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ export const MainNavigation: FC = () => {
return null
}

const isContractCustomer = accountType === 'contract'

const docslink = isIOxOrg
? 'https://docs.influxdata.com/influxdb/cloud-serverless/'
: 'https://docs.influxdata.com/'
Expand Down Expand Up @@ -417,7 +415,7 @@ export const MainNavigation: FC = () => {
/>
)}
/>
{CLOUD && isContractCustomer && (
{CLOUD && (
<TreeNav.SubItem
id="contactSupport"
label="Contact Support"
Expand Down
13 changes: 11 additions & 2 deletions src/shared/apis/sfdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ export const createSfdcSupportCase = async (
description: string,
email: string,
severity: string,
subject: string
subject: string,
caseOrigin: string,
deploymentType: string
) => {
const params: typeof PostUiproxySfdcSupportParams = {
data: {description, email, severity, subject},
data: {
description,
email,
severity,
subject,
caseOrigin,
deploymentType,
},
}

const response = await postUiproxySfdcSupport(params)
Expand Down
Loading