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

Enhancing Polymorphism with Text Display #996

Open
ddecrulle opened this issue May 2, 2024 · 1 comment
Open

Enhancing Polymorphism with Text Display #996

ddecrulle opened this issue May 2, 2024 · 1 comment
Assignees
Labels
Area: Tech enhancement Would be good, but non prioritary

Comments

@ddecrulle
Copy link

ddecrulle commented May 2, 2024

Problem Statement:

We've introduced a new component type, componentType: Text, in Lunatic to improve polymorphism and simplify text display within components. This component should be utilized when we only need to display text within Lunatic components.

Current State:

Currently, in the Table component, text can be displayed by adding the following structure in the body:

{ 
    "label": { 
        "value": "\"The VALUE\"", 
        "type": "VTL|MD" 
    } 
}

This approach lacks polymorphism and can lead to inconsistency in component usage.

Proposed Solution:

We propose leveraging the new componentType: Text for displaying text in both Table and RosterForLoop components. The updated structure would look like this:

{
    "componentType": "Text",
    "label": {
        "value": "THE VALUE",
        "type": "TXT" // We also support VTL and MD
    },
    "conditionFilter": { 
        "value": "true", 
        "type": "VTL" 
    },
    "id": "id"
}
@ddecrulle ddecrulle changed the title Text Component Enhancing Polymorphism with Text Display May 2, 2024
@nsenave nsenave self-assigned this Nov 13, 2024
@nsenave
Copy link
Contributor

nsenave commented Nov 13, 2024

Really nice, the previous model, with isolated labels hanging around in tables, was a hindrance to polymorphism on cells.

I add this on the list of things to do when I have some time.

@nsenave nsenave added the enhancement Would be good, but non prioritary label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tech enhancement Would be good, but non prioritary
Projects
None yet
Development

No branches or pull requests

3 participants