- 'resend emails' functionality - added role based access;

- fixed issue with displaying for instructor manager related amendments;
This commit is contained in:
Vitalii Kiiko
2025-05-13 12:44:43 +02:00
parent e0b745221a
commit 25ec77151a
4 changed files with 41 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ import { Dropdown } from 'primereact/dropdown';
import { Tag } from 'primereact/tag';
import { Calendar } from 'primereact/calendar';
import getQueryParamsForPaginatedEndpoint from '../../../../helpers/getQueryParamsForPaginatedEndpoint';
import SoccorsoResendEmails from '../../../SoccorsoEditPreInstructor/components/SoccorsoResendEmails';
const SoccorsiInstructorManagerMioTableAsync = ({ userId = null }) => {
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
@@ -94,10 +95,25 @@ const SoccorsiInstructorManagerMioTableAsync = ({ userId = null }) => {
});
};
const updateRowData = useCallback((id, updateResponse) => {
const newItems = items.map((o) => {
if (o.id === id) {
o.emailSendResponse = updateResponse;
}
return o;
})
setItems(newItems);
}, [items]);
const actionsBodyTemplate = (rowData) => {
return <Link to={`/mie-domande/${rowData.applicationId}/soccorso/${rowData.id}`}>
<Button severity="info" label={__('Dettagli', 'gepafin')} size="small"/>
</Link>
return <div className="appPageSection__tableActions lessGap">
<Link to={`/mie-domande/${rowData.applicationId}/soccorso/${rowData.id}`}>
<Button severity="info" label={__('Dettagli', 'gepafin')} size="small"/>
</Link>
<SoccorsoResendEmails
emailsData={rowData.emailSendResponse}
setDataEmailsSoccorso={(updateResponse) => updateRowData(rowData.id, updateResponse)}/>
</div>
}
const statusBodyTemplate = (rowData) => {