Skip to content

Commit

Permalink
Merge pull request #299 from RyanNoelk/revert-282-dev
Browse files Browse the repository at this point in the history
reverting bad commit
  • Loading branch information
RyanNoelk authored Dec 15, 2017
2 parents 42b0c2e + 82d93c4 commit aac23b4
Show file tree
Hide file tree
Showing 122 changed files with 3,064 additions and 6,907 deletions.
1 change: 0 additions & 1 deletion api/base/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pytz==2016.10

# graphene-django==1.3
git+https://github.com/graphql-python/graphene-django.git@2929d0866c800ae6efa8d35bb40548940a70c31f
graphene==1.4.1
git+git://github.com/RyanNoelk/[email protected]

# Will need these once I start supporting metric mesurments
Expand Down
1 change: 0 additions & 1 deletion api/v1/list/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def get_node(cls, id, context, info):
class GroceryItemNode(DjangoObjectType):
class Meta:
model = GroceryItem
filter_fields = ['slug', 'list__id']
interfaces = (graphene.relay.Node, )

@classmethod
Expand Down
2 changes: 0 additions & 2 deletions docs/Running_without_Docker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Running OpenEats

#### Warning! This docs are outdated. The recommended way to install OpenEats is via docker.

* `git clone https://github.com/RyanNoelk/openeats.git`
* `cd openeats/api`
* `git checkout dev`
Expand Down
1 change: 1 addition & 0 deletions env_dev.list
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ API_PORT=8000
DJANGO_SECRET_KEY=sdfsadfas32e98zsdvhhsnz6udvbksjdhfi4galshjfg
DJANGO_SETTINGS_MODULE=base.settings
DJANGO_DEBUG=True
ALLOWED_HOST=''

# If you are serving content behind an HTTPS proxy,
# Set this to `true`.
Expand Down
2 changes: 1 addition & 1 deletion env_stg.list
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API_PORT=8000
DJANGO_SECRET_KEY=sdfsadfas32e98zsdvhhsnz6udvbksjdhfi4galshjfg
DJANGO_SETTINGS_MODULE=base.settings
DJANGO_DEBUG=False
ALLOWED_HOST=localhost
ALLOWED_HOST=''

# If you are serving content behind an HTTPS proxy,
# Set this to `true`.
Expand Down
1 change: 0 additions & 1 deletion frontend/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"presets": [
"es2015",
"stage-0",
"react"
],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8.6.0-alpine
FROM node:8.3.0-alpine

# Create app directory
RUN mkdir /code
Expand Down
16 changes: 0 additions & 16 deletions frontend/jest_mocks/createComponentWithIntlAndRouter.js

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/jest_mocks/createComponentWithRouter.js

This file was deleted.

