diff --git a/src/Components/ResourcePageComponents/TextoObjeto.js b/src/Components/ResourcePageComponents/TextoObjeto.js index 1554cc9ebd70387fd72cb155f749232133f1b5c0..f19b82e1d1c55de62c7884e36c63827c7fe77b70 100644 --- a/src/Components/ResourcePageComponents/TextoObjeto.js +++ b/src/Components/ResourcePageComponents/TextoObjeto.js @@ -104,7 +104,12 @@ export default function TextoObjeto (props) { return ( <TextoObjetoDiv> { publisherDeletedObject && - <Redirect to="/"/> + <Redirect + to={{ + pathname: "/perfil", + state: 1 + }} + /> } <Snackbar open={snackbarOpen} autoHideDuration={1000} onClose={() => {toggleSnackbar(false)}} anchorOrigin = {{ vertical:'top', horizontal:'right' }} diff --git a/src/Components/SignUpContainerFunction.js b/src/Components/SignUpContainerFunction.js index 89343fe5ea8d726c1cdb503b68cb280e82b10c46..89752091cd4787555592c3c307e0ea0424395073 100644 --- a/src/Components/SignUpContainerFunction.js +++ b/src/Components/SignUpContainerFunction.js @@ -28,6 +28,7 @@ import {apiUrl} from '../env.js' import {GoogleLoginButton} from './LoginContainerFunction' import ValidateUserInput from './HelperFunctions/FormValidationFunction.js' import GoogleLogo from "../img/logo_google.svg" +import ReCaptcha from 'react-recaptcha' async function handleGoogleAttempt () { console.log("handleGoogleAttempt") @@ -37,6 +38,8 @@ async function handleGoogleAttempt () { window.location.replace(request_url) } export default function SignUpContainer (props) { + const [unavailableButton, setButtonAvailability] = useState(true); + const [formNome, setNome] = useState( { key : false, @@ -137,6 +140,12 @@ export default function SignUpContainer (props) { } } + function captchaVerified (response) { + if (response) { + setButtonAvailability(false) + } + } + return ( <ContainerStyled > <DialogHeaderStyled> @@ -208,8 +217,17 @@ export default function SignUpContainer (props) { help = {formConfirmation.key ? (formConfirmation.value.length === 0 ? "Faltou digitar sua senha." : (formConfirmation.value !== formSenha.value ? "As senhas precisam ser iguais" : "A senha precisa ter no mínimo 8 caracteres.")) : ""} /> <br/> + <div style={{margin:"0 auto", width: "304px"}}> + { + //<ReCaptcha sitekey={process.env.REACT_APP_SITE_KEY} verifyCallback={captchaVerified} /> //when key set in env + //<ReCaptcha sitekey="6LfxuKUUAAAAAIzYpCzEtJyeE8QRjBYa44dvHlTX" verifyCallback={captchaVerified} /> //use this one on production + <ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" verifyCallback={captchaVerified}/> //test key, from google, do not use this one on production + } + </div> <ConfirmContainerStyled> - <StyledSignUpButton type="submit" variant="contained"> + <StyledSignUpButton type="submit" variant="contained" disabled={unavailableButton} + style={unavailableButton ? { backgroundColor: "#e9e9e9" } : { backgroundColor: "#00bcd4" }} + > <span style={{paddingLeft:"16px", paddingRight:"16px", borderRadius:"3px", boxSizing:"border-box", fontFamily:"Roboto, sans serif", fontWeight:"500", color:"#fff"}} @@ -335,7 +353,6 @@ const ConfirmContainerStyled = styled.div` ` const StyledSignUpButton = styled(Button)` - background-color: #00bcd4 !important; box-shadow : none !important; outline: none !important; border : 0 !important; diff --git a/src/Components/UploadPageComponents/PartOne.js b/src/Components/UploadPageComponents/PartOne.js index 1c09b112faef0e0ebe63b01a021164edf48adee5..250428dbf319dd5488a5bcebb31743d787d6a73b 100644 --- a/src/Components/UploadPageComponents/PartOne.js +++ b/src/Components/UploadPageComponents/PartOne.js @@ -16,7 +16,8 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, {useState, useEffect} from 'react' +import React, {useState, useEffect, useContext, useRef} from 'react' +import {Store} from '../../Store.js' import Grid from '@material-ui/core/Grid'; import ButtonsDiv from './ButtonsDiv.js' import SobreORecurso from './Forms/SobreORecurso.js' @@ -28,12 +29,22 @@ import Idioma from './Forms/Idioma.js' import {SendInfo} from './SendInfo.js' import {getRequest} from '../HelperFunctions/getAxiosConfig.js' import SnackBar from '../../Components/SnackbarComponent'; +import LoadingSpinner from '../../Components/LoadingSpinner' export default function PartOne (props) { // {/*const [subjects, setSubjects] = useState([])*/} + const {state} = useContext(Store) + const didMountRef = useRef(false); + const didMountRefObj = useRef(false); + const [languages, setLanguages] = useState([]) const [objTypes, setObjTypes] = useState([]) + const [learningObject, setLearningObject] = useState({}) + + const [loading, toggleLoading] = useState(true) + const [loadingObj, toggleLoadingObj] = useState(true) + const [snackInfo, setSnackInfo] = useState({ open: false, text: '', @@ -87,12 +98,36 @@ export default function PartOne (props) { } } + function handleSuccessfulGet (data) { + setLearningObject(data) + } + useEffect( () => { - getRequest(`/object_types/`, handleSuccessGetObjTypes, (error) => {console.log(error)}) + getRequest(`/object_types/`, handleSuccessGetObjTypes, (error) => {console.log(error)}) + getRequest(`/languages/`, (data) => {setLanguages(data)}, (error) => {console.log(error)}) - getRequest(`/languages/`, (data) => {setLanguages(data)}, (error) => {console.log(error)}) + const url = `/learning_objects/${props.draftID}` + getRequest(url, handleSuccessfulGet, (error) => {console.log(error)}) }, []) + useEffect( () => { + if (didMountRef.current) { + toggleLoading(false) + } + else { + didMountRef.current = true; + } + }, [learningObject]) + + useEffect( () => { + if (didMountRefObj.current) { + toggleLoadingObj(false) + } + else { + didMountRefObj.current = true; + } + }, [objTypes]) + const handleSubmit = (e) => { e.preventDefault(); getRequest(`/learning_objects/${props.draftID}`, @@ -118,49 +153,69 @@ export default function PartOne (props) { color={snackInfo.color} text={snackInfo.text} /> - - <form onSubmit={handleSubmit}> - {/*------------------------------Titulo-----------------------------------------*/} - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <NewTitle draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - {/*------------------------------Sobre------------------------------------------*/} - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <SobreORecurso draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - {/*------------------------------Palavras-chave------------------------------------------*/} - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <Keywords draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - {/*------------------------------Autor------------------------------------------*/} - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <Autor draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - {/*------------------------------Tipo do Objeto------------------------------------------*/} - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <TipoDeRecurso objTypes={objTypes} draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - {/*------------------------------Idioma------------------------------------------*/} - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <Idioma languages={languages} draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - {/*------------------------------Botoes------------------------------------------*/} - <Grid item xs={12}> - <ButtonsDiv draftID={props.draftID} stepperControl={props.stepperControl}/> - </Grid> - - <Grid item xs={12} style={{marginTop : "20px"}}> - <span style={{marginTop : "20px", fontWeight : "200", color : "#a5a5a5", paddingLeft : "10px"}}> - * Campos obrigatórios - </span> - </Grid> - </form> + { + !loading && !loadingObj ? ( + <form onSubmit={handleSubmit}> + {/*------------------------------Titulo-----------------------------------------*/} + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <NewTitle draftID={props.draftID} onBlurCallback={SendInfo} initialValue={learningObject.name}/> + </Grid> + + {/*------------------------------Sobre------------------------------------------*/} + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <SobreORecurso draftID={props.draftID} onBlurCallback={SendInfo} initialValue={learningObject.description}/> + </Grid> + + {/*------------------------------Palavras-chave------------------------------------------*/} + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <Keywords draftID={props.draftID} onBlurCallback={SendInfo} initialValue={learningObject.tags !== undefined ? learningObject.tags.map((tag) => tag.name) : null}/> + </Grid> + + {/*------------------------------Autor------------------------------------------*/} + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <Autor draftID={props.draftID} onBlurCallback={SendInfo} + initialValue={ + learningObject.author === state.currentUser.name ? + 0 : 1 + } + initialOutroAutor={ + learningObject.author !== state.currentUser.name ? + learningObject.author : '' + } + /> + </Grid> + + {/*------------------------------Tipo do Objeto------------------------------------------*/} + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <TipoDeRecurso objTypes={objTypes} draftID={props.draftID} onBlurCallback={SendInfo} + initialValue={learningObject.object_type !== undefined && learningObject.object_type !== null ? objTypes.filter((type) => type.name === learningObject.object_type)[0].id : null} + /> + </Grid> + + {/*------------------------------Idioma------------------------------------------*/} + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <Idioma languages={languages} draftID={props.draftID} onBlurCallback={SendInfo} + initialValue={learningObject.language !== undefined ? learningObject.language.map((language) => language.name) : null} initialIDValues={learningObject.language !== undefined ? learningObject.language.map((language) => language.id) : null} + /> + </Grid> + + {/*------------------------------Botoes------------------------------------------*/} + <Grid item xs={12}> + <ButtonsDiv draftID={props.draftID} stepperControl={props.stepperControl}/> + </Grid> + + <Grid item xs={12} style={{marginTop : "20px"}}> + <span style={{marginTop : "20px", fontWeight : "200", color : "#a5a5a5", paddingLeft : "10px"}}> + * Campos obrigatórios + </span> + </Grid> + </form> + ) + : + ( + <LoadingSpinner text={"CARREGANDO"}/> + ) + } </React.Fragment> ) } diff --git a/src/Components/UploadPageComponents/PartThree.js b/src/Components/UploadPageComponents/PartThree.js index a5d0810784f9475418ec7004ea419f62c564e367..e751a1805175b71d28da3251327e097dc6bba7c6 100644 --- a/src/Components/UploadPageComponents/PartThree.js +++ b/src/Components/UploadPageComponents/PartThree.js @@ -213,12 +213,14 @@ export default function PartThree(props) { </span> </Grid> - <Grid item xs={windowWidth > 990 ? 6 : 12} style={{ paddingRight: "15px", paddingLeft: "15px", textAlign: windowWidth > 990 ? 'left' : 'center' }}> + <Grid item xs={windowWidth > 990 ? 6 : 12} style={{ paddingRight: "15px", paddingLeft: "15px"}}> + <div style={{margin:"0 auto", width: "304px"}}> { - //<ReCaptcha sitekey={process.env.REACT_APP_SITE_KEY} verifyCallback={captchaVerified} /> //when key set in env - //<ReCaptcha sitekey="6LfxuKUUAAAAAIzYpCzEtJyeE8QRjBYa44dvHlTX" verifyCallback={captchaVerified} /> //use this one on production - <ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" verifyCallback={captchaVerified} /> //test key, from google, do not use this one on production + //<ReCaptcha sitekey={process.env.REACT_APP_SITE_KEY} verifyCallback={captchaVerified} /> //when key set in env + //<ReCaptcha sitekey="6LfxuKUUAAAAAIzYpCzEtJyeE8QRjBYa44dvHlTX" verifyCallback={captchaVerified} /> //use this one on production + <ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" verifyCallback={captchaVerified} /> //test key, from google, do not use this one on production } + </div> </Grid> <Grid item xs={12} style={{ paddingRight: "15px", paddingLeft: "15px", marginTop: "30px", textAlign: 'center' }}> <GrayButton onClick={() => { props.stepperControl(-1) }}>VOLTAR</GrayButton> @@ -226,11 +228,23 @@ export default function PartThree(props) { { checkAccessLevel("partner") ? ( - <OrangeButton onClick={props.handlePost} disabled={unavailableButton}>PUBLICAR RECURSO</OrangeButton> + unavailableButton ? ( + <GrayButton disabled={unavailableButton}>PUBLICAR RECURSO</GrayButton> + ) + : + ( + <OrangeButton onClick={props.handlePost}>PUBLICAR RECURSO</OrangeButton> + ) ) : ( - <OrangeButton onClick={props.handleSubmit} disabled={unavailableButton}>SUBMETER RECURSO</OrangeButton> + unavailableButton ? ( + <GrayButton disabled={unavailableButton}>SUBMETER RECURSO</GrayButton> + ) + : + ( + <OrangeButton onClick={props.handleSubmit}>SUBMETER RECURSO</OrangeButton> + ) ) } diff --git a/src/Components/UploadPageComponents/PartTwo.js b/src/Components/UploadPageComponents/PartTwo.js index 0c7b571cf60023ff4c9b38bfb34858a4337d9dd4..cf65a4de9952a0450b5bfedf71bd671511bcecbe 100644 --- a/src/Components/UploadPageComponents/PartTwo.js +++ b/src/Components/UploadPageComponents/PartTwo.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, {useState, useEffect} from 'react' +import React, {useState, useEffect, useRef} from 'react' import Grid from '@material-ui/core/Grid'; import styled from 'styled-components' import DragAndDropThumbnail from './PartTwoComponents/DragAndDropThumbnail' @@ -34,6 +34,7 @@ import DisplayThumbnail from './PartTwoComponents/DisplayThumbnail.js' import CustomCircularProgress from './PartTwoComponents/CustomCircularProgress'; import {getRequest, putRequest} from '../HelperFunctions/getAxiosConfig.js' import SnackBar from '../../Components/SnackbarComponent'; +import LoadingSpinner from '../../Components/LoadingSpinner' export function LoadingDiv () { return ( @@ -44,9 +45,16 @@ export function LoadingDiv () { } export default function PartTwo (props) { + const didMountRef = useRef(false); + const [eduStages, setEduStages] = useState([]) const [subjects, setSubjects] = useState([]) const [themes, setThemes] = useState([]) + + const [learningObject, setLearningObject] = useState({}) + + const [loading, toggleLoading] = useState(true) + const [snackInfo, setSnackInfo] = useState({ open: false, text: '', @@ -98,12 +106,29 @@ export default function PartTwo (props) { } } + function handleSuccessfulGet (data) { + setLearningObject(data) + } + useEffect(() => { getRequest(`/educational_stages/`, (data) => {setEduStages(data)}, (error) => {console.log(error)}) getRequest(`/subjects/`, handleSuccess, (error) => {console.log(error)}) + + const url = `/learning_objects/${props.draftID}` + getRequest(url, handleSuccessfulGet, (error) => {console.log(error)}) }, []) + useEffect( () => { + if (didMountRef.current) { + console.log(learningObject); + toggleLoading(false) + } + else { + didMountRef.current = true; + } + }, [learningObject]) + /*------------------------Licenca------------------------*/ @@ -178,41 +203,53 @@ export default function PartTwo (props) { color={snackInfo.color} text={snackInfo.text} /> - <form style={{width : "100%"}} onSubmit={handleSubmit}> - <Grid item xs={12} style={{paddingBottom : "40px"}}> - {chooseRenderStageThumbnail()} - </Grid> - - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <EducationalStage draftID={props.draftID} eduStages={eduStages} onBlurCallback={SendInfo}/> - </Grid> - - <SubjectsAndThemes draftID={props.draftID} subjects={subjects} themes={themes} onUploadPage={true} onBlurCallback={SendInfo}/> - - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <Licenca draftID={props.draftID} onBlurCallback={SendInfo}/> - </Grid> - - <Grid item xs={12} style={{paddingBottom : "40px"}}> - <StyledFormControl required > - <StyledFormLabel component="legend" style={{fontSize : "14px", marginBottom : "10px"}} onClick={() => window.open("/termos/", "_blank")}> - <b>Confirme se você concorda com os <strong style={{color : "#ff7f00"}}>termos de uso e de propriedade intelectual</strong></b> - </StyledFormLabel> - <FormControlLabel label={<span className="label">Li e concordo com os termos de uso e de propriedade intelectual.</span>} control={<Checkbox checked={termsCheckbox} onChange={toggleCheckbox}/>} + { + !loading ? ( + <form style={{width : "100%"}} onSubmit={handleSubmit}> + <Grid item xs={12} style={{paddingBottom : "40px"}}> + {chooseRenderStageThumbnail()} + </Grid> + + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <EducationalStage draftID={props.draftID} eduStages={eduStages} onBlurCallback={SendInfo} + initialValue={learningObject.educational_stages !== null ? learningObject.educational_stages.map((stage) => String(stage.id)) : null} /> - </StyledFormControl> - </Grid> - - <Grid item xs={12}> - <ButtonsDiv draftID={props.draftID} stepperControl={props.stepperControl} onPartTwo={true}/> - </Grid> - - <Grid item xs={12} style={{marginTop : "20px"}}> - <span style={{marginTop : "20px", fontWeight : "200", color : "#a5a5a5", paddingLeft : "10px"}}> - * Campos obrigatórios - </span> - </Grid> - </form> + </Grid> + + <SubjectsAndThemes draftID={props.draftID} subjects={subjects} themes={themes} onUploadPage={true} onBlurCallback={SendInfo} + initialValue={learningObject.subjects !== null ? learningObject.subjects.map(subject => String(subject.id)) : null} + /> + + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <Licenca draftID={props.draftID} onBlurCallback={SendInfo} initialValue={learningObject.license ? learningObject.license.id : null}/> + </Grid> + + <Grid item xs={12} style={{paddingBottom : "40px"}}> + <StyledFormControl required > + <StyledFormLabel component="legend" style={{fontSize : "14px", marginBottom : "10px"}} onClick={() => window.open("/termos/", "_blank")}> + <b>Confirme se você concorda com os <strong style={{color : "#ff7f00"}}>termos de uso e de propriedade intelectual</strong></b> + </StyledFormLabel> + <FormControlLabel label={<span className="label">Li e concordo com os termos de uso e de propriedade intelectual.</span>} control={<Checkbox checked={termsCheckbox} onChange={toggleCheckbox}/>} + /> + </StyledFormControl> + </Grid> + + <Grid item xs={12}> + <ButtonsDiv draftID={props.draftID} stepperControl={props.stepperControl} onPartTwo={true}/> + </Grid> + + <Grid item xs={12} style={{marginTop : "20px"}}> + <span style={{marginTop : "20px", fontWeight : "200", color : "#a5a5a5", paddingLeft : "10px"}}> + * Campos obrigatórios + </span> + </Grid> + </form> + ) + : + ( + <LoadingSpinner text={"CARREGANDO"}/> + ) + } </React.Fragment> ) } diff --git a/src/Pages/EditLearningObjectPage.js b/src/Pages/EditLearningObjectPage.js index 5f8e84fd37ca9631c73f1ede50177413be608507..c785bf3564d672834c0ed00f964fcc139040a8c5 100644 --- a/src/Pages/EditLearningObjectPage.js +++ b/src/Pages/EditLearningObjectPage.js @@ -24,6 +24,7 @@ import Grid from '@material-ui/core/Grid'; import UploadFileWrapper from '../Components/UploadPageComponents/UploadFileWrapper.js' import Alert from '../Components/Alert.js'; import Snackbar from '@material-ui/core/Snackbar'; +import {Redirect} from 'react-router-dom' import {GreyButton, OrangeButton, InfoBox} from '../Components/UploadPageComponents/StyledComponents.js' import {Background} from '../Components/UploadPageComponents/StyledComponents' import LoadingSpinner from '../Components/LoadingSpinner' @@ -46,6 +47,7 @@ export default function EditLearningObjectPage (props) { const recursoId = props.match.params.recursoId const {state} = useContext(Store) const [learningObject, setLearningObject] = useState({}) + const [publisherDeletedObject, toggleDeleted] = useState(false) const [objTypes, setObjTypes] = useState([]) const [languages, setLanguages] = useState([]) const [eduStages, setEduStages] = useState([]) @@ -115,7 +117,7 @@ export default function EditLearningObjectPage (props) { function handleSuccessfulDelete (data) { toggleSnackbar(true) - props.history.push("/") + toggleDeleted(true) } const handleDelete = () => { @@ -237,6 +239,15 @@ export default function EditLearningObjectPage (props) { } return ( <React.Fragment> + { + publisherDeletedObject && + <Redirect + to={{ + pathname: "/perfil", + state: 1 + }} + /> + } <Snackbar open={snackbarOpen} autoHideDuration={1000} onClose={() => {toggleSnackbar(false)}} anchorOrigin = {{ vertical:'top', horizontal:'right' }} > @@ -276,7 +287,7 @@ export default function EditLearningObjectPage (props) { </Grid> <Grid item xs={12} style={{paddingBottom : "40px"}}> - <Keywords draftID={learningObject.id} initialValue={learningObject.tags.map((tag) => tag.name)} + <Keywords draftID={learningObject.id} initialValue={learningObject.tags !== undefined ? learningObject.tags.map((tag) => tag.name) : null} onBlurCallback={onBlurCallback}/> </Grid> @@ -296,20 +307,21 @@ export default function EditLearningObjectPage (props) { <Grid item xs={12} style={{paddingBottom : "40px"}}> <TipoDeRecurso objTypes={objTypes} draftID={learningObject.id} - initialValue={learningObject.object_type !== null ? objTypes.filter((type) => type.name === learningObject.object_type)[0].id : null} onBlurCallback={onBlurCallback} /> + initialValue={learningObject.object_type !== undefined && learningObject.object_type !== null ? objTypes.filter((type) => type.name === learningObject.object_type)[0].id : null} onBlurCallback={onBlurCallback} /> </Grid> <Grid item xs={12} style={{paddingBottom : "40px"}}> - <Idioma languages={languages} draftID={learningObject.id} initialValue={learningObject.language.map((language) => language.name)} initialIDValues={learningObject.language.map((language) => language.id)} - onBlurCallback={onBlurCallback} /> + <Idioma languages={languages} draftID={learningObject.id} + initialValue={learningObject.language !== undefined ? learningObject.language.map((language) => language.name) : null} initialIDValues={learningObject.language !== undefined ? learningObject.language.map((language) => language.id) : null} + onBlurCallback={onBlurCallback} /> </Grid> <Grid item xs={12} style={{paddingBottom : "40px"}}> - <EducationalStage draftID={learningObject.id} eduStages={eduStages} initialValue={learningObject.educational_stages.map((stage) => String(stage.id))} onBlurCallback={onBlurCallback} + <EducationalStage draftID={learningObject.id} eduStages={eduStages} initialValue={learningObject.educational_stages !== null ? learningObject.educational_stages.map((stage) => String(stage.id)) : null} onBlurCallback={onBlurCallback} /> </Grid> - <SubjectsAndThemes draftId={learningObject.id} subjects={subjects} initialValue={learningObject.subjects.map(subject => String(subject.id))} onBlurCallback={onBlurCallback}/> + <SubjectsAndThemes draftId={learningObject.id} subjects={subjects} initialValue={learningObject.subjects !== null ? learningObject.subjects.map(subject => String(subject.id)) : null} onBlurCallback={onBlurCallback}/> <Grid item xs={12} style={{paddingBottom : "40px"}}> <Licenca draftID={learningObject.id} initialValue={learningObject.license ? learningObject.license.id : null} onBlurCallback={onBlurCallback}/>