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
9 changes: 0 additions & 9 deletions client/sites-dashboard/components/sites-p2-badge.tsx

This file was deleted.

17 changes: 17 additions & 0 deletions client/sites-dashboard/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
PLAN_ECOMMERCE_TRIAL_MONTHLY,
PLAN_HOSTING_TRIAL_MONTHLY,
} from '@automattic/calypso-products';
import { translate } from 'i18n-calypso';
import { isMigrationInProgress } from 'calypso/data/site-migration';
import type { SiteExcerptData, SiteExcerptNetworkData } from '@automattic/sites';

export const TRACK_SOURCE_NAME = 'sites-dashboard';
Expand All @@ -23,6 +25,21 @@ export const getManagePluginsUrl = ( slug: string ) => {
return `/plugins/manage/${ slug }`;
};

export const getSiteDisplayUrl = ( site: SiteExcerptData ) => {
if ( site.options?.is_redirect ) {
return site.slug;
}
return site.URL.replace( 'https://', '' ).replace( 'http://', '' );
};

export const getSiteDisplayName = ( site: SiteExcerptData ) => {
if ( isMigrationInProgress( site ) ) {
return translate( 'Incoming Migration' );
}

return site.name || getSiteDisplayUrl( site );
};

export const displaySiteUrl = ( siteUrl: string ) => {
return siteUrl.replace( 'https://', '' ).replace( 'http://', '' );
};
Expand Down
2 changes: 2 additions & 0 deletions client/sites/components/sites-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,15 @@ const SitesDashboard = ( {
showTitle: true,
mediaField: 'icon',
showMedia: true,
descriptionField: 'URL',
}
: {
type: 'table',
titleField: 'site-title',
showTitle: true,
mediaField: 'icon',
showMedia: true,
descriptionField: 'URL',
layout: {
styles: {
site: {
Expand Down
Loading