Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #3414

Closed
wants to merge 96 commits into from
Closed

test #3414

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
7581d15
Updating libs and adding basic flux
stolksdorf Dec 26, 2016
47396e5
Added smart componenets, page line number highlighting
stolksdorf Dec 26, 2016
95aa803
Trying to fix prod builds breaking
stolksdorf Dec 27, 2016
8abf6ab
Updating pico-flux and vitreum to latest
stolksdorf Dec 27, 2016
f4cf288
newPage is now working, working on editpage
stolksdorf Dec 27, 2016
f75f60a
Edit page finally converted over
stolksdorf Dec 27, 2016
41303e6
'Share
stolksdorf Dec 27, 2016
924b398
Added new navitems
stolksdorf Dec 28, 2016
1173af5
'Created
stolksdorf Dec 30, 2016
95c09ba
moved welcome message and adding in egads errors
stolksdorf Jan 1, 2017
5ba3f98
Finally testing, things should be working a bit better now
stolksdorf Jan 1, 2017
10f4759
adding in some api tests
stolksdorf Jan 2, 2017
68ecf74
Stubbing out test files
stolksdorf Jan 1, 2017
25e0a16
whatever
stolksdorf Jan 1, 2017
a0bc4fd
moving the db setup out
stolksdorf Jan 1, 2017
537a75b
Triyng to setup api tests
stolksdorf Jan 2, 2017
3dc4c13
Something is up
stolksdorf Jan 6, 2017
5820564
added nodemon'd test npm task
stolksdorf Jan 6, 2017
66ca09b
Both types of tests are now working
stolksdorf Jan 6, 2017
174c297
Split off app into own file
stolksdorf Jan 6, 2017
7b38bcc
config file for tests
stolksdorf Jan 6, 2017
987363e
Fixing the pathing to the build folder
stolksdorf Jan 6, 2017
ca40ec5
Added in full test coverage of current spec
stolksdorf Jan 6, 2017
a26c4e2
Cleaned up the admin routes
stolksdorf Jan 7, 2017
d77fa0a
Backend of local login working
stolksdorf Jan 7, 2017
0d0f0d8
Adding in env configs and aextra protection on dev routes
stolksdorf Jan 7, 2017
baaa82e
Added in a logout to the user page
stolksdorf Jan 9, 2017
07f249b
Local login now working great
stolksdorf Jan 9, 2017
894e345
Fixed bug where new page loaded null brews sometimes
stolksdorf Jan 12, 2017
1aa79b3
Remove chrome warnings from after rebase
stolksdorf Jan 22, 2017
37de888
Creating a brand new admin page
stolksdorf Jan 10, 2017
cd2eb5f
Adding in lookup route
stolksdorf Jan 10, 2017
e77532a
Added tests for admin routes, lookup is working
stolksdorf Jan 10, 2017
0878439
Fixed issue with arrays not being saved
stolksdorf Jan 10, 2017
728277f
Removing invalid brews is working
stolksdorf Jan 10, 2017
dfcb04f
Setting up search tests
stolksdorf Jan 11, 2017
a405c7c
Stubbing out tests for searching
stolksdorf Jan 12, 2017
efee8ff
Basic search is working
stolksdorf Jan 23, 2017
2f82d38
Adding a new script from populating the DB with a bunch of random brews
stolksdorf Jan 27, 2017
8e58e5a
MOved the brews search to its own file, writing out more tests
stolksdorf Jan 27, 2017
8018442
Upgrading the brew generation for testing
stolksdorf Jan 27, 2017
a826aaf
created a brew generator and chai plugin for easier testing
stolksdorf Jan 27, 2017
26bcb33
Fixing edge cases in the search tests
stolksdorf Jan 28, 2017
75111ac
All tests should be done, phew
stolksdorf Jan 28, 2017
7e6f42f
Merge branch 'search' into newAdmin
stolksdorf Jan 28, 2017
6030134
New brew search finished on admin page
stolksdorf Jan 28, 2017
4593099
Merge branch 'newAdmin' into v3
stolksdorf Jan 28, 2017
c470bed
'Created
stolksdorf Jan 12, 2017
97c0443
Fixed bug where new page was storing null brews
stolksdorf Jan 12, 2017
c8b089f
Added new lexer for handling the new block syntax
stolksdorf Jan 12, 2017
b1db804
Added a todo for generic line styling
stolksdorf Jan 12, 2017
76ced9c
Added comma parsing to the block code
stolksdorf Jan 22, 2017
22d9982
Added support for title description and thumbnail images
stolksdorf Jan 26, 2017
cbab4f4
added todo
stolksdorf Jan 26, 2017
7001b71
Lots of progress with the new editor
stolksdorf Jan 29, 2017
c8c4672
Making the error looks better
stolksdorf Jan 30, 2017
95c91b6
Merge branch 'styleEditor' into noHtml
stolksdorf Jan 30, 2017
307dd2d
Adding newlines to div injection for blocks
stolksdorf Feb 2, 2017
0663737
moved the old parser and renderer into a depreciated folder
stolksdorf Feb 4, 2017
b40e5bc
simplifying the issue template, because no one ever actually uses it
stolksdorf Feb 12, 2017
304cd0f
Getting both renderers to play nice
stolksdorf Feb 13, 2017
bd08858
Split off the old stlying in a separate file
stolksdorf Feb 13, 2017
1da1f90
Backing up the todo
stolksdorf Feb 18, 2017
2f69ef3
Removing the old server files
stolksdorf Feb 23, 2017
b20f4ff
PHB style should be fully scoped
stolksdorf Feb 23, 2017
a33b1d8
Styling is finally split, oh boy
stolksdorf Feb 23, 2017
fd56735
Moved imgs and fonts into the new style folder
stolksdorf Feb 23, 2017
a6a1f41
Merge branch 'newStyle' into dualRenderer
stolksdorf Feb 23, 2017
dc486cf
Added nested markdown parsering within blocks
stolksdorf Feb 23, 2017
446ae9c
Merge branch 'dualRenderer' into noHtml
stolksdorf Feb 23, 2017
540c00c
Merge branch 'noHtml' into v3
stolksdorf Feb 23, 2017
0d0ce10
Starting to set up the snippets
stolksdorf Feb 24, 2017
9d4d337
Snippet bar has been replaced and new style of snippets being worked on
stolksdorf Feb 26, 2017
fbc18a0
Creating new stlying for the snippet blocks
stolksdorf Feb 26, 2017
ef0265f
moving old snippets into the depricated folder
stolksdorf Feb 26, 2017
234d216
Adding in notes and adding more to blocks
stolksdorf Feb 26, 2017
e112808
Column split now a key word
stolksdorf Feb 27, 2017
0705e08
Added in stlying for code blocks
stolksdorf Feb 27, 2017
4c87414
added an internal nested div on block elements
stolksdorf Feb 27, 2017
00f2703
Moved files into statics, finally fixed the brew editor breaking on r…
stolksdorf Mar 1, 2017
bfb2cea
Working on onster block
stolksdorf Mar 1, 2017
94a3a96
Adding to faq
stolksdorf Mar 4, 2017
393df1b
Updating the faqw
stolksdorf Mar 19, 2017
30d3fcf
Pseudo element borders are working, holy shit
stolksdorf Mar 19, 2017
a3251df
Pseudo borders are now working
stolksdorf Mar 19, 2017
eb1827c
Merge branch 'borderTest' into snippets
stolksdorf Mar 19, 2017
c647bdf
Added in stlying for blockquotes and clean up logic in footer
stolksdorf Mar 19, 2017
28a3f31
Work on the Table of contents snippet
stolksdorf Mar 19, 2017
20371a8
Adding the brew title to the print page title, so downloads are named…
stolksdorf Mar 20, 2017
ee1827e
Trying to get it working
stolksdorf Mar 21, 2017
1946a50
Converted a few nav items over
stolksdorf Mar 21, 2017
32317bf
Merge branch 'collaspeNav' into snippets
stolksdorf Mar 21, 2017
f99bcab
Updating the build scripts
stolksdorf Mar 26, 2017
d5f04ca
Shadows now being drawn as a :after element. Beauty
stolksdorf Mar 26, 2017
2023ae4
Merge branch 'borderShadows' into v3
stolksdorf Mar 26, 2017
b39f904
Updating DB to handle newer versions of mongo
stolksdorf May 28, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

13 changes: 1 addition & 12 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
Share link to issue brew: http://homebrewery.naturalcrit.com/share/XXXXXXX





### Additional Details

**Share Link** :

or

**Brew code to reproduce** : <details><summary>Click to expand</summary><code><pre>

PASTE BREW CODE HERE

</pre></code></details>
53 changes: 28 additions & 25 deletions client/admin/admin.jsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
const React = require('react');
const _ = require('lodash');

var HomebrewAdmin = require('./homebrewAdmin/homebrewAdmin.jsx');
const Nav = require('naturalcrit/nav/nav.jsx');

var Admin = React.createClass({
const BrewLookup = require('./brewLookup/brewLookup.jsx');
const AdminSearch = require('./adminSearch/adminSearch.jsx');
const InvalidBrew = require('./invalidBrew/invalidBrew.jsx');

const Admin = React.createClass({
getDefaultProps: function() {
return {
url : "",
admin_key : "",
homebrews : [],
admin_key : '',
};
},

render : function(){
var self = this;
return(
<div className='admin'>

<header>
<div className='container'>
<i className='fa fa-rocket' />
naturalcrit admin
</div>
</header>

<div className='container'>
renderNavbar : function(){
return <Nav.base>
<Nav.section>
<Nav.item icon='fa-magic' className='homebreweryLogo'>
Homebrewery Admin
</Nav.item>
</Nav.section>
</Nav.base>
},

<HomebrewAdmin homebrews={this.props.homebrews} admin_key={this.props.admin_key} />
</div>
render : function(){
return <div className='admin'>
{this.renderNavbar()}
<main className='content'>
<BrewLookup adminKey={this.props.admin_key} />
<AdminSearch adminKey={this.props.admin_key} />

<div className='dangerZone'>Danger Zone</div>

</div>
);
<InvalidBrew adminKey={this.props.admin_key} />
</main>
</div>
}
});

Expand Down
68 changes: 41 additions & 27 deletions client/admin/admin.less
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
@import 'naturalcrit/styles/reset.less';
@import 'naturalcrit/styles/elements.less';
@import 'naturalcrit/styles/animations.less';
@import 'naturalcrit/styles/colors.less';
@import 'naturalcrit/styles/tooltip.less';

@import 'font-awesome/css/font-awesome.css';

html,body, #reactContainer, .naturalCrit{
@import 'naturalcrit/styles/core.less';
html,body, #reactRoot{
min-height : 100%;
}

@sidebarWidth : 250px;

body{
background-color : #eee;
height : 100%;
margin : 0;
padding : 0;
background-color : #ddd;
font-family : 'Open Sans', sans-serif;
color : #4b5055;
font-weight : 100;
color : #4b5055;
text-rendering : optimizeLegibility;
margin : 0;
padding : 0;
height : 100%;
}

.admin{

header{
.admin {
nav {
background-color : @red;
font-size: 2em;
padding : 20px 0px;
color : white;
margin-bottom: 30px;
i{
margin-right: 30px;
.navItem{
background-color : @red;
}
.homebreweryLogo{
font-family : CodeBold;
font-size : 12px;
color : white;
div{
margin-top : 2px;
margin-bottom : -2px;
}
}
}
h1{
margin-bottom : 10px;
font-size : 2em;
font-weight : 800;
border-bottom : 1px solid #ddd;
}
main.content{
width : 1000px;
margin : 0 auto;
padding : 50px 20px;
background-color : white;
.dangerZone{
margin : 30px 0px;
padding : 10px 20px;
background : repeating-linear-gradient(45deg, @yellow, @yellow 10px, darken(#333, 10%) 10px, darken(#333, 10%) 20px);
font-size : 1em;
font-weight : 800;
color : white;
text-transform : uppercase;
}
}

}
86 changes: 86 additions & 0 deletions client/admin/adminSearch/adminSearch.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

const React = require('react');
const _ = require('lodash');
const cx = require('classnames');
const request = require('superagent');

const BrewTable = require('../brewTable/brewTable.jsx');

const LIMIT = 10;

const AdminSearch = React.createClass({
getDefaultProps: function() {
return {
adminKey : '',
};
},
getInitialState: function() {
return {
totalBrews : 1,
brews: [],

searching : false,
error : null,

page : 1,
searchTerms : ''
};
},

handleSearch : function(e){
this.setState({
searchTerms : e.target.value
});
},
handlePage : function(e){
this.setState({
page : e.target.value
});
},

search : function(){
this.setState({ searching : true, error : null });

request.get(`/api/brew`)
.query({
terms : this.state.searchTerms,
limit : LIMIT,
page : this.state.page - 1
})
.set('x-homebrew-admin', this.props.adminKey)
.end((err, res) => {
if(err){
this.setState({
searching : false,
error : err && err.toString()
});
}else{
this.setState({
brews : res.body.brews,
totalBrews : res.body.total
});
}
});
},

render: function(){
return <div className='adminSearch'>
<h1>Admin Search</h1>
<div className='controls'>
<input className='search' type='text' value={this.state.searchTerms} onChange={this.handleSearch} />

<button onClick={this.search}> <i className='fa fa-search' /> search </button>


<div className='page'>
page:
<input type='text' value={this.state.page} onChange={this.handlePage} />
/ {Math.ceil(this.state.totalBrews / LIMIT)}
</div>
</div>
<BrewTable brews={this.state.brews} />
</div>
}
});

module.exports = AdminSearch;
17 changes: 17 additions & 0 deletions client/admin/adminSearch/adminSearch.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

.adminSearch{
.controls{
margin-bottom : 20px;
input.search{
height : 33px;
padding : 10px;
}
.page {
float : right;
font-weight : 800;
input{
width : 20px;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const _ = require('lodash');
const cx = require('classnames');

const request = require('superagent');
const Moment = require('moment');

const BrewTable = require('../brewTable/brewTable.jsx');

const BrewLookup = React.createClass({
getDefaultProps: function() {
Expand All @@ -16,7 +15,8 @@ const BrewLookup = React.createClass({
return {
query:'',
resultBrew : null,
searching : false
searching : false,
error : null
};
},

Expand All @@ -26,13 +26,14 @@ const BrewLookup = React.createClass({
})
},
lookup : function(){
this.setState({ searching : true });
this.setState({ searching : true, error : null });

request.get(`/admin/lookup/${this.state.query}`)
.query({ admin_key : this.props.adminKey })
.set('x-homebrew-admin', this.props.adminKey)
.end((err, res) => {
this.setState({
searching : false,
error : err && err.toString(),
resultBrew : (err ? null : res.body)
});
})
Expand All @@ -42,14 +43,31 @@ const BrewLookup = React.createClass({
if(this.state.searching) return <div className='searching'><i className='fa fa-spin fa-spinner' /></div>;
if(!this.state.resultBrew) return <div className='noBrew'>No brew found.</div>;

return <BrewTable brews={[this.state.resultBrew ]} />

/*
const brew = this.state.resultBrew;
return <div className='brewRow'>
<div>{brew.title}</div>
<div>{brew.authors.join(', ')}</div>
<div><a href={'/edit/' + brew.editId} target='_blank'>/edit/{brew.editId}</a></div>
<div><a href={'/share/' + brew.shareId} target='_blank'>/share/{brew.shareId}</a></div>
<div><a href={'/edit/' + brew.editId} target='_blank'>{brew.editId}</a></div>
<div><a href={'/share/' + brew.shareId} target='_blank'>{brew.shareId}</a></div>
<div>{Moment(brew.updatedAt).fromNow()}</div>
<div>{brew.views}</div>
<div>
<div className='deleteButton'>
<i className='fa fa-trash' />
</div>
</div>
</div>
*/
},

renderError : function(){
if(!this.state.error) return;

return <div className='error'>
{this.state.error}
</div>
},

Expand All @@ -60,6 +78,7 @@ const BrewLookup = React.createClass({
<button onClick={this.lookup}><i className='fa fa-search'/></button>

{this.renderFoundBrew()}
{this.renderError()}
</div>
}
});
Expand Down
13 changes: 13 additions & 0 deletions client/admin/brewLookup/brewLookup.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

.brewLookup{
height : 200px;
input{
height : 33px;
margin-bottom : 20px;
padding : 0px 10px;
}
.error{
font-weight : 800;
color : @red;
}
}
Loading