Skip to content

Commit

Permalink
feat(Project): Added export spreadsheet with linked release at projec…
Browse files Browse the repository at this point in the history
…t page
  • Loading branch information
amritkv authored and heliocastro committed Jan 12, 2025
1 parent f3492bb commit 43784e1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/app/[locale]/projects/components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,22 @@ function Project(): JSX.Element {
MessageService.error(t('Unauthorized request'))
}
}
else {
const response = await ApiUtils.GET('reports?module=PROJECTS&withLinkedRelease=true',
session.user.access_token)
if (response.status == HttpStatus.OK) {
MessageService.success(t('Excel report generation has started'))
}
else if (response.status == HttpStatus.FORBIDDEN) {
MessageService.warn(t('Access Denied'))
}
else if (response.status == HttpStatus.INTERNAL_SERVER_ERROR) {
MessageService.error(t('Internal server error'))
}
else if (response.status == HttpStatus.UNAUTHORIZED) {
MessageService.error(t('Unauthorized request'))
}
}
}
catch(e) {
console.log(e)
Expand Down Expand Up @@ -449,7 +465,8 @@ function Project(): JSX.Element {
onClick = {() => exportProjectSpreadsheet({ withLinkedRelease: false })}>
{t('Projects only')}
</Dropdown.Item>
<Dropdown.Item>
<Dropdown.Item
onClick = {() => exportProjectSpreadsheet({ withLinkedRelease: true })}>
{t('Projects with linked releases')}
</Dropdown.Item>
</Dropdown.Menu>
Expand Down

0 comments on commit 43784e1

Please sign in to comment.