Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plans Grid: Remove unused components and data stores #75388

Merged
merged 5 commits into from
Apr 7, 2023
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
2 changes: 0 additions & 2 deletions packages/data-stores/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as Site from './site';
import * as StepperInternal from './stepper-internal';
import * as Subscriber from './subscriber';
import * as User from './user';
import * as WPCOMFeatures from './wpcom-features';
import * as WpcomPlansUI from './wpcom-plans-ui';
export { useHappinessEngineersQuery } from './queries/use-happiness-engineers-query';
export { useHas3PC } from './queries/use-has-3rd-party-cookies';
Expand Down Expand Up @@ -40,7 +39,6 @@ export {
Site,
Plans,
WpcomPlansUI,
WPCOMFeatures,
Onboard,
ProductsList,
AutomatedTransferEligibility,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-stores/src/onboard/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { dispatch, select } from '@wordpress/data-controls';
import { __ } from '@wordpress/i18n';
import { STORE_KEY as SITE_STORE } from '../site';
import { CreateSiteParams, Visibility, NewSiteBlogDetails } from '../site/types';
import { FeatureId } from '../wpcom-features/types';
import { SiteGoal, STORE_KEY } from './constants';
import { ProfilerData } from './types';
import type { State } from '.';
import type { DomainSuggestion } from '../domain-suggestions';
import type { FeatureId } from '../shared-types';
// somewhat hacky, but resolves the circular dependency issue
import type { Design, FontPair, StyleVariation } from '@automattic/design-picker/src/types';
import type { MinimalRequestCartProduct } from '@automattic/shopping-cart';
Expand Down
2 changes: 1 addition & 1 deletion packages/data-stores/src/onboard/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SiteGoal } from './constants';
import type { OnboardAction } from './actions';
import type { DomainForm, ProfilerData } from './types';
import type { DomainSuggestion } from '../domain-suggestions';
import type { FeatureId } from '../wpcom-features/types';
import type { FeatureId } from '../shared-types';
// somewhat hacky, but resolves the circular dependency issue
import type { Design, FontPair, StyleVariation } from '@automattic/design-picker/src/types';
import type { MinimalRequestCartProduct } from '@automattic/shopping-cart';
Expand Down
3 changes: 0 additions & 3 deletions packages/data-stores/src/plans/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export const plansSlugs = [
TIMELESS_PLAN_ECOMMERCE,
] as const;

// order of the plans used to determine recommended plan based on features
export const plansOrder = plansSlugs;

export const DEFAULT_PAID_PLAN = TIMELESS_PLAN_PREMIUM;

// plan products constants
Expand Down
10 changes: 10 additions & 0 deletions packages/data-stores/src/shared-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ export interface WpcomClientCredentials {
client_secret: string;
}

export type FeatureId =
| 'domain'
| 'store'
| 'seo'
| 'plugins'
| 'ad-free'
| 'image-storage'
| 'video-storage'
| 'support';

declare global {
interface Window {
_currentSiteId: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/data-stores/src/site/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as selectors from './selectors';
import type { ActionCreators } from './actions';
import type { DispatchFromMap, SelectFromMap } from '../mapped-types';
import type { FeatureId } from '../wpcom-features';
import type { FeatureId } from '../shared-types';

export interface Dispatch {
dispatch: DispatchFromMap< ActionCreators >;
Expand Down
1 change: 0 additions & 1 deletion packages/data-stores/src/wpcom-features/constants.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions packages/data-stores/src/wpcom-features/features-data.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions packages/data-stores/src/wpcom-features/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/data-stores/src/wpcom-features/reducer.ts

This file was deleted.

26 changes: 0 additions & 26 deletions packages/data-stores/src/wpcom-features/selectors.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/data-stores/src/wpcom-features/types.ts

This file was deleted.

15 changes: 12 additions & 3 deletions packages/onboarding/src/feature-icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { SVG, Path } from '@wordpress/components';
import { Icon } from '@wordpress/icons';
import * as React from 'react';
import type { WPCOMFeatures } from '@automattic/data-stores';

export const iconList: Record< WPCOMFeatures.FeatureId, React.ReactElement > = {
type FeatureId =
| 'domain'
| 'store'
| 'seo'
| 'plugins'
| 'ad-free'
| 'image-storage'
| 'video-storage'
| 'support';

export const iconList: Record< FeatureId, React.ReactElement > = {
domain: (
<SVG viewBox="0 0 24 24">
<Path
Expand Down Expand Up @@ -83,7 +92,7 @@ export const iconList: Record< WPCOMFeatures.FeatureId, React.ReactElement > = {
};

interface Props {
featureId: WPCOMFeatures.FeatureId;
featureId: FeatureId;
}

const FeatureIcon: React.FunctionComponent< Props > = ( { featureId } ) => (
Expand Down
6 changes: 1 addition & 5 deletions packages/plans-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@
"@wordpress/components": "^22.1.0",
"@wordpress/compose": "^5.20.0",
"@wordpress/icons": "^9.13.0",
"@wordpress/primitives": "^3.20.0",
"@wordpress/react-i18n": "^3.20.0",
"classnames": "^2.3.1",
"debug": "^4.3.3",
"lodash": "^4.17.21",
"tslib": "^2.3.0",
"uuid": "^8.3.2"
"tslib": "^2.3.0"
},
"devDependencies": {
"@automattic/calypso-typescript-config": "workspace:^",
Expand Down
18 changes: 0 additions & 18 deletions packages/plans-grid/src/badge/index.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions packages/plans-grid/src/badge/style.scss

This file was deleted.

2 changes: 0 additions & 2 deletions packages/plans-grid/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export { default as PlansIntervalToggle } from './plans-interval-toggle';
export type { PlansIntervalToggleProps } from './plans-interval-toggle';
export { default } from './plans-grid';
export type { Props } from './plans-grid';
Loading