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

[Feature Request]: Clarify Label Semantics Operator Components related with Date and DateTime #3092

Open
2 tasks done
jamieleeeeeeee opened this issue Dec 3, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@jamieleeeeeeee
Copy link

Description

Currently the labels of property-filter are directly using the operator value:

label: parsedText.property.propertyLabel + ' ' + value

Could refer to the relevant code implementation here.

While this approach is functional, it can lead to semantic ambiguity. For instance:

  • Create after is more intuitive and user-friendly than Create >
  • Similarly, Create before is clearer than Create <
  • ...

To address this, I propose adding a label generation function to the PropertyFilterOperatorExtended type, such as:

export interface PropertyFilterOperatorExtended<TokenValue> {
  operator: PropertyFilterOperator;
  operatorLabel: (operator: PropertyFilterOperator)=>string
  tokenType?: PropertyFilterTokenType;
  match?: PropertyFilterOperatorMatch<TokenValue>;
  form?: PropertyFilterOperatorForm<TokenValue>;
  format?: PropertyFilterOperatorFormat<TokenValue>;
}

This function could then be executed in the relevant parts of the codebase to dynamically generate more descriptive and user-friendly labels.

I’d be happy to contribute a PR for this feature if needed.
Thank you for considering this suggestion!

Code of Conduct

@jamieleeeeeeee jamieleeeeeeee added the enhancement New feature or request label Dec 3, 2024
@jperals
Copy link
Member

jperals commented Dec 9, 2024

Hi @jamieleeeeeeee,

Thanks for your suggestion. We don't have plans for this at the moment, but just in case it helps, in the meantime, you can customize the labels that appear below the operator (but not the operator itself) via the i18nStrings, e.g:

{
    operatorLessText: 'before',
    operatorGreaterText: 'after'
}

Note, though, this would modify all instances of these operators, so it would only work as long as you don't use them also for e.g, numeric types.

@yisun-anetac
Copy link

Hi @jamieleeeeeeee,

Thanks for your suggestion. We don't have plans for this at the moment, but just in case it helps, in the meantime, you can customize the labels that appear below the operator (but not the operator itself) via the i18nStrings, e.g:

{
    operatorLessText: 'before',
    operatorGreaterText: 'after'
}

Note, though, this would modify all instances of these operators, so it would only work as long as you don't use them also for e.g, numeric types.

Thanks @jperals Will a contribution from us to add such a feature be considered acceptable?

@jperals
Copy link
Member

jperals commented Dec 12, 2024

We usually require a relevant number of use cases, and then go through a team-reviewed process, before we add a feature in the system. This is the first time I have seen this particular request, but I made note of it in our internal tracking tools.

@gethinwebster
Copy link
Member

@jamieleeeeeeee @yisun-anetac
Discussed this a bit more within the team, and this is something that we would support being added to the system if you'd like to contribute it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants