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 : code is shown instead of a proper label inside filter condition drop down list [SDESK-6762] #4163

Closed
wants to merge 3 commits into from

Conversation

devketanpro
Copy link
Member

No description provided.

@devketanpro devketanpro added this to the 2.6 milestone Dec 22, 2022
@tomaskikutis
Copy link
Member

Fix : filter condition drop down list contains reserved keywords

What are "reserved keywords"?


if (fieldId === 'anpa_category') {
return vocabularies.find((v) => v._id === 'categories').display_name;
if (fieldId === 'anpa_category' && categories) {
Copy link
Member

Choose a reason for hiding this comment

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

Only use boolean expressions inside if statements. categories is a vocabulary object, not a boolean, so you should use categories != null inside if stamenent - which will evaluate to a boolean.

Also categories is not the best naming choice since the variable represents a single vocabulary while variable name is in plural. A better name would be categoriesVocabulary.

@devketanpro
Copy link
Member Author

Fix : filter condition drop down list contains reserved keywords

What are "reserved keywords"?

In the sense that we displayed an unnecessary element in the drop down like this:-
filter_condition_dropdown

@devketanpro devketanpro changed the title Fix : filter condition drop down list contains reserved keywords [SDESK-6762] Fix : code is shown instead of a proper label inside filter condition drop down list [SDESK-6762] Jan 2, 2023
@tomaskikutis
Copy link
Member

I've looked more into the issue - it turns out that due to a missing vocabulary a label inside the dropdown couldn't be retrieved.

I've opened #4169 to deal with incomplete instance configuration.

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.

2 participants