-
Notifications
You must be signed in to change notification settings - Fork 65
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
Read-write actions on public view #2017
Conversation
@@ -0,0 +1,63 @@ | |||
import React from 'react' |
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.
Most of this file is lifted from https://github.com/cozy/cozy-drive/blob/master/src/drive/web/modules/drive/Container.jsx — I didn't spend too much time on it because it's been rewritten in #1979
) | ||
if (fetchStatus === 'loaded') { | ||
notesAppUrl = url | ||
} else if (fetchStatus === 'errored') { |
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 don't know if the commit message is explicit enough, but on the public page we don't have permissions to query the list of apps, and this is one of the only places where we really need it. I think the fallback to a generated link is ok, the only issue is if the notes app is not installed, then we won't have a link to the store.
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.
What happens if click on the button with no network?
Can't we do a check if we're in a public context or not?
(and no the commit was not self explaining, maybe you can add your comment to it ;))
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.
What happens if click on the button with no network?
It will try to open notes :/.
Can't we do a check if we're in a public context or not?
Yep, we can! The offline behavior would be the same though. But it's probably a better solution.
(and no the commit was not self explaining, maybe you can add your comment to it ;))
👍
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.
cc @poupotte pour info ;)
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 browsed the PR to have a better idea of the code in Drive that I don't know so much. Great job on using ActionMenu and deleting old code !
I saw that withBreakpoints and translate were used a lot, maybe the codemods to use useI18n and useBreakpoint could be useful in the future.
Ah I forgot, when on a PR I now always check to see if some spec files have been changed 😈 😇 , and for such a big change, I am a bit surprised to see that none have been changed. Is there a particular reason for this ? I find it also difficult to write test files, particularly for UI stuff. I am more and more convinced that Argos would be good to have on our apps. |
a3b2111
to
4fcd82f
Compare
6553276
to
b36c30b
Compare
Yeah the changes were mostly UI related, to screenshots would make more sense here. But I'll add some :) |
) | ||
if (fetchStatus === 'loaded') { | ||
notesAppUrl = url | ||
} else if (fetchStatus === 'errored') { |
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.
What happens if click on the button with no network?
Can't we do a check if we're in a public context or not?
(and no the commit was not self explaining, maybe you can add your comment to it ;))
This makes sure some features such as getCSSVariableValue use their test version to avoid breaking tests.
Co-authored-by: Quentin Valmori <[email protected]>
files, | ||
dirId, | ||
sharingState, | ||
fileUploadedCallback = () => null |
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.
comments to add
With this PR, the public sharing view supports actions that require write permissions (such as renaming files, uploading, etc).
In order to re-use the menu items that we have in the protected pages, I migrated them all to use ActionMenu from cozy-ui. This is also why the PR is fairly big, apologies for that.