diff --git a/environments/dev/dev.env b/environments/dev/dev.env index 38e36ec..ae149fd 100644 --- a/environments/dev/dev.env +++ b/environments/dev/dev.env @@ -1,6 +1,7 @@ REACT_APP_TAB_TITLE=Gepafin 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_WS=https://api-dev-gepafin.memento.credit/wss REACT_APP_LOGO_FILENAME=gepafin-logo.svg REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs diff --git a/src/components/NotificationsSidebar/index.js b/src/components/NotificationsSidebar/index.js index 31b00e5..07ad67d 100644 --- a/src/components/NotificationsSidebar/index.js +++ b/src/components/NotificationsSidebar/index.js @@ -163,12 +163,11 @@ const NotificationsSidebar = () => { stomp.current.connect( {}, () => { - // connected - console.log('Websocket connected'); + //console.log('Websocket connected'); setIsConnected(true); }, (error) => { - console.error('WebSocket Connection Error:', error); + //console.error('WebSocket Connection Error:', error); setIsConnected(false); setTimeout(connectWebSocket, 5000); } @@ -176,14 +175,12 @@ const NotificationsSidebar = () => { }; const subscribeTo = (topic) => { - console.log('subscribeTo', topic) const subscription = stomp.current.subscribe( topic, (message) => { try { const notification = JSON.parse(message.body); - console.log('notification', notification) - //setNotifications(prev => [notification, ...prev]); + setNotifications(prev => [notification, ...prev]); } catch (error) { console.error('Error parsing notification:', error); } @@ -208,7 +205,7 @@ const NotificationsSidebar = () => { if (stomp.current) { stomp.current.disconnect(() => { - console.log('WebSocket Disconnected'); + //console.log('WebSocket Disconnected'); }); } }; diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js index 9c2c517..14bc5e3 100644 --- a/src/pages/DomandaEditPreInstructor/index.js +++ b/src/pages/DomandaEditPreInstructor/index.js @@ -6,7 +6,7 @@ import { klona } from 'klona'; import { wrap } from 'object-path-immutable'; // store -import { storeSet, useStore } from '../../store'; +import { storeGet, storeSet, useStore } from '../../store'; // api import ApplicationEvaluationService from '../../service/application-evaluation-service'; @@ -502,6 +502,11 @@ const DomandaEditPreInstructor = () => { // TODO } + const evaluationShouldBeBlocked = (data = {}) => { + const userData = storeGet.main.userData() + return isAsyncRequest || userData.id !== data.assignedUserId; + } + useEffect(() => { const maxScore = pathOr(0, ['minScore'], data); const criteria = pathOr([], ['criteria'], data); @@ -610,7 +615,7 @@ const DomandaEditPreInstructor = () => { data, ['evaluationDocument'] )} - shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus)} + shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)} sourceId={data.assignedApplicationId} sourceName="evaluation"/> @@ -624,7 +629,7 @@ const DomandaEditPreInstructor = () => {
{data.checklist.map((o, i) =>
updateEvaluationValue( e.checked, @@ -640,7 +645,7 @@ const DomandaEditPreInstructor = () => {
updateEvaluationValue( @@ -656,7 +661,7 @@ const DomandaEditPreInstructor = () => { shouldDisableField(name) || evaluationShouldBeBlocked(data)} name="files" ndg={data.ndg} applicationId={id}/> @@ -670,7 +675,7 @@ const DomandaEditPreInstructor = () => { shouldDisableField(name) || evaluationShouldBeBlocked(data)} name="amendmentDetails" ndg={data.ndg} applicationId={id}/> @@ -693,7 +698,7 @@ const DomandaEditPreInstructor = () => {
{ onClick={() => displayCriterionData(o.id)} aria-label={__('Mostra', 'gepafin')}/> : null}