Skip to content

feat: include relative path as argument to render each node in tree view #45

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

Merged
merged 22 commits into from
Apr 19, 2021

Conversation

joaoassisb
Copy link
Contributor

No description provided.

assisrafael
assisrafael previously approved these changes Dec 21, 2020
@joaoassisb joaoassisb changed the title feat: includes exports of FormLabel and FormValidationFeedback feat: include relative path as argument to render each node in tree view Apr 16, 2021
@joaoassisb joaoassisb requested a review from assisrafael April 16, 2021 12:34
@@ -53,9 +53,9 @@ export function TreeViewExamples() {
return (
<TreeView
nodes={nodes}
template={(item, index, parentItem) => (
template={(item, index, parentItem, relativePath) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the idea here is to facilitate the usage of the TreeView Component with Forms.

<em>
{item.attrA} (index: {index} parent: {parentItem?.attrA || <em>None</em>})
{item.attrA} (index: {index} parent: {parentItem?.attrA || <em>None</em>})<p>Path: {relativePath}</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as the tree grows, only de index and the father element are not enough to handle changes in deep nodes.
With this new argument, change node values is a lot easier.
image

package.json Outdated
@@ -5,7 +5,7 @@
"main": "dist/main.js",
"scripts": {
"build": "rollup --config",
"start": "webpack-dev-server --mode development",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this code was launching this error
image

package.json Outdated
@@ -5,7 +5,7 @@
"main": "dist/main.js",
"scripts": {
"build": "rollup --config",
"start": "webpack-dev-server --mode development",
"start": "webpack serve --mode development",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

after a little research a found this solution
image

Copy link
Owner

Choose a reason for hiding this comment

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

Please, move this change to another PR, because it is not related to the feature proposed here

@@ -28,7 +28,7 @@ module.exports = [
{
entry: './demo/demo.jsx',
output: {
path: `${__dirname}/demo`,
path: `${__dirname}/`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The index.html imports the file from ./demo.js not ./demo/demo.js
image

Copy link
Owner

Choose a reason for hiding this comment

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

Please, move this change to another PR, because it is not related to the feature proposed here

João Vitor added 2 commits April 16, 2021 09:43
package.json Outdated
@@ -5,7 +5,7 @@
"main": "dist/main.js",
"scripts": {
"build": "rollup --config",
"start": "webpack-dev-server --mode development",
"start": "webpack serve --mode development",
Copy link
Owner

Choose a reason for hiding this comment

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

Please, move this change to another PR, because it is not related to the feature proposed here

@@ -28,7 +28,7 @@ module.exports = [
{
entry: './demo/demo.jsx',
output: {
path: `${__dirname}/demo`,
path: `${__dirname}/`,
Copy link
Owner

Choose a reason for hiding this comment

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

Please, move this change to another PR, because it is not related to the feature proposed here

@joaoassisb joaoassisb requested a review from assisrafael April 16, 2021 21:55
@assisrafael assisrafael merged commit a60abb8 into assisrafael:master Apr 19, 2021
assisrafael added a commit that referenced this pull request Apr 20, 2021
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