mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Remove unused end trial modal (#4804)
This commit is contained in:
parent
3a8561f8d1
commit
deee30ad75
@ -231,9 +231,6 @@ export function setSessionData(
|
|||||||
export async function listTeams() {
|
export async function listTeams() {
|
||||||
return fetch.get('/api/teams', getCurrentSessionId());
|
return fetch.get('/api/teams', getCurrentSessionId());
|
||||||
}
|
}
|
||||||
export async function endTrial() {
|
|
||||||
await fetch.put('/api/billing/end-trial', null, getCurrentSessionId());
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~ //
|
// ~~~~~~~~~~~~~~~~ //
|
||||||
// Helper Functions //
|
// Helper Functions //
|
||||||
|
@ -1,81 +0,0 @@
|
|||||||
import { autoBindMethodsForReact } from 'class-autobind-decorator';
|
|
||||||
import React, { PureComponent } from 'react';
|
|
||||||
|
|
||||||
import { endTrial, getFirstName, logout } from '../../../account/session';
|
|
||||||
import { AUTOBIND_CFG } from '../../../common/constants';
|
|
||||||
import { Link } from '../base/link';
|
|
||||||
import { Modal } from '../base/modal';
|
|
||||||
import { ModalBody } from '../base/modal-body';
|
|
||||||
import { ModalHeader } from '../base/modal-header';
|
|
||||||
import { PromptButton } from '../base/prompt-button';
|
|
||||||
let hidePaymentNotificationUntilNextLaunch = false;
|
|
||||||
|
|
||||||
@autoBindMethodsForReact(AUTOBIND_CFG)
|
|
||||||
export class PaymentNotificationModal extends PureComponent {
|
|
||||||
async _handleCancel() {
|
|
||||||
try {
|
|
||||||
await endTrial();
|
|
||||||
await logout();
|
|
||||||
} catch (err) {
|
|
||||||
// That's okay
|
|
||||||
}
|
|
||||||
|
|
||||||
this.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
modal: Modal | null = null;
|
|
||||||
|
|
||||||
_setModalRef(n: Modal) {
|
|
||||||
this.modal = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
|
||||||
// Don't trigger automatically if user has dismissed it already
|
|
||||||
if (hidePaymentNotificationUntilNextLaunch) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hidePaymentNotificationUntilNextLaunch = true;
|
|
||||||
this.modal?.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
hide() {
|
|
||||||
this.modal?.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<Modal ref={this._setModalRef}>
|
|
||||||
<ModalHeader>Insomnia Plus Trial Ended</ModalHeader>
|
|
||||||
<ModalBody className="pad changelog">
|
|
||||||
<div className="text-center pad">
|
|
||||||
<h1>Hi {getFirstName()},</h1>
|
|
||||||
<p
|
|
||||||
style={{
|
|
||||||
maxWidth: '30rem',
|
|
||||||
margin: 'auto',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Your Insomnia Plus trial has come to an end. Please enter your billing info to
|
|
||||||
continue using Plus features like encrypted data synchronization and backup.
|
|
||||||
</p>
|
|
||||||
<br />
|
|
||||||
<p className="pad-top">
|
|
||||||
<PromptButton onClick={this._handleCancel} className="btn btn--compact faint">
|
|
||||||
Cancel Subscription
|
|
||||||
</PromptButton>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
button
|
|
||||||
href="https://app.insomnia.rest/app/subscribe/"
|
|
||||||
className="btn btn--compact btn--outlined"
|
|
||||||
>
|
|
||||||
Update Billing
|
|
||||||
</Link>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</ModalBody>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -53,7 +53,6 @@ import { GitStagingModal } from './modals/git-staging-modal';
|
|||||||
import { registerModal, showModal } from './modals/index';
|
import { registerModal, showModal } from './modals/index';
|
||||||
import { LoginModal } from './modals/login-modal';
|
import { LoginModal } from './modals/login-modal';
|
||||||
import { NunjucksModal } from './modals/nunjucks-modal';
|
import { NunjucksModal } from './modals/nunjucks-modal';
|
||||||
import { PaymentNotificationModal } from './modals/payment-notification-modal';
|
|
||||||
import ProjectSettingsModal from './modals/project-settings-modal';
|
import ProjectSettingsModal from './modals/project-settings-modal';
|
||||||
import { PromptModal } from './modals/prompt-modal';
|
import { PromptModal } from './modals/prompt-modal';
|
||||||
import ProtoFilesModal from './modals/proto-files-modal';
|
import ProtoFilesModal from './modals/proto-files-modal';
|
||||||
@ -488,7 +487,6 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
<AskModal ref={registerModal} />
|
<AskModal ref={registerModal} />
|
||||||
<SelectModal ref={registerModal} />
|
<SelectModal ref={registerModal} />
|
||||||
<RequestCreateModal ref={registerModal} />
|
<RequestCreateModal ref={registerModal} />
|
||||||
<PaymentNotificationModal ref={registerModal} />
|
|
||||||
<FilterHelpModal ref={registerModal} />
|
<FilterHelpModal ref={registerModal} />
|
||||||
<RequestRenderErrorModal ref={registerModal} />
|
<RequestRenderErrorModal ref={registerModal} />
|
||||||
<GenerateConfigModal ref={registerModal} />
|
<GenerateConfigModal ref={registerModal} />
|
||||||
|
@ -35,7 +35,6 @@ import { AskModal } from '../../../ui/components/modals/ask-modal';
|
|||||||
import { AlertModal } from '../../components/modals/alert-modal';
|
import { AlertModal } from '../../components/modals/alert-modal';
|
||||||
import { showAlert, showError, showModal } from '../../components/modals/index';
|
import { showAlert, showError, showModal } from '../../components/modals/index';
|
||||||
import { LoginModal } from '../../components/modals/login-modal';
|
import { LoginModal } from '../../components/modals/login-modal';
|
||||||
import { PaymentNotificationModal } from '../../components/modals/payment-notification-modal';
|
|
||||||
import { SelectModal } from '../../components/modals/select-modal';
|
import { SelectModal } from '../../components/modals/select-modal';
|
||||||
import {
|
import {
|
||||||
SettingsModal,
|
SettingsModal,
|
||||||
@ -60,7 +59,6 @@ export const SET_ACTIVE_ACTIVITY = 'global/activate-activity';
|
|||||||
export const SET_IS_FINISHED_BOOTING = 'global/is-finished-booting';
|
export const SET_IS_FINISHED_BOOTING = 'global/is-finished-booting';
|
||||||
const COMMAND_ALERT = 'app/alert';
|
const COMMAND_ALERT = 'app/alert';
|
||||||
const COMMAND_LOGIN = 'app/auth/login';
|
const COMMAND_LOGIN = 'app/auth/login';
|
||||||
const COMMAND_TRIAL_END = 'app/billing/trial-end';
|
|
||||||
const COMMAND_IMPORT_URI = 'app/import';
|
const COMMAND_IMPORT_URI = 'app/import';
|
||||||
const COMMAND_PLUGIN_INSTALL = 'plugins/install';
|
const COMMAND_PLUGIN_INSTALL = 'plugins/install';
|
||||||
const COMMAND_PLUGIN_THEME = 'plugins/theme';
|
const COMMAND_PLUGIN_THEME = 'plugins/theme';
|
||||||
@ -207,10 +205,6 @@ export const newCommand = (command: string, args: any) => async (dispatch: Dispa
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMMAND_TRIAL_END:
|
|
||||||
showModal(PaymentNotificationModal);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case COMMAND_IMPORT_URI:
|
case COMMAND_IMPORT_URI:
|
||||||
await showModal(AlertModal, {
|
await showModal(AlertModal, {
|
||||||
title: 'Confirm Data Import',
|
title: 'Confirm Data Import',
|
||||||
|
Loading…
Reference in New Issue
Block a user