Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
mark read lengths as obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
risufaj committed Dec 5, 2018
1 parent b319a93 commit 567a331
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
5 changes: 5 additions & 0 deletions library_sample_shared/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class ReadLengthViewSet(viewsets.ReadOnlyModelViewSet):
queryset = ReadLength.objects.filter(obsolete=settings.NON_OBSOLETE)
serializer_class = ReadLengthSerializer

class ReadLengthInvoicingViewSet(viewsets.ReadOnlyModelViewSet):

queryset = ReadLength.objects.all()
serializer_class = ReadLengthSerializer


class ConcentrationMethodViewSet(viewsets.ReadOnlyModelViewSet):
""" Get the list of concentration methods. """
Expand Down
1 change: 1 addition & 0 deletions static/main-hub/app/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Ext.define('MainHub.Application', {
'invoicing.LibraryPreparationCosts',
'invoicing.SequencingCosts',
'invoicing.LibraryProtocolsInvoicing',
'invoicing.ReadLengthsInvoicing',
'usage.Records',
'usage.Organizations',
'usage.PrincipalInvestigators',
Expand Down
27 changes: 27 additions & 0 deletions static/main-hub/app/store/invoicing/ReadLengthsInvoicing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Ext.define('MainHub.store.invoicing.ReadLengthsInvoicing', {
extend: 'Ext.data.Store',
storeId: 'readLengthsInvoicingStore',

requires: [
'MainHub.model.libraries.ReadLength'
],

model: 'MainHub.model.libraries.ReadLength',

proxy: {
type: 'ajax',
url: 'api/read_lengths_invoicing/',
timeout: 1000000,
pageParam: false, //to remove param "page"
startParam: false, //to remove param "start"
limitParam: false, //to remove param "limit"
noCache: false, //to remove param "_dc",
reader: {
type: 'json',
rootProperty: 'data',
successProperty: 'success'
}
},

autoLoad: true
});
2 changes: 1 addition & 1 deletion static/main-hub/app/view/invoicing/InvoicingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Ext.define('MainHub.view.invoicing.InvoicingController', {
},

readLengthRenderer: function (value, meta) {
var store = Ext.getStore('readLengthsStore');
var store = Ext.getStore('readLengthsInvoicingStore');
var items = value.map(function (id) {
var record = store.findRecord('id', id, 0, false, true, true);
return record.get('name');
Expand Down
4 changes: 3 additions & 1 deletion wui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
LibraryTypeViewSet,
ReadLengthViewSet,
ConcentrationMethodViewSet,
LibraryProtocolInvoicingViewSet
LibraryProtocolInvoicingViewSet,
ReadLengthInvoicingViewSet
)
from library.views import LibrarySampleTree, LibraryViewSet
from sample.views import NucleicAcidTypeViewSet, SampleViewSet
Expand Down Expand Up @@ -47,6 +48,7 @@
router.register(r'indices', IndexViewSet, base_name='index')
router.register(r'library_protocols', LibraryProtocolViewSet, base_name='library-protocol')
router.register(r'library_protocols_invoicing', LibraryProtocolInvoicingViewSet, base_name='library-protocol-invoicing')
router.register(r'read_lengths_invoicing',ReadLengthInvoicingViewSet, base_name='read-lengths-invoicing')
router.register(r'library_types', LibraryTypeViewSet, base_name='library-type')
router.register(r'nucleic_acid_types', NucleicAcidTypeViewSet, base_name='nucleic-acid-type')
router.register(r'pool_sizes', PoolSizeViewSet, base_name='pool-size')
Expand Down

0 comments on commit 567a331

Please sign in to comment.