-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Extend lookup operator to work with fields and indexes #5742
Extend lookup operator to work with fields and indexes #5742
Conversation
@joshuafontany For tests have a look at https://github.com/Jermolene/TiddlyWiki5/blob/652e8b1262786a3e7bcc01b51b4319749ff6674c/editions/test/tiddlers/tests/test-filters.js#L211-L213 You can add more tests here for the new features introduced for the lookup operator, as well as to test that the old behaviour remains unchanged for tiddlers that do not exist. You can also add more tiddlers to the fixtures in the setupWiki method. With regards to examples for the documentation, I recommend adding a JSON data tiddler to tiddlywiki.com to be used for this purpose, rather than changing |
Yes, but be really careful adding new tiddlers there. It may have side-effects for other tests. So be prepared for some extra work! |
This reverts commit 5d599aa.
I was just reporting because my addition request of the same was deleted? As suggested I will add the "request here" in case its of any use. Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered Other filter operators can achieve a similar result such as Additional context
|
While I still feel that returning the Stringified value of any non-null/non-undefined property is the way to go, I can see that there might be backwards compatibility issues there.... As such, we leave that aside, and this PR is ready to go (tests have been added and run). @Jermolene @saqimtiaz I know there is a bug-fix release prioritized, so no worries if this is not gotten to right away... |
Hi @joshuafontany thanks for your patience, I had missed this. But looks good, and makes sense, so I've added to #6266 for consideration after v5.2.1 I've also clarified the title |
Thanks @joshuafontany |
I am creating a new PR for this, as the old one was reverted and no longer picks up changes from my branch. I have resolved the bug mentioned in that thread.
I have also setup a couple of Examples that test the new functionality, and would like input (@Jermolene @saqimtiaz) on how to structure tests in the
./editions/test
folder.Also, I noticed that stock TW5 doesn't really have a lot of json data tiddlers to test on that are valid "one level deep" json.
As such, the following test results in "missing-0" displayed twice, even thought the first ($:/HistoryList) has an object at index 0.
Right now the
wiki.extractTiddlerDataItem ()
method will only return a value if it is a string or number type. I would prefer to JSON.stringify() all other non-null (!== null, !== undefined) types.My idea would be to change the following code in
wiki.js
:And thus, example 6 would render out as:
Thoughts?