Этот коммит содержится в:
Conor Macpherson
2023-04-04 16:55:25 -04:00
родитель 9e25878ea7
Коммит 9e41644c5b
2 изменённых файлов: 69 добавлений и 72 удалений

Просмотреть файл

@@ -24,7 +24,6 @@ import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpa
import {getExpandSeatsLink} from 'selectors/cloud'; import {getExpandSeatsLink} from 'selectors/cloud';
import useControlSelfHostedExpansionModal from 'components/common/hooks/useControlSelfHostedExpansionModal'; import useControlSelfHostedExpansionModal from 'components/common/hooks/useControlSelfHostedExpansionModal';
import {useQuery} from 'utils/http_utils'; import {useQuery} from 'utils/http_utils';
import {STORAGE_KEY_EXPANSION_IN_PROGRESS} from 'components/self_hosted_purchases/constants';
const DAYS_UNTIL_EXPIRY_WARNING_DISPLAY_THRESHOLD = 30; const DAYS_UNTIL_EXPIRY_WARNING_DISPLAY_THRESHOLD = 30;
const DAYS_UNTIL_EXPIRY_DANGER_DISPLAY_THRESHOLD = 5; const DAYS_UNTIL_EXPIRY_DANGER_DISPLAY_THRESHOLD = 5;
@@ -66,9 +65,7 @@ const EnterpriseEditionLeftPanel = ({
const actionQueryParam = query.get('action'); const actionQueryParam = query.get('action');
useEffect(() => { useEffect(() => {
console.log(actionQueryParam);
if (actionQueryParam === 'show_expansion_modal' && canExpand && isSelfHostedExpansionEnabled) { if (actionQueryParam === 'show_expansion_modal' && canExpand && isSelfHostedExpansionEnabled) {
console.log('Open modal!');
selfHostedExpansionModal.open(); selfHostedExpansionModal.open();
query.set('action', ''); query.set('action', '');
} }

Просмотреть файл

@@ -356,98 +356,98 @@ export default function SelfHostedExpansionModal() {
<div className='footer-text'>{'Questions?'}</div> <div className='footer-text'>{'Questions?'}</div>
<ContactSalesLink/> <ContactSalesLink/>
</div> </div>
<div className='center'> <div className='center'>
<div <div
className='form' className='form'
data-testid='shpm-form' data-testid='shpm-form'
> >
<span className='section-title'> <span className='section-title'>
{intl.formatMessage({ {intl.formatMessage({
id: 'payment_form.credit_card', id: 'payment_form.credit_card',
defaultMessage: 'Credit Card', defaultMessage: 'Credit Card',
})} })}
</span> </span>
<div className='form-row'> <div className='form-row'>
<CardInput <CardInput
forwardedRef={cardRef} forwardedRef={cardRef}
required={true} required={true}
onCardInputChange={(event: StripeCardElementChangeEvent) => { onCardInputChange={(event: StripeCardElementChangeEvent) => {
setFormState({...formState, cardFilled: event.complete}); setFormState({...formState, cardFilled: event.complete});
}} }}
theme={theme} theme={theme}
/> />
</div> </div>
<div className='form-row'> <div className='form-row'>
<Input <Input
name='organization' name='organization'
type='text' type='text'
value={formState.organization} value={formState.organization}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setFormState({...formState, organization: e.target.value}); setFormState({...formState, organization: e.target.value});
}} }}
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({
id: 'self_hosted_signup.organization', id: 'self_hosted_signup.organization',
defaultMessage: 'Organization Name', defaultMessage: 'Organization Name',
})} })}
required={true} required={true}
/> />
</div> </div>
<div className='form-row'> <div className='form-row'>
<Input <Input
name='name' name='name'
type='text' type='text'
value={formState.cardName} value={formState.cardName}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setFormState({...formState, cardName: e.target.value}); setFormState({...formState, cardName: e.target.value});
}} }}
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({
id: 'payment_form.name_on_card', id: 'payment_form.name_on_card',
defaultMessage: 'Name on Card', defaultMessage: 'Name on Card',
})} })}
required={true} required={true}
/> />
</div> </div>
<span className='section-title'> <span className='section-title'>
<FormattedMessage <FormattedMessage
id='payment_form.billing_address' id='payment_form.billing_address'
defaultMessage='Billing address' defaultMessage='Billing address'
/> />
</span> </span>
<Address <Address
testPrefix='selfHostedExpansion' testPrefix='selfHostedExpansion'
type='billing' type='billing'
country={formState.country} country={formState.country}
changeCountry={(option) => { changeCountry={(option) => {
setFormState({...formState, country: option.value}); setFormState({...formState, country: option.value});
}} }}
address={formState.address} address={formState.address}
changeAddress={(e) => { changeAddress={(e) => {
setFormState({...formState, address: e.target.value}); setFormState({...formState, address: e.target.value});
}} }}
address2={formState.address2} address2={formState.address2}
changeAddress2={(e) => { changeAddress2={(e) => {
setFormState({...formState, address2: e.target.value}); setFormState({...formState, address2: e.target.value});
}} }}
city={formState.city} city={formState.city}
changeCity={(e) => { changeCity={(e) => {
setFormState({...formState, city: e.target.value}); setFormState({...formState, city: e.target.value});
}} }}
state={formState.state} state={formState.state}
changeState={(state: string) => { changeState={(state: string) => {
setFormState({...formState, state}); setFormState({...formState, state});
}} }}
postalCode={formState.postalCode} postalCode={formState.postalCode}
changePostalCode={(e) => { changePostalCode={(e) => {
setFormState({...formState, postalCode: e.target.value}); setFormState({...formState, postalCode: e.target.value});
}} }}
/> />
<ChooseDifferentShipping <ChooseDifferentShipping
shippingIsSame={formState.shippingSame} shippingIsSame={formState.shippingSame}
setShippingIsSame={(val: boolean) => { setShippingIsSame={(val: boolean) => {
setFormState({...formState, shippingSame: val}); setFormState({...formState, shippingSame: val});
}} }}
/> />
{!formState.shippingSame && ( {!formState.shippingSame && (
<> <>
<div className='section-title'> <div className='section-title'>
<FormattedMessage <FormattedMessage
@@ -485,14 +485,14 @@ export default function SelfHostedExpansionModal() {
/> />
</> </>
)} )}
<Terms <Terms
agreed={formState.agreedTerms} agreed={formState.agreedTerms}
setAgreed={(data: boolean) => { setAgreed={(data: boolean) => {
setFormState({...formState, agreedTerms: data}); setFormState({...formState, agreedTerms: data});
}} }}
/> />
</div> </div>
</div> </div>
<div className='rhs'> <div className='rhs'>
<SelfHostedExpansionCard <SelfHostedExpansionCard
updateSeats={(seats: number) => { updateSeats={(seats: number) => {