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

Add ability to omit basePath in buttons #6041

Merged
merged 5 commits into from
Mar 18, 2021
Merged

Add ability to omit basePath in buttons #6041

merged 5 commits into from
Mar 18, 2021

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Mar 15, 2021

In the general case, we can infer the basePath from the resource, which is in the context.

                        <CardActions className={classes.cardActions}>
-                           <EditButton
-                               resource="posts"
-                               basePath={basePath}
-                               record={data[id]}
-                           />
-                           <ShowButton
-                               resource="posts"
-                               basePath={basePath}
-                               record={data[id]}
-                           />
+                           <EditButton record={data[id]} />
+                           <ShowButton record={data[id]} />
                        </CardActions>

@fzaninotto fzaninotto added the RFR Ready For Review label Mar 15, 2021
@@ -62,7 +62,9 @@ const getResourceLinkPath = ({
);
}
const sourceId = get(record, source);
const rootPath = basePath.replace(resource, reference);
const rootPath = basePath
Copy link
Member Author

Choose a reason for hiding this comment

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

this is a change I wanted to push in the previous PR, but @djhi was too fast to merge it

Copy link
Collaborator

Choose a reason for hiding this comment

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

It was RFR! 😂

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

There is a lint error

@fzaninotto fzaninotto merged commit 0a5ff63 into next Mar 18, 2021
@fzaninotto fzaninotto deleted the optional-basepath2 branch March 18, 2021 07:39
@fzaninotto fzaninotto added this to the 3.14 milestone Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants