-
Notifications
You must be signed in to change notification settings - Fork 236
feat: validate entity types before navigation #499
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
base: develop
Are you sure you want to change the base?
Conversation
|
@SharanRP thanks for this PR! I'll merge this, but could you clean up the code a bit - for example, refactor the three functions into one uniform one? |
|
Have made the changes |
|
Sharan, I'm sorry - I should have realized this earlier. But this is not a good way to solve the issue, because we're adding an extra server call for every route. Instead Do you want to take this up? |
|
Yes, thank you for the guidance ,I’ll make the necessary changes. |
|
@safwansamsudeen can you check this once |
drive/api/permissions.py
Outdated
|
|
||
| @frappe.whitelist(allow_guest=True) | ||
| def get_entity_with_permissions(entity_name): | ||
| def get_entity_with_permissions(entity_name, expected_type=None): |
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 isn't a good paradigm - instead, could you analyze the route and get the file type?
frontend/src/pages/Document.vue
Outdated
| entity_name: props.entityName, | ||
| expected_type: "document", | ||
| }, | ||
| transform(entity) { |
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.
Should be done in onSuccess, not transform
|
|
||
|
|
||
| @frappe.whitelist(allow_guest=True) | ||
| def get_entity_type(entity_name): |
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.
Why was this deleted?
safwansamsudeen
left a comment
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.
Hey, could you make the requested changes? Reach out @realsafwan in Telegram if you need some help.
…e, folder, and document components
closes #475