Skip to content

GDCC-42/Fix allowfreetext handling#45

Merged
qqmyers merged 1 commit intomainfrom
GDCC-42-disallow_free_text
Aug 22, 2025
Merged

GDCC-42/Fix allowfreetext handling#45
qqmyers merged 1 commit intomainfrom
GDCC-42-disallow_free_text

Conversation

@qqmyers
Copy link
Copy Markdown
Member

@qqmyers qqmyers commented Aug 20, 2025

This PR adopts the syntax from the ontoportal script to leverage jquery's parsing of string values into booleans via
.data("cvoc-allowfreetext");

An alternate approach would be to do:
$(funderInput).attr('data-cvoc-allowfreetext')?.toLowerCase() === "true" ||
$(funderInput).attr('data-cvoc-allowfreetext') === true,

It sounds like .data() caches values and may have problems if the attribute is being reset, but since that is not our case, it looks like the shorter syntax should be fine.

Closes: #42

@PaulBoon
Copy link
Copy Markdown
Collaborator

@qqmyers Looks clean!

@qqmyers qqmyers merged commit 7c4ae70 into main Aug 22, 2025
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.

Unable to disable 'allow free text' via the config

2 participants