Skip to content

Commit

Permalink
Merge branch 'xdmod10.5' into job_viewer_plotly
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwhite4 authored Jul 5, 2023
2 parents ea1edfc + f40b817 commit 2e6b0ed
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/latest-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Below you will find links to our latest releases by supported OS.
You can find the latest CentOS7 build here: [CentOS7 Latest](https://github.com/ubccr/xdmod/releases/latest)

# Rocky 8
You can find the latest Rocky 8 build here: [Rocky 8 Latest](https://github.com/ubccr/xdmod/releases/tag/v10.0.2-beta1-el8)
You can find the latest Rocky 8 build here: [Rocky 8 Latest](https://github.com/ubccr/xdmod/releases/tag/v10.0.2-2-el8)

**Note: Rocky8 support is still in beta. Full support is slated for Open XDMoD 10.5**
14 changes: 14 additions & 0 deletions docs/software-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ dnf module -y reset nodejs
dnf module -y install nodejs:16
```

**NOTE**: The method to install the system level mongodb drivers has changed for Rocky 8. To account for this, you will
need to run the following:
```shell
dnf install -y php-devel
pecl install mongodb
echo "extension=mongodb.so" > /etc/php.d/40-mongodb.ini
```

You can double check that the installation was successful by running the following and confirming that
there is output:
```shell
php -i | grep mongo
```

Additional Notes
----------------

Expand Down
5 changes: 5 additions & 0 deletions html/gui/css/ProfileEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
width: 125px !important;
}

#user_profile_most_privileged_role {
font-weight: bold;
padding-left: 3px;
}

/* ----------------------------- */

.role_manager .lbl_member_status{
Expand Down
7 changes: 2 additions & 5 deletions html/gui/js/AddDataPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ Ext.apply(CCR.xdmod.ui.AddDataPanel, {
['label_asc', 'Labels Ascending'],
['label_desc', 'Labels Descending']
],
randomInt: function (min, max) {
// eslint-disable-next-line no-mixed-operators
return Math.floor(Math.random() * (max - min + 1) + min);
},

defaultConfig: function (timeseries) {
return {
group_by: 'none',
Expand Down Expand Up @@ -87,7 +84,7 @@ Ext.apply(CCR.xdmod.ui.AddDataPanel, {
var conf = {};
jQuery.extend(true, conf, CCR.xdmod.ui.AddDataPanel.defaultConfig(timeseries));
if (config) jQuery.extend(true, conf, config);
conf.id = this.randomInt(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
conf.id = CCR.randomInt(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
conf.z_index = store.getCount();
conf.filters = selectedFilters ? selectedFilters : {
data: [],
Expand Down
5 changes: 5 additions & 0 deletions html/gui/js/CCR.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,11 @@ CCR.xdmod.ui.invertColor = function (hexTripletColor) {
color = ("000000" + color).slice(-6); // pad with leading zeros
return color;
};

CCR.randomInt = function (min, max) {
// eslint-disable-next-line no-mixed-operators
return Math.floor(Math.random() * (max - min + 1) + min);
};
// ------------------------------------

// Global reference to login prompt
Expand Down
37 changes: 35 additions & 2 deletions html/gui/js/profile_editor/ProfileApiToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ XDMoD.ProfileApiToken = Ext.extend(Ext.form.FormPanel, {
creationDate: '',
expirationDate: '',
initialParentWindowWidth: undefined,
hasBeenClosed: false,
responseArgs: null,

// Methods
initComponent: function () {
Expand All @@ -43,6 +45,19 @@ XDMoD.ProfileApiToken = Ext.extend(Ext.form.FormPanel, {
this.getToken();
},

handleOpenEvent: function () {
this.hasBeenClosed = false;
// If a response arrived while the window was opening, process it now.
if (this.responseArgs !== null) {
this.processHttpResponse();
}
},

handleCloseEvent: function () {
this.hasBeenClosed = true;
this.responseArgs = null;
},

initSubComponents: function () {
this.initPanelMsg();
this.initBtnCopyToClipboard();
Expand Down Expand Up @@ -181,8 +196,22 @@ XDMoD.ProfileApiToken = Ext.extend(Ext.form.FormPanel, {
url: '/users/current/api/token',
method: params.method,
callback: function (options, success, response) {
// If the window has already been closed, throw away the
// response.
if (self.hasBeenClosed) {
return;
}
// Store the arguments needed to process the response.
self.responseArgs = {
params: params,
success: success,
response: response
};
// If the window has finished opening, go ahead and process the
// response. Otherwise, the window will call handleOpenEvent
// later to process the response.
if (self.parentWindow.isVisible()) {
self.processResponse(params, success, response);
self.processHttpResponse();
}
}
});
Expand Down Expand Up @@ -242,7 +271,11 @@ XDMoD.ProfileApiToken = Ext.extend(Ext.form.FormPanel, {
self.showNewToken();
},

processResponse: function (params, success, response) {
processHttpResponse: function () {
var success = this.responseArgs.success;
var params = this.responseArgs.params;
var response = this.responseArgs.response;
this.responseArgs = null;
if (success) {
this.processSuccessfulResponse(params, response);
} else if (params.onFailure) {
Expand Down
19 changes: 16 additions & 3 deletions html/gui/js/profile_editor/ProfileEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ XDMoD.ProfileEditorConstants = {

XDMoD.ProfileEditor = Ext.extend(Ext.Window, {
id: 'xdmod-profile-editor',
width: 375,
width: 400,

border: false,
frame: true,
Expand All @@ -33,8 +33,21 @@ XDMoD.ProfileEditor = Ext.extend(Ext.Window, {
tooltip: 'Profile Editor',

init: function () {
this.general_settings.init();
this.api_token.init();
var tabs = [this.general_settings, this.api_token];
this.addListener('afterrender', function () {
tabs.forEach(function (tab) {
tab.handleOpenEvent();
});
});
this.addListener('close', function () {
tabs.forEach(function (tab) {
tab.handleCloseEvent();
});
});
tabs.forEach(function (tab) {
tab.init();
});
this.show();
},

handleProfileClose: function () {
Expand Down
93 changes: 71 additions & 22 deletions html/gui/js/profile_editor/ProfileGeneralSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
resizable: false,
title: 'General',
cls: 'no-underline-invalid-fields-form',
hasBeenClosed: false,
responseArgs: null,

// Dictates whether closing the profile editor logs out the user automatically
perform_logout_on_close: false,

init: function () {
var self = this;
XDMoD.REST.connection.request({
url: '/users/current',
method: 'GET',
callback: this.cbProfile
callback: function (options, success, response) {
// If the window has already been closed, throw away the
// response.
if (self.hasBeenClosed) {
return;
}
// Store the arguments needed to process the response.
self.responseArgs = {
success: success,
response: response
};
// If the window has finished opening, go ahead and process
// the response. Otherwise, the window will call
// handleOpenEvent later to process the response.
if (self.parentWindow.isVisible()) {
self.processHttpResponse();
}
}
});
},

Expand All @@ -30,7 +50,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
var user_profile_firstname = new Ext.form.TextField({
name: 'first_name',
fieldLabel: 'First Name',
emptyText: '1 min, ' + maxFirstNameLength + ' max',
emptyText: 'Loading...',
msgTarget: 'under',

allowBlank: false,
Expand All @@ -39,6 +59,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
maxLengthText: 'Maximum length (' + maxFirstNameLength + ' characters) exceeded.',
regex: XDMoD.regex.noReservedCharacters,
regexText: reservedCharactersNotAllowedText,
disabled: true,

listeners: {
blur: XDMoD.utils.trimOnBlur,
Expand All @@ -51,7 +72,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
var user_profile_lastname = new Ext.form.TextField({
name: 'last_name',
fieldLabel: 'Last Name',
emptyText: '1 min, ' + maxLastNameLength + ' max',
emptyText: 'Loading...',
msgTarget: 'under',

allowBlank: false,
Expand All @@ -60,6 +81,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
maxLengthText: 'Maximum length (' + maxLastNameLength + ' characters) exceeded.',
regex: XDMoD.regex.noReservedCharacters,
regexText: reservedCharactersNotAllowedText,
disabled: true,

listeners: {
blur: XDMoD.utils.trimOnBlur,
Expand All @@ -76,7 +98,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
var user_profile_email_addr = new Ext.form.TextField({
name: 'email_address',
fieldLabel: 'E-Mail Address',
emptyText: minEmailLength + ' min, ' + maxEmailLength + ' max',
emptyText: 'Loading...',
msgTarget: 'under',
allowBlank: false,
blankText: fieldRequiredText,
Expand All @@ -85,6 +107,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
maxLength: maxEmailLength,
maxLengthText: 'Maximum length (' + maxEmailLength + ' characters) exceeded.',
validator: XDMoD.validator.email,
disabled: true,

listeners: {
blur: XDMoD.utils.trimOnBlur,
Expand Down Expand Up @@ -162,7 +185,12 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {

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

this.cbProfile = function (options, success, response) {
var user_profile_most_privileged_role;
var btnUpdate;
this.processHttpResponse = function () {
var success = this.responseArgs.success;
var response = this.responseArgs.response;
this.responseArgs = null;
// If success reported, attempt to extract user data.
var data;
var decodedSuccessResponse;
Expand All @@ -172,9 +200,23 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
}

if (decodedSuccessResponse) {
user_profile_firstname.emptyText = (
'1 min, ' + maxFirstNameLength + ' max'
);
user_profile_firstname.setValue(data.results.first_name);
user_profile_firstname.setDisabled(false);

user_profile_lastname.emptyText = (
'1 min, ' + maxLastNameLength + ' max'
);
user_profile_lastname.setValue(data.results.last_name);
user_profile_lastname.setDisabled(false);

user_profile_email_addr.emptyText = (
minEmailLength + ' min, ' + maxEmailLength + ' max'
);
user_profile_email_addr.setValue(data.results.email_address);
user_profile_email_addr.setDisabled(false);

// ================================================

Expand All @@ -190,21 +232,12 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
}
}

// ================================================
// eslint-disable-next-line no-use-before-define
lblRole.on(
'afterrender',
function () {
// eslint-disable-next-line no-undef
document.getElementById('profile_editor_most_privileged_role').innerHTML = data.results.most_privileged_role;
}
);

self.parentWindow.show();
user_profile_most_privileged_role.update(data.results.most_privileged_role);
btnUpdate.setDisabled(false);
} else {
Ext.MessageBox.alert('My Profile', 'There was a problem retrieving your profile information.');
}
}; // cbProfile
}; // processHttpResponse

// ------------------------------------------------
var optPasswordUpdate;
Expand Down Expand Up @@ -290,8 +323,10 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {

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

var lblRole = new Ext.form.Label({
html: '<div style="width: 300px; font-size: 12px; padding-top: 5px">Top Role: <b style="margin-left: 45px"><span id="profile_editor_most_privileged_role"></span></b><br /></div>'
user_profile_most_privileged_role = new Ext.form.DisplayField({
fieldLabel: 'Top Role',
html: 'Loading...',
id: 'user_profile_most_privileged_role'
});

// ------------------------------------------------
Expand All @@ -315,7 +350,7 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
user_profile_lastname,
user_profile_email_addr,

lblRole
user_profile_most_privileged_role
// cmbFieldOfScience

]
Expand Down Expand Up @@ -412,11 +447,12 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
// ------------------------------------------------


var btnUpdate = new Ext.Button({
btnUpdate = new Ext.Button({

iconCls: 'user_profile_btn_update_icon',
cls: 'user_profile_btn_update',
text: 'Update',
disabled: true,
handler: function () {
updateProfile();
} // handler
Expand Down Expand Up @@ -445,6 +481,19 @@ XDMoD.ProfileGeneralSettings = Ext.extend(Ext.form.FormPanel, {
});

XDMoD.ProfileGeneralSettings.superclass.initComponent.call(this);
} // initComponent
}, // initComponent

handleOpenEvent: function () {
this.hasBeenClosed = false;
// If a response arrived while the window was opening, process it now.
if (this.responseArgs !== null) {
this.processHttpResponse();
}
},

handleCloseEvent: function () {
this.hasBeenClosed = true;
this.responseArgs = null;
}

}); // XDMoD.ProfileGeneralSettings
3 changes: 2 additions & 1 deletion tests/ui/test/specs/xdmod/myProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ describe('My Profile Tests', function generalTests() {
browser.waitForAllInvisible('.ext-el-mask');
browser.waitForVisible(myProfile.toolbarButton, 3000);
browser.waitForLoadedThenClick(myProfile.toolbarButton);
browser.waitForVisible(myProfile.container, 20000);
browser.waitForVisible(myProfile.container, 1000);
browser.waitForEnabled(selectors.general.user_information.first_name(), 3000);
});

describe('Check User Information', function checkUserInformation() {
Expand Down
Loading

0 comments on commit 2e6b0ed

Please sign in to comment.