Skip to content

Commit

Permalink
Standardize restore button in compose and admin
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY authored and Fajfa committed Apr 25, 2024
1 parent e169cf5 commit d2fcfdf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Expand Up @@ -58,6 +58,8 @@
<c-input-confirm
v-if="item.delete"
:icon="item.deleted ? ['fas', 'trash-restore'] : undefined"
:variant="item.deleted ? 'outline-warning' : 'outline-danger'"
:variant-ok="item.deleted ? 'warning' : 'danger'"
@confirmed="item.delete()"
/>

Expand Down
24 changes: 15 additions & 9 deletions client/web/compose/src/components/PageBlocks/RecordListBase.vue
Expand Up @@ -211,6 +211,7 @@
:icon="['fas', 'trash-restore']"
:tooltip="$t('recordList.tooltip.restoreSelected')"
variant="outline-warning"
variant-ok="warning"
@confirmed="handleRestoreSelectedRecords()"
/>
</template>
Expand Down Expand Up @@ -448,16 +449,20 @@
{{ $t('recordList.record.tooltip.clone') }}
</b-dropdown-item>

<b-dropdown-item
<c-input-confirm
v-if="isInlineRestoreActionVisible(item.r)"
@click.prevent="handleRestoreInline(item, index)"
>
<font-awesome-icon
:icon="['fas', 'trash-restore']"
class="text-warning"
/>
{{ $t('recordList.record.tooltip.restore') }}
</b-dropdown-item>
:text="$t('recordList.record.tooltip.restore')"
:icon="['fas', 'trash-restore']"
show-icon
borderless
variant="link"
variant-ok="warning"
size="md"
button-class="dropdown-item text-decoration-none text-dark rounded-0"
icon-class="text-warning"
class="w-100"
@confirmed="handleRestoreInline(item, index)"
/>

<!-- The user should be able to delete the record if it's not yet saved -->
<b-dropdown-item
Expand Down Expand Up @@ -553,6 +558,7 @@
show-icon
borderless
variant="link"
variant-ok="warning"
size="md"
button-class="dropdown-item text-decoration-none text-dark rounded-0"
icon-class="text-warning"
Expand Down

0 comments on commit d2fcfdf

Please sign in to comment.