Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Conditional variables UI #233

Closed
Michael-Grover opened this issue Nov 22, 2019 · 2 comments · Fixed by #288 or #300
Closed

Conditional variables UI #233

Michael-Grover opened this issue Nov 22, 2019 · 2 comments · Fixed by #288 or #300
Assignees

Comments

@Michael-Grover
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
As a user I would like to enable and disable conditional variables, and to switch between two options in conditional variables.

Describe the solution you'd like
See this Loom video explaining the UI:
https://www.loom.com/share/694e7927a744475a98b1cf81154c3673

Smart Clause with three conditional variables, marked with red text
https://projects.invisionapp.com/d/main#/console/16741009/394631841/preview
image

User hovers over Smart Clause to see there is an additional conditional variable that can be enabled. Signified by a plus icon.
https://projects.invisionapp.com/d/main#/console/16741009/394631840/preview
image

User hovers over icon to see what text will appear when they click on it.
https://projects.invisionapp.com/d/main#/console/16741009/394631839/preview
image

The user clicked on the text, making the conditional variable text appear.
https://projects.invisionapp.com/d/main#/console/16741009/394631838/preview
image

The user is hovering over conditional variable text. A tooltip tells the user the text will be hidden if they click
https://projects.invisionapp.com/d/main#/console/16741009/394631837/preview
image

The user has clicked to hide the text and it is hidden again
https://projects.invisionapp.com/d/main#/console/16741009/394631840/preview
image

If the user hovers on a conditional variable that switches between two text options, they will see a message like this. When they click, the text will change to the other option.
https://projects.invisionapp.com/d/main#/console/16741009/394633329/preview
image

@jeromesimeon
Copy link
Member

jeromesimeon commented Feb 6, 2020

Currently, there is not enough information in the SlateDOM to know what the alternative text of a variable is. One possibility to address that is to change the MD representation for conditional variables to always have the alternative text.

Proposed format is as follows:

Late Delivery and Penalty.
----

In case of delayed delivery<if id="forceMajeure" whenTrue=" except for Force Majeure cases," whenFalse=" even when there is a Force Majeure," value="true"/>
<variable id="seller" value="%22Dan%22"/> (the Seller) shall pay to <variable id="buyer" value="%22Steve%22"/> (the Buyer) for every <variable id="penaltyDuration" value="2%20days"/>
of delay penalty amounting to <variable id="penaltyPercentage" value="10.5"/>% of the total value of the Equipment
whose delivery has been delayed. Any fractional part of a <variable id="fractionalPart" value="days"/> is to be
considered a full <variable id="fractionalPart" value="days"/>. The total amount of penalty shall not however,
exceed <variable id="capPercentage" value="55.0"/>% of the total value of the Equipment involved in late delivery.
If the delay is more than <variable id="termination" value="15%20days"/>, the Buyer is entitled to terminate this Contract.

This should be translated to Slate with the corresponding information. For instance:

          {
            "object": "inline",
            "type": "conditional",
            "data": {
              "id": "forceMajeure",
              "whenTrue": " except for Force Majeure cases,",
              "whenFalse": " even when there is a Force Majeure,",
              "value": false
            },
            "nodes": [
              {
                "object": "text",
                "text": " even when there is a Force Majeure,",
                "marks": []
              }
            ]
          }, 

@jolanglinais
Copy link
Member

jolanglinais commented Feb 24, 2020

Reopening for the tooltip feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.