Skip to content

Commit

Permalink
#357: Refactoring the code so that it is short and precise.
Browse files Browse the repository at this point in the history
  • Loading branch information
bnitsch authored and benitsch committed May 29, 2024
1 parent 0c27680 commit 6204173
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/components/shared/MoreTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,14 @@ Licensed under the Elastic License 2.0. */
if (row.userRoles) {
return (
(row.userRoles.some((r: StudyRole) =>
row.userRoles.some((r: StudyRole) =>
props.editAccessRoles.includes(r),
) &&
row.status === StudyStatus.Draft) ||
(row.userRoles.some((r: StudyRole) =>
props.editAccessRoles.includes(r),
) &&
row.status === StudyStatus.Paused) ||
(row.userRoles.some((r: StudyRole) =>
props.editAccessRoles.includes(r),
) &&
row.status === StudyStatus.PausedPreview)
[
StudyStatus.Draft,
StudyStatus.Paused,
StudyStatus.PausedPreview,
].includes(row.status)
);
} else {
return props.editable(row);
Expand Down

0 comments on commit 6204173

Please sign in to comment.