Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 394 | Rev 396 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 394 Rev 395
Línea 1... Línea 1...
1
import React, { useState } from "react";
1
import React, { useState, useEffect } from "react";
2
import { axios } from '../../../utils';
2
import { axios } from '../../../utils';
3
import Section from "./section/Section";
3
import Section from "./section/Section";
4
import Spinner from "../../../shared/loading-spinner/Spinner";
4
import Spinner from "../../../shared/loading-spinner/Spinner";
5
import ConfirmModal from "../../../shared/confirm-modal/ConfirmModal";
5
import ConfirmModal from "../../../shared/confirm-modal/ConfirmModal";
Línea 8... Línea 8...
8
 
8
 
9
    //init states 
9
    //init states 
10
    const [confirmationBoxShow, setConfirmationBoxShow] = useState(false);
10
    const [confirmationBoxShow, setConfirmationBoxShow] = useState(false);
11
    const [valid, setValid] = useState(false);
11
    const [valid, setValid] = useState(false);
-
 
12
    const [success, setSuccess] = useState(false);
Línea 12... Línea 13...
12
    const [success, setSuccess] = useState(false);
13
    const [page, setPage] = useState(0);
13
 
14
 
Línea 14... Línea 15...
14
    // get props
15
    // get props
15
    const { backendVars, test, loading, setTest, action, page, setPage } = props;
16
    const { backendVars, test, loading, setTest, action } = props;
16
 
17
 
17
    /**
18
    /**
Línea 93... Línea 94...
93
     * Cancel test and send to the list of forms
94
     * Cancel test and send to the list of forms
94
     * @returns 
95
     * @returns 
95
     */
96
     */
96
    const handleCancel = () => setTest('');
97
    const handleCancel = () => setTest('');
Línea -... Línea 98...
-
 
98
 
-
 
99
 
-
 
100
    /**
-
 
101
     * componentDidMount
-
 
102
     */
-
 
103
    useEffect(() => {
-
 
104
 
-
 
105
        if (test.content.length <= 0) {
-
 
106
            setPage(test.content[0].position);
-
 
107
        }
-
 
108
 
-
 
109
    }, []);
97
 
110
 
98
    return (
111
    return (
99
        <div>
112
        <div>
100
            {loading ? (
113
            {loading ? (
101
                <div className="row">
114
                <div className="row">
Línea 109... Línea 122...
109
                            <ConfirmModal
122
                            <ConfirmModal
110
                                show={confirmationBoxShow}
123
                                show={confirmationBoxShow}
111
                                title={backendVars.LBL_TITLE_CONFIRM_SELF_EVALUATION}
124
                                title={backendVars.LBL_TITLE_CONFIRM_SELF_EVALUATION}
112
                                message={backendVars.LBL_TEXT_CONFIRM_SELF_EVALUATION}
125
                                message={backendVars.LBL_TEXT_CONFIRM_SELF_EVALUATION}
113
                                acceptLabel={backendVars.LBL_BTN_CONFIRM_SELF_EVALUATION}
126
                                acceptLabel={backendVars.LBL_BTN_CONFIRM_SELF_EVALUATION}
114
                                onClose = {handleConfirmationBoxShow}
127
                                onClose={handleConfirmationBoxShow}
115
                                onAccept={handleCancel}
128
                                onAccept={handleCancel}
116
                            />
129
                            />
Línea 117... Línea 130...
117
 
130
 
118
                            <div className="col-md-12 col-sm-12 col-xs-12">
131
                            <div className="col-md-12 col-sm-12 col-xs-12">