enso-ui / forms

Vue forms
MIT License
5 stars 6 forks source link

Cannot hide a form tab which contains a slot #28

Closed adithewonderboy closed 3 years ago

adithewonderboy commented 3 years ago

This is a bug.

Prerequisites

Description

Cannot hide a form tab that contains a slot

Steps to Reproduce

  1. Configure the form.json file as follows: ...{ "tab": "Devices", "columns": "slot", "slot": "devices", "fields": [] },...
  2. Inside form create component (@ready) try to hide that tab (this is a specific use-case) this.$refs.form.hideTab('Devices');

Expected behavior

The tab should be hidden from the form. This works for other tabs which contains some fields inside them.

Actual behavior

The tab is still visible after the form is shown.

Maybe it's a good idea to extend the show/hide functionality for tabs like you did for columns inside tabels with "isVisible" property.. I saw in the code that for showing/hiding a tab there is a logic concerning fields visibility inside them. It seems this logic fails when a tab is containing only a slot..

adithewonderboy commented 3 years ago

Hello,

Any updates on this? Thank you!

raftx24 commented 3 years ago

Hi @adithewonderboy. I agree if we have visible for tab we can solve this problem. But @aocneanu can decide on it.

aocneanu commented 3 years ago

@adithewonderboy,

To hide tabs directly is more complicated because in the current JSON template the tabs are not defined in the tree, they are only defined as props.

We will add the hidden property to sections and we will be able to control tab visibility by controlling the sections' visibility.

adithewonderboy commented 3 years ago

That's great, Thank you @aocneanu!

aocneanu commented 3 years ago

@raftx24 will close this once the feature is implemented.

aocneanu commented 3 years ago

@adithewonderboy please test with the latest release

adithewonderboy commented 3 years ago

Hi @aocneanu,

I updated now enso code and hiding of the sections works as expected, but hiding the form fields is not working anymore for me. Is it because I'll need to wait for the official new release or is it another bug?

Thank you!

robbykrlos commented 3 years ago

Ok, so diving deeper into this on our side, I found some small issues in our code but what really baffles me is that I don't get the yarn update / enso releases system.

I have forcefully update to enso-ui/forms@2.3.6, although package.json stated initially on dependencies: "@enso-ui/forms": "^2.3.5" (so compatible with...), and I still don't find the changes done here:

@raftx24 - adds section visibility (ref #28) - a17cca9

Even on master https://github.com/enso-ui/forms/tree/v2.3.6 I don't see these changes.

Later edit: I see that a17cca9 is part of the 2.3.4 tag, and not present anymore in 2.3.5, 2.3.6, or 2.3.7.