Skip to content

Commit

Permalink
Pool Paths (#79)
Browse files Browse the repository at this point in the history
Co-authored-by: Saurabh Dome <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 20, 2023
1 parent b1d7574 commit bc1b62a
Show file tree
Hide file tree
Showing 158 changed files with 9,981 additions and 9,291 deletions.
169 changes: 88 additions & 81 deletions backend/static/main-hub/app/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,92 @@
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext.ux': 'static/main-hub/ext/packages/ux/classic/src/'
}
"Ext.ux": "static/main-hub/ext/packages/ux/classic/src/",
},
});

// Ext.util.Format.decimalSeparator = ',';
// Ext.util.Format.thousandSeparator = '.';
Ext.util.Format.deMoney = function (v) {
return Ext.util.Format.currency(v, '€', 2, true, ' ');
return Ext.util.Format.currency(v, "€", 2, true, " ");
};
Ext.Date.defaultFormat = 'd.m.Y';
Ext.Date.defaultFormat = "d.m.Y";

Ext.define('MainHub.Application', {
extend: 'Ext.app.Application',
Ext.define("MainHub.Application", {
extend: "Ext.app.Application",

name: 'MainHub',
name: "MainHub",

appFolder: '/static/main-hub/app',
appFolder: "/static/main-hub/app",

stores: [
'NavigationTree',
'requests.Requests',
'requests.RequestFiles',
'requests.CostUnits',
'libraries.Libraries',
'libraries.LibraryProtocols',
'libraries.LibraryTypes',
'libraries.Organisms',
'libraries.IndexTypes',
'libraries.IndexI7',
'libraries.IndexI5',
'libraries.ConcentrationMethods',
'libraries.ReadLengths',
'libraries.NucleicAcidTypes',
'libraries.RNAQuality',
'incominglibraries.IncomingLibraries',
'indexgenerator.PoolSizes',
'indexgenerator.StartCoordinates',
'indexgenerator.GeneratorIndexTypes',
'requests.LibrariesInRequest',
'indexgenerator.IndexGenerator',
'librarypreparation.LibraryPreparation',
'pooling.Pooling',
'flowcell.Flowcells',
'flowcell.Sequencer',
'flowcell.Lanes',
'flowcell.Pool',
'flowcell.PoolInfo',
'invoicing.BillingPeriods',
'invoicing.Invoicing',
'invoicing.FixedCosts',
'invoicing.LibraryPreparationCosts',
'invoicing.SequencingCosts',
'invoicing.LibraryProtocolsInvoicing',
'invoicing.ReadLengthsInvoicing',
'usage.Records',
'usage.Organizations',
'usage.PrincipalInvestigators',
'usage.LibraryTypes',
'statistics.RunStatistics',
'statistics.Sequences',
'metadataexporter.Samples',
'metadataexporter.StudyTypes',
'metadataexporter.LibrarySources',
'metadataexporter.LibrarySelections'
"NavigationTree",
"requests.Requests",
"requests.RequestFiles",
"requests.CostUnits",
"libraries.Libraries",
"libraries.LibraryProtocols",
"libraries.LibraryTypes",
"libraries.Organisms",
"libraries.IndexTypes",
"libraries.IndexI7",
"libraries.IndexI5",
"libraries.ConcentrationMethods",
"libraries.ReadLengths",
"libraries.NucleicAcidTypes",
"libraries.RNAQuality",
"incominglibraries.IncomingLibraries",
"indexgenerator.PoolSizes",
"indexgenerator.StartCoordinates",
"indexgenerator.GeneratorIndexTypes",
"requests.LibrariesInRequest",
"indexgenerator.IndexGenerator",
"librarypreparation.LibraryPreparation",
"pooling.Pooling",
"flowcell.Flowcells",
"flowcell.Sequencer",
"flowcell.Lanes",
"flowcell.Pool",
"flowcell.PoolInfo",
"invoicing.BillingPeriods",
"invoicing.Invoicing",
"invoicing.FixedCosts",
"invoicing.LibraryPreparationCosts",
"invoicing.SequencingCosts",
"invoicing.LibraryProtocolsInvoicing",
"invoicing.ReadLengthsInvoicing",
"usage.Records",
"usage.Organizations",
"usage.PrincipalInvestigators",
"usage.LibraryTypes",
"statistics.RunStatistics",
"statistics.Sequences",
"metadataexporter.Samples",
"metadataexporter.StudyTypes",
"metadataexporter.LibrarySources",
"metadataexporter.LibrarySelections",
],

requires: [
'Ext.ux.ToastMessage'
],
requires: ["Ext.ux.ToastMessage"],

launch: function () {
// TODO - Launch the application
},

onAppUpdate: function () {
Ext.Msg.confirm('Application Update', 'This application has an update, reload?',
Ext.Msg.confirm(
"Application Update",
"This application has an update, reload?",
function (choice) {
if (choice === 'yes') {
if (choice === "yes") {
window.location.reload();
}
}
);
}
},
});

Ext.define('MainHub.Utilities', {
Ext.define("MainHub.Utilities", {
singleton: true,
getDataIndex: function (e, view) {
var xPos = e.getXY()[0];
Expand All @@ -109,64 +109,67 @@ Ext.define('MainHub.Utilities', {
}

return dataIndex;
}
},
});

Ext.define('MainHub.grid.SearchInputMixin', {
Ext.define("MainHub.grid.SearchInputMixin", {
changeFilter: function (el, value) {
var grid = el.up('grid');
var grid = el.up("grid");
var store = grid.getStore();
var columns = Ext.pluck(grid.getColumns(), 'dataIndex');
var columns = Ext.pluck(grid.getColumns(), "dataIndex");

store.clearFilter();
store.filterBy(function (record) {
var res = false;
Ext.each(columns, function (column) {
if (
record.data[column] &&
record.data[column].toString().toLowerCase().indexOf(value.toLowerCase()) > -1
record.data[column]
.toString()
.toLowerCase()
.indexOf(value.toLowerCase()) > -1
) {
res = res || true;
}
});
return res;
});
}
},
});

Ext.define('MainHub.grid.CheckboxesAndSearchInputMixin', {
Ext.define("MainHub.grid.CheckboxesAndSearchInputMixin", {
changeFilter: function (el, value) {
var grid = el.up('grid');
var grid = el.up("grid");
var store = grid.getStore();
var columns = Ext.pluck(grid.getColumns(), 'dataIndex');
var columns = Ext.pluck(grid.getColumns(), "dataIndex");
var showLibraries;
var showSamples;
var searchQuery;

if (el.itemId === 'show-libraries-checkbox') {
if (el.itemId === "show-libraries-checkbox") {
showLibraries = value;
showSamples = el.up().items.items[1].getValue();
searchQuery = el.up('header').down('textfield').getValue();
} else if (el.itemId === 'show-samples-checkbox') {
searchQuery = el.up("header").down("textfield").getValue();
} else if (el.itemId === "show-samples-checkbox") {
showLibraries = el.up().items.items[0].getValue();
showSamples = value;
searchQuery = el.up('header').down('textfield').getValue();
} else if (el.itemId === 'search-field') {
showLibraries = el.up().down('fieldcontainer').items.items[0].getValue();
showSamples = el.up().down('fieldcontainer').items.items[1].getValue();
searchQuery = el.up("header").down("textfield").getValue();
} else if (el.itemId === "search-field") {
showLibraries = el.up().down("fieldcontainer").items.items[0].getValue();
showSamples = el.up().down("fieldcontainer").items.items[1].getValue();
searchQuery = value;
}

var showFilter = Ext.util.Filter({
filterFn: function (record) {
var res = false;
if (record.get('record_type') === 'Library') {
if (record.get("record_type") === "Library") {
res = res || showLibraries;
} else {
res = res || showSamples;
}
return res;
}
},
});

var searchFilter = Ext.util.Filter({
Expand All @@ -175,18 +178,22 @@ Ext.define('MainHub.grid.CheckboxesAndSearchInputMixin', {
if (searchQuery) {
Ext.each(columns, function (column) {
var val = record.get(column);
if (val && val.toString().toLowerCase().indexOf(searchQuery.toLowerCase()) > -1) {
if (
val &&
val.toString().toLowerCase().indexOf(searchQuery.toLowerCase()) >
-1
) {
res = res || true;
}
});
} else {
res = true;
}
return res;
}
},
});

store.clearFilter();
store.filter([showFilter, searchFilter]);
}
},
});
76 changes: 38 additions & 38 deletions backend/static/main-hub/app/components/BaseGrid.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
Ext.define('MainHub.components.BaseGrid', {
extend: 'Ext.grid.Panel',
alias: 'widget.basegrid',
Ext.define("MainHub.components.BaseGrid", {
extend: "Ext.grid.Panel",
alias: "widget.basegrid",

requires: [
'MainHub.components.BaseGridController'
],
requires: ["MainHub.components.BaseGridController"],

controller: 'basegrid',
controller: "basegrid",

height: Ext.Element.getViewportHeight() - 64,
region: 'center',
region: "center",
padding: 15,

viewConfig: {
stripeRows: false
stripeRows: false,
// loadMask: false,
// markDirty: false
},

customConfig: {
qualityCheckMenuOptions: []
qualityCheckMenuOptions: [],
},

selModel: {
type: 'spreadsheet',
rowSelect: false
type: "spreadsheet",
rowSelect: false,
},

sortableColumns: false,
enableColumnMove: false,

plugins: [
{
ptype: 'bufferedrenderer',
ptype: "bufferedrenderer",
trailingBufferZone: 100,
leadingBufferZone: 100
leadingBufferZone: 100,
},
{
ptype: 'rowediting',
clicksToEdit: 1
ptype: "rowediting",
clicksToEdit: 1,
},
{
ptype: 'clipboard'
ptype: "clipboard",
},
{
ptype: 'gridfilters'
}
ptype: "gridfilters",
},
],

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [
'->',
{
xtype: 'button',
itemId: 'cancel-button',
iconCls: 'fa fa-ban fa-lg',
text: 'Cancel'
},
{
xtype: 'button',
itemId: 'save-button',
iconCls: 'fa fa-floppy-o fa-lg',
text: 'Save'
}
]
}]
dockedItems: [
{
xtype: "toolbar",
dock: "bottom",
items: [
"->",
{
xtype: "button",
itemId: "cancel-button",
iconCls: "fa fa-ban fa-lg",
text: "Cancel",
},
{
xtype: "button",
itemId: "save-button",
iconCls: "fa fa-floppy-o fa-lg",
text: "Save",
},
],
},
],
});
Loading

0 comments on commit bc1b62a

Please sign in to comment.