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

[stable21] Fix account data visibility after disabling public addressbook upload #26724

Merged
merged 19 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2ba56b5
Fix summary footer position and text contrast
jancborchardt Apr 12, 2021
6be8894
Improve focus feedback for file list actions
jancborchardt Apr 13, 2021
5792250
Add proper labels for personal settings privacy toggles
jancborchardt Apr 13, 2021
73cf806
Fix screenreader label of search icon
jancborchardt Apr 13, 2021
0a3875e
Fix missing label of grid view toggle
jancborchardt Apr 13, 2021
199f736
Fix missing label of Files navigation sublist toggles
jancborchardt Apr 13, 2021
9bb2e8d
Fix accessibility of profile picture section
jancborchardt Apr 15, 2021
b276593
Fix accessibility of federation menu privacy buttons
jancborchardt Apr 15, 2021
f4171c9
Fix avatar actions
nickvergessen Jun 15, 2021
4fbb9b2
Use constants from interface rather than class
danxuliu Jan 29, 2021
2eeac35
Extract default test data to a helper getter
danxuliu Jan 29, 2021
36fa740
Change default test data to values less similar to empty values
danxuliu Jan 29, 2021
7ed78d2
Add more unit tests for setting user settings
danxuliu Jan 29, 2021
6865d51
Respect additional user settings not covered by the controller
danxuliu Jan 29, 2021
ae7eca8
Fix TypeError when "email" is not given in the controller request
danxuliu Jan 31, 2021
44c870a
Fix deleting properties of user settings when not given explicitly
danxuliu Jan 31, 2021
491c031
Add integration tests for searching users in contacts menu
danxuliu Jan 31, 2021
3ae1ec4
Guard against null phone number value
danxuliu Jan 31, 2021
43a9879
Fix active scope not visible in the menu if excluded
danxuliu Feb 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,31 @@ trigger:
- pull_request
- push

---
kind: pipeline
name: integration-contacts-menu

steps:
- name: submodules
image: docker:git
commands:
- git submodule update --init
- name: integration-contacts-menu
image: nextcloudci/integration-php7.3:integration-php7.3-2
commands:
- bash tests/drone-run-integration-tests.sh || exit 0
- ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
- cd build/integration
- ./run.sh features/contacts-menu.feature

trigger:
branch:
- master
- stable*
event:
- pull_request
- push

---
kind: pipeline
name: integration-favorites
Expand Down
27 changes: 20 additions & 7 deletions apps/files/css/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,16 @@ table td.selection {
}

