scinote-web/app/assets/javascripts/sitewide/dropdown_selector.js

1068 lines
38 KiB
JavaScript
Raw Normal View History

2019-08-26 21:49:33 +08:00
/* global PerfectScrollbar activePSB PerfectSb I18n */
2019-08-07 16:25:58 +08:00
/* eslint-disable no-unused-vars, no-use-before-define */
2019-11-21 19:19:47 +08:00
/*
Data options for SELECT:
data-ajax-url // Url for GET ajax request
data-select-by-group // Add groups to dropdown
data-disable-placeholder // Placeholder for disabled fields
data-placeholder // Search placeholder
data-select-hint // A hint on top of a dropdown
data-disable-on-load // Disable input after initialization
data-select-all-button // Text for select all button
2019-12-06 20:18:35 +08:00
data-combine-tags // Combine multiple tags to one (in simple mode gives you multiple select)
data-select-multiple-all-selected // Text for combine tags, when all selected
data-select-multiple-name // Text for combine tags, when select more than one tag
data-view-mode // Run in view mode
Initialization
dropdownSelector.init('#select-element', config)
config = {
localFilter: function(data), // Filter non-AJAX data
optionLabel: function(option), // Change option label
optionClass: string, // Add class to option
optionStyle: string, // Add style to option
tagLabel: function(tag), // Change tag label (only for tags)
tagClass: string, // Add class to tag (only for tags)
tagStyle: string, // Add style to tag (only for tags)
ajaxParams: function(params), // Customize params to AJAX request
onOpen: function(), // Run action on open options container
onClose: function(), // Run action on close options container
onSelect: function(), // Run action after select
onChange: function(), // Run action after change
onUnSelect: function(), // Run action after unselect
customDropdownIcon: function(), // Add custom dropdown icon
inputTagMode: boolean, // Use as simple input tag field
2019-11-24 04:09:34 +08:00
selectKeys: array, // array of keys id which use for fast select // default - [13]
noEmptyOption: boolean, // use defaut select (only for single option select). default 'false'
singleSelect: boolean, // disable multiple select. default 'false'
selectAppearance: string, // 'tag' or 'simple'. Default 'tag'
closeOnSelect: boolean, // Close dropdown after select
disableSearch: boolean, // Disable search
2020-02-07 21:57:07 +08:00
emptyOptionAjax: boolean, // Add empty option for ajax request
labelHTML: bolean, // render as HTMLelement or text
}
*/
2019-08-02 21:57:41 +08:00
var dropdownSelector = (function() {
2019-08-07 16:25:58 +08:00
// /////////////////////
// Support functions //
// ////////////////////
const MAX_DROPDOWN_HEIGHT = 320;
2019-08-07 16:25:58 +08:00
// Change direction of dropdown depends of container position
function updateDropdownDirection(selector, container) {
var windowHeight = $(window).height();
var containerPosition = container[0].getBoundingClientRect().top;
2020-01-13 21:46:43 +08:00
var containerPositionLeft = container[0].getBoundingClientRect().left;
2019-08-07 16:25:58 +08:00
var containerHeight = container[0].getBoundingClientRect().height;
var containerWidth = container[0].getBoundingClientRect().width;
var bottomSpace;
var modalContainer = container.closest('.modal-dialog');
var modalContainerBottom = 0;
var maxHeight = 0;
2020-05-11 21:11:12 +08:00
const bottomTreshold = 280;
if (modalContainer.length && windowHeight !== modalContainer.height()) {
2020-05-11 20:53:28 +08:00
let modalClientRect = modalContainer[0].getBoundingClientRect();
windowHeight = modalContainer.height() + modalClientRect.top;
containerPositionLeft -= modalClientRect.left;
modalContainerBottom = windowHeight + modalClientRect.bottom;
2019-12-11 21:49:14 +08:00
maxHeight += modalContainerBottom;
}
bottomSpace = windowHeight - containerPosition - containerHeight;
2019-12-11 21:49:14 +08:00
2020-05-11 21:11:12 +08:00
if ((modalContainerBottom + bottomSpace) < bottomTreshold) {
2019-08-07 16:25:58 +08:00
container.addClass('inverse');
maxHeight = Math.min(containerPosition - 122 + maxHeight, MAX_DROPDOWN_HEIGHT);
container.find('.dropdown-container').css('max-height', `${maxHeight}px`)
2019-08-07 16:25:58 +08:00
.css('margin-bottom', `${(containerPosition * -1)}px`)
2020-01-13 21:46:43 +08:00
.css('left', `${containerPositionLeft}px`)
2019-08-07 16:25:58 +08:00
.css('width', `${containerWidth}px`);
} else {
container.removeClass('inverse');
maxHeight = Math.min(bottomSpace - 32 + maxHeight, MAX_DROPDOWN_HEIGHT);
container.find('.dropdown-container').css('max-height', `${maxHeight}px`)
.css('width', `${containerWidth}px`)
2020-01-13 21:46:43 +08:00
.css('left', `${containerPositionLeft}px`)
2019-12-11 21:49:14 +08:00
.css('margin-top', `${(bottomSpace * -1)}px`);
2019-08-07 16:25:58 +08:00
}
}
// Get data in JSON from field
function getCurrentData(container) {
if (!container.find('.data-field').val()) {
return '';
}
2019-08-07 16:25:58 +08:00
return JSON.parse(container.find('.data-field').val());
}
// Save data to the field
function updateCurrentData(container, data) {
container.find('.data-field').val(JSON.stringify(data)).change();
2019-08-07 16:25:58 +08:00
}
// Search filter for non-ajax data
function filterOptions(selector, container, options) {
var customFilter = selector.data('config').localFilter;
2019-08-26 21:49:33 +08:00
var searchQuery = container.find('.search-field').val();
var data = customFilter ? customFilter(options) : options;
if (searchQuery.length === 0) return data;
return $.grep(data, (n) => {
2019-08-07 16:25:58 +08:00
return n.label.toLowerCase().includes(searchQuery.toLowerCase());
});
}
// Check if all options selected, for non ajax data
function allOptionsSelected(selector, container) {
return JSON.parse(container.find('.data-field').val()).length === selector.find('option').length && !(selector.data('ajax-url'));
}
// Update dropdown selection, based on save data
function refreshDropdownSelection(selector, container) {
container.find('.dropdown-option, .dropdown-group').removeClass('select');
$.each(getCurrentData(container), function(i, selectedOption) {
container.find(`.dropdown-option[data-value="${selectedOption.value}"][data-group="${selectedOption.group || ''}"]`)
2019-08-07 16:25:58 +08:00
.addClass('select');
});
if (selector.data('select-by-group')) {
$.each(container.find('.dropdown-group'), function(gi, group) {
if ($(group).find('.dropdown-option').length === $(group).find('.dropdown-option.select').length) {
$(group).addClass('select');
}
});
}
}
function enableViewMode(selector, container) {
container
.addClass('view-mode disabled')
.removeClass('open')
.find('.search-field').prop('disabled', true);
}
2019-08-26 21:49:33 +08:00
function disableEnableDropdown(selector, container, mode) {
var searchFieldValue = container.find('.search-field');
if (mode) {
if ($(selector).data('ajax-url')) {
updateCurrentData(container, []);
}
updateTags(selector, container, { skipChange: true });
2019-12-06 20:18:35 +08:00
searchFieldValue.attr('placeholder', selector.data('disable-placeholder') || '');
container.addClass('disabled').removeClass('open')
2019-08-26 21:49:33 +08:00
.find('.search-field').val('')
.prop('disabled', true);
} else {
container.removeClass('disabled')
2019-08-26 21:49:33 +08:00
.find('.search-field').prop('disabled', false);
updateTags(selector, container, { skipChange: true });
}
}
2019-10-17 16:06:40 +08:00
// Read option to JSON
function convertOptionToJson(option) {
if (option === undefined) {
return { label: '', value: '', params: {} };
}
2019-10-17 16:06:40 +08:00
return {
2019-10-18 17:31:13 +08:00
label: option.innerHTML,
value: option.value,
group: option.dataset.group || '',
params: JSON.parse(option.dataset.params || '{}')
2019-10-18 17:31:13 +08:00
};
2019-10-17 16:06:40 +08:00
}
function noOptionsForSelect(selector) {
return !$(selector).data('ajax-url') && $(selector).find('.dropdown-option').length == 0;
}
2019-10-17 16:06:40 +08:00
// Ajax intial values, we will use default options //
function ajaxInitialValues(selector, container) {
2019-10-18 17:31:13 +08:00
var intialData = [];
2019-10-17 16:06:40 +08:00
$(selector).find('option').each((i, option) => {
2019-10-18 17:31:13 +08:00
intialData.push(convertOptionToJson(option));
});
updateCurrentData(container, intialData);
2019-10-17 16:06:40 +08:00
updateTags(selector, container, { skipChange: true });
}
// Add selected option to value
2020-08-12 19:54:05 +08:00
function addSelectedOptions(selector, container) {
var selectedOptions = [];
var optionSelector = selector.data('config').noEmptyOption ? 'option:selected' : 'option[data-selected=true]';
$.each($(selector).find(optionSelector), function(i, option) {
selectedOptions.push(convertOptionToJson(option));
if (selector.data('config').singleSelect) return false;
return true;
});
if (!selectedOptions.length) return false;
setData(selector, selectedOptions, true);
return true;
}
2019-10-18 17:31:13 +08:00
// Prepare custom dropdown icon
function prepareCustomDropdownIcon(selector, config) {
if (config.inputTagMode && noOptionsForSelect(selector)) {
return '';
}
2019-10-18 17:31:13 +08:00
if (config.customDropdownIcon) {
return config.customDropdownIcon();
}
return '<i class="fas fa-caret-down right-icon"></i><i class="fas fa-search right-icon simple-dropdown"></i>';
2019-10-18 17:31:13 +08:00
}
// Set new data
function setData(selector, data, skipSelect) {
updateCurrentData(selector.next(), data);
refreshDropdownSelection(selector, selector.next());
updateTags(selector, selector.next(), { select: true, skipSelect: skipSelect });
}
// Delete specific value
function deleteValue(selector, container, value, group = '', skipUnselect = false) {
var selectedOptions = getCurrentData(container);
var toDelete = selectedOptions.findIndex(x => (String(x.value) === String(value)
&& (String(x.group) === String(group) || !selector.data('select-by-group'))
));
selectedOptions.splice(toDelete, 1);
updateCurrentData(container, selectedOptions);
updateTags(selector, container, { unselect: true, tagId: value, skipUnselect: skipUnselect });
}
// Function generate new tag
function addNewTag(selector, container) {
var searchField = container.find('.search-field');
var selectArray = getCurrentData(container);
var newTag = {
label: searchField.val(),
value: searchField.val()
};
$.each(selectArray, function() {
if (this.value === newTag.value) searchField.val('');
});
if (searchField.val().length <= 1) return;
selectArray.push(newTag);
searchField.val('');
updateCurrentData(container, selectArray);
updateTags(selector, container, { select: true });
}
// initialize keyboard control
function initKeyboardControl(selector, container) {
2019-11-24 04:09:34 +08:00
container.find('.search-field').keydown(function(e) {
var dropdownContainer = container.find('.dropdown-container');
var pressedKey = e.keyCode;
var selectedOption = dropdownContainer.find('.highlight');
if (selectedOption.length === 0 && (pressedKey === 38 || pressedKey === 40)) {
dropdownContainer.find('.dropdown-option').first().addClass('highlight');
}
if (pressedKey === 38) { // arrow up
2019-11-24 04:09:34 +08:00
if (selectedOption.prev('.dropdown-option').length) {
selectedOption.removeClass('highlight').prev().addClass('highlight');
}
if (selectedOption.prev('.delimiter').length) {
selectedOption.removeClass('highlight').prev().prev().addClass('highlight');
2019-11-24 04:09:34 +08:00
}
} else if (pressedKey === 40) { // arrow down
2019-11-24 04:09:34 +08:00
if (selectedOption.next('.dropdown-option').length) {
selectedOption.removeClass('highlight').next().addClass('highlight');
}
if (selectedOption.next('.delimiter').length) {
selectedOption.removeClass('highlight').next().next().addClass('highlight');
2019-11-24 04:09:34 +08:00
}
} else if (pressedKey === 8 && e.target.value === '') { // backspace
deleteTag(selector, container, container.find('.ds-tags .fa-times').last());
2019-11-24 04:09:34 +08:00
}
});
}
2019-08-07 16:25:58 +08:00
// //////////////////////
// Private functions ///
// /////////////////////
// Initialization of dropdown
function generateDropdown(selector, config = {}) {
var selectElement = $(selector);
2019-08-05 23:21:58 +08:00
var optionContainer;
2019-08-26 21:49:33 +08:00
var perfectScroll;
var dropdownContainer;
var toggleElement;
2019-12-02 23:04:50 +08:00
if (selectElement.length === 0) return;
// Check if element exist or already initialized
2019-12-02 23:04:50 +08:00
if (selectElement.next().hasClass('dropdown-selector-container')) selectElement.next().remove();
// Create initial container after select block
dropdownContainer = selectElement.after('<div class="dropdown-selector-container"></div>').next();
2019-08-06 21:25:52 +08:00
// Save config info to select element
2019-08-07 16:25:58 +08:00
selectElement.data('config', config);
2019-08-06 21:25:52 +08:00
// Draw main elements
2019-08-02 21:57:41 +08:00
$(`
<div class="dropdown-container"></div>
2019-08-06 21:25:52 +08:00
<div class="input-field">
<input type="text" class="search-field" data-options-selected=0 placeholder="${selectElement.data('placeholder') || ''}"></input>
${prepareCustomDropdownIcon(selector, config)}
2019-08-06 21:25:52 +08:00
</div>
<input type="hidden" class="data-field" value="[]">
2019-08-07 16:25:58 +08:00
`).appendTo(dropdownContainer);
2019-08-02 21:57:41 +08:00
// Blank option
if (selectElement.data('blank')) {
$(`<div class="dropdown-blank btn">${selectElement.data('blank')}</div>`)
.appendTo(dropdownContainer.find('.dropdown-container'))
.click(() => {
dropdownContainer.find('.dropdown-group, .dropdown-option').removeClass('select');
saveData(selectElement, dropdownContainer);
dropdownContainer.removeClass('open');
});
}
if (selectElement.data('toggle-target')) {
dropdownContainer.find('.data-field').on('change', function() {
toggleElement = $(selectElement.data('toggle-target'));
if (getCurrentData(dropdownContainer).length > 0) {
toggleElement.removeClass('hidden');
toggleElement.find('input, select').removeAttr('disabled');
} else {
toggleElement.addClass('hidden');
toggleElement.find('input, select').attr('disabled', true);
}
});
}
// If we setup Select All we draw it and add correspond logic
2019-08-07 16:25:58 +08:00
if (selectElement.data('select-all-button')) {
2019-08-06 21:25:52 +08:00
$(`<div class="dropdown-select-all btn">${selectElement.data('select-all-button')}</div>`)
.appendTo(dropdownContainer.find('.dropdown-container'))
.click(() => {
// For AJAX dropdown we will use only "Deselect All"
2019-08-06 21:25:52 +08:00
if (allOptionsSelected(selectElement, dropdownContainer) || selectElement.data('ajax-url')) {
2019-08-07 16:25:58 +08:00
dropdownContainer.find('.dropdown-group, .dropdown-option').removeClass('select');
2019-08-06 21:25:52 +08:00
} else {
2019-08-07 16:25:58 +08:00
dropdownContainer.find('.dropdown-group, .dropdown-option').addClass('select');
2019-08-06 21:25:52 +08:00
}
2019-08-07 16:25:58 +08:00
saveData(selectElement, dropdownContainer);
});
2019-08-06 21:25:52 +08:00
}
2019-10-17 16:06:40 +08:00
if (selectElement.data('ajax-url') || config.inputTagMode) {
// If we use AJAX dropdown or tags input, options become initial values
2019-10-18 17:31:13 +08:00
ajaxInitialValues(selectElement, dropdownContainer);
2019-10-17 16:06:40 +08:00
}
// When we start typing it will dynamically update data
dropdownContainer.find('.search-field')
.keyup((e) => {
2019-11-24 04:09:34 +08:00
if (e.keyCode === 38
|| e.keyCode === 40
|| (config.selectKeys || []).includes(e.keyCode)) {
return;
}
e.stopPropagation();
2019-08-07 16:25:58 +08:00
loadData(selectElement, dropdownContainer);
})
.keypress((e) => {
2019-11-24 04:09:34 +08:00
if ((config.selectKeys || [13]).includes(e.keyCode)) {
if (config.inputTagMode) {
addNewTag(selectElement, dropdownContainer);
2019-11-24 04:09:34 +08:00
} else if (dropdownContainer.find('.highlight').length) {
dropdownContainer.find('.highlight').click();
} else {
dropdownContainer.find('.dropdown-option').first().click();
}
dropdownContainer.find('.search-field').val('');
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
e.stopPropagation();
e.preventDefault();
}
}).click((e) =>{
e.stopPropagation();
if (dropdownContainer.hasClass('open')) {
loadData(selectElement, dropdownContainer);
} else {
dropdownContainer.find('.input-field').click();
}
});
2019-08-06 21:25:52 +08:00
// Initialize scroll bar inside options container
2019-08-26 21:49:33 +08:00
perfectScroll = new PerfectScrollbar(dropdownContainer.find('.dropdown-container')[0]);
activePSB.push(perfectScroll);
2019-08-02 21:57:41 +08:00
// Select options container
2019-08-07 16:25:58 +08:00
optionContainer = dropdownContainer.find('.dropdown-container');
2019-08-05 23:21:58 +08:00
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
dropdownContainer.find('.input-field').on('focus', () => {
setTimeout(function() {
if (!dropdownContainer.hasClass('open')) {
dropdownContainer.find('.input-field').click();
}
}, 250);
});
dropdownContainer.find('.search-field').on('keydown', function(e) {
if (e.which === 9) { // Tab key
dropdownContainer.find('.search-field').val('');
if (dropdownContainer.hasClass('open') && config.onClose) {
config.onClose();
}
dropdownContainer.removeClass('open active');
}
});
// Add click event to input field
2019-08-02 21:57:41 +08:00
dropdownContainer.find('.input-field').click(() => {
// Now we can have only one dropdown opened at same time
2019-08-07 16:25:58 +08:00
$('.dropdown-selector-container').removeClass('active');
dropdownContainer.addClass('active');
$('.dropdown-selector-container:not(.active)').removeClass('open');
// If dropdown disabled or we use it in only tag mode we not open it
if (dropdownContainer.hasClass('disabled') || (config.inputTagMode && noOptionsForSelect(selector))) return;
// Each time we open option contianer we must scroll it
2019-08-07 16:25:58 +08:00
optionContainer.scrollTo(0);
// Now open/close option container
2019-08-07 16:25:58 +08:00
dropdownContainer.toggleClass('open');
if (dropdownContainer.hasClass('open')) {
// on Open we load new data
2019-08-07 16:25:58 +08:00
loadData(selectElement, dropdownContainer);
updateDropdownDirection(selectElement, dropdownContainer);
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
2019-09-12 20:11:27 +08:00
dropdownContainer.find('.search-field').focus();
2019-10-18 17:31:13 +08:00
// onOpen event
if (config.onOpen) {
config.onOpen();
}
2019-10-17 16:06:40 +08:00
} else {
// on Close we blur search field
dropdownContainer.find('.search-field').blur().val('');
2019-10-18 17:31:13 +08:00
// onClose event
if (config.onClose) {
config.onClose();
}
2019-08-02 21:57:41 +08:00
}
2019-08-07 16:25:58 +08:00
});
// When user will resize browser we must check dropdown position
2019-12-11 21:49:14 +08:00
$(window).resize(() => { updateDropdownDirection(selectElement, dropdownContainer); });
$(window).scroll(() => { updateDropdownDirection(selectElement, dropdownContainer); });
// When user will click away, we must close dropdown
2019-10-18 17:36:56 +08:00
$(window).click(() => {
if (dropdownContainer.hasClass('open')) {
2019-11-24 04:09:34 +08:00
dropdownContainer.find('.search-field').val('');
}
if (dropdownContainer.hasClass('open') && config.onClose) {
2019-10-18 17:31:13 +08:00
config.onClose();
}
dropdownContainer.removeClass('open active');
2019-10-18 17:31:13 +08:00
});
// Prevent closing dropdown if we click inside
dropdownContainer.click((e) => { e.stopPropagation(); });
2019-08-02 21:57:41 +08:00
// Hide original select element
2019-08-07 16:25:58 +08:00
selectElement.css('display', 'none');
// Disable dropdown by default
2019-08-26 21:49:33 +08:00
if (selectElement.data('disable-on-load')) disableEnableDropdown(selectElement, dropdownContainer, true);
// EnableView mode
if (selectElement.data('view-mode')) {
enableViewMode(selectElement, dropdownContainer);
}
// Select default value
2020-08-12 19:54:05 +08:00
if (!selectElement.data('ajax-url')) {
2020-08-27 17:30:55 +08:00
addSelectedOptions(selectElement, dropdownContainer);
}
// Enable simple mode for dropdown selector
if (config.selectAppearance === 'simple') {
dropdownContainer.addClass('simple-mode');
if (dropdownContainer.find('.tag-label').length) {
dropdownContainer.find('.search-field').attr('placeholder', dropdownContainer.find('.tag-label').text().trim());
}
}
// Disable search
if (config.disableSearch) {
dropdownContainer.addClass('disable-search');
}
// initialization keyboard control
initKeyboardControl(selector, dropdownContainer);
2019-11-24 04:09:34 +08:00
// In some case dropdown position not correctly calculated
2019-08-07 16:25:58 +08:00
updateDropdownDirection(selectElement, dropdownContainer);
2019-08-02 21:57:41 +08:00
}
2019-08-07 16:25:58 +08:00
// Load data to dropdown list
2019-08-06 21:25:52 +08:00
function loadData(selector, container, ajaxData = null) {
2019-08-07 16:25:58 +08:00
var data;
2019-08-09 20:31:50 +08:00
var containerDropdown = container.find('.dropdown-container');
// We need to remeber previos option container size before update
2019-08-09 20:31:50 +08:00
containerDropdown.css('height', `${containerDropdown.height()}px`);
2019-08-06 21:25:52 +08:00
if (ajaxData) {
// For ajax we simpy use data from request
2019-08-07 16:25:58 +08:00
data = ajaxData;
2019-08-06 21:25:52 +08:00
} else {
// For local from select options
2019-08-07 16:25:58 +08:00
data = dataSource(selector, container);
2019-08-06 21:25:52 +08:00
}
2019-08-07 16:25:58 +08:00
// Draw option object
2019-10-18 17:31:13 +08:00
function drawOption(selector2, option, group = null) {
// Check additional params from config
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
var params = option.params || {};
2019-10-18 17:31:13 +08:00
var customLabel = selector2.data('config').optionLabel;
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
var customClass = params.optionClass || selector2.data('config').optionClass || '';
2019-10-18 17:31:13 +08:00
var customStyle = selector2.data('config').optionStyle;
2019-08-05 23:21:58 +08:00
return $(`
2019-10-17 16:06:40 +08:00
<div class="dropdown-option ${customClass}" style="${customStyle ? customStyle(option) : ''}"
title="${(option.params && option.params.tooltip) || ''}"
2019-10-18 17:31:13 +08:00
data-params='${JSON.stringify(option.params || {})}'
2019-08-06 21:25:52 +08:00
data-label="${option.label}"
data-group="${group ? group.value : ''}"
2019-08-05 23:21:58 +08:00
data-value="${option.value}">
2019-10-17 16:06:40 +08:00
${customLabel ? customLabel(option) : option.label}
2019-08-05 23:21:58 +08:00
</div>"
2019-08-07 16:25:58 +08:00
`);
2019-08-05 23:21:58 +08:00
}
// Draw delimiter object
function drawDelimiter() {
return $('<div class="delimiter"></div>');
}
2019-08-07 16:25:58 +08:00
// Draw group object
2019-08-05 23:21:58 +08:00
function drawGroup(group) {
return $(`
<div class="dropdown-group">
<div class="group-name checkbox-icon">${group.label}</div>
</div>
2019-08-07 16:25:58 +08:00
`);
2019-08-05 23:21:58 +08:00
}
2019-08-07 16:25:58 +08:00
// Click action for option object
2019-08-05 23:21:58 +08:00
function clickOption() {
var $container = $(this).closest('.dropdown-selector-container');
// Unselect all previous one if single select
if (selector.data('config').singleSelect) {
$container.find('.dropdown-option').removeClass('select');
updateCurrentData($container, []);
selector.val($(this).data('value')).change();
}
2019-08-07 16:25:58 +08:00
$(this).toggleClass('select');
saveData(selector, $container);
2019-08-05 23:21:58 +08:00
}
2019-08-06 21:25:52 +08:00
// Remove placeholder from option container
container.find('.dropdown-group, .dropdown-option, .empty-dropdown, .dropdown-hint, .delimiter').remove();
2019-08-26 21:49:33 +08:00
if (!data) return;
2020-02-17 17:47:10 +08:00
if (data.length > 0 && !(data.length === 1 && data[0].value === '')) {
if (selector.data('select-hint')) {
$(`<div class="dropdown-hint">${selector.data('select-hint')}</div>`)
.appendTo(container.find('.dropdown-container'));
}
// If we use select-by-group option we need first draw groups
2019-08-26 21:49:33 +08:00
if (selector.data('select-by-group')) {
$.each(data, function(gi, group) {
// First we create our group
2019-08-26 21:49:33 +08:00
var groupElement = drawGroup(group);
// Now add options to this group
2019-08-26 21:49:33 +08:00
$.each(group.options, function(oi, option) {
2019-10-17 16:06:40 +08:00
var optionElement = drawOption(selector, option, group);
2019-08-26 21:49:33 +08:00
optionElement.click(clickOption);
optionElement.appendTo(groupElement);
});
// Now for each group we add action to select all options
2019-08-26 21:49:33 +08:00
groupElement.find('.group-name').click(function() {
var groupContainer = $(this).parent();
// Disable group select to single select
if (selector.data('config').singleSelect) return;
2019-08-26 21:49:33 +08:00
if (groupContainer.toggleClass('select').hasClass('select')) {
groupContainer.find('.dropdown-option').addClass('select');
} else {
groupContainer.find('.dropdown-option').removeClass('select');
}
saveData(selector, container);
});
// And finally appen group to option container
2019-08-26 21:49:33 +08:00
groupElement.appendTo(container.find('.dropdown-container'));
2019-08-07 16:25:58 +08:00
});
2019-08-26 21:49:33 +08:00
} else {
// For simple options we only draw them
2019-08-26 21:49:33 +08:00
$.each(data, function(oi, option) {
var optionElement;
if (option.delimiter || (option.params && option.params.delimiter)) {
drawDelimiter().appendTo(container.find('.dropdown-container'));
return;
}
optionElement = drawOption(selector, option);
2019-08-26 21:49:33 +08:00
optionElement.click(clickOption);
optionElement.appendTo(container.find('.dropdown-container'));
2019-08-07 16:25:58 +08:00
});
2019-08-26 21:49:33 +08:00
}
2019-08-02 21:57:41 +08:00
} else {
// If we data empty, draw placeholder
2019-08-26 21:49:33 +08:00
$(`<div class="empty-dropdown">${I18n.t('dropdown_selector.nothing_found')}</div>`).appendTo(container.find('.dropdown-container'));
2019-08-02 21:57:41 +08:00
}
// Update scrollbar
2019-08-07 16:25:58 +08:00
PerfectSb().update_all();
// Check position of option dropdown
2019-08-07 16:25:58 +08:00
refreshDropdownSelection(selector, container);
// Unfreeze option container height
2019-08-09 20:31:50 +08:00
containerDropdown.css('height', 'auto');
2019-08-02 21:57:41 +08:00
}
2019-08-07 16:25:58 +08:00
// Save data to local field
2019-08-05 23:21:58 +08:00
function saveData(selector, container) {
// Check what we have now selected
2019-08-07 16:25:58 +08:00
var selectArray = getCurrentData(container);
// Search option by value and group
2019-08-07 16:25:58 +08:00
function findOption(options, option) {
return options.findIndex(x => (x.value === option.dataset.value
&& x.group === option.dataset.group));
}
// First we clear search field
if (selector.data('config').singleSelect) container.find('.search-field').val('');
2019-08-07 16:25:58 +08:00
// Now we check all options in dropdown for selection and add them to array
2019-08-07 16:25:58 +08:00
$.each(container.find('.dropdown-container .dropdown-option'), function(oi, option) {
2019-08-06 21:25:52 +08:00
var alreadySelected;
var toDelete;
var newOption;
2019-08-07 16:25:58 +08:00
if ($(option).hasClass('select')) {
alreadySelected = findOption(selectArray, option);
// If it is new option we add it
2019-08-07 16:25:58 +08:00
if (alreadySelected === -1) {
2019-08-06 21:25:52 +08:00
newOption = {
label: option.dataset.label,
value: option.dataset.value,
2019-10-17 16:06:40 +08:00
group: option.dataset.group,
params: JSON.parse(option.dataset.params)
2019-08-07 16:25:58 +08:00
};
selectArray.push(newOption);
2019-08-06 21:25:52 +08:00
}
} else {
// If we deselect option we remove it
2019-08-07 16:25:58 +08:00
toDelete = findOption(selectArray, option);
if (toDelete >= 0) selectArray.splice(toDelete, 1);
2019-08-06 21:25:52 +08:00
}
// This complex required to save order of tags
2019-08-07 16:25:58 +08:00
});
// Now we save new data
2019-08-07 16:25:58 +08:00
updateCurrentData(container, selectArray);
// Redraw tags
2019-10-18 17:31:13 +08:00
updateTags(selector, container, { select: true });
2019-08-05 23:21:58 +08:00
}
function deleteTag(selector, container, target) {
var tagLabel = target.prev();
// Start delete animation
target.parent().addClass('closing');
// Add timeout for deleting animation
setTimeout(() => {
if (selector.data('combine-tags')) {
// if we use combine-tags options we simply clear all values
container.find('.data-field').val('[]');
updateTags(selector, container);
} else {
// Or delete specific one
deleteValue(selector, container, tagLabel.data('ds-tag-id'), tagLabel.data('ds-tag-group'));
}
}, 350);
}
2019-08-07 16:25:58 +08:00
// Refresh tags in input field
function updateTags(selector, container, config = {}) {
2019-08-07 16:25:58 +08:00
var selectedOptions = getCurrentData(container);
2019-08-26 21:49:33 +08:00
var searchFieldValue = container.find('.search-field');
2019-08-05 23:21:58 +08:00
2019-08-07 16:25:58 +08:00
// Draw tag and assign event
2019-08-06 21:25:52 +08:00
function drawTag(data) {
// Check for custom options
2019-08-07 16:25:58 +08:00
var customLabel = selector.data('config').tagLabel;
2019-10-17 16:06:40 +08:00
var customClass = selector.data('config').tagClass || '';
var customStyle = selector.data('config').tagStyle;
// Select element appearance
var tagAppearance = selector.data('config').selectAppearance === 'simple' ? 'ds-simple' : 'ds-tags';
2019-11-27 21:04:59 +08:00
var label = customLabel ? customLabel(data) : data.label;
// Add new tag before search field
var tag = $(`<div class="${tagAppearance} ${customClass}" style="${customStyle ? customStyle(data) : ''}" >
2019-08-06 21:25:52 +08:00
<div class="tag-label"
title="${(data.params && data.params.tooltip) || $('<span>' + label + '</span>').text().trim()}"
2019-08-06 21:25:52 +08:00
data-ds-tag-group="${data.group}"
2019-09-12 20:11:27 +08:00
data-ds-tag-id="${data.value}">
2019-08-06 21:25:52 +08:00
</div>
<i class="fas fa-times ${selector.data('config').singleSelect ? 'hidden' : ''}"></i>
2019-08-26 21:49:33 +08:00
</div>`).insertBefore(container.find('.input-field .search-field'));
if (selector.data('config').labelHTML) {
tag.find('.tag-label').html(label);
} else {
tag.find('.tag-label').text(label);
}
// Now we need add delete action to tag
2019-08-05 23:21:58 +08:00
tag.find('.fa-times').click(function(e) {
2019-08-07 16:25:58 +08:00
e.stopPropagation();
deleteTag(selector, container, $(this));
2019-08-05 23:21:58 +08:00
});
}
// Clear all tags
container.find('.ds-tags, .ds-simple').remove();
2019-08-07 16:25:58 +08:00
if (selector.data('combine-tags')) {
// If we use combine-tags options we draw only one tag
2019-08-05 23:21:58 +08:00
if (selectedOptions.length === 1) {
// If only one selected we use his name
2019-08-07 16:25:58 +08:00
drawTag({ label: selectedOptions[0].label, value: selectedOptions[0].value });
2019-08-05 23:21:58 +08:00
} else if (allOptionsSelected(selector, container)) {
// If all selected we use placeholder for all tags from select config
2019-08-07 16:25:58 +08:00
drawTag({ label: selector.data('select-multiple-all-selected'), value: 0 });
// Otherwise use placeholder from select config
2019-08-05 23:21:58 +08:00
} else if (selectedOptions.length > 1) {
2019-08-07 16:25:58 +08:00
drawTag({ label: `${selectedOptions.length} ${selector.data('select-multiple-name')}`, value: 0 });
2019-08-05 23:21:58 +08:00
}
} else {
// For normal tags we simpy draw each
2019-08-06 21:25:52 +08:00
$.each(selectedOptions, (ti, tag) => {
2019-08-07 16:25:58 +08:00
drawTag(tag);
});
2019-08-06 21:25:52 +08:00
}
// If we have alteast one tag, we need to remove placeholder from search field
if (selector.data('config').selectAppearance === 'simple') {
let selectedLabel = container.find('.tag-label');
2020-02-17 17:47:10 +08:00
container.find('.search-field').prop('placeholder',
selectedLabel.length && selectedLabel.text().trim() !== '' ? selectedLabel.text().trim() : selector.data('placeholder'));
} else {
searchFieldValue.attr('placeholder',
selectedOptions.length > 0 ? '' : (selector.data('placeholder') || ''));
}
2019-12-11 21:49:14 +08:00
searchFieldValue.attr('data-options-selected', selectedOptions.length);
2019-08-05 23:21:58 +08:00
// Add stretch class for visual improvments
if (!selector.data('combine-tags')) {
2019-08-07 16:25:58 +08:00
container.find('.ds-tags').addClass('stretch');
2019-08-06 21:25:52 +08:00
} else {
2019-08-07 16:25:58 +08:00
container.find('.ds-tags').removeClass('stretch');
2019-08-06 21:25:52 +08:00
}
// Update option container direction position
2019-08-07 16:25:58 +08:00
updateDropdownDirection(selector, container);
// Update options selection status
2019-08-07 16:25:58 +08:00
refreshDropdownSelection(selector, container);
// If dropdown active focus on search field
2019-09-16 22:20:16 +08:00
if (container.hasClass('open')) container.find('.search-field').focus();
2019-10-17 16:06:40 +08:00
// Trigger onSelect event
2019-10-18 17:31:13 +08:00
if (selector.data('config').onSelect && !config.skipChange && config.select && !config.skipSelect) {
2019-10-17 16:06:40 +08:00
selector.data('config').onSelect();
}
// Trigger onChange event
if (selector.data('config').onChange && !config.skipChange) {
2019-08-07 16:25:58 +08:00
selector.data('config').onChange();
}
2019-10-17 16:06:40 +08:00
// Trigger onUnSelect event
2019-10-18 17:31:13 +08:00
if (selector.data('config').onUnSelect && !config.skipChange && config.unselect && !config.skipUnselect) {
2019-10-17 16:06:40 +08:00
selector.data('config').onUnSelect(config.tagId);
}
// Close dropdown after select
if (selector.data('config').closeOnSelect && container.hasClass('open')) {
container.find('.input-field').click();
}
2019-08-06 21:25:52 +08:00
}
2019-08-07 16:25:58 +08:00
// Convert local data or ajax data to same format
function dataSource(selector, container) {
2019-08-06 21:25:52 +08:00
var result = [];
var groups;
var options;
var defaultParams;
var customParams;
var ajaxParams;
// If use AJAX we need to prepare correct format on backend
2019-08-07 16:25:58 +08:00
if (selector.data('ajax-url')) {
2019-08-26 21:49:33 +08:00
defaultParams = { query: container.find('.search-field').val() };
2019-08-07 16:25:58 +08:00
customParams = selector.data('config').ajaxParams;
ajaxParams = customParams ? customParams(defaultParams) : defaultParams;
2019-08-06 21:25:52 +08:00
$.get(selector.data('ajax-url'), ajaxParams, (data) => {
2020-02-17 17:47:10 +08:00
var optionsAjax = data.constructor === Array ? data : [];
2020-02-07 21:57:07 +08:00
if (selector.data('config').emptyOptionAjax) {
optionsAjax = [{
2020-02-17 17:47:10 +08:00
label: selector.data('placeholder') || '',
2020-02-07 21:57:07 +08:00
value: '',
group: null,
params: {}
2020-02-17 17:47:10 +08:00
}].concat(optionsAjax);
2020-02-07 21:57:07 +08:00
}
loadData(selector, container, optionsAjax);
2020-01-31 21:11:37 +08:00
PerfectSb().update_all();
2019-08-07 16:25:58 +08:00
});
// For local options we convert options element from select to correct array
2019-08-07 16:25:58 +08:00
} else if (selector.data('select-by-group')) {
groups = selector.find('optgroup');
$.each(groups, (gi, group) => {
var groupElement = { label: group.label, value: group.label, options: [] };
var groupOptions = filterOptions(selector, container, $(group).find('option'));
2019-08-07 16:25:58 +08:00
$.each(groupOptions, function(oi, option) {
groupElement.options.push({ label: option.innerHTML, value: option.value });
});
if (groupElement.options.length > 0) result.push(groupElement);
});
} else {
options = filterOptions(selector, container, selector.find('option'));
2019-08-07 16:25:58 +08:00
$.each(options, function(oi, option) {
result.push({
label: option.innerHTML,
value: option.value,
delimiter: option.dataset.delimiter,
params: JSON.parse(option.dataset.params || '{}')
});
2019-08-07 16:25:58 +08:00
});
2019-08-06 21:25:52 +08:00
}
2019-08-07 16:25:58 +08:00
return result;
2019-08-05 23:21:58 +08:00
}
2019-08-07 16:25:58 +08:00
// ////////////////////
// Public functions ///
// ////////////////////
2019-08-02 21:57:41 +08:00
return {
2019-08-07 16:25:58 +08:00
// Dropdown initialization
2019-08-09 20:31:50 +08:00
init: function(selector, config) {
2019-08-07 16:25:58 +08:00
generateDropdown(selector, config);
2019-08-09 20:31:50 +08:00
return this;
},
// Clear button initialization
initClearButton: function(selector, clearButton) {
var container;
if ($(selector).length === 0) return false;
container = $(selector).next();
$(clearButton).click(() => {
updateCurrentData(container, []);
refreshDropdownSelection($(selector), container);
updateTags($(selector), container);
});
return this;
2019-08-02 21:57:41 +08:00
},
2019-08-07 16:25:58 +08:00
// Update dropdown position
2019-08-09 20:31:50 +08:00
updateDropdownDirection: function(selector) {
if ($(selector).length === 0) return false;
2019-11-27 21:04:59 +08:00
if (!$(selector).next().hasClass('open')) return false;
2019-08-07 16:25:58 +08:00
updateDropdownDirection($(selector), $(selector).next());
2019-08-09 20:31:50 +08:00
return this;
2019-08-06 21:25:52 +08:00
},
2019-08-07 16:25:58 +08:00
// Get only values
2019-08-09 20:31:50 +08:00
getValues: function(selector) {
var values;
if ($(selector).length === 0) return false;
values = $.map(getCurrentData($(selector).next()), (v) => {
2019-08-07 16:25:58 +08:00
return v.value;
});
if ($(selector).data('config').singleSelect) return values[0];
return values;
2019-08-07 16:25:58 +08:00
},
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
// Get selected labels
getLabels: function(selector) {
var labels;
if ($(selector).length === 0) return false;
labels = $.map(getCurrentData($(selector).next()), (v) => {
return v.label;
});
if ($(selector).data('config').singleSelect) return labels[0];
return labels;
},
2019-08-07 16:25:58 +08:00
// Get all data
2019-08-09 20:31:50 +08:00
getData: function(selector) {
if ($(selector).length === 0) return false;
2019-08-07 16:25:58 +08:00
return getCurrentData($(selector).next());
},
2019-08-09 20:31:50 +08:00
// Set data to selector
setData: function(selector, data) {
if ($(selector).length === 0) return false;
setData($(selector), data);
return this;
},
// Select values
selectValues: function(selector, values) {
var $selector = $(selector);
var option;
var valuesArray = [].concat(values);
var options = [];
if ($selector.length === 0) return false;
2019-08-09 20:31:50 +08:00
valuesArray.forEach(function(value) {
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
option = $selector.find(`option[value="${value}"]`);
option.attr('selected', true);
options.push(convertOptionToJson(option[0]));
});
setData($selector, options);
2019-08-09 20:31:50 +08:00
return this;
},
// Clear selector
clearData: function(selector) {
if ($(selector).length === 0) return false;
2019-10-18 17:31:13 +08:00
setData($(selector), []);
return this;
},
removeValue: function(selector, value, group = '', skip_event = false) {
var dropdownContainer;
if ($(selector).length === 0) return false;
dropdownContainer = $(selector).next();
deleteValue($(selector), dropdownContainer, value, null, skip_event);
return this;
},
addValue: function(selector, value, skip_event = false) {
var currentData;
if ($(selector).length === 0) return false;
currentData = getCurrentData($(selector).next());
currentData.push(value);
setData($(selector), currentData, skip_event);
2019-08-09 20:31:50 +08:00
return this;
},
2019-08-26 21:49:33 +08:00
// Enable selector
enableSelector: function(selector) {
if ($(selector).length === 0) return false;
disableEnableDropdown($(selector), $(selector).next(), false);
return this;
},
2019-08-09 20:31:50 +08:00
// Disable selector
2019-08-26 21:49:33 +08:00
disableSelector: function(selector) {
if ($(selector).length === 0) return false;
2019-08-26 21:49:33 +08:00
disableEnableDropdown($(selector), $(selector).next(), true);
2019-08-09 20:31:50 +08:00
return this;
2019-10-17 16:06:40 +08:00
},
// close dropdown
closeDropdown: function(selector) {
var dropdownContainer;
if ($(selector).length === 0) return false;
2019-10-18 17:31:13 +08:00
dropdownContainer = $(selector).next();
2019-10-17 16:06:40 +08:00
if (dropdownContainer.hasClass('open')) {
2019-10-18 17:31:13 +08:00
dropdownContainer.find('.input-field').click();
2019-10-17 16:06:40 +08:00
}
return this;
},
2019-10-18 17:31:13 +08:00
// get dropdown container
2019-10-17 16:06:40 +08:00
getContainer: function(selector) {
if ($(selector).length === 0) return false;
2019-10-18 17:31:13 +08:00
return $(selector).next();
},
// Run success animation on dropdown
highlightSuccess: function(selector) {
var container = $(selector).next();
if ($(selector).length === 0) return false;
container.addClass('success');
setTimeout(() => {
container.removeClass('success');
}, 1500);
return this;
},
// Run error animation on dropdown
highlightError: function(selector) {
var container = $(selector).next();
if ($(selector).length === 0) return false;
container.addClass('error');
setTimeout(() => {
container.removeClass('error');
}, 1500);
return this;
Version 1.25.0 (#4087) * Add initial implementation of inventory stock management [SCI-6402] * Add stock column type (#3786) * Add stock column type * Create new stock column [SCI-6410] * Small fixed for stock column [SCI-6410] * Add stock column validations [SCI-6410] Co-authored-by: Anton <anton@scinote.net> * Add stock table renders [SCI-6412] (#3787) Co-authored-by: Anton <anton@scinote.net> * Implemented stock management modal [SCI-6417] (#3788) * Implement inventory stock management modal [SCI-6417] * Add generalized validation mechanic, some bugfixes [SCI-6417] * Fix permission check and method name in RepositoryStockValue [SCI-6417] * Add stock and consumption to assigned items section [SCI-6434] (#3793) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] (#3781) * Fix invalid return in reports jobs [SCI-6409] (#3777) * Added UPDATE_STOCK_CONSUMPTION to MyModule permissons [SCI-6418] * Add current/new amount section to stock [SCI-6416] (#3791) Co-authored-by: Anton <anton@scinote.net> * Task stock consumption modal[SCI-6444][SCI-6445] (#3798) Add main logic for consumption on task [SCI-6444] Co-authored-by: Anton <anton@scinote.net> * Add stock management columns to snapshots [SCI-6448] * Handle stock management in full table views [SCI-6440] * Implement stock management activities [SCI-6452] (#3810) * Implement stock management activities [SCI-6452] * PR code fixes [SCI-6452] * Implement import for repository stock values [SCI-6461] (#3818) * Add permissions checking to assigned items view on tasks [SCI-6435] (#3801) * Add front-end validation for comments field [SCI-6464] (#3829) Co-authored-by: Anton <anton@scinote.net> * Add stock consumption to pdf and docx [SCI-6460] (#3816) Co-authored-by: Anton <anton@scinote.net> * Add support of repository snapshots to assigned items section [SCI-6439] (#3828) * Change subject of Repository (#3838) * Fixed full view assigned items modal stock consumption (#3846) * Implement repository snapshots displaying on assigned items full view modal [SCI-6442] (#3862) * Implement low stock threshold column [SCI-6555] (#3907) * Stock column fixes [SCI-6455] (#3878) * Fix issues with stock column management [SCI-6455] * Refactor stock column in datatables [SCI-6455] * Fix tests [SCI-6486] (#3913) * Fix tests [SCI-6486] * Fix rspec tests [SCI-6486] Co-authored-by: Anton <anton@scinote.net> * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] (#3911) * Implement basic logic for Date/DateTime/Stock reminders [SCI-6554] * Implement bell icon [SCI-6500] * Refactor reminder cells scope [SCI-6554] * Add red dot for date/datetime reminder [SCI-6499] (#3924) Co-authored-by: Anton <anton@scinote.net> * Add reminders to stock modal [SCI-6557] (#3917) Co-authored-by: Anton <anton@scinote.net> * Add flyout for repository reminders [SCI-6501] (#3926) Co-authored-by: Anton <anton@scinote.net> * Fix moving experiment [SCI-6602] (#3927) * Update Rails to 6.1.4.7 [SCI-6615] (#3928) * Task inventory activity for assigned item consumption [SCI-6453] (#3830) * Add task inventory activity [SCI-6453] * Apply user's time zone in advanced filters for time data type [SCI-6585] (#3930) * Bump version to 1.24.2 * Implement hidden repository cell reminders [SCI-6504] (#3933) * Low stock flyout reminders [SCI-6502] (#3932) * Display low stock flyout reminder [SCI-6502] * Display low stock flyout reminder [SCI-6502] * Adapt showing stock reminders for every bell icon click [SCI-6502] * Correct hound error [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix event registration for fetching reminder data [SCI-6502] * Fix hound [SCI-6502] * Remove not needed line [SCI-6502] * Add reminder template [SCI-6502] * Add clearing messages [SCI-6502] * Displaying low stock warning [SCI-6497] (#3912) * Low stock warning [SCI-6497 * Fix some bugs [SCI-6497] * Fix to long line [SCI-6497] * Clean not needed information in renderes [SCI-6497] * Icon bell reminder for an assigned item on the task [SCI-6506] (#3929) * Add bell icon on assigned task [SCI-6506] * Add flyout and improve quering [SCI-6506] * Refactor repository toolbar [SCI-6545] (#3943) Co-authored-by: Anton <anton@scinote.net> * Add datetime reminders to columns modal [SCI-6556] (#3934) Co-authored-by: Anton <anton@scinote.net> * Hide reminders for archived repositories [SCI-6609] (#3941) * Hide reminders for archived repositories [SCI-6609] * Always pass repository in datatable helper [SCI-6609] * Handle locked stock consumption state [SCI-6608] (#3942) * Change env variable name for s3 bucket region [SCI-6603] (#3944) * Add last_transition_error column to tasks [SCI-6610] (#3949) * Add microtransactions to stock consumptions [SCI-6626] (#3948) Co-authored-by: Anton <anton@scinote.net> * Date remidner flyout [SCI-6503] (#3937) * Implement date reminder flyout [SCI-6503] * Show only days left for date reminder [SCI-6503] * Pluralize day in reminders [SCI-6503] * Create partials for different reminders [SCI-6503] * Unify css for reminder [SCI-6503] * Add micro interactions for stock modal [SCI-6625] (#3947) Co-authored-by: Anton <anton@scinote.net> * Hide options to add New Tags for users without permissions on Task level [SCI-6573] (#3945) * Bump lodash-es from 4.17.15 to 4.17.21 (#3939) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21) --- updated-dependencies: - dependency-name: lodash-es dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Implement clearing hidden repository reminders [SCI-6507] (#3936) * Add stock filters [SCI-6547] (#3938) Co-authored-by: Anton <anton@scinote.net> * Fix assign view for task repository [SCI-6648] (#3954) Co-authored-by: Anton <anton@scinote.net> * Add micro-interactions to reminders flyout [SCI-6627] (#3951) Co-authored-by: Anton <anton@scinote.net> * Improve error reporting in task status transition [SCI-6611] (#3952) * Add ordering to global search results [SCI-6639] (#3960) * Fix multiple stock bugs [SCI-6651] (#3959) Co-authored-by: Anton <anton@scinote.net> * Fix large previews for csv files [SCI-6619] (#3961) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] (#3953) * Add alias to cell sort query, to prevent join conflicts [SCI-6649] * Added value_type to join condition to make use of DB index [SCI-6649] * Update front end validation for columns managment [SCI-6657] (#3962) Co-authored-by: Anton <anton@scinote.net> * Print protocol smart annotation and table improvements [SCI-6566] (#3925) * Improve table printing in the print menu [SCI-6566] * Open smart annotation in new tab for print view [SCI-6566] * Unify naming of same parameter [SCI-6566] * Fix typo [SCI-6566] * Fix hound errors [SCI-6566] * Add stock management toggling [SCI-6653] (#3967) Co-authored-by: Anton <anton@scinote.net> * Fix caching of an experiment card dropdown [SCI-6606] (#3963) * Add stock consumption permission to user roles [SCI-6665] (#3966) * Show archive icon only on archived projects in the header [SCI-6617] (#3965) * Fix assigned items fullview modal [SCI-6664] (#3968) * Implement hide all repository reminders button [SCI-6505] (#3940) * Viewer role does not see any tasks in archived project [SCI-6616] (#3958) * Fix viewer role not see any tasks in archived project [SCI-6616] * Fix rollback for add read archive permission migration [SCI-6616] * Stock modal bugs [SCI-6667] (#3970) Co-authored-by: Anton <anton@scinote.net> * Always use Tika text extractor in server mode [SCI-6658] (#3957) * Implement stock consumption via the API [SCI-6642] (#3964) * Implement stock consumption via the API [SCI-6642] * Remove unnecessary attribute from InventoryItemSerializer [SCI-6642] * Amend permission check, add nested transaction support to consume_stock method [SCI-6642] * Toolbar fixes [SCI-6670] (#3973) Co-authored-by: Anton <anton@scinote.net> * Make stock column work properly with different orders [SCI-6677] (#3974) * Fix filters loading for stock filter [SCI-6687] (#3975) Co-authored-by: Anton <anton@scinote.net> * Hide reminders and disable stock consumption for archived items [SCI-6689] (#3978) * Fix red dot for datetime columns [SCI-6684] (#3977) Co-authored-by: Anton <anton@scinote.net> * Fix saving of inventory date time reminders saving [SCI-6672] (#3976) * Bump puma from 5.6.2 to 5.6.4 (#3972) Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Don't load reminders if the stock feature is disabled [SCI-6673] (#3981) * Don't load reminders if the stock feature is disabled [SCI-6673] * Don't load reminders if the stock feature is disabled [SCI-6673] * Unify stock management enabled check [6673] * Update repository card view for stock [SCI-6685] (#3982) Co-authored-by: Anton <anton@scinote.net> * Disable stock managememnt for all tables in my module context [SCI-6692] (#3983) * Implement failed snapshot pop-up on task screen [SCI-6612] (#3950) * Implement failed snapshot pop-up on task screen [SCI-6612] * Copy change [SCI-6612] * Proper handling of snapshot transition error [SCI-6612] * Move modal auto open logic to JS file [SCI-6612] * Remove unnecessary .html_safe [SCI-6612] * Fix assigning and consuming items [SCI-6686] (#3985) * Repository toolbar CSS fixes [SCI-6676] (#3984) Co-authored-by: Anton <anton@scinote.net> * Add basic validation to reminder value to prevent integer overflow errors [SCI-6693] (#3986) * Fix reminder dropdown on task screen [SCI-6678] (#3987) Co-authored-by: Anton <anton@scinote.net> * Fix inventory sorting with date time reminders [SCI-6683] (#3980) * Fix css stock modal [SCI-6675] (#3989) Co-authored-by: Anton <anton@scinote.net> * Stock column management UX/UI fixes [SCI-6674] (#3979) * Fix red dot for dates in repository [SCI-6696] (#3991) Co-authored-by: Anton <anton@scinote.net> * Added styling for failed snapshots in sidebar [SCI-6636] (#3990) * Added styling for failed snapshots in sidebar [SCI-6636] * Simplify markup for failed icon [SCI-6636] * Turn off autocomplete for stock amount/reminder [SCI-6694] (#3988) * Override error styling in stock column management [SCI-6674] (#3995) * Fix repository full view tables without stock management [SCI-6703] (#3994) * Add pagination to projects list [SCI-6655] * Add reminder preset to date(time) reminders [SCI-6693] (#3996) * Fix color on consumption link [SCI-6686] (#3992) * Fix sorting by date time columns in inventories [SCI-6683] (#4002) * Improve loading of the dashboard [SCI-6618] (#4001) * Stock modal UX fixes [SCI-6714] (#3998) Co-authored-by: Anton <anton@scinote.net> * Fix css for stotck modal [SCI-6698] (#3999) Co-authored-by: Anton <anton@scinote.net> * API: add endpoint for updating of stock [SCI-6549] (#3955) * Add test for Stock repository cell [SCI-6549] * Create and update stock inventory cell [SCI-6549] * Fix hound errors [SCI-6549] * Fix ledger recording [SCI-6549] * Fix api endpoint [SCI-6549] * Fix hound [SCI-6549] * Fix collapsing of assigned items tables [SCI-6705] (#4000) * API: add endpoint for creating stock column [SCI-6550] (#3956) * Add test for repositoty stock column api [SCI-6550] * Create and update stock column [SCI-6550] * Change stock unit [SCI-6550] * Fix hound [SCI-6550] * Fix on delete [SCI-6550] * Fix houd [SCI-6550] * Removed autofocus clear on open reminder flyout [SCI-6690] (#4003) * Removed clear autofocus on open reminder flyout [SCI-6690] * Fix hound [SCI-6690] * Adding/changing stock consumption [SCI-6708] (#4005) * Adding/changing stock consumption [SCI-6708] * Fix hound [SCI-6708] * Remove date red dots for snapshots [SCI-6715] (#4004) Co-authored-by: Anton <anton@scinote.net> * Add snapshot error message below task status [SCI-6614] (#4009) * Add repository snapshot error modal [SCI-6613] (#3993) * Bump nokogiri from 1.13.3 to 1.13.4 (#4008) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add pagination for experiments [SCI-6656] * Fix sorting by time and time range columns [SCI-6683] (#4011) * Bump moment from 2.24.0 to 2.29.2 (#4006) Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2) --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Align items in assigned item section [SCI-6707] (#4007) * Add locking and unique index to repository row assigning [SCI-6591] (#3921) * tmp (#3935) * Revert "tmp (#3935)" (#4014) This reverts commit 043086d55fe0c7adeac528662e1433ccdb91aed0. * Move cursor to end of value when focusing consumption amount [SCI-6727] (#4013) * Fix removing stock reminder threshold [SCI-6724] (#4010) * Stock small ux fixes [SCI-6714] (#4015) Co-authored-by: Anton <anton@scinote.net> * Add aibility to delete stock column [SCI-6723] (#4017) Co-authored-by: Anton <anton@scinote.net> * Fix red dot for date reminders [SCI-6696] (#4016) Co-authored-by: Anton <anton@scinote.net> * Change the way setting stock works [SCI-6730] (#4018) * Fix error modal opening on successful snapshot [SCI-6726] (#4019) * Refactor and fix display of stock warnings and stock consumption [SCI-6734] (#4021) * Refactor and fix how stock consumption is displayed [SCI-6734] * Refactor and fix display of stock warnings [SCI-6734] * Fix stock consumption in reports [SCI-6735] * Fix markup * Focus authenticator code field [SCI-6716] (#4022) * Hide reminders settings and red dots if stock is disabled [SCI-6673] (#4024) * Fix decimals in stock consumption modal [SCI-6732] * Add edit title for stock consumption modal [SCI-6731] * Highlight negative stock in modal with red [SCI-6729] * Stock management test [SCI-6420] (#3946) * Initial test for stock management * Repository stock values adding [does not work] SCI-6420 * Fix typos SCI-6420 * Fix test [SCI-6420] * Test changes [SCI-6402] * Remove locking test [SCI-6420] * Remove lock [SCI-6420] * Remove serializer [SCI-6420] * Fix stock test and add ledger creation on consume [SCI-6420] * Fix inviting users to team [SCI-6725] (#4026) * Improve stock ledger records creation [SCI-6419] * Fix stock modal add/remove value preset value [SCI-6740] * API GET repository stock column output fix [SCI-6550] (#4030) * Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550] * Move list-type column includes to param, unify naming [SCI-6738] (#4036) * Add default includes for inventory columns with lists [SCI-6738] * Move list-type column includes to param, unify naming [SCI-6738] * Fix snapshot consumption display [SCI-6734] (#4035) * Fix decimal render function [SCI-6742] (#4037) Co-authored-by: Anton <anton@scinote.net> * Add comment to repository stock activities [SCI-6746] * Fix default stock column default units selection [SCI-6744] * Add negative validation for stock [SCI-6743] * Highlight negative value in consumption modal [SCI-6741] * Fix snapshot creation with stock consumption [SCI-6762] * Update stock value without reloading the table [SCI-6745] (#4041) * Allow tag creation on task level if you have permission [SCI-6573] (#4031) * Enable team normal user to edit repository files [SCI-6765] (#4049) * Add negative validation for treshold [SCI-6743] * Copy fix [SCI-6762] (#4048) * Add bell icon for negative stock [SCI-6770] * Fix formatting of stock consumption on tasks [SCI-6737] (#4050) * Fix duplicated inventories on tasks for export all [SCI-6776] * Stock / stock consumption display fixes [SCI-6771] (#4054) * Fix blank stock consumption representation in reports [SCI-6769] * Upgrade Rails to 6.1.5.1 * Show last page message only after second page [SCI-6761] * Small CSS fixes for repository [SCI-6767] * Added validations for date(time) column reminder [SCI-6775] (#4063) * Upgrade Ruby to 2.7.6 * Open repository on print view [SCI-6566] (#4055) * Fix saving of new date time columns with reminders [SCI-6774] (#4068) * Improve input field for adding new team [SCI-6155] * Allow deleteion of stock columns when stock management is disabled [SCI-6800] * Update default label template [SCI-6763] (#4064) * Stock editing and reminder fixes [SCI-6803] (#4078) * Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803] * Improve loading time of canvas view/edit [SCI-6797] * Fix stock consumption rounding [SCI-6807] * Fix displaying of stock consumption units [SCI-6795] * Fix task dropdown actions [SCI-6817] * Fix archived tasks view [SCI-6822] * Fix display of repository snapshot with stock consumption [SCI-6824] * Fix duplicated counters on task card [SCI-6825] * Bump version to 1.25.0 Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com> Co-authored-by: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Co-authored-by: Anton <anton@scinote.net> Co-authored-by: ajugo <andrej.jugovic7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 16:39:51 +08:00
},
showError: function(selector, error) {
var container = $(selector).next();
if ($(selector).length === 0) return false;
container.addClass('error').attr('data-error-text', error);
return this;
},
hideError: function(selector) {
var container = $(selector).next();
if ($(selector).length === 0) return false;
container.removeClass('error');
return this;
2019-08-02 21:57:41 +08:00
}
};
2019-08-07 16:25:58 +08:00
}());