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

Added reset summary page layout UI #982

Merged
merged 1 commit into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion html/gui/js/modules/NoviceUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,16 @@ Ext.extend(XDMoD.Module.Summary, XDMoD.PortalModule, {
}
},
request_refresh: function () {
this.needsRefresh = true;
var tabPanel = Ext.getCmp('main_tab_panel');
if (this === tabPanel.getActiveTab()) {
// This is the case where the 'Reset to defaults' button is
// clicked in the Profile dialog and the user is already on the
// summary page
portletStore.load();
} else {
// The refresh will happen the next time the tab is activated
this.needsRefresh = true;
}
}
}
});
Expand Down
78 changes: 57 additions & 21 deletions html/gui/js/profile_editor/ProfileEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,69 @@ XDMoD.ProfileEditor = Ext.extend(Ext.Window, {
var self = this;

this.general_settings = new XDMoD.ProfileGeneralSettings({parentWindow: self});
this.role_delegation = new XDMoD.ProfileRoleDelegation({parentWindow: self, id: 'tab_role_delegation' });

// ------------------------------------------------

this.on('beforeclose', self.handleProfileClose);

// ------------------------------------------------

var tabItems = [
this.general_settings
];

if (CCR.xdmod.ui.isCenterDirector) {
tabItems.push(new XDMoD.ProfileRoleDelegation({
parentWindow: self
}));
}

if (!CCR.xdmod.ui.tgSummaryViewer.usesToolbar) {
tabItems.push({
title: 'Settings',
height: 320,
layout: 'fit',
border: false,
frame: true,
items: [{
items: [{
title: 'User Interface',
xtype: 'form',
bodyStyle: 'padding:5px',
labelWidth: 230,
frame: true,
items: [{
xtype: 'compositefield',
items: [{
xtype: 'button',
fieldLabel: 'Summary Tab Panel Layout',
text: 'Reset to Default',
handler: function (button) {
Ext.Ajax.request({
url: XDMoD.REST.url + '/summary/layout',
method: 'DELETE',
success: function () {
button.setDisabled(true);
CCR.xdmod.ui.tgSummaryViewer.fireEvent('request_refresh');
},
failure: function (response, opts) {
Ext.MessageBox.alert('Error', response.message);
}
});
}
}]
}]
}]
}],
bbar: {
items: [
'->',
self.getCloseButton()
]
}
});
}

var tabPanel = new Ext.TabPanel({

frame: false,
Expand All @@ -101,10 +156,7 @@ XDMoD.ProfileEditor = Ext.extend(Ext.Window, {
tabCls: 'tab-strip'
},

items: [
this.general_settings,
this.role_delegation
],
items: tabItems,

listeners: {
tabchange: function (thisTabPanel, tab) {
Expand All @@ -131,22 +183,6 @@ XDMoD.ProfileEditor = Ext.extend(Ext.Window, {

// ------------------------------------------------

if (CCR.xdmod.ui.isCenterDirector == false) {

tabPanel.on('afterrender', function(tp) {

var role_delegation_tab = tp.id + '__tab_role_delegation';

var tab = document.getElementById(role_delegation_tab);

tab.style.display = 'none';

});//afterrender

}//if (CCR.xdmod.ui.isCenterDirector == false)

// ------------------------------------------------

Ext.apply(this, {

items:[
Expand Down