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

Adding example for get_resource for taipy extension #2297

Merged
merged 10 commits into from
Dec 4, 2024

Conversation

namnguyen20999
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Adding an example for get_resources for taipy extension

Checklist

We encourage you to keep the code coverage percentage at 80% and above.

  • Does this solution meet the acceptance criteria of the related issue?
  • Is the related issue checklist completed?
  • Does this PR adds unit tests for the developed code? If not, why?
  • End-to-End tests have been added or updated?
  • Was the documentation updated, or a dedicated issue for documentation created? (If applicable)
  • Is the release notes updated? (If applicable)

@namnguyen20999 namnguyen20999 changed the title docs/get_resource Adding example for get_resource for taipy extension Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
19427 16906 87% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: da40565 by action🐍

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.

I don't see the implementation for the get_resources() method that is at the heart of this PR...
With what I propose, this should point to the assets directory.



class ExampleLibrary(ElementLibrary):
def __init__(self) -> None:
# Initialize the set of visual elements for this extension library

logo_path = self.get_resource("resources/taipy_logo.png")
Copy link
Member

Choose a reason for hiding this comment

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

The best I think would be to change the path not to confuse users about what we're looking for and where.
I also rename the image file itself for simplicity.

Suggested change
logo_path = self.get_resource("resources/taipy_logo.png")
logo_path = self.get_resource("icons/logo.png")

Copy link
Member

Choose a reason for hiding this comment

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

Rename to doc/gui/extension/example_library/assets/icons/logo.png

@FabienLelaquais FabienLelaquais added 🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 📄 Documentation Internal or public documentation 🟧 Priority: High Must be addressed as soon labels Dec 3, 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.

Looks good to me!

@namnguyen20999 namnguyen20999 merged commit 5a52d3f into develop Dec 4, 2024
126 checks passed
@namnguyen20999 namnguyen20999 deleted the docs/get_resource branch December 4, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 Documentation Internal or public documentation 🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants