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

Warn user on style property name change #1863

Merged

Conversation

FredLL-Avaiga
Copy link
Member

resolves #1832

from taipy.gui import Gui, Markdown

x_range = range(-10, 11, 4)

data = {"x": x_range, "y": [x * x for x in x_range]}


def even_odd_class(_, row):
    if row % 2:
        # Odd rows are blue
        return "blue-row"
    else:
        # Even rows are red
        return "red-row"


# Lambda version, getting rid of even_odd_class():
# Replace the table control definition with
#    <|{data}|table|row_class_name={lambda _, row: 'blue-row' if row % 2 else 'red-row'}|show_all|>
page = Markdown(
    "<|{data}|table|row_class_name=even_odd_class|show_all|style=toto|style[a]=tata|>",
    style={
        ".blue-row>td": {"color": "white", "background-color": "blue"},
        ".red-row>td": {"color": "yellow", "background-color": "red"},
    },
)


if __name__ == "__main__":
    Gui(page).run(title="Table - Styling rows")

results in:

--- 2 warning(s) were found for page '/'  ---
 - Warning 1: Table: property 'style[]' has been renamed to 'cell_class_name[]'.
 - Warning 2: Table: property 'style' has been renamed to 'row_class_name'.
----------------------------------------------

@FredLL-Avaiga FredLL-Avaiga added 🟥 Priority: Critical Must be addressed as soon as possible 📈 Improvement Improvement of a feature. Gui: Back-End labels Sep 30, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Sep 30, 2024
Copy link
Contributor

github-actions bot commented Sep 30, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
18900 16373 87% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/gui/_renderers/builder.py 82% 🟢
taipy/gui/utils/table_col_builder.py 63% 🟢
TOTAL 73% 🟢

updated for commit: f554e50 by action🐍

namnguyen20999
namnguyen20999 previously approved these changes Oct 1, 2024
dinhlongviolin1
dinhlongviolin1 previously approved these changes Oct 1, 2024
Copy link
Member

@dinhlongviolin1 dinhlongviolin1 left a comment

Choose a reason for hiding this comment

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

LGTM! I am thinking about having the word deprecation within the message

FabienLelaquais
FabienLelaquais previously approved these changes Oct 1, 2024
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

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

👌

@FredLL-Avaiga
Copy link
Member Author

LGTM! I am thinking about having the word deprecation within the message

I thought of that too but we will soon have a style property in every element

dinhlongviolin1
dinhlongviolin1 previously approved these changes Oct 1, 2024
Copy link
Member

@namnguyen20999 namnguyen20999 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

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

👍

@FredLL-Avaiga FredLL-Avaiga merged commit 7bff956 into develop Oct 1, 2024
126 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the feature/#1832-warn-user-on-property-name-change branch October 1, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gui: Back-End 📈 Improvement Improvement of a feature. 🟥 Priority: Critical Must be addressed as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexed style in tables don't apply when defined as a lambda function (Markdown format)
4 participants