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