Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Admin/js): get correct treenode when edit quota
Browse files Browse the repository at this point in the history
  • Loading branch information
ccheng-dev committed Oct 12, 2021
1 parent d191685 commit 6f6e107
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tine20/Admin/js/QuotaEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Tine.Admin.QuotaEditDialog = Ext.extend(Tine.Tinebase.dialog.Dialog, {
if (this.customizeFields?.isPersonalNode) {
additionalData['isPersonalNode'] = this.customizeFields?.isPersonalNode;
additionalData['accountId'] = this.customizeFields?.accountId;
}
}

this.node.attributes.quota = this.getForm().findField('quota').getValue();
}
Expand All @@ -97,7 +97,7 @@ Tine.Admin.QuotaEditDialog = Ext.extend(Tine.Tinebase.dialog.Dialog, {

await Tine.Admin.saveQuota(this.appName, this.node.attributes, additionalData)
.then((result) => {
// expand child node to the deepest
// expand child node to the deepest
this.node.parentNode.reload();
this.window.close();
});
Expand Down Expand Up @@ -142,7 +142,7 @@ Tine.Admin.QuotaEditDialog = Ext.extend(Tine.Tinebase.dialog.Dialog, {
disabled: ! this.hasRequiredRight
}], [{
fieldLabel: this.translation.gettext('Current Mailbox size'),
value: emailUser.get('emailMailSize'),
value: emailUser.get('emailMailSize') ?? 0,
xtype: 'extuxbytesfield',
disabled: true
}], [{
Expand All @@ -154,7 +154,7 @@ Tine.Admin.QuotaEditDialog = Ext.extend(Tine.Tinebase.dialog.Dialog, {
disabled: ! this.hasRequiredRight
}], [{
fieldLabel: this.translation.gettext('Current Sieve size'),
value: emailUser.get('emailSieveSize'),
value: emailUser.get('emailSieveSize') ?? 0,
xtype: 'extuxbytesfield',
disabled: true
}]]
Expand Down
10 changes: 6 additions & 4 deletions tine20/Admin/js/QuotaManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Tine.Admin.QuotaManagement = Ext.extend(Ext.ux.tree.TreeGrid, {
})
});
}
if (showCurrentFSUsageConfig.includes('revision_size')
if (showCurrentFSUsageConfig.includes('revision_size')
&& Tine.Tinebase.configManager.get('filesystem.modLogActive', 'Tinebase')) {
this.columns.push({
id: 'revision_size',
Expand Down Expand Up @@ -181,8 +181,10 @@ Tine.Admin.QuotaManagement = Ext.extend(Ext.ux.tree.TreeGrid, {
/**
* onclick handler for edit action
*/
async quotaEditDialogHandler(node, _event) {
async quotaEditDialogHandler(_event) {
// search current folder record based on its parent path
const node = this.getSelectionModel().getSelectedNode();

if (this.isNodeEditable(node)) {
Tine.Admin.QuotaEditDialog.openWindow({
windowTitle: String.format(this.translation.gettext('Edit {0} Quota'),
Expand All @@ -201,7 +203,7 @@ Tine.Admin.QuotaManagement = Ext.extend(Ext.ux.tree.TreeGrid, {
const appName = node.attributes.appName;
const translateApp = path.split('/').filter(Boolean)?.[0];
let isEditable = false;

let disabledNodes = [
`/${translateApp}`,
`/${translateApp}/folders`,
Expand Down Expand Up @@ -295,4 +297,4 @@ Tine.Admin.registerItem({
viewRight: 'view_quota_usage',
panel: Tine.Admin.QuotaManagement,
dataPanelType: "quotamanagement",
});
});

0 comments on commit 6f6e107

Please sign in to comment.