Merge pull request #57355 from nextcloud/refactor/oc-settings

refactor: consolidate `OC.Settings`
This commit is contained in:
Ferdinand Thiessen 2026-01-13 22:35:40 +01:00 committed by GitHub
commit c59ad1f847
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 53 additions and 364 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["settings.scss","../../../core/css/variables.scss","../../../core/css/functions.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA,GCEA;AAAA;AAAA;AAAA,GCFA;AAAA;AAAA;AAAA,GFUC,0BACC,WAKF,OACC,WAID,4BE2BC,2CFvBD,mBEuBC,kDFnBD,qBEmBC,yCFfD,0BEeC,wCFXD,oEEWC,2CFPD,oCACC,oBACA,0BACA,+BACA,mBAGD,4BACC,oBACA,kCAGD,yBACC,WAIA,wCACC,kBACA,yDACC,gBAIA,mOACC,WAKH,uCACC,aAGD,sCACC,WAED,uDACC,WAKD,gBACC,WAIF,mBACC,aACA,aACA,iBACA,uEACA,qBAEA,4BACC,kBACA,SAEA,+BACC,mBAIA,qCACC,iBAKH,kCACC,sBACA,mBACA,gBAGD,mGACC,4BACA,0BACA,WAMF,oBACC,kBACA,wCACC,0BAIF,aACC,oBACA,4CACA,kFACA,8CACA,wCACA,2CACA,8CACA,6CACA,mBACA,yCAEA,sCAEC,oDAGD,+CAEC,6DACA,oDAGD,6BACC,qCACA,WACA,YAIF,6BACC,oBACA,kCAEA,mCACC,WAIA,oCACC,kBACA,oBACA,iBACA,2BACA,WACA,mBACA,QAEA,0CACC,mBACA,uBACA,gBAKD,gIACC,kBACA,qBACA,UACA,oBACA,YAKH,qCACC,kBACA,wBACA,MACA,SAEA,yCACC,qBAIF,4CACC,eAGD,4CACC,sBACA,WACA,YACA,YAMF,qBACC,aACA,sBACA,SACA,YAEA,uBACC,aAGD,uCACC,sBACA,cACA,yBAIF,iBACC,kBACA,eACA,oCACA,qCACA,6CACA,SACA,gBACA,YAEA,8CAEC,+CACA,2CAEA,0FACC,WAIF,uCACC,0BACA,qBACA,gCACA,WACA,eAEA,wDACC,qBACA,sBACA,eAIF,sCACC,kCAGC,4DAEC,iBACA,kBAEA,kFACC,YAGD,mEACC,oDAEA,kFACC,iBAIF,qEACC,WAEA,eAEA,uEACC,eAQN,gBACC,YAIA,2BACC,kCAGD,mBACC,YAIF,sCAEC,aAGD,eACC,WAGD,YACC,qBAIA,aACC,WACA,yBACA,YAGD,WACC,WACA,yBACA,YAMD,oBACC,sBAGD,iBACC,eAKD,iCACC,aACA,eACA,sBACA,SACA,gDACC,aACA,eACA,sBACA,sDACC,oBAIF,kGACC,cACA,YACA,gBAKA,iEACC,kBACA,UAED,+EACC,oBACA,oBACA,wBACA,qBAIF,wCACC,WAGD,iDACC,qBAGD,sDACC,kBACA,qBACA,WACA,0BACA,eACA,gBACA,WAQF,oBACC,gBAGD,wBACC,yBAGD,oDACC,WACA,YACA,wCAOD,oBACC,UACA,cACA,gBACA,uBAGD,2BACC,UAKD,oCAEC,cAKD,wEAEC,aAIF,gBACC,kBACA,QACA,mBAEA,sBACC,YAGD,sBACC,iBAKF,WACC,WAEA,cACC,WACA,UACA,uBACA,4CACA,iBACA,mBAGD,cACC,4CACA,UACA,uBACA,iBACA,mBAKD,gBACC,0BACA,cACA,eACA,uBACA,gBAGD,wBACC,0BAEA,gCACC,kBAIF,sCACC,kBAGD,sDAEC,cACA,eACA,eAEA,0EACC,UACA,qBACA,uBACA,gBAIF,8BACC,eAGD,kCACC,wBACA,cAIF,2BACC,mBAMA,oBACC,mBACA,sBACA,WAGD,gCACC,0BAIA,gGACC,cAOH,SACC,gBAEA,0BACC,4CAID,YACC,oBACA,mBACA,uBACA,eACA,iBACA,gBACA,aAEA,uBACC,aACA,mBACA,uBACA,oCACA,qCACA,yDACA,sBACA,oCAKF,WACC,kBACA,kBACA,oCACA,gBAKF,KACC,mBACA,mBAGD,SACC,aAGD,mBACC,mBAGD,eACC,gBAIA,sBACC,aAGD,YACC,oBAGD,kBACC,0BAGD,yBACC,0BAGD,sBACC,0BAGD,oCACC,uBAIF,yCACC,uBAGD,wBACC,qBAGD,2BACC,wBAEA,gBACA,aACA,yBACA,sBAKD,WACC,kBACA,2BACA,WAGD,2DAGC,qBAIA,mCACC,qBACA,YACA,eAGD,+EAEC,YAIF,yBACC,mCACC,YACA,iBACA,cACA,iDAIF,eACC,WAGD,SACC,yBAGD,QACC,qBACA,YACA,WACA,2BAEA,gBACC,kBAIF,qBACC,sBACA,qBACA,YACA,iBAGD,kBACC,qBACA,gBAIA,aACC,sCACA,mCAGD,WACC,oCAGD,mBACC,sCACA,oBAMF,8CACC,yBACA,YAGD,wBACC,WACA,YACA,mBACA,kBACA,+DAGD,SACC,UAGD,eACC,oCACA,wBAGD,UACI,+CAGJ,2BACE,GACE,YAGJ,mCACE,GACE,WAKH,wBACC,qBACA,eACA,mCACA","file":"settings.css"}
{"version":3,"sourceRoot":"","sources":["settings.scss","../../../core/css/variables.scss","../../../core/css/functions.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA,GCEA;AAAA;AAAA;AAAA,GCFA;AAAA;AAAA;AAAA,GFUC,0BACC,WAKF,OACC,WAID,4BE2BC,2CFvBD,mBEuBC,kDFnBD,qBEmBC,yCFfD,0BEeC,wCFXD,oEEWC,2CFPD,oCACC,oBACA,0BACA,+BACA,mBAGD,4BACC,oBACA,kCAGD,yBACC,WAIA,wCACC,kBACA,yDACC,gBAIA,mOACC,WAKH,uCACC,aAGD,sCACC,WAED,uDACC,WAKD,gBACC,WAIF,mBACC,aACA,aACA,iBACA,uEACA,qBAEA,4BACC,kBACA,SAEA,+BACC,mBAIA,qCACC,iBAKH,kCACC,sBACA,mBACA,gBAGD,mGACC,4BACA,0BACA,WAMF,oBACC,kBACA,wCACC,0BAIF,aACC,oBACA,4CACA,kFACA,8CACA,wCACA,2CACA,8CACA,6CACA,mBACA,yCAEA,sCAEC,oDAGD,+CAEC,6DACA,oDAGD,6BACC,qCACA,WACA,YAIF,6BACC,oBACA,kCAEA,mCACC,WAIA,oCACC,kBACA,oBACA,iBACA,2BACA,WACA,mBACA,QAEA,0CACC,mBACA,uBACA,gBAKD,gIACC,kBACA,qBACA,UACA,oBACA,YAKH,qCACC,kBACA,wBACA,MACA,SAEA,yCACC,qBAIF,4CACC,eAGD,4CACC,sBACA,WACA,YACA,YAMF,qBACC,aACA,sBACA,SACA,YAEA,uBACC,aAGD,uCACC,sBACA,cACA,yBAIF,gBACC,YAIA,2BACC,kCAGD,mBACC,YAIF,sCAEC,aAGD,eACC,WAGD,YACC,qBAIA,aACC,WACA,yBACA,YAGD,WACC,WACA,yBACA,YAMD,oBACC,sBAGD,iBACC,eAKD,iCACC,aACA,eACA,sBACA,SACA,gDACC,aACA,eACA,sBACA,sDACC,oBAIF,kGACC,cACA,YACA,gBAKA,iEACC,kBACA,UAED,+EACC,oBACA,oBACA,wBACA,qBAIF,wCACC,WAGD,iDACC,qBAGD,sDACC,kBACA,qBACA,WACA,0BACA,eACA,gBACA,WAQF,oBACC,gBAGD,wBACC,yBAGD,oDACC,WACA,YACA,wCAOD,oBACC,UACA,cACA,gBACA,uBAGD,2BACC,UAKD,oCAEC,cAKD,wEAEC,aAIF,gBACC,kBACA,QACA,mBAEA,sBACC,YAGD,sBACC,iBAKF,WACC,WAEA,cACC,WACA,UACA,uBACA,4CACA,iBACA,mBAGD,cACC,4CACA,UACA,uBACA,iBACA,mBAKD,gBACC,0BACA,cACA,eACA,uBACA,gBAGD,wBACC,0BAEA,gCACC,kBAIF,sCACC,kBAGD,sDAEC,cACA,eACA,eAEA,0EACC,UACA,qBACA,uBACA,gBAIF,8BACC,eAGD,kCACC,wBACA,cAIF,2BACC,mBAMA,oBACC,mBACA,sBACA,WAGD,gCACC,0BAIA,gGACC,cAOH,SACC,gBAEA,0BACC,4CAID,YACC,oBACA,mBACA,uBACA,eACA,iBACA,gBACA,aAEA,uBACC,aACA,mBACA,uBACA,oCACA,qCACA,yDACA,sBACA,oCAKF,WACC,kBACA,kBACA,oCACA,gBAKF,KACC,mBACA,mBAGD,SACC,aAGD,mBACC,mBAGD,eACC,gBAIA,sBACC,aAGD,YACC,oBAGD,kBACC,0BAGD,yBACC,0BAGD,sBACC,0BAGD,oCACC,uBAIF,yCACC,uBAGD,wBACC,qBAGD,2BACC,wBAEA,gBACA,aACA,yBACA,sBAKD,WACC,kBACA,2BACA,WAGD,2DAGC,qBAIA,mCACC,qBACA,YACA,eAGD,+EAEC,YAIF,yBACC,mCACC,YACA,iBACA,cACA,iDAIF,eACC,WAGD,SACC,yBAGD,QACC,qBACA,YACA,WACA,2BAEA,gBACC,kBAIF,qBACC,sBACA,qBACA,YACA,iBAGD,kBACC,qBACA,gBAIA,aACC,sCACA,mCAGD,WACC,oCAGD,mBACC,sCACA,oBAMF,8CACC,yBACA,YAGD,wBACC,WACA,YACA,mBACA,kBACA,+DAGD,SACC,UAGD,eACC,oCACA,wBAGD,UACI,+CAGJ,2BACE,GACE,YAGJ,mCACE,GACE,WAKH,wBACC,qBACA,eACA,mCACA","file":"settings.css"}

View file

@ -239,75 +239,6 @@ select {
}
}
.federation-menu {
position: relative;
cursor: pointer;
width: var(--default-clickable-area);
height: var(--default-clickable-area);
padding: calc(2 * var(--default-grid-baseline));
margin: 0;
background: none;
border: none;
&:hover,
&:focus {
background-color: var(--color-background-hover);
border-radius: var(--border-radius-element);
.icon-federation-menu {
opacity: 0.8;
}
}
.icon-federation-menu {
padding-inline-start: 16px;
background-size: 16px;
background-position: left center;
opacity: .3;
cursor: inherit;
.icon-triangle-s {
display: inline-block;
vertical-align: middle;
cursor: inherit;
}
}
.federationScopeMenu {
top: var(--default-clickable-area);
&.popovermenu {
.menuitem {
// override h3 heading font size
font-size: 12.8px;
line-height: 1.6em;
.menuitem-text-detail {
opacity: .75;
}
&.active {
box-shadow: inset 2px 0 var(--color-primary-element);
.menuitem-text {
font-weight: bold;
}
}
&.disabled {
opacity: .5;
cursor: default;
* {
cursor: default;
}
}
}
}
}
}
.clientsbox img {
height: 60px;
}

View file

@ -1,91 +0,0 @@
(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>\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":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":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];
}
return undefined
};
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":11,"column":23},"end":{"line":11,"column":36}}}) : helper)))
+ "\"></span>\n";
},"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)) {
return parent[propertyName];
}
return undefined
};
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":26,"column":10}}})) != null ? stack1 : "")
+ "</ul>\n";
},"useData":true});
})();

View file

@ -1,27 +0,0 @@
<ul>
{{#each items}}
{{#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}}
<span class="no-icon"></span>
{{/if}}
<p>
<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>

View file

@ -1,60 +0,0 @@
/* global OC */
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
(function() {
'use strict'
let errorNotification
/**
* Model for storing and saving user settings
*
* @class UserSettings
*/
const UserSettings = OC.Backbone.Model.extend({
url: OC.generateUrl('/settings/users/{id}/settings', { id: OC.currentUser }),
isNew: function() {
return false // Force PUT on .save()
},
parse: function(data) {
if (_.isUndefined(data)) {
return null
}
if (errorNotification) {
errorNotification.hide()
}
if (data.status && data.status === 'error') {
errorNotification = OC.Notification.show(data.data.message, { type: 'error' })
}
if (_.isUndefined(data.data)) {
return null
}
data = data.data
const ignored = [
'userId',
'message',
]
_.each(ignored, function(ign) {
if (!_.isUndefined(data[ign])) {
delete data[ign]
}
})
return data
},
})
OC.Settings = OC.Settings || {}
OC.Settings.UserSettings = UserSettings
})()

View file

@ -1,10 +0,0 @@
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import rebuildNavigation from './service/rebuild-navigation.js'
window.OC.Settings = window.OC.Settings || {}
window.OC.Settings.Apps = window.OC.Settings.Apps || {
rebuildNavigation,
}

View file

@ -10,9 +10,5 @@ __webpack_nonce__ = getCSPNonce()
Vue.prototype.t = t
// Not used here but required for legacy templates
window.OC = window.OC || {}
window.OC.Settings = window.OC.Settings || {}
const View = Vue.extend(ArtificialIntelligence)
new View().$mount('#ai-settings')

View file

@ -13,10 +13,6 @@ __webpack_nonce__ = getCSPNonce()
Vue.prototype.t = t
// Not used here but required for legacy templates
window.OC = window.OC || {}
window.OC.Settings = window.OC.Settings || {}
store.replaceState(loadState('settings', 'mandatory2FAState'))
const View = Vue.extend(AdminTwoFactor)

View file

@ -4,9 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
script('settings', [
'vue-settings-admin-ai',
]);
\OCP\Util::addScript('settings', 'vue-settings-admin-ai');
?>
<div id="ai-settings">

View file

@ -7,9 +7,7 @@
/** @var \OCP\IL10N $l */
/** @var array $_ */
script('settings', [
'vue-settings-admin-basic-settings',
]);
\OCP\Util::addScript('settings', 'vue-settings-admin-basic-settings');
?>
<div id="vue-admin-background-job"></div>

View file

@ -5,9 +5,7 @@
*/
style('settings', 'settings');
\OCP\Util::addScript('settings', 'settings', 'core');
\OCP\Util::addScript('settings', 'legacy-admin');
?>
<div id="app-navigation">

View file

@ -8,11 +8,7 @@
/** @var \OCP\IL10N $l */
/** @var array $_ */
script('settings', [
'usersettings',
'templates',
'vue-settings-personal-info',
]);
\OCP\Util::addScript('settings', 'vue-settings-personal-info');
?>
<?php if (!$_['isFairUseOfFreePushService']) : ?>
<div class="section">

View file

@ -51,7 +51,6 @@ module.exports = {
'public-nickname-handler': path.join(__dirname, 'apps/files_sharing/src', 'public-nickname-handler.ts'),
},
settings: {
apps: path.join(__dirname, 'apps/settings/src', 'apps.js'),
'legacy-admin': path.join(__dirname, 'apps/settings/src', 'admin.js'),
'vue-settings-admin-overview': path.join(__dirname, 'apps/settings/src', 'main-admin-overview.ts'),
'vue-settings-admin-basic-settings': path.join(__dirname, 'apps/settings/src', 'main-admin-basic-settings.js'),

View file

@ -69,6 +69,7 @@ import { getRequestToken } from './requesttoken.ts'
import {
linkToRemoteBase,
} from './routing.js'
import Settings from './settings.js'
import { theme } from './theme.js'
import Util from './util.js'
import webroot from './webroot.js'
@ -198,6 +199,10 @@ export default {
*/
PasswordConfirmation,
Plugins,
/**
* @deprecated 25.0.0 Use Vue based (`@nextcloud/vue`) settings components instead
*/
Settings,
theme,
Util,
debug,

View file

@ -3,9 +3,18 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
OC.Settings = OC.Settings || {}
OC.Settings = _.extend(OC.Settings, {
import axios from '@nextcloud/axios'
import { emit } from '@nextcloud/event-bus'
import { generateOcsUrl } from '@nextcloud/router'
import $ from 'jquery'
import _ from 'underscore'
import logger from '../logger.js'
/**
* @deprecated 25.0.0 Use Vue based (`@nextcloud/vue`) settings components instead
*/
export default {
_cachedGroups: null,
escapeHTML: function(text) {
@ -17,6 +26,16 @@ OC.Settings = _.extend(OC.Settings, {
.split('\'').join('&#039;')
},
async rebuildNavigation() {
const { data } = await axios.get(generateOcsUrl('core/navigation', 2) + '/apps?format=json')
if (data.ocs.meta.statuscode !== 200) {
return
}
emit('nextcloud:app-menu.refresh', { apps: data.ocs.data })
window.dispatchEvent(new Event('resize'))
},
/**
* Setup selection box for group selection.
*
@ -35,7 +54,7 @@ OC.Settings = _.extend(OC.Settings, {
if ($elements.length > 0) {
// Let's load the data and THEN init our select
$.ajax({
url: OC.linkToOCS('cloud/groups', 2) + 'details',
url: generateOcsUrl('cloud/groups/details'),
dataType: 'json',
success: function(data) {
const results = []
@ -50,7 +69,7 @@ OC.Settings = _.extend(OC.Settings, {
// note: settings are saved through a "change" event registered
// on all input fields
$elements.select2(_.extend({
placeholder: t('settings', 'Groups'),
placeholder: t('core', 'Groups'),
allowClear: true,
multiple: true,
toggleSelect: true,
@ -94,15 +113,15 @@ OC.Settings = _.extend(OC.Settings, {
},
}, extraOptions || {}))
} else {
OC.Notification.show(t('settings', 'Group list is empty'), { type: 'error' })
console.log(data)
OC.Notification.show(t('core', 'Group list is empty'), { type: 'error' })
logger.debug(data)
}
},
error: function(data) {
OC.Notification.show(t('settings', 'Unable to retrieve the group list'), { type: 'error' })
console.log(data)
OC.Notification.show(t('core', 'Unable to retrieve the group list'), { type: 'error' })
logger.debug(data)
},
})
}
},
})
}

4
dist/core-common.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/core-login.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/core-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
(()=>{"use strict";var e,o={33167(e,o,t){var r=t(19051),n=t(61338),a=t(63814);window.OC.Settings=window.OC.Settings||{},window.OC.Settings.Apps=window.OC.Settings.Apps||{rebuildNavigation:()=>r.Ay.get((0,a.KT)("core/navigation",2)+"/apps?format=json").then(({data:e})=>{200===e.ocs.meta.statuscode&&((0,n.Ic)("nextcloud:app-menu.refresh",{apps:e.ocs.data}),window.dispatchEvent(new Event("resize")))})}}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return o[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=o,e=[],r.O=(o,t,n,a)=>{if(!t){var i=1/0;for(u=0;u<e.length;u++){for(var[t,n,a]=e[u],d=!0,l=0;l<t.length;l++)(!1&a||i>=a)&&Object.keys(r.O).every(e=>r.O[e](t[l]))?t.splice(l--,1):(d=!1,a<i&&(i=a));if(d){e.splice(u--,1);var s=n();void 0!==s&&(o=s)}}return o}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,n,a]},r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.e=()=>Promise.resolve(),r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.j=4897,(()=>{r.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={4897:0};r.O.j=o=>0===e[o];var o=(o,t)=>{var n,a,[i,d,l]=t,s=0;if(i.some(o=>0!==e[o])){for(n in d)r.o(d,n)&&(r.m[n]=d[n]);if(l)var u=l(r)}for(o&&o(t);s<i.length;s++)a=i[s],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(u)},t=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];t.forEach(o.bind(null,0)),t.push=o.bind(null,t.push.bind(t))})(),r.nc=void 0;var n=r.O(void 0,[4208],()=>r(33167));n=r.O(n)})();
//# sourceMappingURL=settings-apps.js.map?v=2679f8d99cb20b89542b

View file

@ -1,55 +0,0 @@
SPDX-License-Identifier: MIT
SPDX-License-Identifier: ISC
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-License-Identifier: BSD-3-Clause
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: T. Jameson Little <t.jameson.little@gmail.com>
SPDX-FileCopyrightText: Roman Shtylman <shtylman@gmail.com>
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Matt Zabriskie
SPDX-FileCopyrightText: GitHub Inc.
SPDX-FileCopyrightText: Feross Aboukhadijeh
SPDX-FileCopyrightText: Christoph Wurst
This file is generated from multiple sources. Included packages:
- @nextcloud/auth
- version: 2.5.3
- license: GPL-3.0-or-later
- @nextcloud/axios
- version: 2.5.2
- license: GPL-3.0-or-later
- @nextcloud/browser-storage
- version: 0.5.0
- license: GPL-3.0-or-later
- semver
- version: 7.7.2
- license: ISC
- @nextcloud/event-bus
- version: 3.3.3
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.1.0
- license: GPL-3.0-or-later
- axios
- version: 1.12.2
- license: MIT
- base64-js
- version: 1.5.1
- license: MIT
- ieee754
- version: 1.2.1
- license: BSD-3-Clause
- buffer
- version: 6.0.3
- license: MIT
- process
- version: 0.11.10
- license: MIT
- webpack
- version: 5.104.1
- license: MIT
- nextcloud
- version: 1.0.0
- license: AGPL-3.0-or-later

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
settings-apps.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long