eLabSDK.Inventory
addTopNotice(noticeToAdd)
Add a warning or informational notice to the top of inventory storage unit pages.
This displays a prominent notice banner at the top of storage unit or storage layer detail
pages. The notice can include an icon and custom HTML content, styled with warning colors
to draw attention. Useful for displaying important information, warnings, or contextual
help to users viewing inventory storage locations. The notice is only added once (checked
by ID) to prevent duplicates.
Kind: global function
| Param | Type | Description |
|---|---|---|
| noticeToAdd | Object | Configuration object for the notice to add |
| noticeToAdd.id | string | Unique identifier for the notice (prevents duplicates) |
| noticeToAdd.icon | string | FontAwesome icon class (e.g., 'fas fa-exclamation-circle', 'fas fa-info-circle') |
| noticeToAdd.contents | string | HTML content to display in the notice |
Example
// Add warning notice to storage unit page
eLabSDK.ready(function() {
var inventory = new eLabSDK.Inventory();
inventory.addTopNotice({
id: 'temperatureWarning',
icon: 'fas fa-exclamation-triangle',
contents: '<p><strong>Warning:</strong> This storage unit requires -80°C temperature.</p>'
});
});
Example
// Add informational notice
eLabSDK.ready(function() {
var inventory = new eLabSDK.Inventory();
inventory.addTopNotice({
id: 'maintenanceNotice',
icon: 'fas fa-info-circle',
contents: '<p>This freezer is scheduled for maintenance on Friday.</p>'
});
});
Example
// Add notice with custom HTML content
eLabSDK.ready(function() {
var inventory = new eLabSDK.Inventory();
inventory.addTopNotice({
id: 'capacityAlert',
icon: 'fas fa-exclamation-circle',
contents: '<div>' +
'<strong>Storage Capacity Alert</strong>' +
'<p>This unit is at 95% capacity. Please relocate samples before adding more.</p>' +
'<a href="/inventory/manage">Manage Storage</a>' +
'</div>'
});
});
Example
// Conditional notice based on storage properties
eLabSDK.ready(function() {
var inventory = new eLabSDK.Inventory();
// Get storage unit data
$.get('/api/v1/storageunits/123', function(storageUnit) {
if (storageUnit.temperature < -70) {
inventory.addTopNotice({
id: 'ultraLowTempNotice',
icon: 'fas fa-snowflake',
contents: '<p><strong>Ultra-Low Temperature Storage:</strong> Special PPE required.</p>'
});
}
});
});
© 2023 eLabNext
Updated about 4 hours ago