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

Supporting negative numbers in RHS of selection expression #33

Open
hboon opened this issue Jun 26, 2024 · 3 comments
Open

Supporting negative numbers in RHS of selection expression #33

hboon opened this issue Jun 26, 2024 · 3 comments
Assignees

Comments

@hboon
Copy link
Member

hboon commented Jun 26, 2024

I was adding a dummy selection so it can be used to trigger early-loading that attribute (points). So I wrote this:

<ts:selection name="dummyForcePointsToLoadAlwaysFalse" filter="points>-1">

But the expression parsing code at

const matches = filter.match(/([a-zA-Z0-9]*)([=<>]*)([a-zA-Z0-9]*)/);
doesn't handle negative numbers on the RHS.

const matches = filter.match(/([a-zA-Z0-9]*)([=<>]*)([a-zA-Z0-9]*)/);

It'll assign an empty string to conditionValue.

It's a uint though, so I'm not sure we'll ever have negative numbers, or will we?

@micwallace
Copy link
Collaborator

@hboon I've added full support for the conditionals using the implementation from AW iOS, so this is likely fixed.

What was the purpose of loading this attribute before a card is opened? Did you want to display this value somewhere else in the UI?

Maybe we could add a preload XML attribute onto ts:attribute that tells the engine to reload attributes where preload="true".

@hboon
Copy link
Member Author

hboon commented Sep 12, 2024

What was the purpose of loading this attribute before a card is opened? Did you want to display this value somewhere else in the UI?

@micwallace it's so that when we click on the "i"/Information button the attribute value is available. Without the selection hack, the value isn't available until a card using it is displayed.

@hboon
Copy link
Member Author

hboon commented Sep 12, 2024

Maybe we could add a preload XML attribute onto ts:attribute that tells the engine to reload attributes where preload="true".

Yeah, that would be useful.

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

No branches or pull requests

2 participants