-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#357: Allow to edit participants alias, when study is active or in preview status. #447
Conversation
src/components/shared/MoreTable.vue
Outdated
), | ||
) | ||
: column.placeholder | ||
? column.placeholder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
da braucht es die komplexität des ternary operators nicht:
(column.placeholder || $t('global.placeholder.chooseDropdownOptionDefault'))
hat die gleiche funktionalität und macht es simpler zu verstehen
src/components/ParticipantList.vue
Outdated
@@ -93,7 +93,7 @@ Licensed under the Elastic License 2.0. */ | |||
field: 'studyGroupId', | |||
header: t('study.props.studyGroup'), | |||
type: MoreTableFieldType.choice, | |||
editable: { values: groupStatuses.value }, | |||
editable: { values: groupStatuses.value, editable: actionsVisible }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mir gefällt das naming hier nicht: in dem editable
Attribut nochmal ein editable
attribute zu haben. Da braucht es einen sinnvolleren namen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Früher war es so, das sobald ein Object mit "values" vorhanden war, war es editable. Nun musste ich noch weiter unterscheiden. Ich habe nun das property "showValuesForEditing" benannt.
3b3e7f6
to
b0db333
Compare
src/components/shared/MoreTable.vue
Outdated
(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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be equivalent, I guess:
(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) | |
row.userRoles.some((r: StudyRole) => | |
props.editAccessRoles.includes(r), | |
) && | |
[StudyStatus.Draft, StudyStatus.Paused, StudyStatus.PausedPreview].contains(row.status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elegant, thanks for the tip! I just replaced "contains()" with the js like "includes()".
* Rename object property from editable to showValuesForEditing for a better naming. * Remove unnecessary ternary operator to have the same functionality, but simpler.
79379da
to
b2fb3ab
Compare
But it is not possible to edit the study group when the status is active or in preview status, this is only possible when the study or the preview is paused.
Issue: #357