/* Use label to have bigger clickable size for checkbox */
#fileList tr td.selection>.selectCheckBox + label,
.select-all + label {
padding: 16px;
#fileList tr td.selection>.selectCheckBox,
.select-all {
& + label {
padding: 16px;
}

&:focus + label {
background-color: var(--color-background-hover);
border-radius: var(--border-radius-pill);
}
}

#fileList tr td.filename {
Expand Down Expand Up @@ -632,7 +639,11 @@ a.action > img {
}
}
&:hover, &:focus {
opacity: .7;
opacity: 1;
}
&:focus {
background-color: var(--color-background-hover);
border-radius: var(--border-radius-pill);
}
}
.fileActionsMenu a.action, a.action.action-share.shared-style {
Expand Down Expand Up @@ -683,12 +694,14 @@ a.action > img {
}

.summary {
opacity: .3;
color: var(--color-text-maxcontrast);
/* add whitespace to bottom of files list to correctly show dropdowns */
height: 250px;
}
#filestable .filesummary {
width: 100%;
/* Width of checkbox and file preview */
padding-left: 101px;
}
/* Less whitespace needed on link share page
* as there is a footer and action menus have fewer entries.
Expand All @@ -707,8 +720,8 @@ table tr.summary td {
vertical-align: top;
padding-top: 20px;
}
.summary .info {
margin-left: 2px;
.summary td:first-child {
padding: 0;
}
.hiddeninfo {
white-space: pre-line;
Expand Down
5 changes: 4 additions & 1 deletion apps/files/templates/appnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ class="nav-icon-<?php p(isset($item['icon']) && $item['icon'] !== '' ? $item['ic
NavigationElementMenu($item);
if (isset($item['sublist'])) {
?>
<button class="collapse app-navigation-noclose" <?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>></button>
<button class="collapse app-navigation-noclose"
aria-label="<?php p($l->t('Toggle %1$s sublist', $item['name'])) ?>"
<?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>>
</button>
<ul id="sublist-<?php p($item['id']); ?>">
<?php
foreach ($item['sublist'] as $item) {
Expand Down
1 change: 1 addition & 0 deletions apps/files/templates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<?php if (!$_['isIE']) { ?>
<input type="checkbox" class="hidden-visually" id="showgridview"
aria-label="<?php p($l->t('Toggle grid view'))?>"
<?php if ($_['showgridview']) { ?>checked="checked" <?php } ?>/>
<label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
title="<?php p($l->t('Toggle grid view'))?>"></label>
Expand Down
46 changes: 37 additions & 9 deletions apps/settings/css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ input {
#uploadavatarbutton, #selectavatar, #removeavatar {
padding: 21px;
}
#selectavatar, #removeavatar {
vertical-align: top;
}

.jcrop-holder {
z-index: 500;
Expand Down Expand Up @@ -118,9 +121,19 @@ input {
width: 100%;
}

.personal-settings-setting-box input {
&[type='text'], &[type='email'], &[type='tel'], &[type='url'] {
width: 100%;
.personal-settings-setting-box {
.section {
padding: 10px 30px;

h3 {
margin-bottom: 0;
}

input {
&[type='text'], &[type='email'], &[type='tel'], &[type='url'] {
width: 100%;
}
}
}
}

Expand Down Expand Up @@ -361,11 +374,20 @@ select {
.federation-menu {
position: relative;
cursor: pointer;
margin-left: 10px;
width: 44px;
height: 44px;
padding: 10px;
margin: -12px 0 0 8px;
background: none;
border: none;

&:hover,
&:focus {
background-color: var(--color-background-hover);
border-radius: var(--border-radius-pill);

.icon-federation-menu {
opacity: 0.7;
opacity: 0.8;
}
}

Expand Down Expand Up @@ -403,6 +425,16 @@ select {
font-weight: bold;
}
}

&.disabled {
opacity: .5;

cursor: default;

* {
cursor: default;
}
}
}
}
}
Expand Down Expand Up @@ -928,10 +960,6 @@ span.version {
}
}

.personal-settings-setting-box .section {
padding: 10px 30px;
}

.followupsection {
display: block;
padding: 0 30px 30px 30px;
Expand Down
16 changes: 13 additions & 3 deletions apps/settings/js/federationscopemenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
className: 'federationScopeMenu popovermenu bubble menu menu-center',
field: undefined,
_scopes: undefined,
_excludedScopes: [],

initialize: function(options) {
this.field = options.field;
Expand Down Expand Up @@ -58,9 +59,7 @@
];

if (options.excludedScopes && options.excludedScopes.length) {
this._scopes = this._scopes.filter(function(scopeEntry) {
return options.excludedScopes.indexOf(scopeEntry.name) === -1;
})
this._excludedScopes = options.excludedScopes
}
},

Expand Down Expand Up @@ -122,6 +121,17 @@
} else {
this._scopes[i].active = false;
}

var isExcludedScope = this._excludedScopes.includes(this._scopes[i].name)
if (isExcludedScope && !this._scopes[i].active) {
this._scopes[i].hidden = true
} else if (isExcludedScope && this._scopes[i].active) {
this._scopes[i].hidden = false
this._scopes[i].disabled = true
} else {
this._scopes[i].hidden = false
this._scopes[i].disabled = false
}
}

this.render();
Expand Down
17 changes: 15 additions & 2 deletions apps/settings/js/settings/personalInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,17 @@ window.addEventListener('DOMContentLoaded', function () {

$('#uploadavatar').fileupload(uploadparms);

$('#selectavatar').click(function () {
// Trigger upload action also with keyboard navigation on enter
$('#uploadavatarbutton').on('keyup', function(event) {
if (event.key === ' ' || event.key === 'Enter') {
$('#uploadavatar').trigger('click');
}
});

$('#selectavatar').click(function (event) {
event.stopPropagation();
event.preventDefault();

OC.dialogs.filepicker(
t('settings', "Select a profile picture"),
function (path) {
Expand Down Expand Up @@ -338,7 +348,10 @@ window.addEventListener('DOMContentLoaded', function () {
);
});

$('#removeavatar').click(function () {
$('#removeavatar').click(function (event) {
event.stopPropagation();
event.preventDefault();

$.ajax({
type: 'DELETE',
url: OC.generateUrl('/avatar/'),
Expand Down
72 changes: 56 additions & 16 deletions apps/settings/js/templates.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,65 @@
(function() {
var template = Handlebars.template, templates = OC.Settings.Templates = OC.Settings.Templates || {};
templates['federationscopemenu'] = template({"1":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = lookupProperty(helpers,"unless").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":2},"end":{"line":25,"column":13}}})) != null ? stack1 : "");
},"2":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <li tabindex=\"0\">\n <a href=\"#\" class=\"menuitem action action-"
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":4,"column":45},"end":{"line":4,"column":53}}}) : helper)))
+ " permanent "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"active") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":64},"end":{"line":4,"column":91}}})) != null ? stack1 : "")
+ "\" data-action=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":4,"column":106},"end":{"line":4,"column":114}}}) : helper)))
+ "\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"iconClass") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data,"loc":{"start":{"line":5,"column":4},"end":{"line":9,"column":11}}})) != null ? stack1 : "")
return " <li>\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disabled") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(6, data, 0),"data":data,"loc":{"start":{"line":5,"column":3},"end":{"line":9,"column":10}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"iconClass") : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(10, data, 0),"data":data,"loc":{"start":{"line":10,"column":4},"end":{"line":14,"column":11}}})) != null ? stack1 : "")
+ " <p>\n <strong class=\"menuitem-text\">"
+ alias4(((helper = (helper = lookupProperty(helpers,"displayName") || (depth0 != null ? lookupProperty(depth0,"displayName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data,"loc":{"start":{"line":11,"column":35},"end":{"line":11,"column":50}}}) : helper)))
+ alias4(((helper = (helper = lookupProperty(helpers,"displayName") || (depth0 != null ? lookupProperty(depth0,"displayName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":50}}}) : helper)))
+ "</strong><br>\n <span class=\"menuitem-text-detail\">"
+ alias4(((helper = (helper = lookupProperty(helpers,"tooltip") || (depth0 != null ? lookupProperty(depth0,"tooltip") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tooltip","hash":{},"data":data,"loc":{"start":{"line":12,"column":40},"end":{"line":12,"column":51}}}) : helper)))
+ "</span>\n </p>\n </a>\n </li>\n";
},"2":function(container,depth0,helpers,partials,data) {
return "active";
+ alias4(((helper = (helper = lookupProperty(helpers,"tooltip") || (depth0 != null ? lookupProperty(depth0,"tooltip") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tooltip","hash":{},"data":data,"loc":{"start":{"line":17,"column":40},"end":{"line":17,"column":51}}}) : helper)))
+ "</span>\n </p>\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disabled") : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.program(14, data, 0),"data":data,"loc":{"start":{"line":19,"column":3},"end":{"line":23,"column":10}}})) != null ? stack1 : "")
+ " </li>\n";
},"3":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div class=\"menuitem action action-"
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":6,"column":38},"end":{"line":6,"column":46}}}) : helper)))
+ " permanent "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"active") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":57},"end":{"line":6,"column":84}}})) != null ? stack1 : "")
+ " disabled\" data-action=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":6,"column":108},"end":{"line":6,"column":116}}}) : helper)))
+ "\">\n";
},"4":function(container,depth0,helpers,partials,data) {
return "active";
},"6":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <a href=\"#\" class=\"menuitem action action-"
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":8,"column":45},"end":{"line":8,"column":53}}}) : helper)))
+ " permanent "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"active") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":64},"end":{"line":8,"column":91}}})) != null ? stack1 : "")
+ "\" data-action=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":8,"column":106},"end":{"line":8,"column":114}}}) : helper)))
+ "\">\n";
},"8":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
Expand All @@ -32,10 +68,14 @@ templates['federationscopemenu'] = template({"1":function(container,depth0,helpe
};

return " <span class=\"icon "
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"iconClass") || (depth0 != null ? lookupProperty(depth0,"iconClass") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"iconClass","hash":{},"data":data,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":36}}}) : helper)))
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"iconClass") || (depth0 != null ? lookupProperty(depth0,"iconClass") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"iconClass","hash":{},"data":data,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":36}}}) : helper)))
+ "\"></span>\n";
},"6":function(container,depth0,helpers,partials,data) {
},"10":function(container,depth0,helpers,partials,data) {
return " <span class=\"no-icon\"></span>\n";
},"12":function(container,depth0,helpers,partials,data) {
return " </div>\n";
},"14":function(container,depth0,helpers,partials,data) {
return " </a>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
Expand All @@ -45,7 +85,7 @@ templates['federationscopemenu'] = template({"1":function(container,depth0,helpe
};

return "<ul>\n"
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"items") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":1},"end":{"line":16,"column":10}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"items") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":1},"end":{"line":26,"column":10}}})) != null ? stack1 : "")
+ "</ul>\n";
},"useData":true});
})();
12 changes: 11 additions & 1 deletion apps/settings/js/templates/federationscopemenu.handlebars
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<ul>
{{#each items}}
<li tabindex="0">
{{#unless hidden}}
<li>
{{#if disabled}}
<div class="menuitem action action-{{name}} permanent {{#if active}}active{{/if}} disabled" data-action="{{name}}">
{{else}}
<a href="#" class="menuitem action action-{{name}} permanent {{#if active}}active{{/if}}" data-action="{{name}}">
{{/if}}
{{#if iconClass}}
<span class="icon {{iconClass}}"></span>
{{else}}
Expand All @@ -11,7 +16,12 @@
<strong class="menuitem-text">{{displayName}}</strong><br>
<span class="menuitem-text-detail">{{tooltip}}</span>
</p>
{{#if disabled}}
</div>
{{else}}
</a>
{{/if}}
</li>
{{/unless}}
{{/each}}
</ul>
Loading