Skip to content

Commit

Permalink
Comments: add feature flag for comment moderation and add route (Auto…
Browse files Browse the repository at this point in the history
  • Loading branch information
gwwar authored May 12, 2017
1 parent 97b8e74 commit 159e44d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 0 deletions.
19 changes: 19 additions & 0 deletions client/my-sites/comments/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* External dependencies
*/
import { renderWithReduxStore } from 'lib/react-helpers';
import React from 'react';

/**
* Internal dependencies
*/
import CommentsManagement from './main';

export const comments = function( context ) {
renderWithReduxStore(
<CommentsManagement
basePath={ context.path } />,
'primary',
context.store
);
};
26 changes: 26 additions & 0 deletions client/my-sites/comments/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* External dependencies
*/
import page from 'page';

/**
* Internal dependencies
*/
import controller from 'my-sites/controller';
import { comments } from './controller';
import config from 'config';

export default function() {
if ( config.isEnabled( 'comments/management' ) ) {
page( '/comments',
controller.siteSelection,
controller.sites
);

page( '/comments/:site',
controller.siteSelection,
controller.navigation,
comments
);
}
}
33 changes: 33 additions & 0 deletions client/my-sites/comments/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* External dependencies
*/
import React, { Component, PropTypes } from 'react';
import { localize } from 'i18n-calypso';

/**
* Internal dependencies
*/
import Main from 'components/main';
import PageViewTracker from 'lib/analytics/page-view-tracker';
import DocumentHead from 'components/data/document-head';

export class CommentsManagement extends Component {

static propTypes = {
basePath: PropTypes.string,
translate: PropTypes.func,
};

render() {
const { translate, basePath } = this.props;
return (
<Main className="comments">
<PageViewTracker path={ basePath } title="Manage Comments" />
<DocumentHead title={ translate( 'Manage Comments' ) } />
<div>Hello World!</div>
</Main>
);
}
}

export default localize( CommentsManagement );
8 changes: 8 additions & 0 deletions client/wordpress-com.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,12 @@ sections.push( {
secondary: true
} );

sections.push( {
name: 'comments',
paths: [ '/comments' ],
module: 'my-sites/comments',
group: 'sites',
secondary: true
} );

module.exports = sections;
1 change: 1 addition & 0 deletions config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"code-splitting": true,
"comments/filters-in-posts": true,
"comments/moderation-tools-in-posts": true,
"comments/management": true,
"community-translator": true,
"css-hot-reload": true,
"desktop-promo": true,
Expand Down

0 comments on commit 159e44d

Please sign in to comment.