ripe-tech / ripe-components-vue

Library of shared components to be re-used in Vue.js
http://ripe-components-vue.platforme.com
Apache License 2.0
7 stars 1 forks source link

feat: add reacticity to `emptySlots()` computed property in `molecules/upload-area.vue` #614

Closed beneditomauro closed 2 years ago

beneditomauro commented 2 years ago
- -
Issue -
Dependencies -
Decisions Conceptually, computed values in vue are used when logic needs to be triggered when component internal state changes weather the logic is conditional to the state itself. In this specific case, emptySlots() is running only one time on component creation, limiting use-cases when the parent component adds or removes slots accordingly (see screenshots below) not removing the button when a slot is added. What was done to fix this:

- Reference the respective data property to react to, and use it in a way that doesn't alter the returning boolean expression
Animated GIF No slots: Screenshot 2022-10-27 at 15 56 46 With slots:Screenshot 2022-10-27 at 15 57 12
vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ripe-components-vue ✅ Ready (Inspect) Visit Preview Oct 31, 2022 at 1:49PM (UTC)
ripe-tobias-bot[bot] commented 2 years ago

Woof, Woof!

Thank you @beneditomauro for submitting the "feat: add reacticity to emptySlots() computed propertie in molecules/upload-area.vue" pull request 😎.

Please do not forget to review our internal guidelines:

Engaging in the development process in the best possible way helps it being efficient and fast.

Your friend, Tobias (Platforme's mascot)

Tobias Bot
beneditomauro commented 2 years ago

I was inclined to add a talk label to discuss other possible approaches, as this differs from any "pattern" in our vue codebase. But I will leave the PR without it

3rdvision commented 2 years ago

@beneditomauro are we able to reproduce this bug in components-vue storybook?

beneditomauro commented 2 years ago

@beneditomauro are we able to reproduce this bug in components-vue storybook?

Not as it is, we would have to add a story that inserts a slot after component mounting

ripe-tobias-bot[bot] commented 2 years ago

Woof, Woof!

Oops! @beneditomauro it looks like the PR check have just failed.

Please try to fix them as soon as possible.

Your friend, Tobias (Platforme's mascot)

Tobias Bot
ripe-tobias-bot[bot] commented 2 years ago

Woof, Woof!

Oops! @beneditomauro it looks like the PR check have just failed.

Please try to fix them as soon as possible.

Your friend, Tobias (Platforme's mascot)

Tobias Bot
3rdvision commented 2 years ago

@beneditomauro tests are failing... can you check it out?

ripe-tobias-bot[bot] commented 2 years ago

Woof, Woof!

Oops! @beneditomauro it looks like the PR check have just failed.

Please try to fix them as soon as possible.

Your friend, Tobias (Platforme's mascot)

Tobias Bot
beneditomauro commented 2 years ago

@beneditomauro tests are failing... can you check it out?

This is not related to the PR, this is locally in master fails too:

Screenshot 2022-11-02 at 15 12 29