21 changes: 8 additions & 13 deletions frontend/locale/de.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"login.alert.unable_to_login": "Das Einloggen war nicht erfolgreich!",
"login.alert.confirm": "Bitte stellen Sie sicher, dass Ihr Benutzername und Passwort richtig sind.",
"login.please_sign_in": "Bitte einloggen.",
"login.username": "Benutzername",
"login.password": "Passwort",
"login.sign_in": "Einloggen",
"login.alert.unable_to_login": "Das Einloggen war nicht erfolgreich!",
"login.alert.confirm": "Bitte stellen Sie sicher, dass Ihr Benutzername und Passwort richtig sind.",
"404.header": "Unsere Köche haben das Rezept in der Testküche versaut, bitte versuchen Sie etwas anderes.",
"404.message": "Entschuldigung! Ein 404 Fehler ist aufgetreten, wir können nicht finden wonach Sie suchen.",
"footer.credit": "Erstellt mit {link}",
Expand Down Expand Up @@ -32,16 +32,14 @@
"nav.brand": "OpenEats",
"nav.news": "News",
"nav.recipes": "Rezepte durchsuchen",
"list.new-input-placeholder": "Was benötigen Sie noch?",
"list.error.message": "Something went wrong!",
"grocery_list.my_lists": "Meine Listen",
"grocery_list.footer": "Doppelklicken Sie auf einen Eintrag, um diesen zu verändern.",
"list.new-input-placeholder": "Was benötigen Sie noch?",
"list.footer.items_left": "{itemCount, plural, =0 {Keine Einträge übrig} one {1 Eintrag übrig} other {{itemCount} Einträge übrig}}",
"list.footer.all": "Alle",
"list.footer.completed": "Fertig",
"list.footer.active": "Offen",
"list.footer.clear_completed": "Fertige Einträge löschen",
"list_header.confirm_delete": "Are you sure you want to delete this list?",
"my_lists.no_lists": "Keine Listen vorhanden",
"my_lists.new_list": "Erstelle eine neue Liste!",
"new_list.header": "Erstelle eine neue Liste",
Expand Down Expand Up @@ -96,17 +94,14 @@
"recipe.create.photo_label": "Foto",
"recipe.create.photo_placeholder": "Foto",
"recipe.create.submit": "Rezept anlegen",
"recipe.edit_recipe": "Rezept ändern",
"recipe.servings": "Portionen",
"recipe.prep_time": "Vorbereitungszeit",
"recipe.cooking_time": "Kochzeit",
"recipe.minutes": "Minuten",
"recipe.recipe_ingredient_button.save": "Add To",
"recipe.recipe_ingredient_button.check_all": "Check All",
"recipe.recipe_ingredient_button.clear": "Clear",
"recipe.ingredients": "Zutaten",
"recipe.directions": "Anweisungen",
"recipe.source": "Quelle",
"recipe.created_by": "Erstellt von",
"recipe.last_updated": "Letzte Bearbeitung",
"recipe.edit_recipe": "Rezept ändern",
"recipe.ingredients": "Zutaten",
"recipe.directions": "Anweisungen"
}
"recipe.minutes": "Minuten"
}
21 changes: 8 additions & 13 deletions frontend/locale/en.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"login.alert.unable_to_login": "Unable to login!",
"login.alert.confirm": "Please confirm that the username and password are correct.",
"login.please_sign_in": "Please sign in",
"login.username": "Username",
"login.password": "Password",
"login.sign_in": "Sign in",
"login.alert.unable_to_login": "Unable to login!",
"login.alert.confirm": "Please confirm that the username and password are correct.",
"404.header": "Our chef's ruined this recipe in the test kitchen, we suggest you try something else.",
"404.message": "Sorry the page came back with a 404 error we can't find what you are looking for.",
"footer.credit": "Created with {link}",
Expand Down Expand Up @@ -32,16 +32,14 @@
"nav.brand": "OpenEats",
"nav.news": "News",
"nav.recipes": "Browse recipes",
"list.new-input-placeholder": "What else do you need?",
"list.error.message": "Something went wrong!",
"grocery_list.my_lists": "My Lists",
"grocery_list.footer": "Double Click to edit an item.",
"list.new-input-placeholder": "What else do you need?",
"list.footer.items_left": "{itemCount, plural, =0 {No items} one {1 item left} other {{itemCount} items left}}",
"list.footer.all": "All",
"list.footer.completed": "Completed",
"list.footer.active": "Active",
"list.footer.clear_completed": "Clear completed",
"list_header.confirm_delete": "Are you sure you want to delete this list?",
"my_lists.no_lists": "No lists to display",
"my_lists.new_list": "Create a new list!",
"new_list.header": "Create a new list",
Expand Down Expand Up @@ -96,17 +94,14 @@
"recipe.create.photo_label": "Photo",
"recipe.create.photo_placeholder": "Photo",
"recipe.create.submit": "Submit recipe",
"recipe.edit_recipe": "Edit recipe",
"recipe.servings": "Servings",
"recipe.prep_time": "Prep time",
"recipe.cooking_time": "Cooking time",
"recipe.minutes": "minutes",
"recipe.recipe_ingredient_button.save": "Add To",
"recipe.recipe_ingredient_button.check_all": "Check All",
"recipe.recipe_ingredient_button.clear": "Clear",
"recipe.ingredients": "Ingredients",
"recipe.directions": "Directions",
"recipe.source": "Source",
"recipe.created_by": "Created by",
"recipe.last_updated": "Last edit",
"recipe.edit_recipe": "Edit recipe",
"recipe.ingredients": "Ingredients",
"recipe.directions": "Directions"
}
"recipe.minutes": "minutes"
}
21 changes: 8 additions & 13 deletions frontend/locale/es.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"login.alert.unable_to_login": "Identificación fallida!",
"login.alert.confirm": "Asegurese de que su nombre de usuario y contraseña sean correctos.",
"login.please_sign_in": "Identifiquese por favor",
"login.username": "Nombre de usuario",
"login.password": "Contraseña",
"login.sign_in": "Identifiquese",
"login.alert.unable_to_login": "Identificación fallida!",
"login.alert.confirm": "Asegurese de que su nombre de usuario y contraseña sean correctos.",
"404.header": "Nuestro chef no ha podido preparar esta receta, te sugerimos que intentes buscar otra cosa.",
"404.message": "No hemos podido encontrar lo que buscas.",
"footer.credit": "Creado con {link}",
Expand Down Expand Up @@ -32,16 +32,14 @@
"nav.brand": "OpenEats",
"nav.news": "Noticias",
"nav.recipes": "Recetas",
"list.new-input-placeholder": "¿Qué necesito comprar?",
"list.error.message": "Something went wrong!",
"grocery_list.my_lists": "Mis listas",
"grocery_list.footer": "Haga doble click para modificar ",
"list.new-input-placeholder": "¿Qué necesito comprar?",
"list.footer.items_left": "{itemCount, plural, =0 {No quedan productos} one {Queda un producto} other {Quedan {itemCount} productos}}",
"list.footer.all": "Todos",
"list.footer.completed": "Completados",
"list.footer.active": "Pendientes",
"list.footer.clear_completed": "Borrar completado",
"list_header.confirm_delete": "Are you sure you want to delete this list?",
"my_lists.no_lists": "No hay listas para mostrar",
"my_lists.new_list": "Crear una nueva lista",
"new_list.header": "Crear una nueva lista",
Expand Down Expand Up @@ -96,17 +94,14 @@
"recipe.create.photo_label": "Foto",
"recipe.create.photo_placeholder": "Foto",
"recipe.create.submit": "Guardar receta",
"recipe.edit_recipe": "Modificar receta",
"recipe.servings": "Sirve",
"recipe.prep_time": "Tiempo de preparación",
"recipe.cooking_time": "Tiempo de cocción",
"recipe.minutes": "minutos",
"recipe.recipe_ingredient_button.save": "Add To",
"recipe.recipe_ingredient_button.check_all": "Check All",
"recipe.recipe_ingredient_button.clear": "Clear",
"recipe.ingredients": "Ingredientes",
"recipe.directions": "Instrucciones",
"recipe.source": "La Fuento",
"recipe.created_by": "Creado por",
"recipe.last_updated": "Modificado",
"recipe.edit_recipe": "Modificar receta",
"recipe.ingredients": "Ingredientes",
"recipe.directions": "Instrucciones"
}
"recipe.minutes": "minutos"
}
30 changes: 0 additions & 30 deletions frontend/modules/account/components/Alert.js

