- updated ammendment comm modal window form;
This commit is contained in:
@@ -242,7 +242,7 @@ const SoccorsoAddInstructorManager = () => {
|
|||||||
<div style={{marginBottom: '30px'}}>
|
<div style={{marginBottom: '30px'}}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label>
|
<label>
|
||||||
{__('Files', 'gepafin')}
|
{__('Allegati PEC', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
ref={ammendmentFilesRef}
|
ref={ammendmentFilesRef}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
<div style={{marginBottom: '30px'}}>
|
<div style={{marginBottom: '30px'}}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label>
|
<label>
|
||||||
{__('Files', 'gepafin')}
|
{__('Allegati PEC', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
ref={ammendmentFilesRef}
|
ref={ammendmentFilesRef}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { wrap } from 'object-path-immutable';
|
|||||||
import getDateFromISOstring from '../../../../helpers/getDateFromISOstring';
|
import getDateFromISOstring from '../../../../helpers/getDateFromISOstring';
|
||||||
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
||||||
import uniqid from '../../../../helpers/uniqid';
|
import uniqid from '../../../../helpers/uniqid';
|
||||||
|
import getFormatedFileSizeText from '../../../../helpers/getFormatedFileSizeText';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
import { storeGet, useStoreValue } from '../../../../store';
|
import { storeGet, useStoreValue } from '../../../../store';
|
||||||
@@ -18,12 +19,11 @@ import CommunicationService from '../../../../service/communication-service';
|
|||||||
import { Button } from 'primereact/button';
|
import { Button } from 'primereact/button';
|
||||||
import { classNames } from 'primereact/utils';
|
import { classNames } from 'primereact/utils';
|
||||||
import { InputText } from 'primereact/inputtext';
|
import { InputText } from 'primereact/inputtext';
|
||||||
import { InputTextarea } from 'primereact/inputtextarea';
|
|
||||||
import { Dialog } from 'primereact/dialog';
|
import { Dialog } from 'primereact/dialog';
|
||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
import { FileUpload } from 'primereact/fileupload';
|
import { FileUpload } from 'primereact/fileupload';
|
||||||
import { defaultMaxFileSize, mimeTypes } from '../../../../configData';
|
import { defaultMaxFileSize, mimeTypes } from '../../../../configData';
|
||||||
import getFormatedFileSizeText from '../../../../helpers/getFormatedFileSizeText';
|
import { Editor } from 'primereact/editor';
|
||||||
|
|
||||||
const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => {
|
const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => {
|
||||||
const [comms, setComms] = useState([]);
|
const [comms, setComms] = useState([]);
|
||||||
@@ -146,6 +146,26 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => {
|
|||||||
return userData.id === comm.senderUserId ? 'outgoing' : 'incoming';
|
return userData.id === comm.senderUserId ? 'outgoing' : 'incoming';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const renderHeader = () => {
|
||||||
|
return (
|
||||||
|
<span className="ql-formats">
|
||||||
|
<button className="ql-bold" aria-label="Bold"></button>
|
||||||
|
<button className="ql-italic" aria-label="Italic"></button>
|
||||||
|
<button className="ql-underline" aria-label="Underline"></button>
|
||||||
|
<button className="ql-link" aria-label="Link"></button>
|
||||||
|
<button className="ql-list" value="ordered"></button>
|
||||||
|
<button className="ql-header" value="2"></button>
|
||||||
|
<button className="ql-header" value="3"></button>
|
||||||
|
<button className="ql-blockquote"></button>
|
||||||
|
<button className="ql-list" value="bullet"></button>
|
||||||
|
<button className="ql-indent" value="-1"></button>
|
||||||
|
<button className="ql-indent" value="+1"></button>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const header = renderHeader();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Toast ref={toast}/>
|
<Toast ref={toast}/>
|
||||||
@@ -196,7 +216,7 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => {
|
|||||||
onHide={hideNewComDialog}>
|
onHide={hideNewComDialog}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label
|
<label
|
||||||
className={classNames({'p-error': isEmpty(newCommData.title)})}>
|
className={classNames({'p-error': !newCommData.title || isEmpty(newCommData.title)})}>
|
||||||
{__('Titolo', 'gepafin')}*
|
{__('Titolo', 'gepafin')}*
|
||||||
</label>
|
</label>
|
||||||
<InputText value={newCommData.title}
|
<InputText value={newCommData.title}
|
||||||
@@ -205,15 +225,17 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => {
|
|||||||
onChange={(e) => updateNewCommData(e.target.value, 'title')}/>
|
onChange={(e) => updateNewCommData(e.target.value, 'title')}/>
|
||||||
|
|
||||||
<label
|
<label
|
||||||
className={classNames({'p-error': isEmpty(newCommData.comment)})}>
|
className={classNames({'p-error': !newCommData.comment || isEmpty(newCommData.comment)})}>
|
||||||
{__('Contenuto', 'gepafin')}*
|
{__('Contenuto', 'gepafin')}*
|
||||||
</label>
|
</label>
|
||||||
<InputTextarea
|
<Editor
|
||||||
value={newCommData.comment}
|
value={newCommData.comment}
|
||||||
disabled={soccorsoStatus === 'CLOSE'}
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
rows={5} cols={30}
|
readOnly={soccorsoStatus === 'CLOSE'}
|
||||||
invalid={isEmpty(newCommData.comment)}
|
headerTemplate={header}
|
||||||
onChange={(e) => updateNewCommData(e.target.value, 'comment')}/>
|
onTextChange={(e) => updateNewCommData(e.htmlValue, 'comment')}
|
||||||
|
style={{ height: 80 * 3, width: '100%' }}
|
||||||
|
/>
|
||||||
{!['ROLE_CONFIDI', 'ROLE_BENEFICIARY'].includes(role)
|
{!['ROLE_CONFIDI', 'ROLE_BENEFICIARY'].includes(role)
|
||||||
? <div className="appForm__field">
|
? <div className="appForm__field">
|
||||||
<label>
|
<label>
|
||||||
|
|||||||
Reference in New Issue
Block a user