Skip to content

Commit

Permalink
#470: Disable all table action buttons if a row is in edit mode.
Browse files Browse the repository at this point in the history
* To have the same behavior over all categories (observations, interventions, etc.)
  • Loading branch information
benitsch committed Jun 28, 2024
1 parent 7a5f4ce commit 84b1bd5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/IntegrationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@ Licensed under the Elastic License 2.0. */
@on-action="executeAction($event)"
@on-change="updateIntegration($event)"
>
<template #tableActions>
<template #tableActions="{ isInEditMode }">
<div>
<Button
type="button"
icon="pi pi-plus"
:label="t('integration.integrationList.action.add')"
:disabled="!actionsVisible"
:disabled="isInEditMode ? true : !actionsVisible"
@click="
openIntegrationDialog(t('integration.dialog.header.create'))
"
Expand Down
4 changes: 2 additions & 2 deletions src/components/InterventionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,13 @@ Licensed under the Elastic License 2.0. */
@on-action="executeAction($event)"
@on-change="changeValue($event)"
>
<template #tableActions>
<template #tableActions="{ isInEditMode }">
<div>
<Button
type="button"
icon="pi pi-plus"
:label="t('intervention.interventionList.action.add')"
:disabled="!actionsVisible"
:disabled="isInEditMode ? true : !actionsVisible"
@click="
openInterventionDialog(t('intervention.dialog.header.create'))
"
Expand Down
6 changes: 3 additions & 3 deletions src/components/ParticipantList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ Licensed under the Elastic License 2.0. */
<Button
type="button"
:label="t('participants.participantsList.action.distribute')"
:disabled="!actionsVisible || participantsList.length === 0"
:disabled="isInEditMode ? true : !actionsVisible || participantsList.length === 0"

Check warning on line 408 in src/components/ParticipantList.vue

View workflow job for this annotation

GitHub Actions / Run Tests

Replace `isInEditMode·?·true·:·!actionsVisible·||·participantsList.length·===·0` with `⏎··············isInEditMode⏎················?·true⏎················:·!actionsVisible·||·participantsList.length·===·0⏎············`
@click="openDistributeDialog()"
/>
</div>
Expand All @@ -417,7 +417,7 @@ Licensed under the Elastic License 2.0. */
:custom-upload="true"
:auto="true"
accept=".csv"
:disabled="!actionsVisible"
:disabled="isInEditMode ? true : !actionsVisible"
@uploader="importParticipants($event)"
></FileUpload>
</div>
Expand All @@ -426,7 +426,7 @@ Licensed under the Elastic License 2.0. */
type="button"
icon="pi pi-download"
:label="t('participants.participantsList.action.export')"
:disabled="participantsList.length === 0"
:disabled="isInEditMode ? true : participantsList.length === 0"
@click="exportParticipants()"
/>
</div>
Expand Down

0 comments on commit 84b1bd5

Please sign in to comment.