add role to button
This commit is contained in:
@@ -24,7 +24,7 @@ import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
|||||||
import { Dropdown } from 'primereact/dropdown';
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
import { Tag } from 'primereact/tag';
|
import { Tag } from 'primereact/tag';
|
||||||
import { Calendar } from 'primereact/calendar';
|
import { Calendar } from 'primereact/calendar';
|
||||||
import { storeSet } from '../../../../store';
|
import { storeGet, storeSet } from '../../../../store';
|
||||||
|
|
||||||
|
|
||||||
const AllBandiPreInstructorTableAsync = () => {
|
const AllBandiPreInstructorTableAsync = () => {
|
||||||
@@ -46,6 +46,8 @@ const AllBandiPreInstructorTableAsync = () => {
|
|||||||
});
|
});
|
||||||
const statuses = ['DRAFT','PUBLISH','EXPIRED'];
|
const statuses = ['DRAFT','PUBLISH','EXPIRED'];
|
||||||
|
|
||||||
|
const role = storeGet('getRole')
|
||||||
|
|
||||||
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]);
|
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]);
|
||||||
|
|
||||||
const onPage = (event) => {
|
const onPage = (event) => {
|
||||||
@@ -94,7 +96,10 @@ const AllBandiPreInstructorTableAsync = () => {
|
|||||||
<Link to={`/bandi/${rowData.id}`}>
|
<Link to={`/bandi/${rowData.id}`}>
|
||||||
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small" iconPos="right" />
|
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small" iconPos="right" />
|
||||||
</Link>
|
</Link>
|
||||||
<Button severity="info" label={__('Scarica graduatoria', 'gepafin')} icon="pi pi-download" size="small" iconPos="right" style={{marginTop:'10px'}} onClick={() => handleDownloadRanking(rowData.id)}/>
|
{role === 'ROLE_INSTRUCTOR_MANAGER' && (
|
||||||
|
<Button severity="info" label={__('Scarica graduatoria', 'gepafin')} icon="pi pi-download" size="small" iconPos="right" style={{marginTop:'10px'}} onClick={() => handleDownloadRanking(rowData.id)}/>
|
||||||
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user