-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Contacts menu #3233
Contacts menu #3233
Conversation
5af5c16
to
333ef1a
Compare
Dang it. I've lost my most recent changes due to a rebase+force push of an outdated version of the branch 😠 |
333ef1a
to
10ea8f7
Compare
Got them back from my other PC 💪 😌 |
'message' => "Could not load contacts menu action provider $class", | ||
'app' => 'core', | ||
]); | ||
throw new \Exception("Could not load contacts menu action provider $class"); |
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.
Don't throw $class
to avoid input injection. You log the class, that's fine enough
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.
Makes sense!
core/templates/layout.user.php
Outdated
@@ -163,5 +170,14 @@ | |||
<?php print_unescaped($_['content']); ?> | |||
</div> | |||
</div> | |||
|
|||
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript"> |
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.
Doing this here has some security implications as a XSS in $_['content']
may be able to extract this by using an <img>
tag etc.
Can we move that to a dedicated script of before the content? :)
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.
Sure we can. I just wanted to do it inline for performance reasons as we'd save one request per page load.
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.
IMHO better solved by making sure we concatenate all JS files that we deliver anyways on nearly every page load :)
8e0c703
to
5dfd133
Compare
php5.6+usort+phpunit mocks = 💩 |
Alright, this has already gotten bigger than I wanted it to be for the first PR. Let's do the more advanced stuff in follow-up PRs:
|
@nextcloud/designers I need some help with styling the different elements: Should the inner popover menu overlap the scrollbar or should it only be visible inside the menu? @skjnldsv do you know if I have to/should tweak the css to get the popover menu positioned right or are there any server classes I have to use or guidelines I have to follow? :-) |
Just want to say that it looks damn good! 🦀 |
By the way the other menu on the header don't use a popovermenu. |
😂 |
Heya, answering some of your questions @ChristophWurst
Anything else? I guess lots is for a follow-up PR anyway. :) |
@MorrisJobke Better, but should the item indicate about whether it is opened or not (a bit more grey or something...) 🤔 @jancborchardt |
Codecov Report
@@ Coverage Diff @@
## master #3233 +/- ##
============================================
+ Coverage 54.1% 54.23% +0.13%
- Complexity 21716 21774 +58
============================================
Files 1334 1343 +9
Lines 83213 83528 +315
Branches 1315 1327 +12
============================================
+ Hits 45025 45305 +280
- Misses 38188 38223 +35
|
Disagree @MariusBluem . We have the triangle indicator, that's enough I think :) |
return [ | ||
'contacts' => $topEntries, | ||
'contactsAppEnabled' => $contactsEnabled, | ||
'contactsAppURL' => $contactsURL, |
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.
Will generate a URL without index.php for me which breaks. You should either link to the route directly, or always prepend /index.php/
or just use the JS OC.generateUrl('/apps/contacts');
which should take care of that.
In this scenario I'd probably vote for the JS approach.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
When we test wheter action menus in the contacts menu close when clicking other ones, we have to provide test data that actually causes the view to render the menu. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
We do not want to have sensitive information in the URL and therefore also not in the access log. Thus the GET request is replaced by a POST request. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
f4ee854
to
2ccaae8
Compare
Rebased. Thanks for testing, @jospoortvliet! :) |
So I
I think it goes without saying this should be double-checked. 😂 |
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
a423882
to
241e397
Compare
@ChristophWurst please document the API in the dev manual |
|
Rough todo list:
lazy loadingnot necessary if number of elements is limited to 25.discuss API design in separate issuegot not feedback within two weeksimplements #207
Current screenshot: