-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A4A: Integrate Plugin Management v2 into the A4A dashboard (#98413)
* Add plugins management to A4A dashboard * Add feature flag for Plugins Management * Update feature/section flags
- Loading branch information
1 parent
51015ca
commit ac00e61
Showing
6 changed files
with
68 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters