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

Provide options for taxonomy elements (terms) #15

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JiriLojda
Copy link
Member

@JiriLojda JiriLojda commented Mar 10, 2023

Motivation

Adds options for taxonomy elements. Fixes #13

  • it cannot be a dynamic dropdown, because there is no way to pass the dropdown info about the element it needs to fill => no way to know the taxonomy group to fetch

Checklist

  • Code follows coding conventions held in this repo
  • Code has been tested in a private Zapier integration
  • Docs have been updated (if applicable)
  • Temporary settings (e.g. variables used during development and testing) have been reverted to defaults

How to test

Check it is possible to correctly create an item with a taxonomy element and the input provides choices with the taxonomy group's terms.

- it cannot be a dynamic dropdown, because there is no way to pass the dropdown info about the element it needs to fill => no way to know the taxonomy group to fetch
@JiriLojda JiriLojda requested a review from a team as a code owner March 10, 2023 12:05
const idChoices = terms.map(t => ({ value: t.id, label: t.name, sample: t.id }));
const codenameChoices = terms.map(t => ({ value: t.codename, label: `${t.name} (codename)`, sample: t.codename }));

return getField(element, { type: 'unicode', choices: [...idChoices, ...codenameChoices], list: true });
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it not possible to have two tabs one for id and one for codename?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am no sure what you mean by tabs, but it is possible to have two separate fields and then choose one of them at runtime. It is an unfortunate situation, because we need both options to be able to accept both identifiers from previous steps, but in the dropdown in the UI, we would ideally want just one of them.

@JiriLojda
Copy link
Member Author

Since this PR introduces a breaking change and is not of high priority, we will wait with this change until there will be more breaking changes and merge it with them.

@JiriLojda JiriLojda marked this pull request as draft April 3, 2023 14:45
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.

Display codenames in dropdown when working with taxonomies
2 participants