This file was deleted.

64 changes: 42 additions & 22 deletions frontend/modules/account/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import {
defineMessages,
formatMessage
} from 'react-intl';

import { browserHistory } from 'react-router'
import AuthActions from '../actions/AuthActions';
import AuthStore from '../stores/AuthStore';
import Alert from './Alert'

// Load in the base CSS
require("./../css/login.scss");
Expand All @@ -20,36 +19,34 @@ function getAuthErrors() {
};
}

class Login extends React.Component {
constructor(props) {
super(props);

this.state = getAuthErrors();
}
export default injectIntl(React.createClass({
getInitialState: function() {
return getAuthErrors();
},

componentDidMount() {
componentDidMount: function() {
if (AuthStore.isAuthenticated()) {
this.props.history.push('/');
browserHistory.push('/');
}
AuthStore.addChangeListener(this._onChange);
}
},

componentWillUnmount() {
componentWillUnmount: function() {
AuthStore.removeChangeListener(this._onChange);
}
},

_onChange = () => {
_onChange: function() {
this.setState(getAuthErrors());
};
},

handleSubmit = e => {
handleSubmit: function(e) {
e.preventDefault();
let username = this.refs.username.value;
let pass = this.refs.pass.value;
var username = this.refs.username.value;
var pass = this.refs.pass.value;
AuthActions.getToken(username, pass);
};
},
render: function() {

render() {
const {formatMessage} = this.props.intl;
const messages = defineMessages({
please_sign_in: {
Expand Down Expand Up @@ -84,6 +81,29 @@ class Login extends React.Component {
</form>
)
}
}
}));

var Alert = injectIntl(React.createClass({
render: function() {

export default injectIntl(Login)
const {formatMessage} = this.props.intl;
const messages = defineMessages({
title: {
id: 'login.alert.unable_to_login',
description: 'Fail to login header',
defaultMessage: 'Unable to login!',
},
message: {
id: 'login.alert.confirm',
description: 'Fail to login message',
defaultMessage: 'Please confirm that the username and password are correct.',
}
});

return (
<div className="alert alert-danger">
<strong>{ formatMessage(messages.title) }</strong> { formatMessage(messages.message) }
</div>
)
}
}));
Loading

0 comments on commit aac23b4

Please sign in to comment.