- added modal window for approve/reject;
This commit is contained in:
@@ -44,7 +44,8 @@ const DomandaEditPreInstructor = () => {
|
|||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [isVisibleCompleteDialog, setIsVisibleCompleteDialog] = useState(false);
|
const [isVisibleCompleteDialog, setIsVisibleCompleteDialog] = useState(false);
|
||||||
const [operationType, setOperationType] = useState('')
|
const [operationType, setOperationType] = useState('');
|
||||||
|
const [motivation, setMotivation] = useState('');
|
||||||
|
|
||||||
const goToEvaluationsPage = () => {
|
const goToEvaluationsPage = () => {
|
||||||
navigate('/domande');
|
navigate('/domande');
|
||||||
@@ -272,7 +273,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const shouldDisableField = (fieldName) => {
|
const shouldDisableField = (fieldName) => {
|
||||||
return !['EVALUATION', 'OPEN'].includes(data.status) || ['ADMISSIBLE'].includes(data.status) && fieldName !== 'criteria'
|
return !['EVALUATION', 'OPEN'].includes(data.status) || (['ADMISSIBLE'].includes(data.status) && fieldName !== 'criteria')
|
||||||
}
|
}
|
||||||
|
|
||||||
const headerCompleteDialog = () => {
|
const headerCompleteDialog = () => {
|
||||||
@@ -283,6 +284,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
|
|
||||||
const hideCompleteDialog = () => {
|
const hideCompleteDialog = () => {
|
||||||
setIsVisibleCompleteDialog(false);
|
setIsVisibleCompleteDialog(false);
|
||||||
|
setOperationType('');
|
||||||
}
|
}
|
||||||
|
|
||||||
const footerCompleteDialog = () => {
|
const footerCompleteDialog = () => {
|
||||||
@@ -297,10 +299,13 @@ const DomandaEditPreInstructor = () => {
|
|||||||
|
|
||||||
const initiateApproving = () => {
|
const initiateApproving = () => {
|
||||||
setOperationType('approve');
|
setOperationType('approve');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const initiateRejecting = () => {
|
const initiateRejecting = () => {
|
||||||
setOperationType('approve');
|
setOperationType('approve');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -618,17 +623,15 @@ const DomandaEditPreInstructor = () => {
|
|||||||
style={{ maxWidth: '600px', width: '100%' }}
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
onHide={hideCompleteDialog}>
|
onHide={hideCompleteDialog}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
{/*<label
|
<label>{__('Motivazione', 'gepafin')}</label>
|
||||||
className={classNames({ 'p-error': isEmpty(chosenUser) || chosenUser === 0 || chosenApplication === 0 })}>
|
<Editor
|
||||||
{__('Istruttore', 'gepafin')}*
|
value={motivation}
|
||||||
</label>
|
readOnly={loading}
|
||||||
<Dropdown
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
value={chosenUser}
|
headerTemplate={header}
|
||||||
invalid={isEmpty(chosenUser) || chosenUser === 0 || chosenApplication === 0}
|
onTextChange={(e) => setMotivation(e.htmlValue)}
|
||||||
onChange={(e) => setChosenUser(e.value)}
|
style={{ height: 80 * 3, width: '100%' }}
|
||||||
options={users}
|
/>
|
||||||
optionLabel="name"
|
|
||||||
optionValue="value"/>*/}
|
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user