StudentPro

En esta sección se atenderán las dudas relacionadas con sistemas de gestión de la calidad, procedimientos, buenas prácticas, normas y todo lo relacionado con aseguramiento de la calidad

Moderator: julianmartinez16

User avatar
Valeriam04
Posts: 41
Joined: Tue Jan 17, 2017 8:55 am

Re: StudentPro

Post by Valeriam04 » Thu Sep 13, 2018 8:02 pm

JosueFerMar wrote:
Thu Sep 13, 2018 6:46 pm
Sprint 7 11/09/2018

Que se hizo?
Los estudiantes ya pueden guardar sus cursos

Problemas?
Falta de tiempo

Que se va a hacer?
La posibilidad de visualizar los cursos guardados y la posibilidad de guardar los tiempos disponibles

Code: Select all

import React from 'react';
import { View, Text, ActivityIndicator, Image } from 'react-native';

import styles from './styles'

export default class extends React.Component {
    render() {
        return (
            <View style={styles.container}>
                <View style={styles.wrapper}>
                    <Image style={styles.image} source={{uri: ""}}/>
                    <Text style={styles.title}>StudentPro</Text>
                </View>
                <View style={styles.activityIndicatorContainer}>
                    <ActivityIndicator animating={true}/>
                </View>
            </View>
        );
    }
}
Image
Last edited by Valeriam04 on Thu Sep 13, 2018 8:41 pm, edited 1 time in total.
Valeria Moreno
Gestión de la calidad del Software

User avatar
Valeriam04
Posts: 41
Joined: Tue Jan 17, 2017 8:55 am

Re: StudentPro

Post by Valeriam04 » Thu Sep 13, 2018 8:09 pm

JosueFerMar wrote:
Thu Sep 13, 2018 6:45 pm
Sprint 6 04/09/2018

Que se hizo?
se termino el logeo y registro por roles

Problemas?
Falta de tiempo

Que se va a hacer?
Se empezara con el modulo de guardar los cursos

Code: Select all

form.js

import React from 'react';
import PropTypes from 'prop-types'

import {Text, View} from 'react-native';
import {Button} from 'react-native-elements'

import {isEmpty, validate} from '../../utils/validate'

import styles from "./styles"

import AuthTextInput from "../AuthTextInput"

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

        const { fields, error } = props;

        this.state = this.createState(fields, error);

        //bind functions
        this.onChange = this.onChange.bind(this);
        this.onSubmit = this.onSubmit.bind(this);
    }

    createState(fields, error) {
        //create the state
        const state = {};
        fields.forEach((field) => {
            let {key, type, value} = field;
            state[key] = {type: type, value: value};
        })

        state["error"] = error;
        return state;
    }

    onSubmit() {
        const data = this.state;
        const result = validate(data);

        if (!result.success) this.setState({error: result.error});
        else this.props.onSubmit(this.extractData(data));
    }

    extractData(data) {
        const retData = {};

        Object.keys(data).forEach(function (key) {
            if (key !== "error") {
                let {value} = data[key];
                retData[key] = value;
            }
        });

        return retData;
    }

    onChange(key, text) {
        const state = this.state;
        state[key]['value'] = text;
        this.setState(state);
    }

    render() {
        const { fields, showLabel, buttonTitle, onForgotPassword} = this.props;

        return (
            <View style={styles.container}>
                <View style={styles.wrapper}>
                    {
                        (!isEmpty(this.state.error['general'])) &&
                        <Text style={styles.errorText}>{this.state.error['general']}</Text>
                    }

                    {
                        fields.map((data, idx) => {
                            let {key, label, placeholder, autoFocus, secureTextEntry, keyboardType} = data;
                            return (
                                <AuthTextInput key={key}
                                               label={label}
                                               showLabel={showLabel}
                                               placeholder={placeholder}
                                               autoFocus={autoFocus}
                                               onChangeText={(text) => this.onChange(key, text)}
                                               secureTextEntry={secureTextEntry}
                                               keyboardType={keyboardType}
                                               value={this.state[key]['value']}
                                               error={this.state.error[key]}/>
                            )
                        })
                    }

                    <Button
                        raised
                        title={buttonTitle}
                        borderRadius={0}
                        containerViewStyle={styles.containerView}
                        buttonStyle={styles.button}
                        textStyle={styles.buttonText}
                        onPress={this.onSubmit}/>
                    {
                        this.props.onForgotPassword !== null &&
                        <Text style={styles.forgotText} onPress={onForgotPassword}>
                            Forgot password?</Text>
                    }

                </View>
            </View>
        );
    }
}

Form.propTypes = {
    // fields: PropTypes.object,
    showLabel: PropTypes.bool,
    buttonTitle: PropTypes.string,
    onSubmit: PropTypes.func.isRequired,
    error: PropTypes.object
}


Form.defaultProps = {
    onForgotPassword: null,
}


export default Form;

Code: Select all

style.js

import { StyleSheet } from 'react-native';

import { theme } from "../../index"
const  { color, padding, windowWidth, normalize, fontSize, fontFamily } = theme;

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: color.white,
    },

    wrapper:{
        justifyContent:"center",
        alignItems:"center"
    },

    errorText:{
        color: color.red,
        width: (windowWidth - 45),
        marginTop: 20,
    },

    containerView:{
        marginVertical: padding * 3,
        width: windowWidth - 40
    },

    socialButton:{
        height: normalize(55),
        borderRadius:4,
        marginTop:0,
        marginBottom:0
    },

    button:{
        backgroundColor: "#FF553F",
        height: normalize(55)
    },

    buttonText:{
        fontSize: fontSize.regular + 2,
        fontFamily: fontFamily.medium
    },

    forgotText:{
        textAlign:"center",
        color:color.black,
        marginBottom: padding,
        fontSize: fontSize.regular,
        fontFamily: fontFamily.medium,
    }
});


export default styles;

Code: Select all

index.js

import Form from './Form'

export default Form;
Image
Valeria Moreno
Gestión de la calidad del Software

User avatar
Valeriam04
Posts: 41
Joined: Tue Jan 17, 2017 8:55 am

Re: StudentPro

Post by Valeriam04 » Tue Sep 18, 2018 6:16 pm

Sprint 6 18/09/2018

Que se hizo?
Se continua con el modulo de añadir la posibilidad de agregar horarios y cursos para estudiantes universitarios

Problemas?
Falta de tiempo

Que se va a hacer?
La posibilidad de visualizar los cursos guardados y la posibilidad de guardar los tiempos disponibles
Valeria Moreno
Gestión de la calidad del Software

User avatar
Valeriam04
Posts: 41
Joined: Tue Jan 17, 2017 8:55 am

Re: StudentPro

Post by Valeriam04 » Tue Sep 18, 2018 7:03 pm

Preentrega

Valeria Moreno
Gestión de la calidad del Software

User avatar
JosueFerMar
Posts: 10
Joined: Sun Feb 11, 2018 2:08 pm

Re: StudentPro

Post by JosueFerMar » Thu Sep 20, 2018 11:18 am


Post Reply