Skip to content

Commit

Permalink
* make progress render null safe
Browse files Browse the repository at this point in the history
  • Loading branch information
CalamityC committed Mar 22, 2024
1 parent ae6082d commit 918fca9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rdmo/projects/assets/js/api/ProjectsApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class ProjectsApi extends BaseApi {
if (response.ok) {
if (response.url) {
window.open(response.url, '_blank')
// open in same window:
// window.location.href = response.url
} else {
throw new Error('Response does not contain a URL')
}
Expand Down
2 changes: 1 addition & 1 deletion rdmo/projects/assets/js/components/main/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const Projects = ({ config, configActions, currentUserObject, projectsActions, p
return foundInArrays.length > 0 ? gettext(foundInArrays.join(', ')) : null
},
owner: (_content, row) => row.owners.map(owner => `${owner.first_name} ${owner.last_name}`).join('; '),
progress: (_content, row) => {return `${row.progress_count} ${gettext('of')} ${row.progress_total}`},
progress: (_content, row) => `${row.progress_count ?? 0} ${gettext('of')} ${row.progress_total ?? 0}`,
created: content => new Date(content).toLocaleString(language, dateOptions),
updated: content => new Date(content).toLocaleString(language, dateOptions),
actions: (_content, row) => {
Expand Down

0 comments on commit 918fca9

Please sign in to comment.