-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added Feature Cover Json Data Node in Data Node control #2164
Added Feature Cover Json Data Node in Data Node control #2164
Conversation
@quest-bot loot #1248 |
Quest PR submitted!@THEBOSS0369, you are attempting to solve the issue and loot this Quest. Will you be successful? Questions? Check out the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests
12fb4e6
to
7daba5e
Compare
Hey @FredLL-Avaiga ! Apologies for late reply. I have created a test file can you tell me in which folder should i add that file , this is the test file in the root folder |
What does this show ? that you can display some json data in a markdown page ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs:
backend check and modification if necessary- tests
- example of the data_node control usage with json
please fix the failing checks |
Yes sir i will fix these errors. |
58feaaa
to
00272c1
Compare
@FredLL-Avaiga The test is failing because of the it can resolve if i import it from |
Sir, I will be adding this in the next commit |
You have to update your dependencies |
Got it Sir , This will work! Also I won't be able to share any update till tomorrow due to Diwali Festival. Hope you understand 😀 |
Enjoy the festival 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to make things work, you will nee to modify the backend also:
in _adapters.py
taipy/taipy/gui_core/_adapters.py
Line 190 in 63f0cbf
return isinstance(datanode, _TabularDataNodeMixin) or isinstance( |
the static method should be
@staticmethod
def _is_tabular_data(datanode: DataNode, value: t.Any):
return isinstance(datanode, _TabularDataNodeMixin) or (
isinstance(value, (pd.DataFrame, pd.Series, list, tuple, dict)) and not isinstance(datanode, JSONDataNode)
)
PS do not forget to import JSONDataNode
from taipy.core.data import JSONDataNode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also have a change in package.json ?
and the package react-json-view
is not maintained any more ... need to change it
2c58cec
to
6e8b61d
Compare
@FredLL-Avaiga ! As I created a demo-1248-dn.json file for the demo i have added the same file in root folder for testing as well, but don't know why its not showing when i try to add it in the commit here is the ss for it, I think i am adding that file in wrong folder maybe that is causing problem? |
4ec5603
to
130e3ab
Compare
We don't want any demo-* fille in the repo |
By the screen shot it doesn't look like the json is rendered? |
I think you will see that :
around taipy/frontend/taipy/src/DataNodeViewer.tsx Line 997 in 7dac175
ie replacing the onClick handler with undefined when dtType == "dict" |
0eb3324
to
3187dc9
Compare
Hey @FredLL-Avaiga ! Can you take a look now. |
Can you fix the checks ? |
@FredLL-Avaiga ! I think this problem is occuring because maybe there is no collapsed function showing in the main lib . So shall i go ahead and use any other lib like this one https://www.npmjs.com/package/react-json-view-lite |
No just remove the collapse properly |
@FredLL-Avaiga ! It seems all tests have passed what to do next? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if @FabienLelaquais liked it
Can you merge this @jrobinAV ? |
Hey @FredLL-Avaiga ! There was an extra comma in json file which was not letting the test passed now i have removed it and test are Passing. |
|
||
json_config_node = Config.configure_json_data_node( | ||
id="json_node", | ||
default_path="./demo-1248-dn.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the json file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it should be renamed datanode_viewer_json.json
And that would be why the demo-* file was ignored
6e47af1
to
c5b6fa9
Compare
@FredLL-Avaiga Sir all tests passed if its ready to merge please merge this. Otherwise merge conflict will create the issue 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another try @jrobinAV
This PR fixes #1248
Hey Everyone!
In this PR, The changes has been done in
DataNodeViewer.tsx
file, Now Data in Json can be collapsed or expand as the user wish.I have imported
react-json-view
because it will make our process much easier.Thanks!