Skip to content

Commit

Permalink
Merge branch 'trunk' into hc-zendesk-link
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyweight authored Jan 22, 2025
2 parents 2348a2b + 248ffbc commit 7c12cc1
Show file tree
Hide file tree
Showing 138 changed files with 1,604 additions and 2,046 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mark-issue-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Message to be added to stale issues.
stale-issue-message: 'This issue is stale because 720 days have passed with no activity. A member of the Dotcom Product Ambassadors Guild will review and if required close this issue within 7 days. If you disagree and would like this issue to remain open, please provide additional context, updated reproduction steps and/or screenshots.'
stale-issue-message: 'This issue is stale because 540 days have passed with no activity. A member of the Dotcom Product Ambassadors Guild will review and if required close this issue within 7 days. If you disagree and would like this issue to remain open, please provide additional context, updated reproduction steps and/or screenshots.'
# Days before issue is considered stale.
days-before-issue-stale: 720
days-before-issue-stale: 540
# Override stale setting for PRs.
days-before-pr-stale: -1
# Exempted issue labels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
commentAuthorAvatar,
people,
starEmpty,
plugins,
} from '@wordpress/icons';
import { useTranslate } from 'i18n-calypso';
import { useMemo } from 'react';
Expand All @@ -28,6 +29,7 @@ import {
A4A_MARKETPLACE_HOSTING_LINK,
A4A_MIGRATIONS_LINK,
A4A_SETTINGS_LINK,
A4A_PLUGINS_LINK,
A4A_PARTNER_DIRECTORY_DASHBOARD_LINK,
A4A_REFERRALS_DASHBOARD,
A4A_TEAM_LINK,
Expand Down Expand Up @@ -106,18 +108,6 @@ const useMainMenuItems = ( path: string ) => {
},
withChevron: true,
},
/*
// Hide this section until we support plugin management in A4A
{
icon: plugins,
path: '/',
link: A4A_PLUGINS_LINK,
title: translate( 'Plugins' ),
trackEventProps: {
menu_item: 'Automattic for Agencies / Plugins',
},
},
*/
{
icon: tag,
path: A4A_MARKETPLACE_LINK,
Expand All @@ -140,6 +130,19 @@ const useMainMenuItems = ( path: string ) => {
},
...referralItems,
migrationMenuItem,
...( isSectionNameEnabled( 'a8c-for-agencies-plugins' )
? [
{
icon: plugins,
path: '/',
link: A4A_PLUGINS_LINK,
title: translate( 'Plugins' ),
trackEventProps: {
menu_item: 'Automattic for Agencies / Plugins',
},
},
]
: [] ),
...( config.isEnabled( 'a4a-partner-directory' ) ||
config.isEnabled( 'a8c-for-agencies-agency-tier' )
? [
Expand Down
4 changes: 4 additions & 0 deletions client/a8c-for-agencies/lib/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
A4A_SITES_LINK_WALKTHROUGH_TOUR,
A4A_SITES_LINK_ADD_NEW_SITE_TOUR,
A4A_SITES_CONNECT_URL_LINK,
A4A_PLUGINS_LINK,
A4A_MARKETPLACE_LINK,
A4A_MARKETPLACE_PRODUCTS_LINK,
A4A_MARKETPLACE_HOSTING_LINK,
Expand Down Expand Up @@ -91,20 +92,23 @@ const MEMBER_ACCESSIBLE_PATHS: Record< string, string[] > = {
[ A4A_MIGRATIONS_PAYMENT_SETTINGS ]: [ 'a4a_read_migrations' ],
[ A4A_TEAM_INVITE_LINK ]: [ 'a4a_edit_user_invites' ],
[ A4A_AGENCY_TIER_LINK ]: [ 'a4a_read_agency_tier' ],
[ A4A_PLUGINS_LINK ]: [ 'a4a_read_managed_sites' ],
};

const MEMBER_ACCESSIBLE_DYNAMIC_PATHS: Record< string, string[] > = {
'sites-overview': [ 'a4a_read_managed_sites' ],
team: [ 'a4a_read_users' ],
marketplace: [ 'a4a_read_marketplace' ],
licenses: [ 'a4a_jetpack_licensing' ],
plugins: [ 'a4a_read_managed_sites' ],
};

const DYNAMIC_PATH_PATTERNS: Record< string, RegExp > = {
'sites-overview': /^\/sites\/overview\/[^/]+(\/.*)?$/,
marketplace: /^\/marketplace\/[^/]+\/[^/]+(\/.*)?$/,
licenses: /^\/purchases\/licenses(\/.*)?$/,
team: /^\/team(\/.*)?$/,
plugins: /^\/plugins(\/.*)?$/,
};

export const isPathAllowed = ( pathname: string, agency: Agency | null ) => {
Expand Down
45 changes: 25 additions & 20 deletions client/a8c-for-agencies/sections/plugins/controller.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
import page from '@automattic/calypso-router';
import { type Callback } from '@automattic/calypso-router';
import { LayoutWithGuidedTour as Layout } from 'calypso/a8c-for-agencies/components/layout/layout-with-guided-tour';
import LayoutTop from 'calypso/a8c-for-agencies/components/layout/layout-with-payment-notification';
import MobileSidebarNavigation from 'calypso/a8c-for-agencies/components/sidebar/mobile-sidebar-navigation';
import LayoutBody from 'calypso/layout/hosting-dashboard/body';
import LayoutHeader, {
LayoutHeaderSubtitle as Subtitle,
LayoutHeaderTitle as Title,
} from 'calypso/layout/hosting-dashboard/header';
import PageViewTracker from 'calypso/lib/analytics/page-view-tracker';
import { A4A_PLUGINS_LINK } from '../../components/sidebar-menu/lib/constants';
import MainSidebar from '../../components/sidebar-menu/main';

export const pluginsContext: Callback = ( context, next ) => {
export const pluginsContext: Callback = ( context ) => {
const { slug } = context.params;
const redirectPath = slug
? `${ A4A_PLUGINS_LINK }/manage/sites/${ slug }`
: `${ A4A_PLUGINS_LINK }/manage/sites`;

page.redirect( redirectPath );
};

export const pluginManagementContext: Callback = ( context, next ) => {
context.secondary = <MainSidebar path={ context.path } />;
context.primary = (
<Layout title="Plugins" wide sidebarNavigation={ <MobileSidebarNavigation /> }>
<LayoutTop>
<LayoutHeader>
<Title>Plugins</Title>
<Subtitle>plugins of your agency</Subtitle>
</LayoutHeader>
</LayoutTop>
<LayoutBody>
<div>test</div>
</LayoutBody>
</Layout>
<>
<PageViewTracker title="Plugins" path={ context.path } />
</>
);
next();
};

export const pluginDetailsContext: Callback = ( context, next ) => {
context.secondary = <MainSidebar path={ context.path } />;
context.primary = (
<>
<PageViewTracker title="Plugins" path={ context.path } />
</>
);
next();
};
23 changes: 22 additions & 1 deletion client/a8c-for-agencies/sections/plugins/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
import page from '@automattic/calypso-router';
import { requireAccessContext } from 'calypso/a8c-for-agencies/controller';
import { makeLayout, render as clientRender } from 'calypso/controller';
import { pluginsContext } from './controller';
import { renderPluginsDashboard } from 'calypso/my-sites/plugins/controller';
import { pluginsContext, pluginManagementContext, pluginDetailsContext } from './controller';

export default function () {
page( '/plugins', requireAccessContext, pluginsContext, makeLayout, clientRender );

page( '/plugins/:slug', requireAccessContext, pluginsContext, makeLayout, clientRender );

page(
'/plugins/manage/sites',
requireAccessContext,
pluginManagementContext,
renderPluginsDashboard,
makeLayout,
clientRender
);

page(
'/plugins/manage/sites/:slug',
requireAccessContext,
pluginDetailsContext,
renderPluginsDashboard,
makeLayout,
clientRender
);
}
6 changes: 3 additions & 3 deletions client/blocks/get-apps/apps-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@ export const createWordPressStudioConfig = (
[ PlatformType.MacIntel ]: {
...platformConfigs[ PlatformType.MacIntel ],
onClick: () => recordTracksEvent( 'calypso_studio_download_mac_click' ),
link: 'https://cdn.a8c-ci.services/studio/studio-darwin-x64-v1.3.0.dmg',
link: 'https://cdn.a8c-ci.services/studio/studio-darwin-x64-v1.3.2.dmg',
},
[ PlatformType.MacSilicon ]: {
...platformConfigs[ PlatformType.MacSilicon ],
onClick: () => recordTracksEvent( 'calypso_studio_download_mac_silicon_click' ),
link: 'https://cdn.a8c-ci.services/studio/studio-darwin-arm64-v1.3.0.dmg',
link: 'https://cdn.a8c-ci.services/studio/studio-darwin-arm64-v1.3.2.dmg',
},
[ PlatformType.Windows ]: {
...platformConfigs[ PlatformType.Windows ],
onClick: () => recordTracksEvent( 'calypso_studio_download_windows_click' ),
link: 'https://cdn.a8c-ci.services/studio/studio-win32-v1.3.0.exe',
link: 'https://cdn.a8c-ci.services/studio/studio-win32-v1.3.2.exe',
},
},
};
Expand Down
7 changes: 6 additions & 1 deletion client/blocks/get-apps/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ main.get-apps {
display: flex;
flex-direction: row;
gap: 16px;

> a {
display: inline-flex;
gap: 2px;
}
}

.get-apps__desktop-button {
Expand All @@ -120,4 +125,4 @@ main.get-apps {
margin-right: 0;
}
}
}
}
25 changes: 0 additions & 25 deletions client/blocks/reader-combined-card/docs/example.jsx

This file was deleted.

Loading

0 comments on commit 7c12cc1

Please sign in to comment.