Skip to content

Fix/remove logical and#382

Merged
salihudickson merged 3 commits intomainfrom
fix/remove-logical-AND
Nov 3, 2024
Merged

Fix/remove logical and#382
salihudickson merged 3 commits intomainfrom
fix/remove-logical-AND

Conversation

@salihudickson
Copy link
Copy Markdown
Contributor

@salihudickson salihudickson commented Nov 2, 2024

Description

Fixes #379

Checklist

  • My code follows the contributing guidelines of this project.
  • I am aware that all my commits will be squashed into a single commit, using the PR title as the commit message.
  • I have performed a self-review of my own code.
  • I have commented my code in hard-to-understand areas.
  • I have updated the user-facing documentation to describe any new or changed behavior.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have not reduced the existing code coverage.

Comments

Summary by Sourcery

Fix tooltip rendering logic by replacing logical AND with optional chaining and trim method to ensure tooltips are displayed only when non-empty. Refactor file input rendering logic to use ternary operators for better readability and maintainability.

Bug Fixes:

  • Fix tooltip rendering logic by replacing logical AND with optional chaining and trim method to ensure tooltips are displayed only when non-empty.

Enhancements:

  • Refactor file input rendering logic to use ternary operators for better readability and maintainability.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Nov 2, 2024

Reviewer's Guide by Sourcery

This PR improves the form component's tooltip handling and file upload rendering logic while also introducing new input height variables. The main changes focus on simplifying tooltip checks and restructuring conditional rendering patterns.

Updated class diagram for EccUtilsDesignForm

classDiagram
    class EccUtilsDesignForm {
        +render()
        +handleTusFileUpload(Event, field)
    }
    EccUtilsDesignForm : LitElement
    EccUtilsDesignForm : fieldOptions
    EccUtilsDesignForm : fileOptions
    EccUtilsDesignForm : uploadPercentage
    note for EccUtilsDesignForm "Simplified tooltip checks and restructured conditional rendering patterns."
Loading

File-Level Changes

Change Details Files
Simplified tooltip existence checks throughout the form component
  • Replaced verbose tooltip checks with a simple trim() check
  • Removed redundant empty string comparison
packages/ecc-utils-design/src/components/form/form.ts
Improved conditional rendering for file upload components
  • Restructured nested ternary expressions into clearer conditional blocks
  • Separated TUS protocol and native file upload rendering logic
packages/ecc-utils-design/src/components/form/form.ts
Added new input height variables and styling
  • Added xlarge, 2xlarge, and 3xlarge input height variables
  • Added minimum height for group items using the new 3xlarge variable
packages/ecc-utils-design/src/styles/primitive.styles.ts
packages/ecc-utils-design/src/components/form/form.styles.ts

Assessment against linked issues

Issue Objective Addressed Explanation
#379 Remove logical AND operators from template strings to prevent 'false' strings being displayed in components

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
elixir-cloud-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2024 8:27pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 2, 2024

⚠️ No Changeset found

Latest commit: 37afcc3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @salihudickson - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread packages/ecc-utils-design/src/components/form/form.ts
Copy link
Copy Markdown
Member

@anuragxxd anuragxxd left a comment

Choose a reason for hiding this comment

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

lgtm again :)! @salihudickson

@salihudickson
Copy link
Copy Markdown
Contributor Author

@anuragxxd, changeset added, please review.

@salihudickson salihudickson merged commit 58f257d into main Nov 3, 2024
@salihudickson salihudickson deleted the fix/remove-logical-AND branch November 3, 2024 20:53
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.

fix: remove all logical AND from template strings

2 participants