Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VTL expression readOnly to add the readOnly attribute to a single component #628

Merged
merged 25 commits into from
Sep 20, 2023

Conversation

renaud23
Copy link
Collaborator

@renaud23 renaud23 commented Aug 2, 2023

This feature adds the possibility to define the readOnly attribute based on a VTL expression in the source.json.

Initially, this feature has only been added to the Input component and the Radio component. (note: the style of the Radio component with the readOnly attribute has not yet been updated to communicate visually that users cannot interact with it)

@renaud23 renaud23 linked an issue Aug 2, 2023 that may be closed by this pull request
Copy link
Collaborator

@Grafikart Grafikart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il faut modifier le type dans les sources et aussi le model lunatic pour indiquer ce qui est attendu dans disabled (en plus ce n'est pas forcément présent pour tous les composants j'imagine).

Aussi, petit réflexion entre "disabled" et "readonly" car ça n'a pas la même signification niveau HTML. un champs readonly peut être focus là ou un champs disabled ne peut pas l'être. Donc à voir si le nom de la propriété correspond bien à ce que l'on veut ou si cela doit être renommé "readonly".

@isMattCoding
Copy link
Contributor

Il faut modifier le type dans les sources et aussi le model lunatic pour indiquer ce qui est attendu dans disabled (en plus ce n'est pas forcément présent pour tous les composants j'imagine).

J'ai du mal a comprendre, je vois dans LunaticBaseProps on a déjà typé disabled et readOnly. Comment faudrait-il le modifier ?

Aussi, petit réflexion entre "disabled" et "readonly" car ça n'a pas la même signification niveau HTML. un champs readonly peut être focus là ou un champs disabled ne peut pas l'être. Donc à voir si le nom de la propriété correspond bien à ce que l'on veut ou si cela doit être renommé "readonly".

Pour notre besoin, il s'agit bien d'un readOnly qu'on veut, une variable pre-rempli que l'on peut voir mais ne peut pas modifier.

@isMattCoding isMattCoding changed the title add disabled attribute in lunatic to disabled a single component from… VTL expression readOnly to add the readOnly attribute to a single component Aug 30, 2023
@isMattCoding isMattCoding marked this pull request as ready for review August 30, 2023 15:00
@laurentC35
Copy link
Contributor

laurentC35 commented Sep 11, 2023

Verify :

  • ComponentSet
  • Table
  • PairwiseLink

@laurentC35
Copy link
Contributor

laurentC35 commented Sep 18, 2023

ToDo

  • Input
  • InputNumber
  • Radio (doesn't exist in HTML)
  • CheckBox (doesn't exist in HTML)
  • Textarea
  • Dropdown
  • Datepicker
  • Suggester
  • Switch (doesn't exist in HTML)

@isMattCoding
Copy link
Contributor

I reverted the changes affecting the combobox as #683 is in progress.
I pushed a branch which includes the changes for dropdown/suggester, which we likely won't use because of conflicts with #683, but it gives an idea of what's required

@isMattCoding
Copy link
Contributor

Verify :
* ComponentSet
* Table
* PairwiseLink

I checked these components, and the feature seems to work correctly.

@laurentC35
Copy link
Contributor

Fix : #692 ?

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@ddecrulle ddecrulle merged commit 48b722d into develop Sep 20, 2023
@ddecrulle ddecrulle deleted the feat/disabled-single-component branch September 20, 2023 08:04
Grafikart pushed a commit that referenced this pull request Sep 20, 2023
…omponent (#628)

Co-authored-by: Matthew Clark <[email protected]>
Co-authored-by: Matt Clark <[email protected]>
Co-authored-by: Dylan Decrulle <[email protected]>
Co-authored-by: Laurent Caouissin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable a single component from a VTL expression with readOnly props
5 participants