adobe-dmeservices / custom-metadata

The home for a Custom Metadata Panel extension for Creative Cloud
https://exchange.adobe.com/creativecloud.details.103752.html
17 stars 8 forks source link

Option to Allow/Disallow User Generated Values for Tags Field Type #18

Closed thegitterhub closed 2 years ago

thegitterhub commented 3 years ago

When using the "Tags" field type, we can populate our keyword taxonomy into the Options tab via JSON. When the user fills out metadata they are forced to use the taxonomy suggestions only. They cannot add their own user values.

In contrast, when using the "Multiple Text" field type, our users can add their own keywords without being forced into the taxonomy. However, with "Multiple Text", we cannot leverage our taxonomy to make suggestions to the user. Keywords-Bridge1

Requesting a hybrid functionality where the user is prompted with suggestions from the taxonomy (from the Options tab)...but can also add their own values if there are no relevant values from the suggestions.

The use case is basically:

  1. Start typing a keyword and value suggestions pop up.
  2. Choose a value from the taxonomy suggestion if it’s relevant…
  3. Otherwise, type in your own term because no valid suggestions appeared.

It seems it’s either all taxonomy based or none at all.

Workarounds Tried To try and solve, I added a second keyword field to the panel…(one field set to Tags and one set to MultiText). While each of these work individually, you can’t use them in the same session, the panel favors the one set to a Tags field type to write/embed to dc:subject. The MultiText keyword is not embedded in this scenario even though it displays “Metadata Updated” in green.

Possible Way to Implement: Add a yes/no choice in the "Edit a metadata form field" dialog to allow or disallow user generated values when using the "Tags" field type along with a taxonomy in the Options tab. Choosing No will keep the current behavior as it is now. Choosing yes will allow the user to add their own values, while still being prompted with suggestions from the taxonomy. (see image below) Keywords-Bridge2

bhunut-adobe commented 3 years ago

@thegitterhub There is a feature already exist for the Tags field for you to create a new tag if it is not part of the JSON. I never got a chance to add UI for this feature in the configurator form. However, You can manually manipulate the JSON.

If you open view template JSON and add allowCreate: true this will allow you to create a new tag by typing in the box and hit enter

This should work for Multiple DropDown and Tags fields.

I will add this to the UI for the next release.

Here is an example:

{
    "id": "11",
    "displayName": "Breed",
    "namespace": "http://pet.adobe.com",
    "prefix": "pet",
    "propertyName": "breed",
    "type": "Tags",
    "options": [{
        "label": "Labrador Retriever",
        "parent": "Dog",
        "value": "Labrador Retriever"
    }, {
        "label": "German Shepherd Dog",
        "parent": "Dog",
        "value": "German Shepherd Dog"
    }, {
        "label": "Golden Retriever",
        "parent": "Dog",
        "value": "Golden Retriever"
    }, {
        "label": "Bulldog",
        "parent": "Dog",
        "value": "Bulldog"
    }, {
        "label": "Siamese",
        "parent": "Cat",
        "value": "Siamese"
    }, {
        "label": "Ragdoll",
        "parent": "Cat",
        "value": "Ragdoll"
    }, {
        "label": "British Shorthair",
        "parent": "Cat",
        "value": "British Shorthair"
    }, {
        "label": "Persian",
        "parent": "Cat",
        "value": "Persian"
    }, {
        "label": "Maine Coon",
        "parent": "Cat",
        "value": "Maine Coon"
    }, {
        "label": "Parrot",
        "parent": "Bird",
        "value": "Parrot"
    }, {
        "label": "Chicadee",
        "parent": "Bird",
        "value": "Chicadee"
    }, {
        "label": "Cockatoo",
        "parent": "Bird",
        "value": "Cockatoo"
    }, {
        "label": "American Rabbit",
        "parent": "Rabbit",
        "value": "American Rabbit"
    }, {
        "label": "English Lop",
        "parent": "Rabbit",
        "value": "English Lop"
    }, {
        "label": "Blanc de Hotot",
        "parent": "Rabbit",
        "value": "Blanc de Hotot"
    }, {
        "label": "Other",
        "parent": ["Cat", "Dog", "Bird", "Rabbit", "Others"],
        "value": "Other"
    }],
    "arrayType": "bag",
    "allowCreate": true
}
thegitterhub commented 3 years ago

@bhunut-adobe Thanks I was able to get this working by adding "allowCreate": true manually as you described. Look forward to it in the UI.

jameslockman commented 2 years ago

This is incorporated into the UI for the next release.