mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 04:26:10 +08:00
Merge branch 'master' into onbuild
This commit is contained in:
@@ -5,14 +5,15 @@ import {IndexLink, Link} from 'react-router';
|
||||
import styles from './Drawer.css';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
import {can} from 'coral-framework/services/perms';
|
||||
import cn from 'classnames';
|
||||
|
||||
const CoralDrawer = ({handleLogout, auth = {}}) => (
|
||||
<Drawer className={styles.drawer}>
|
||||
<Drawer className={cn('talk-admin-drawer-nav', styles.drawer)}>
|
||||
{ auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ?
|
||||
<div>
|
||||
<Navigation className={styles.nav}>
|
||||
<IndexLink
|
||||
className={styles.navLink}
|
||||
className={cn('talk-admin-nav-dashboard', styles.navLink)}
|
||||
to="/admin/dashboard"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.dashboard')}
|
||||
@@ -20,19 +21,21 @@ const CoralDrawer = ({handleLogout, auth = {}}) => (
|
||||
{
|
||||
can(auth.user, 'MODERATE_COMMENTS') && (
|
||||
<Link
|
||||
className={styles.navLink}
|
||||
className={cn('talk-admin-nav-moderate', styles.navLink)}
|
||||
to="/admin/moderate"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.moderate')}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
<Link className={styles.navLink}
|
||||
<Link
|
||||
className={cn('talk-admin-nav-stories', styles.navLink)}
|
||||
to="/admin/stories"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.stories')}
|
||||
</Link>
|
||||
<Link className={styles.navLink}
|
||||
<Link
|
||||
className={cn('talk-admin-nav-community', styles.navLink)}
|
||||
to="/admin/community"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.community')}
|
||||
@@ -41,7 +44,7 @@ const CoralDrawer = ({handleLogout, auth = {}}) => (
|
||||
can(auth.user, 'UPDATE_CONFIG') &&
|
||||
(
|
||||
<Link
|
||||
className={styles.navLink}
|
||||
className={cn('talk-admin-nav-configure', styles.navLink)}
|
||||
to="/admin/configure"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.configure')}
|
||||
|
||||
@@ -15,9 +15,13 @@ module.exports = {
|
||||
'passwordInput': '.talk-admin-login-sign-in #password',
|
||||
'signInButton': '.talk-admin-login-sign-in-button',
|
||||
'storiesNav': '.talk-admin-nav-stories',
|
||||
'storiesDrawerNav': '.talk-admin-drawer-nav .talk-admin-nav-stories',
|
||||
'storiesSection': '.talk-admin-stories',
|
||||
'communityNav': '.talk-admin-nav-community',
|
||||
'communityDrawerNav': '.talk-admin-drawer-nav .talk-admin-nav-community',
|
||||
'communitySection': '.talk-admin-community',
|
||||
'moderationContainer': '.talk-admin-moderation-container'
|
||||
'moderationContainer': '.talk-admin-moderation-container',
|
||||
'drawerButton': '.mdl-layout__drawer-button',
|
||||
'drawerOverlay': 'div.mdl-layout__obfuscator.is-visible',
|
||||
}
|
||||
};
|
||||
|
||||
+18
-10
@@ -1,10 +1,9 @@
|
||||
module.exports = {
|
||||
'@tags': ['admin', 'login'],
|
||||
beforeEach: (client) => {
|
||||
|
||||
// Testing Desktop
|
||||
client.resizeWindow(1280, 800);
|
||||
},
|
||||
beforeEach: (client) => {
|
||||
|
||||
client.resizeWindow(1024, 800);
|
||||
},
|
||||
'Admin logs in': (client) => {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
@@ -29,9 +28,14 @@ module.exports = {
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.waitForElementVisible('@storiesNav')
|
||||
.click('@storiesNav')
|
||||
.waitForElementVisible('@drawerButton')
|
||||
.click('@drawerButton')
|
||||
.waitForElementVisible('@storiesDrawerNav')
|
||||
.click('@storiesDrawerNav')
|
||||
.waitForElementVisible('@drawerOverlay')
|
||||
.click('@drawerOverlay')
|
||||
.waitForElementVisible('@storiesSection');
|
||||
|
||||
},
|
||||
|
||||
'Admin goes to Community': (client) => {
|
||||
@@ -39,9 +43,13 @@ module.exports = {
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.waitForElementVisible('@communityNav')
|
||||
.click('@communityNav')
|
||||
.waitForElementVisible('@communitySection');
|
||||
.waitForElementVisible('@drawerButton')
|
||||
.click('@drawerButton')
|
||||
.waitForElementVisible('@communityDrawerNav')
|
||||
.click('@communityDrawerNav')
|
||||
.waitForElementVisible('@drawerOverlay')
|
||||
.click('@drawerOverlay')
|
||||
.waitForElementVisible('@communitySection');
|
||||
},
|
||||
after: (client) => {
|
||||
client.end();
|
||||
|
||||
Reference in New Issue
Block a user