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

fix: undefined tags in field when editing #3315

Merged

Conversation

coatezy
Copy link
Contributor

@coatezy coatezy commented Oct 8, 2024

Description

This PR fixes an undefined tag issue when editing existing tags on a resource.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

Before:

CleanShot 2024-10-08 at 13 12 48@2x
CleanShot 2024-10-08 at 13 00 44@2x

After:
CleanShot 2024-10-08 at 13 13 08@2x

Manual review steps

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

@github-actions github-actions bot added the Fix label Oct 8, 2024
Copy link

codeclimate bot commented Oct 8, 2024

Code Climate has analyzed commit 2af81ca and detected 0 issues on this pull request.

View more on Code Climate.

@coatezy coatezy changed the title Fix: Undefined tags in field when editing fix: undefined tags in field when editing Oct 8, 2024
@Paul-Bob
Copy link
Contributor

Paul-Bob commented Oct 9, 2024

Hey @coatezy thanks for the contribution! I noticed that some tests are failing. Could you please share the tags field code from your resource and more details about how to reproduce the issue?

@coatezy
Copy link
Contributor Author

coatezy commented Oct 9, 2024

Hey @coatezy thanks for the contribution! I noticed that some tests are failing. Could you please share the tags field code from your resource and more details about how to reproduce the issue?

Hey, @Paul-Bob! Not problem. I'd be happy to try and understand why these are failing. The tags field is configured in the following way on the resource.

    field :tags, as: :tags, acts_as_taggable_on: :tags

@Paul-Bob
Copy link
Contributor

Paul-Bob commented Oct 9, 2024

I was able to reproduce the issue, I guess the tests are failing because tags cover several use cases and this change fixes this particular use case but maybe is breaking another use case, I'll also have a look

@coatezy coatezy force-pushed the fix/undefined_tags_in_field_when_editing branch from 62be726 to 851affa Compare October 9, 2024 18:46
Copy link
Contributor

@Paul-Bob Paul-Bob left a comment

Choose a reason for hiding this comment

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

I suggested some changes that might be effective.

When using suggestions https://docs.avohq.io/3.0/fields/tags.html#possible-values as an array of hashes the possibleSuggestion will respond to label but when used as array of values or not used at all it will NOT respond to label

Copy link
Contributor

This PR has been marked as stale because there was no activity for the past 15 days.

@github-actions github-actions bot added the Stale label Oct 30, 2024
Copy link
Contributor

@Paul-Bob Paul-Bob left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution @coatezy!

Some tests were failing, so I made a change to ensure that tags function correctly in other scenarios.

@Paul-Bob Paul-Bob merged commit 2652e70 into avo-hq:main Nov 1, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants