Merge branch 'develop' into feature/93-user-details-page
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_TAB_TITLE=Gepafin
|
REACT_APP_TAB_TITLE=Gepafin
|
||||||
REACT_APP_API_EXECUTION_ADDRESS=https://api-dev-gepafin.memento.credit/v1
|
REACT_APP_API_EXECUTION_ADDRESS=https://api-dev-gepafin.memento.credit/v1
|
||||||
REACT_APP_API_ADDRESS=https://api-dev-gepafin.memento.credit
|
REACT_APP_API_ADDRESS=https://api-dev-gepafin.memento.credit
|
||||||
|
REACT_APP_API_ADDRESS_WS=https://api-dev-gepafin.memento.credit/wss
|
||||||
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
|
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
|
||||||
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
|
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
|
||||||
REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
|
REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
|
||||||
|
|||||||
@@ -163,12 +163,11 @@ const NotificationsSidebar = () => {
|
|||||||
stomp.current.connect(
|
stomp.current.connect(
|
||||||
{},
|
{},
|
||||||
() => {
|
() => {
|
||||||
// connected
|
//console.log('Websocket connected');
|
||||||
console.log('Websocket connected');
|
|
||||||
setIsConnected(true);
|
setIsConnected(true);
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.error('WebSocket Connection Error:', error);
|
//console.error('WebSocket Connection Error:', error);
|
||||||
setIsConnected(false);
|
setIsConnected(false);
|
||||||
setTimeout(connectWebSocket, 5000);
|
setTimeout(connectWebSocket, 5000);
|
||||||
}
|
}
|
||||||
@@ -176,14 +175,12 @@ const NotificationsSidebar = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const subscribeTo = (topic) => {
|
const subscribeTo = (topic) => {
|
||||||
console.log('subscribeTo', topic)
|
|
||||||
const subscription = stomp.current.subscribe(
|
const subscription = stomp.current.subscribe(
|
||||||
topic,
|
topic,
|
||||||
(message) => {
|
(message) => {
|
||||||
try {
|
try {
|
||||||
const notification = JSON.parse(message.body);
|
const notification = JSON.parse(message.body);
|
||||||
console.log('notification', notification)
|
setNotifications(prev => [notification, ...prev]);
|
||||||
//setNotifications(prev => [notification, ...prev]);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error parsing notification:', error);
|
console.error('Error parsing notification:', error);
|
||||||
}
|
}
|
||||||
@@ -208,7 +205,7 @@ const NotificationsSidebar = () => {
|
|||||||
|
|
||||||
if (stomp.current) {
|
if (stomp.current) {
|
||||||
stomp.current.disconnect(() => {
|
stomp.current.disconnect(() => {
|
||||||
console.log('WebSocket Disconnected');
|
//console.log('WebSocket Disconnected');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { klona } from 'klona';
|
|||||||
import { wrap } from 'object-path-immutable';
|
import { wrap } from 'object-path-immutable';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
import { storeSet, useStore } from '../../store';
|
import { storeGet, storeSet, useStore } from '../../store';
|
||||||
|
|
||||||
// api
|
// api
|
||||||
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
||||||
@@ -502,6 +502,11 @@ const DomandaEditPreInstructor = () => {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const evaluationShouldBeBlocked = (data = {}) => {
|
||||||
|
const userData = storeGet.main.userData()
|
||||||
|
return isAsyncRequest || userData.id !== data.assignedUserId;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const maxScore = pathOr(0, ['minScore'], data);
|
const maxScore = pathOr(0, ['minScore'], data);
|
||||||
const criteria = pathOr([], ['criteria'], data);
|
const criteria = pathOr([], ['criteria'], data);
|
||||||
@@ -610,7 +615,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
data,
|
data,
|
||||||
['evaluationDocument']
|
['evaluationDocument']
|
||||||
)}
|
)}
|
||||||
shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus)}
|
shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
||||||
sourceId={data.assignedApplicationId}
|
sourceId={data.assignedApplicationId}
|
||||||
sourceName="evaluation"/>
|
sourceName="evaluation"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -624,7 +629,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<div className="appPageSection__checklist">
|
<div className="appPageSection__checklist">
|
||||||
{data.checklist.map((o, i) => <div key={o.id}>
|
{data.checklist.map((o, i) => <div key={o.id}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
disabled={shouldDisableField('checklist')}
|
disabled={shouldDisableField('checklist') || evaluationShouldBeBlocked(data)}
|
||||||
inputId={`checklist_${o.id}`}
|
inputId={`checklist_${o.id}`}
|
||||||
onChange={(e) => updateEvaluationValue(
|
onChange={(e) => updateEvaluationValue(
|
||||||
e.checked,
|
e.checked,
|
||||||
@@ -640,7 +645,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<div>
|
<div>
|
||||||
<Editor
|
<Editor
|
||||||
value={data.note}
|
value={data.note}
|
||||||
readOnly={shouldDisableField('note')}
|
readOnly={shouldDisableField('note') || evaluationShouldBeBlocked(data)}
|
||||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
headerTemplate={header}
|
headerTemplate={header}
|
||||||
onTextChange={(e) => updateEvaluationValue(
|
onTextChange={(e) => updateEvaluationValue(
|
||||||
@@ -656,7 +661,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<ListOfFiles
|
<ListOfFiles
|
||||||
files={data.files}
|
files={data.files}
|
||||||
updateFn={updateEvaluationValue}
|
updateFn={updateEvaluationValue}
|
||||||
shouldDisableFieldFn={shouldDisableField}
|
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationShouldBeBlocked(data)}
|
||||||
name="files"
|
name="files"
|
||||||
ndg={data.ndg}
|
ndg={data.ndg}
|
||||||
applicationId={id}/>
|
applicationId={id}/>
|
||||||
@@ -670,7 +675,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<ListOfFiles
|
<ListOfFiles
|
||||||
files={data.amendmentDetails}
|
files={data.amendmentDetails}
|
||||||
updateFn={updateEvaluationValue}
|
updateFn={updateEvaluationValue}
|
||||||
shouldDisableFieldFn={shouldDisableField}
|
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationShouldBeBlocked(data)}
|
||||||
name="amendmentDetails"
|
name="amendmentDetails"
|
||||||
ndg={data.ndg}
|
ndg={data.ndg}
|
||||||
applicationId={id}/>
|
applicationId={id}/>
|
||||||
@@ -693,7 +698,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<td>
|
<td>
|
||||||
<div className="p-inputgroup">
|
<div className="p-inputgroup">
|
||||||
<InputNumber
|
<InputNumber
|
||||||
disabled={shouldDisableField('criteria')}
|
disabled={shouldDisableField('criteria') || evaluationShouldBeBlocked(data)}
|
||||||
placeholder={__('Punteggio', 'gepafin')}
|
placeholder={__('Punteggio', 'gepafin')}
|
||||||
keyfilter="int"
|
keyfilter="int"
|
||||||
value={o.score}
|
value={o.score}
|
||||||
@@ -716,7 +721,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
onClick={() => displayCriterionData(o.id)}
|
onClick={() => displayCriterionData(o.id)}
|
||||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||||
disabled={shouldDisableField('criteria')}
|
disabled={shouldDisableField('criteria') || evaluationShouldBeBlocked(data)}
|
||||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||||
onClick={() => updateEvaluationValue(
|
onClick={() => updateEvaluationValue(
|
||||||
true,
|
true,
|
||||||
@@ -724,7 +729,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
)}
|
)}
|
||||||
aria-label={__('Su', 'gepafin')}/>
|
aria-label={__('Su', 'gepafin')}/>
|
||||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||||
disabled={shouldDisableField('criteria')}
|
disabled={shouldDisableField('criteria') || evaluationShouldBeBlocked(data)}
|
||||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||||
onClick={() => updateEvaluationValue(
|
onClick={() => updateEvaluationValue(
|
||||||
false,
|
false,
|
||||||
@@ -767,7 +772,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!data.id || data.status === 'CLOSE' || (data.applicationStatus === 'EVALUATION'
|
disabled={!data.id || data.status === 'CLOSE' || (data.applicationStatus === 'EVALUATION'
|
||||||
&& (!allFilesRated || !atLeastOneChecked))}
|
&& (!allFilesRated || !atLeastOneChecked)) || evaluationShouldBeBlocked(data)}
|
||||||
onClick={doNewSoccorso}
|
onClick={doNewSoccorso}
|
||||||
outlined
|
outlined
|
||||||
label={<>
|
label={<>
|
||||||
@@ -782,7 +787,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
{data.id
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={data.status === 'CLOSE'}
|
disabled={data.status === 'CLOSE' || evaluationShouldBeBlocked(data)}
|
||||||
onClick={() => doSaveDraft()}
|
onClick={() => doSaveDraft()}
|
||||||
outlined
|
outlined
|
||||||
label={__('Salva bozza valutazione', 'gepafin')}
|
label={__('Salva bozza valutazione', 'gepafin')}
|
||||||
@@ -795,28 +800,49 @@ const DomandaEditPreInstructor = () => {
|
|||||||
{/*{APP_EVALUATION_FLOW_ID === '1' && ['EVALUATION'].includes(data.applicationStatus)
|
{/*{APP_EVALUATION_FLOW_ID === '1' && ['EVALUATION'].includes(data.applicationStatus)
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!data.id || !allFilesRated || !allChecksChecked}
|
disabled={!data.id || !allFilesRated || !allChecksChecked || evaluationShouldBeBlocked(data)}
|
||||||
onClick={doCheckNDG}
|
onClick={doCheckNDG}
|
||||||
label={__('Controlla NDG', 'gepafin')}
|
label={__('Controlla NDG', 'gepafin')}
|
||||||
/> : null}*/}
|
/> : null}*/}
|
||||||
{APP_EVALUATION_FLOW_ID === '1' && ['NDG'].includes(data.applicationStatus) && data.ndg
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={true}
|
||||||
|
onClick={() => {
|
||||||
|
}}
|
||||||
|
label={__('Controlla NDG', 'gepafin')}
|
||||||
|
/>
|
||||||
|
{/*{APP_EVALUATION_FLOW_ID === '1' && ['NDG'].includes(data.applicationStatus) && data.ndg
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!data.id}
|
disabled={!data.id || evaluationShouldBeBlocked(data)}
|
||||||
onClick={doCreateAppointment}
|
onClick={doCreateAppointment}
|
||||||
label={__('Crea l\'appuntamento', 'gepafin')}
|
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||||
/> : null}
|
/> : null}*/}
|
||||||
{APP_EVALUATION_FLOW_ID === '1' && ['APPOINTMENT'].includes(data.applicationStatus)
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={true}
|
||||||
|
onClick={() => {
|
||||||
|
}}
|
||||||
|
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||||
|
/>
|
||||||
|
{/*{APP_EVALUATION_FLOW_ID === '1' && ['APPOINTMENT'].includes(data.applicationStatus)
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!data.id}
|
disabled={!data.id || evaluationShouldBeBlocked(data)}
|
||||||
onClick={doMakeAdmisible}
|
onClick={doMakeAdmisible}
|
||||||
label={__('Ammissibile', 'gepafin')}
|
label={__('Ammissibile', 'gepafin')}
|
||||||
/> : null}
|
/> : null}*/}
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={true}
|
||||||
|
onClick={() => {
|
||||||
|
}}
|
||||||
|
label={__('Ammissibile', 'gepafin')}
|
||||||
|
/>
|
||||||
{data.id
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!isAdmissible || ['APPROVED'].includes(data.applicationStatus)}
|
disabled={!isAdmissible || ['APPROVED'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
||||||
/*disabled={!isAdmissible
|
/*disabled={!isAdmissible
|
||||||
|| (APP_EVALUATION_FLOW_ID === '1' && !['ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus))}*/
|
|| (APP_EVALUATION_FLOW_ID === '1' && !['ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus))}*/
|
||||||
onClick={initiateApproving}
|
onClick={initiateApproving}
|
||||||
@@ -832,7 +858,9 @@ const DomandaEditPreInstructor = () => {
|
|||||||
{data.id
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={APP_EVALUATION_FLOW_ID === '1' && !['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus)}
|
disabled={APP_EVALUATION_FLOW_ID === '1'
|
||||||
|
&& !['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus)
|
||||||
|
|| evaluationShouldBeBlocked(data)}
|
||||||
onClick={initiateRejecting}
|
onClick={initiateRejecting}
|
||||||
label={__('Respingi Domanda', 'gepafin')}
|
label={__('Respingi Domanda', 'gepafin')}
|
||||||
icon="pi pi-times" iconPos="right"/> : null}
|
icon="pi pi-times" iconPos="right"/> : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user