fix the bug from minjun' testing

This commit is contained in:
Sukchan Lee 2017-09-22 21:38:38 +09:00
parent d7e9814bee
commit c7fb169cb3
4 changed files with 9 additions and 6 deletions

View File

@ -34,13 +34,13 @@ co(function* () {
} }
const db = yield mongoose.connect(process.env.DB_URI) const db = yield mongoose.connect(process.env.DB_URI)
// FIXME : we need to implement landing page for inserting admin account Account.count((err, count) => {
Account.findByUsername('admin', true, (err, account) => {
if (err) { if (err) {
console.error(err); console.error(err);
throw err; throw err;
} }
if (!account) {
if (!count) {
const newAccount = new Account(); const newAccount = new Account();
newAccount.username = 'admin'; newAccount.username = 'admin';
newAccount.roles = [ 'admin' ]; newAccount.roles = [ 'admin' ];

View File

@ -12,6 +12,7 @@ const schema = {
"type": "string", "type": "string",
"title": "Username*", "title": "Username*",
"required": true, "required": true,
"maxLength": 24
}, },
"roles": { "roles": {
"type" : "array", "type" : "array",

View File

@ -4,8 +4,9 @@ import styled from 'styled-components';
import { media, transitions } from 'helpers/style-utils'; import { media, transitions } from 'helpers/style-utils';
import oc from 'open-color'; import oc from 'open-color';
import SubscriberIcon from 'react-icons/lib/md/person-add' import SubscriberIcon from 'react-icons/lib/md/person-add';
import ProfileIcon from 'react-icons/lib/md/folder-shared'; import ProfileIcon from 'react-icons/lib/md/content-copy';
import AccountIcon from 'react-icons/lib/md/vpn-key';
const Menu = styled.div` const Menu = styled.div`
display: block; display: block;
@ -89,7 +90,7 @@ const Sidebar = ({ isOpen, width, selectedView, onSelectView }) => (
<Title>Profile</Title> <Title>Profile</Title>
</Item> </Item>
<Item name="account" selected={selectedView} onSelect={onSelectView}> <Item name="account" selected={selectedView} onSelect={onSelectView}>
<Icon><ProfileIcon/></Icon> <Icon><AccountIcon/></Icon>
<Title>Account</Title> <Title>Account</Title>
</Item> </Item>
</Menu> </Menu>

View File

@ -12,6 +12,7 @@ const schema = {
"type": "string", "type": "string",
"title": "Title*", "title": "Title*",
"required": true, "required": true,
"maxLength": 24
}, },
"security": { "security": {
"title": "", "title": "",