Skip to content

Commit

Permalink
Clean up hosting-overview-refinements feature flag (#94050)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekelund authored Sep 6, 2024
1 parent e02a0a3 commit 43dc289
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import { Gridicon } from '@automattic/components';
import { Button } from '@wordpress/components';
import { useMediaQuery } from '@wordpress/compose';
Expand Down Expand Up @@ -64,10 +63,7 @@ export default function ItemPreviewPaneHeader( {
extraProps?.siteIconFallback ?? ( itemData.isDotcomSite ? 'wordpress-logo' : 'color' );

const shouldDisplayVersionNumbers =
config.isEnabled( 'hosting-overview-refinements' ) &&
! itemData.hideEnvDataInHeader &&
isAtomic &&
( wpVersion || phpVersion );
! itemData.hideEnvDataInHeader && isAtomic && ( wpVersion || phpVersion );

const handlePhpVersionClick = () => {
dispatch( recordTracksEvent( 'calypso_hosting_php_version_click' ) );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import { FEATURE_SFTP, getPlan, PLAN_BUSINESS } from '@automattic/calypso-products';
import page from '@automattic/calypso-router';
import { Dialog } from '@automattic/components';
Expand Down Expand Up @@ -186,7 +185,7 @@ const HostingFeatures = () => {
let title;
let description;
let buttons;
if ( isTransferInProgress && config.isEnabled( 'hosting-overview-refinements' ) ) {
if ( isTransferInProgress ) {
title = translate( 'Activating hosting features' );
description = translate(
"The hosting features will appear here automatically when they're ready!",
Expand Down
108 changes: 52 additions & 56 deletions client/hosting/overview/components/plan-card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import {
getPlan,
PlanSlug,
Expand Down Expand Up @@ -210,9 +209,6 @@ const PlanCard: FC = () => {
}
};

const shouldRenderPlanData =
! isStaging || ( isStaging && config.isEnabled( 'hosting-overview-refinements' ) );

return (
<>
<QuerySitePlans siteId={ site?.ID } />
Expand All @@ -229,60 +225,60 @@ const PlanCard: FC = () => {
</>
) }
</div>
{ shouldRenderPlanData && (
<>
{ isAgencyPurchase && (
<div className="hosting-overview__plan-agency-purchase">
<p>
{ translate( 'This site is managed through {{a}}Automattic for Agencies{{/a}}.', {
components: {
a: isA4A ? (
<a
href={ `https://agencies.automattic.com/sites/overview/${ site?.slug }` }
></a>
) : (
<strong></strong>
),
},
} ) }
</p>
</div>
) }
{ ! isAgencyPurchase && ! isStaging && <PricingSection /> }
{ ! isLoading && (
<div className="hosting-overview__site-metrics">
<PlanStorage
className="hosting-overview__plan-storage"
hideWhenNoStorage
siteId={ site?.ID }
StorageBarComponent={ PlanStorageBar }
>
{ storageAddons.length > 0 && ! isAgencyPurchase && (
<div className="hosting-overview__plan-storage-footer">
<Button
className="hosting-overview__link-button"
plain
href={ `/add-ons/${ site?.slug }` }
onClick={ () => {
dispatch(
recordTracksEvent( 'calypso_hosting_overview_need_more_storage_click' )
);
} }
>
{ translate( 'Need more storage?' ) }
</Button>
</div>
) }
</PlanStorage>
{ config.isEnabled( 'hosting-overview-refinements' ) && site && (
<div className="hosting-overview__site-metrics-footer">
<PlanBandwidth siteId={ site.ID } />
<PlanSiteVisits siteId={ site.ID } />
</div>
) }

{ isAgencyPurchase && (
<div className="hosting-overview__plan-agency-purchase">
<p>
{ translate( 'This site is managed through {{a}}Automattic for Agencies{{/a}}.', {
components: {
a: isA4A ? (
<a
href={ `https://agencies.automattic.com/sites/overview/${ site?.slug }` }
></a>
) : (
<strong></strong>
),
},
} ) }
</p>
</div>
) }

{ ! isAgencyPurchase && ! isStaging && <PricingSection /> }

{ ! isLoading && (
<div className="hosting-overview__site-metrics">
<PlanStorage
className="hosting-overview__plan-storage"
hideWhenNoStorage
siteId={ site?.ID }
StorageBarComponent={ PlanStorageBar }
>
{ storageAddons.length > 0 && ! isAgencyPurchase && (
<div className="hosting-overview__plan-storage-footer">
<Button
className="hosting-overview__link-button"
plain
href={ `/add-ons/${ site?.slug }` }
onClick={ () => {
dispatch(
recordTracksEvent( 'calypso_hosting_overview_need_more_storage_click' )
);
} }
>
{ translate( 'Need more storage?' ) }
</Button>
</div>
) }
</PlanStorage>

{ site && (
<div className="hosting-overview__site-metrics-footer">
<PlanBandwidth siteId={ site.ID } />
<PlanSiteVisits siteId={ site.ID } />
</div>
) }
</>
</div>
) }
</HostingCard>
</>
Expand Down
3 changes: 1 addition & 2 deletions config/a8c-for-agencies-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-dev-sites": true,
"a4a-multi-user-support": true,
"hosting-overview-refinements": true
"a4a-multi-user-support": true
},
"enable_all_sections": false,
"sections": {
Expand Down
3 changes: 1 addition & 2 deletions config/a8c-for-agencies-horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-dev-sites": false,
"a4a-multi-user-support": true,
"hosting-overview-refinements": true
"a4a-multi-user-support": true
},
"enable_all_sections": false,
"sections": {
Expand Down
3 changes: 1 addition & 2 deletions config/a8c-for-agencies-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-dev-sites": false,
"a4a-multi-user-support": false,
"hosting-overview-refinements": true
"a4a-multi-user-support": false
},
"enable_all_sections": false,
"sections": {
Expand Down
3 changes: 1 addition & 2 deletions config/a8c-for-agencies-stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-dev-sites": false,
"a4a-multi-user-support": false,
"hosting-overview-refinements": true
"a4a-multi-user-support": false
},
"enable_all_sections": false,
"sections": {
Expand Down
1 change: 0 additions & 1 deletion config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"help/gpt-response": true,
"home/layout-dev": true,
"hosting/datacenter-picker": true,
"hosting-overview-refinements": true,
"i18n/community-translator": false,
"i18n/empathy-mode": true,
"i18n/translation-scanner": true,
Expand Down
1 change: 0 additions & 1 deletion config/horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"google-my-business": false,
"help": true,
"home/layout-dev": true,
"hosting-overview-refinements": true,
"i18n/empathy-mode": false,
"i18n/translation-scanner": true,
"importer/site-backups": true,
Expand Down
1 change: 0 additions & 1 deletion config/production.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"google-my-business": true,
"help": true,
"help/gpt-response": true,
"hosting-overview-refinements": true,
"i18n/empathy-mode": false,
"i18n/translation-scanner": true,
"importer/site-backups": true,
Expand Down
1 change: 0 additions & 1 deletion config/stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"google-my-business": true,
"help": true,
"help/gpt-response": true,
"hosting-overview-refinements": true,
"i18n/empathy-mode": true,
"importer/site-backups": true,
"importer/unified": true,
Expand Down
1 change: 0 additions & 1 deletion config/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"cookie-banner": false,
"google-my-business": false,
"help": true,
"hosting-overview-refinements": true,
"importers/newsletter": true,
"importers/substack": true,
"individual-subscriber-stats": false,
Expand Down
1 change: 0 additions & 1 deletion config/wpcalypso.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"help/gpt-response": true,
"home/layout-dev": true,
"hosting/datacenter-picker": true,
"hosting-overview-refinements": true,
"i18n/translation-scanner": true,
"importer/site-backups": true,
"importer/unified": true,
Expand Down
39 changes: 16 additions & 23 deletions packages/domains-table/src/domains-table-header/columns.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import { DomainData, PartialDomainData } from '@automattic/data-stores';
import { __, _n, sprintf } from '@wordpress/i18n';
import { I18N } from 'i18n-calypso';
Expand Down Expand Up @@ -59,6 +58,14 @@ export const allSitesViewColumns = (
supportsOrderSwitching: true,
sortFunctions: [ getSimpleSortFunctionBy( 'blog_name' ) ],
},
{
name: 'ssl',
label: __( 'SSL', __i18n_text_domain__ ),
isSortable: true,
initialSortDirection: 'asc',
supportsOrderSwitching: true,
sortFunctions: [ getSimpleSortFunctionBy( 'ssl_status' ) ],
},
{
name: 'expire_renew',
label: __( 'Expires / renews on', __i18n_text_domain__ ),
Expand Down Expand Up @@ -86,17 +93,6 @@ export const allSitesViewColumns = (
},
];

if ( config.isEnabled( 'hosting-overview-refinements' ) ) {
columns.splice( 3, 0, {
name: 'ssl',
label: __( 'SSL', __i18n_text_domain__ ),
isSortable: true,
initialSortDirection: 'asc',
supportsOrderSwitching: true,
sortFunctions: [ getSimpleSortFunctionBy( 'ssl_status' ) ],
} );
}

return columns;
};

Expand Down Expand Up @@ -127,6 +123,14 @@ export const siteSpecificViewColumns = (
label: __( 'Email', __i18n_text_domain__ ),
isSortable: false,
},
{
name: 'ssl',
label: __( 'SSL', __i18n_text_domain__ ),
isSortable: true,
initialSortDirection: 'asc',
supportsOrderSwitching: true,
sortFunctions: [ getSimpleSortFunctionBy( 'ssl_status' ) ],
},
{
name: 'expire_renew',
label: __( 'Expires / renews on', __i18n_text_domain__ ),
Expand Down Expand Up @@ -154,17 +158,6 @@ export const siteSpecificViewColumns = (
},
];

if ( config.isEnabled( 'hosting-overview-refinements' ) ) {
columns.splice( 3, 0, {
name: 'ssl',
label: __( 'SSL', __i18n_text_domain__ ),
isSortable: true,
initialSortDirection: 'asc',
supportsOrderSwitching: true,
sortFunctions: [ getSimpleSortFunctionBy( 'ssl_status' ) ],
} );
}

return columns;
};
export const applyColumnSort = (
Expand Down

0 comments on commit 43dc289

Please sign in to comment.