-
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.
* Add new Site Settings * Add the rest of the routes * Sidebar fixes * Constant values for consistency * Missing site route fixes * Remove wpcomtools - won't be using this moving forward
- Loading branch information
Showing
6 changed files
with
197 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import makeSidebar, { PanelWithSidebar } from '../components/panel-sidebar'; | ||
import type { Context as PageJSContext } from '@automattic/calypso-router'; | ||
|
||
const SettingsSidebar = makeSidebar( { | ||
items: [ | ||
{ | ||
key: 'site', | ||
get label() { | ||
return __( 'Site' ); | ||
}, | ||
}, | ||
{ | ||
key: 'administration', | ||
get label() { | ||
return __( 'Administration' ); | ||
}, | ||
}, | ||
{ | ||
key: 'agency', | ||
get label() { | ||
return __( 'Agency' ); | ||
}, | ||
}, | ||
{ | ||
key: 'caches', | ||
get label() { | ||
return __( 'Caches' ); | ||
}, | ||
}, | ||
{ | ||
key: 'web-server', | ||
get label() { | ||
return __( 'Web Server' ); | ||
}, | ||
}, | ||
], | ||
} ); | ||
|
||
export function siteSettings( context: PageJSContext, next: () => void ) { | ||
context.primary = ( | ||
<PanelWithSidebar> | ||
<SettingsSidebar selectedItemKey="site" /> | ||
<p>Site settings</p> | ||
</PanelWithSidebar> | ||
); | ||
next(); | ||
} | ||
|
||
export function administrationSettings( context: PageJSContext, next: () => void ) { | ||
context.primary = ( | ||
<PanelWithSidebar> | ||
<SettingsSidebar selectedItemKey="administration" /> | ||
<p>Administration settings</p> | ||
</PanelWithSidebar> | ||
); | ||
next(); | ||
} | ||
|
||
export function agencySettings( context: PageJSContext, next: () => void ) { | ||
context.primary = ( | ||
<PanelWithSidebar> | ||
<SettingsSidebar selectedItemKey="agency" /> | ||
<p>Agency settings</p> | ||
</PanelWithSidebar> | ||
); | ||
next(); | ||
} | ||
|
||
export function cachesSettings( context: PageJSContext, next: () => void ) { | ||
context.primary = ( | ||
<PanelWithSidebar> | ||
<SettingsSidebar selectedItemKey="caches" /> | ||
<p>Caches settings</p> | ||
</PanelWithSidebar> | ||
); | ||
next(); | ||
} | ||
|
||
export function webServerSettings( context: PageJSContext, next: () => void ) { | ||
context.primary = ( | ||
<PanelWithSidebar> | ||
<SettingsSidebar selectedItemKey="web-server" /> | ||
<p>Web server settings</p> | ||
</PanelWithSidebar> | ||
); | ||
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import page from '@automattic/calypso-router'; | ||
import { makeLayout, render as clientRender } from 'calypso/controller'; | ||
import { siteSelection, navigation, sites } from 'calypso/my-sites/controller'; | ||
import { | ||
SETTINGS_SITE, | ||
SETTINGS_ADMINISTRATION, | ||
SETTINGS_AGENCY, | ||
SETTINGS_CACHES, | ||
SETTINGS_WEB_SERVER, | ||
} from 'calypso/sites/components/site-preview-pane/constants'; | ||
import { siteDashboard } from 'calypso/sites/controller'; | ||
import { | ||
siteSettings, | ||
administrationSettings, | ||
agencySettings, | ||
cachesSettings, | ||
webServerSettings, | ||
} from './controller'; | ||
|
||
export default function () { | ||
page( '/sites/settings/site', siteSelection, sites, makeLayout, clientRender ); | ||
page( | ||
'/sites/settings/site/:site', | ||
siteSelection, | ||
navigation, | ||
siteSettings, | ||
siteDashboard( SETTINGS_SITE ), | ||
makeLayout, | ||
clientRender | ||
); | ||
|
||
page( '/sites/settings/administration', siteSelection, sites, makeLayout, clientRender ); | ||
page( | ||
'/sites/settings/administration/:site', | ||
siteSelection, | ||
navigation, | ||
administrationSettings, | ||
siteDashboard( SETTINGS_ADMINISTRATION ), | ||
makeLayout, | ||
clientRender | ||
); | ||
|
||
page( '/sites/settings/agency', siteSelection, sites, makeLayout, clientRender ); | ||
page( | ||
'/sites/settings/agency/:site', | ||
siteSelection, | ||
navigation, | ||
agencySettings, | ||
siteDashboard( SETTINGS_AGENCY ), | ||
makeLayout, | ||
clientRender | ||
); | ||
|
||
page( '/sites/settings/caches', siteSelection, sites, makeLayout, clientRender ); | ||
page( | ||
'/sites/settings/caches/:site', | ||
siteSelection, | ||
navigation, | ||
cachesSettings, | ||
siteDashboard( SETTINGS_CACHES ), | ||
makeLayout, | ||
clientRender | ||
); | ||
|
||
page( '/sites/settings/web-server', siteSelection, sites, makeLayout, clientRender ); | ||
page( | ||
'/sites/settings/web-server/:site', | ||
siteSelection, | ||
navigation, | ||
webServerSettings, | ||
siteDashboard( SETTINGS_WEB_SERVER ), | ||
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