Skip to content
Merged
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
16 changes: 3 additions & 13 deletions packages/app/src/app/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,7 @@ export type TemplateFragmentDashboardFragment = {

export type TeamFragmentDashboardFragment = { __typename?: 'Team' } & Pick<
Team,
'id' | 'name' | 'description' | 'creatorId' | 'avatarUrl' | 'joinedPilotAt'
'id' | 'name' | 'description' | 'creatorId' | 'avatarUrl'
> & {
settings: Maybe<
{ __typename?: 'WorkspaceSandboxSettings' } & Pick<
Expand Down Expand Up @@ -2223,13 +2223,7 @@ export type TeamFragmentDashboardFragment = { __typename?: 'Team' } & Pick<

export type CurrentTeamInfoFragmentFragment = { __typename?: 'Team' } & Pick<
Team,
| 'id'
| 'creatorId'
| 'description'
| 'inviteToken'
| 'joinedPilotAt'
| 'name'
| 'avatarUrl'
'id' | 'creatorId' | 'description' | 'inviteToken' | 'name' | 'avatarUrl'
> & {
users: Array<
{ __typename?: 'User' } & Pick<User, 'id' | 'avatarUrl' | 'username'>
Expand Down Expand Up @@ -2306,7 +2300,6 @@ export type ProjectFragment = { __typename?: 'Project' } & {

export type _CreateTeamMutationVariables = Exact<{
name: Scalars['String'];
pilot: Maybe<Scalars['Boolean']>;
}>;

export type _CreateTeamMutation = { __typename?: 'RootMutationType' } & {
Expand Down Expand Up @@ -3757,8 +3750,5 @@ export type JoinTeamByTokenMutationVariables = Exact<{
}>;

export type JoinTeamByTokenMutation = { __typename?: 'RootMutationType' } & {
redeemTeamInviteToken: { __typename?: 'Team' } & Pick<
Team,
'id' | 'name' | 'joinedPilotAt'
>;
redeemTeamInviteToken: { __typename?: 'Team' } & Pick<Team, 'id' | 'name'>;
};
2 changes: 1 addition & 1 deletion packages/app/src/app/overmind/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ type ModalName =
| 'sandboxPicker'
| 'minimumPrivacy'
| 'addMemberToWorkspace'
| 'pilotPayment'
| 'legacyPayment'
| 'whatsNew';

export const modalOpened = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export const teamFragmentDashboard = gql`
description
creatorId
avatarUrl
joinedPilotAt
settings {
minimumPrivacy
}
Expand Down Expand Up @@ -157,7 +156,6 @@ export const currentTeamInfoFragment = gql`
creatorId
description
inviteToken
joinedPilotAt
name
avatarUrl

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export const createTeam: Query<
_CreateTeamMutation,
_CreateTeamMutationVariables
> = gql`
mutation _CreateTeam($name: String!, $pilot: Boolean) {
createTeam(name: $name, pilot: $pilot) {
mutation _CreateTeam($name: String!) {
createTeam(name: $name) {
...teamFragmentDashboard
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/app/overmind/internalActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,6 @@ export const trackCurrentTeams = async ({ effects, state }: Context) => {
export const identifyCurrentUser = async ({ state, effects }: Context) => {
const user = state.user;
if (user) {
effects.analytics.identify('pilot', user.experiments.inPilot);
effects.browser.storage.set('pilot', user.experiments.inPilot);
Object.entries(user.metadata).forEach(([key, value]) => {
if (value) {
effects.analytics.identify(key, value);
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/app/overmind/namespaces/dashboard/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1075,17 +1075,14 @@ export const createTeam = async (
{ effects, actions, state }: Context,
{
teamName,
pilot = false,
}: {
teamName: string;
pilot?: boolean;
}
) => {
try {
effects.analytics.track('Team - Create Team', { dashboardVersion: 2 });
const { createTeam: newTeam } = await effects.gql.mutations.createTeam({
name: teamName,
pilot,
});
state.dashboard.teams = [...state.dashboard.teams, newTeam];
actions.setActiveTeam({ id: newTeam.id });
Expand Down Expand Up @@ -1550,7 +1547,6 @@ export const setTeamMinimumPrivacy = async (
}
};


export const setWorkspaceSandboxSettings = async (
{ state, effects }: Context,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useAppState } from 'app/overmind';
import {
SubscriptionStatus,
TeamMemberAuthorization,
SubscriptionOrigin,
SubscriptionPaymentProvider,
} from 'app/graphql/types';
import { useLocation, useHistory } from 'react-router-dom';
Expand All @@ -12,7 +11,6 @@ import { Stack, Text } from '@codesandbox/components';

import { Card } from '../../components';
import { Upgrade } from './upgrade';
import { Pilot } from './pilot';
import { Paddle } from './paddle';
import { Stripe } from './stripe';
import { ProcessingPayment } from '../../components/ProcessingPayment';
Expand Down Expand Up @@ -58,10 +56,6 @@ export const ManageSubscription = () => {
);

const renderProvider = () => {
if (team.subscription?.origin === SubscriptionOrigin.Pilot) {
return <Pilot />;
}

if (
team?.subscription?.paymentProvider === SubscriptionPaymentProvider.Paddle
) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
TeamMemberAuthorization,
SubscriptionType,
SubscriptionInterval,
SubscriptionOrigin,
CurrentTeamInfoFragmentFragment,
} from 'app/graphql/types';
import { Card } from '../components';
Expand Down Expand Up @@ -115,13 +114,10 @@ export const WorkspaceSettings = () => {
// throw them a confirmation modal
const confirmNewMemberAddition =
team?.subscription &&
team?.subscription.origin !== SubscriptionOrigin.Pilot &&
numberOfUnusedSeats === 0 &&
newMemberAuthorization !== TeamMemberAuthorization.Read;
const confirmMemberRoleChange =
team?.subscription &&
team?.subscription.origin !== SubscriptionOrigin.Pilot &&
numberOfUnusedSeats === 0;
team?.subscription && numberOfUnusedSeats === 0;

const onInviteSubmit = async event => {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Patron = () => {
padding: 0,
})}
onClick={() => {
actions.modalOpened({ modal: 'pilotPayment' });
actions.modalOpened({ modal: 'legacyPayment' });
}}
>
Update payment information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const ChangeSubscription: FunctionComponent = () => {
onClick={(event: MouseEvent<HTMLButtonElement>) => {
event.preventDefault();

modalOpened({ modal: 'pilotPayment' });
modalOpened({ modal: 'legacyPayment' });
}}
>
user preferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
ProSubscription,
SubscriptionType,
SubscriptionInterval,
SubscriptionOrigin,
} from 'app/graphql/types';
import track from '@codesandbox/common/lib/utils/analytics';
import { plans } from './plans';
Expand Down Expand Up @@ -163,9 +162,6 @@ export const WorkspacePlanSelection: React.FC<{

const isLegacyPersonalPro = isPersonalWorkspace && user.subscription;
const currentSubscription = activeTeamInfo?.subscription;
const isTeamProPilot =
currentSubscription &&
currentSubscription.origin === SubscriptionOrigin.Pilot;

// if there is mismatch of intent - team/personal
// or you don't have access to upgrade
Expand Down Expand Up @@ -376,7 +372,7 @@ export const WorkspacePlanSelection: React.FC<{
onClick={e => {
e.preventDefault();

modalOpened({ modal: 'pilotPayment' });
modalOpened({ modal: 'legacyPayment' });
}}
>
update your payment details
Expand Down Expand Up @@ -477,7 +473,7 @@ export const WorkspacePlanSelection: React.FC<{
</Stack>
</Stack>

{currentSubscription && !isTeamProPilot ? (
{currentSubscription ? (
<>
<Button
loading={loading}
Expand Down Expand Up @@ -543,8 +539,7 @@ const PlanCard: React.FC<{
}> = ({ plan, billingInterval, setBillingInterval, currentSubscription }) => {
const isSelected = plan.billingInterval === billingInterval;
const isCurrent =
plan.billingInterval === currentSubscription?.billingInterval &&
currentSubscription?.origin !== SubscriptionOrigin.Pilot;
plan.billingInterval === currentSubscription?.billingInterval;

return (
<Stack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ const JoinTeam = ({ inviteToken }: { inviteToken: string }) => {
const [loading, setLoading] = React.useState(true);
const [team, setTeam] = React.useState<{
id: string;
joinedPilotAt: string | null;
} | null>(null);
const [error, setError] = React.useState<Error | null>(null);

Expand Down
1 change: 0 additions & 1 deletion packages/app/src/app/pages/TeamInvitation/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const joinTeamMutation = gql`
redeemTeamInviteToken(inviteToken: $inviteToken) {
id
name
joinedPilotAt
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Body: FunctionComponent = () => {
);
};

export const PilotPaymentModal: FunctionComponent = () => {
export const LegacyPaymentModal: FunctionComponent = () => {
const { paymentDetailsRequested } = useActions().preferences;

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const TeamInfo: React.FC<{ onComplete: () => void }> = ({
try {
await actions.dashboard.createTeam({
teamName,
pilot: location.search.includes('pilot'),
});
setLoading(false);
onComplete();
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/app/pages/common/Modals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { NetlifyLogs } from './NetlifyLogs';
import { PickSandboxModal } from './PickSandboxModal';
import { PreferencesModal } from './PreferencesModal';
import { RecoverFilesModal } from './RecoverFilesModal';
import { PilotPaymentModal } from './PilotPaymentModal';
import { LegacyPaymentModal } from './LegacyPaymentModal';
import { SandboxPickerModal } from './SandboxPickerModal';
import { SearchDependenciesModal } from './SearchDependenciesModal';
import { SelectSandboxModal } from './SelectSandboxModal';
Expand All @@ -54,8 +54,8 @@ const modals = {
Component: PreferencesModal,
width: 900,
},
pilotPayment: {
Component: PilotPaymentModal,
legacyPayment: {
Component: LegacyPaymentModal,
width: 600,
},
newSandbox: {
Expand Down