-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow folder-level setting of 10x defaults
- Loading branch information
Showing
6 changed files
with
250 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
singlecell/resources/web/singlecell/panel/TenxSettingsPanel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
Ext4.define('SingleCell.panel.TenxSettingsPanel', { | ||
extend: 'Ext.panel.Panel', | ||
alias: 'widget.singlecell-tenxsettingspanel', | ||
|
||
hidePageLoadWarning: true, | ||
hideButtons: false, | ||
maxWidth: 650, | ||
|
||
initComponent: function(){ | ||
Ext4.applyIf(this, { | ||
bodyStyle: 'padding: 5px;', | ||
items: [{ | ||
html: 'Loading...', | ||
border: false | ||
}], | ||
buttons: this.hideButtons ? null : SingleCell.panel.TenxSettingsPanel.getButtons() | ||
}); | ||
|
||
this.callParent(arguments); | ||
|
||
LABKEY.Ajax.request({ | ||
method: 'POST', | ||
url: LABKEY.ActionURL.buildURL('singlecell', 'getTenXImportDefaults'), | ||
scope: this, | ||
success: this.onDataLoad, | ||
failure: LDK.Utils.getErrorCallback() | ||
}); | ||
}, | ||
|
||
onDataLoad: function(response){ | ||
LDK.Utils.decodeHttpResponseJson(response); | ||
this.removeAll(); | ||
|
||
if (response.responseJSON){ | ||
var configDefaults = response.responseJSON; | ||
var items = [{ | ||
html: 'Note: you must reload this page before any change will be applied.', | ||
border: false, | ||
hidden: !!this.hidePageLoadWarning | ||
},{ | ||
xtype: 'checkbox', | ||
fieldLabel: 'Require Assay Type', | ||
labelWidth: 300, | ||
itemId: 'requireAssayType', | ||
checked: !!JSON.parse(configDefaults.requireAssayType) | ||
},{ | ||
xtype: 'checkbox', | ||
fieldLabel: 'Combine Hashing and Cite-Seq', | ||
labelWidth: 300, itemId: 'combineHashingCite', | ||
checked: !!JSON.parse(configDefaults.combineHashingCite) | ||
}]; | ||
|
||
this.add(items); | ||
} | ||
else { | ||
this.add({html: 'Something went wrong loading saved data'}); | ||
} | ||
}, | ||
|
||
statics: { | ||
getButtons: function () { | ||
return [{ | ||
text: 'Submit', | ||
handler: function (btn) { | ||
var win = btn.up('window'); | ||
var panel = win ? win.down('singlecell-tenxsettingspanel') : btn.up('singlecell-tenxsettingspanel'); | ||
|
||
var params = {}; | ||
params['requireAssayType'] = panel.down('#requireAssayType').getValue(); | ||
params['combineHashingCite'] = panel.down('#combineHashingCite').getValue(); | ||
|
||
Ext4.Msg.wait('Saving...'); | ||
LABKEY.Ajax.request({ | ||
method: 'POST', | ||
url: LABKEY.ActionURL.buildURL('singlecell', 'setTenXImportDefaults'), | ||
jsonData: params, | ||
scope: panel, | ||
success: panel.onSuccess, | ||
failure: LDK.Utils.getErrorCallback() | ||
}) | ||
} | ||
}]; | ||
} | ||
}, | ||
|
||
onSuccess: function(){ | ||
Ext4.Msg.hide(); | ||
Ext4.Msg.alert('Success', 'Settings have been saved'); | ||
|
||
if (this.up('window')){ | ||
this.up('window').close(); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters