drink can't edit if picture is not loading #3

Closed
opened 2021-06-29 12:29:48 +00:00 by crimsen · 1 comment
Owner

You can't edit a drink if the picture of the drink couldn't load.

Problem is here in line 36:

<q-img style="max-height: 256px" :src="image(props.row.uuid)">
            <div
              v-if="!public && !nodetails && editable"
              class="absolute-top-right justify-end"
              style="background-color: transparent"
            >
              <q-btn
                round
                icon="mdi-pencil"
                style="background-color: rgba(0, 0, 0, 0.5)"
                @click="editDrink = props.row"
              />
            </div>
            <div class="absolute-bottom-right justify-end">
              <div class="text-subtitle1 text-right">
                {{ props.row.name }}
              </div>
              <div class="text-caption text-right">
                {{ props.row.type.name }}
              </div>
            </div>
            <template #error>
              <q-img class="bg-white" style="max-height: 256px" src='no-image.svg' />
              <div
                v-if="!public && !nodetails && editable"
                class="absolute-top-right justify-end"
                style="background-color: transparent"
              >
                <q-btn
                  round
                  icon="mdi-pencil"
                  style="background-color: rgba(0, 0, 0, 0.5)"
                  @click="editDrink = props.row"
                />
              </div>
            </template>
          </q-img>

if no image is loaded, the edit button will never show. This can be fixed with error handling e.g:

<template #error>
  <div
    v-if="!public && !nodetails && editable"
    class="absolute-top-right justify-end"
    style="background-color: transparent"
  >
    <q-btn
      round
      icon="mdi-pencil"
      style="background-color: rgba(0, 0, 0, 0.5)"
      @click="editDrink = props.row"
    />
  </div>
</template>
You can't edit a drink if the picture of the drink couldn't load. Problem is [here](https://flaschengeist.dev/Flaschengeist/flaschengeist-pricelist/src/branch/develop/src/components/CalculationTable.vue#L36) in line 36: ```html <q-img style="max-height: 256px" :src="image(props.row.uuid)"> <div v-if="!public && !nodetails && editable" class="absolute-top-right justify-end" style="background-color: transparent" > <q-btn round icon="mdi-pencil" style="background-color: rgba(0, 0, 0, 0.5)" @click="editDrink = props.row" /> </div> <div class="absolute-bottom-right justify-end"> <div class="text-subtitle1 text-right"> {{ props.row.name }} </div> <div class="text-caption text-right"> {{ props.row.type.name }} </div> </div> <template #error> <q-img class="bg-white" style="max-height: 256px" src='no-image.svg' /> <div v-if="!public && !nodetails && editable" class="absolute-top-right justify-end" style="background-color: transparent" > <q-btn round icon="mdi-pencil" style="background-color: rgba(0, 0, 0, 0.5)" @click="editDrink = props.row" /> </div> </template> </q-img> ``` if no image is loaded, the edit button will never show. This can be fixed with error handling e.g: ```html <template #error> <div v-if="!public && !nodetails && editable" class="absolute-top-right justify-end" style="background-color: transparent" > <q-btn round icon="mdi-pencil" style="background-color: rgba(0, 0, 0, 0.5)" @click="editDrink = props.row" /> </div> </template> ```
crimsen added this to the v1.0.0-beta milestone 2021-06-29 12:29:48 +00:00
crimsen added the
🐞 bug
📺 frontend
labels 2021-06-29 12:29:48 +00:00
crimsen self-assigned this 2021-06-29 12:29:48 +00:00
Author
Owner

fixed with commit a7765797d1

fixed with commit [a7765797d1](https://flaschengeist.dev/Flaschengeist/flaschengeist-pricelist/commit/a7765797d1f52b15b5ddac6a1a39269143927ae7)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Flaschengeist/flaschengeist-pricelist#3
No description provided.