Skip to content
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

Merged
merged 3 commits into from
May 29, 2024

Conversation

benitsch
Copy link

@benitsch benitsch commented May 22, 2024

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

src/components/shared/MoreTable.vue Show resolved Hide resolved
),
)
: column.placeholder
? column.placeholder
Copy link
Contributor

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

@@ -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 },
Copy link
Contributor

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

Copy link
Author

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.

Copy link

github-actions bot commented May 24, 2024

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 1027cc3. ± Comparison against base commit 659f522.

♻️ This comment has been updated with latest results.

Comment on lines 255 to 266
(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)
Copy link
Member

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:

Suggested change
(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)

Copy link
Author

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()".

bnitsch added 2 commits May 29, 2024 08:24
* Rename object property from editable to showValuesForEditing for a better naming.
* Remove unnecessary ternary operator to have the same functionality, but simpler.
@benitsch benitsch merged commit 6204173 into develop May 29, 2024
4 checks passed
@benitsch benitsch deleted the MORE-357_edit_alias branch May 29, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alias name editing for the unused token ( i.e new participants ) should not mandate pausing a running study
3 participants