1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

remove FormPropertyHeader

This commit is contained in:
Tim Daubenschütz 2015-08-06 10:23:01 +02:00
parent a3bfda186a
commit 68f4decaad
9 changed files with 29 additions and 43 deletions

View File

@ -13,7 +13,6 @@ import apiUrls from '../../constants/api_urls';
import { getLangText } from '../../utils/lang_utils';
let CreateEditionsForm = React.createClass({
propTypes: {
handleSuccess: React.PropTypes.func,
pieceId: React.PropTypes.number

View File

@ -8,7 +8,6 @@ import Form from './form';
import Property from './property';
import InputTextAreaToggable from './input_textarea_toggable';
import AppConstants from '../../constants/application_constants';
import { getLangText } from '../../utils/lang_utils.js';

View File

@ -9,6 +9,7 @@ import AppConstants from '../../constants/application_constants';
import { getLangText } from '../../utils/lang_utils';
let PieceDeleteForm = React.createClass({
propTypes: {
pieceId: React.PropTypes.number,

View File

@ -11,7 +11,6 @@ import UserActions from '../../actions/user_actions';
import Form from './form';
import Property from './property';
import FormPropertyHeader from './form_property_header';
import apiUrls from '../../constants/api_urls';
import AppConstants from '../../constants/application_constants';
@ -20,7 +19,6 @@ import { getLangText } from '../../utils/lang_utils';
let LoginForm = React.createClass({
propTypes: {
headerMessage: React.PropTypes.string,
submitMessage: React.PropTypes.string,
@ -114,9 +112,9 @@ let LoginForm = React.createClass({
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
</span>
}>
<FormPropertyHeader>
<div className="ascribe-form-header">
<h3>{this.props.headerMessage}</h3>
</FormPropertyHeader>
</div>
<Property
name='email'
label={getLangText('Email')}>

View File

@ -1,22 +0,0 @@
'use strict';
import React from 'react';
let FormPropertyHeader = React.createClass({
propTypes: {
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
])
},
render() {
return (
<div className="ascribe-form-header">
{this.props.children}
</div>
);
}
});
export default FormPropertyHeader;

View File

@ -7,7 +7,6 @@ import UserActions from '../../actions/user_actions';
import Form from './form';
import Property from './property';
import FormPropertyHeader from './form_property_header';
import ReactS3FineUploader from '../ascribe_uploader/react_s3_fine_uploader';
@ -110,9 +109,9 @@ let RegisterPieceForm = React.createClass({
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
</span>
}>
<FormPropertyHeader>
<div className="ascribe-form-header">
<h3>{this.props.headerMessage}</h3>
</FormPropertyHeader>
</div>
<Property
ignoreFocus={true}>
<FileUploader

View File

@ -12,7 +12,6 @@ import GlobalNotificationActions from '../../actions/global_notification_actions
import Form from './form';
import Property from './property';
import FormPropertyHeader from './form_property_header';
import InputCheckbox from './input_checkbox';
import apiUrls from '../../constants/api_urls';
@ -83,9 +82,9 @@ let SignupForm = React.createClass({
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
</span>
}>
<FormPropertyHeader>
<div className="ascribe-form-header">
<h3>{this.props.headerMessage}</h3>
</FormPropertyHeader>
</div>
<Property
name='email'
label={getLangText('Email')}>

View File

@ -5,7 +5,6 @@ import Router from 'react-router';
import Form from './ascribe_forms/form';
import Property from './ascribe_forms/property';
import FormPropertyHeader from './ascribe_forms/form_property_header';
import apiUrls from '../constants/api_urls';
import GlobalNotificationModel from '../models/global_notification_model';
@ -15,12 +14,15 @@ import { getLangText } from '../utils/lang_utils';
let PasswordResetContainer = React.createClass({
mixins: [Router.Navigation],
getInitialState() {
return {isRequested: false};
},
handleRequestSuccess(email){
handleRequestSuccess(email) {
this.setState({isRequested: email});
},
render() {
if (this.props.query.email && this.props.query.token) {
return (
@ -57,12 +59,17 @@ let PasswordResetContainer = React.createClass({
});
let PasswordRequestResetForm = React.createClass({
propTypes: {
handleRequestSuccess: React.PropTypes.func
},
handleSuccess() {
let notificationText = getLangText('If your email address exists in our database, you will receive a password recovery link in a few minutes.');
let notification = new GlobalNotificationModel(notificationText, 'success', 50000);
GlobalNotificationActions.appendGlobalNotification(notification);
this.props.handleRequestSuccess(this.refs.form.refs.email.state.value);
},
render() {
return (
<Form
@ -80,15 +87,15 @@ let PasswordRequestResetForm = React.createClass({
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
</span>
}>
<FormPropertyHeader>
<div className="ascribe-form-header">
<h3>{getLangText('Reset your password')}</h3>
</FormPropertyHeader>
</div>
<Property
name='email'
label={getLangText('Email')}>
<input
type="email"
placeholder={getLangText("Enter your email and we'll send a link")}
placeholder={getLangText('Enter your email and we\'ll send a link')}
name="email"
required/>
</Property>
@ -99,19 +106,26 @@ let PasswordRequestResetForm = React.createClass({
});
let PasswordResetForm = React.createClass({
propTypes: {
email: React.PropTypes.string,
token: React.PropTypes.string
},
mixins: [Router.Navigation],
getFormData(){
getFormData() {
return {
email: this.props.email,
token: this.props.token
};
},
handleSuccess() {
this.transitionTo('pieces');
let notification = new GlobalNotificationModel(getLangText('password successfully updated'), 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
},
render() {
return (
<Form
@ -130,9 +144,9 @@ let PasswordResetForm = React.createClass({
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
</span>
}>
<FormPropertyHeader>
<div className="ascribe-form-header">
<h3>{getLangText('Reset the password for')} {this.props.email}</h3>
</FormPropertyHeader>
</div>
<Property
name='password'
label={getLangText('Password')}>

View File

@ -23,7 +23,6 @@ import GlobalNotificationActions from '../actions/global_notification_actions';
import Property from './ascribe_forms/property';
import PropertyCollapsible from './ascribe_forms/property_collapsible';
import RegisterPieceForm from './ascribe_forms/form_register_piece';
//import FormPropertyHeader from './ascribe_forms/form_property_header';
import LoginContainer from './login_container';
import SlidesContainer from './ascribe_slides_container/slides_container';