Merge pull request #4621 from scinote-eln/release/1.26.2.1

Release/1.26.2.1
This commit is contained in:
Alex Kriuchykhin 2022-11-22 11:07:20 +01:00 committed by GitHub
commit b7664ad70f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 44 additions and 36 deletions

View file

@ -56,8 +56,6 @@
//= require_directory ./access_permissions
//= require sidebar
//= require turbolinks
//= require 'BrowserPrint-3.0.216.min'
//= require 'BrowserPrint-Zebra-1.0.216.min'
// Initialize links for submitting forms. This is useful for submitting
// forms with clicking on links outside form in cases when other than

View file

@ -59,12 +59,14 @@
$(document).on('click', '.print-label-button', function() {
var selectedRows = $(this).data('rows');
PrintModalComponent.showModal = true;
if (selectedRows.length) {
$('#modal-info-repository-row').modal('hide');
PrintModalComponent.row_ids = selectedRows;
} else {
PrintModalComponent.row_ids = RepositoryDatatable.selectedRows();
if (typeof PrintModalComponent !== 'undefined') {
PrintModalComponent.showModal = true;
if (selectedRows.length) {
$('#modal-info-repository-row').modal('hide');
PrintModalComponent.row_ids = selectedRows;
} else {
PrintModalComponent.row_ids = RepositoryDatatable.selectedRows();
}
}
});
}());

View file

@ -7,35 +7,37 @@ Vue.prototype.i18n = window.I18n;
function initPrintModalComponent() {
const container = $('.print-label-modal-container');
window.PrintModalComponent = new Vue({
el: '.print-label-modal-container',
name: 'PrintModalComponent',
components: {
'print-modal-container': PrintModalContainer
},
data() {
return {
showModal: false,
row_ids: [],
zebraEnabled: container.data('zebra-enabled'),
urls: {
print: container.data('print-url'),
zebraProgress: container.data('zebra-progress-url'),
printers: container.data('printers-url'),
labelTemplates: container.data('label-templates-url'),
rows: container.data('rows-url'),
fluicsInfo: container.data('fluics-info-url'),
printValidation: container.data('print-validation-url'),
labelPreview: container.data('label-preview-url')
if (container.length) {
window.PrintModalComponent = new Vue({
el: '.print-label-modal-container',
name: 'PrintModalComponent',
components: {
'print-modal-container': PrintModalContainer
},
data() {
return {
showModal: false,
row_ids: [],
zebraEnabled: container.data('zebra-enabled'),
urls: {
print: container.data('print-url'),
zebraProgress: container.data('zebra-progress-url'),
printers: container.data('printers-url'),
labelTemplates: container.data('label-templates-url'),
rows: container.data('rows-url'),
fluicsInfo: container.data('fluics-info-url'),
printValidation: container.data('print-validation-url'),
labelPreview: container.data('label-preview-url')
}
};
},
methods: {
closeModal() {
this.showModal = false;
}
};
},
methods: {
closeModal() {
this.showModal = false;
}
}
});
});
}
}
initPrintModalComponent();

View file

@ -20,7 +20,7 @@ class LabelPrinter < ApplicationRecord
validates :language_type, presence: true
def self.zebra_print_enabled?
RepositoryBase.stock_management_enabled?
RepositoryBase.stock_management_enabled?.present?
end
def done?

View file

@ -18,4 +18,5 @@
></print-modal-container>
</div>
<%= render partial: 'label_printers/zebra_printer_library' %>
<%= javascript_pack_tag 'vue/repository_print_modal' %>

View file

@ -0,0 +1,4 @@
<% if LabelPrinter.zebra_print_enabled? %>
<%= javascript_include_tag 'BrowserPrint-3.0.216.min' %>
<%= javascript_include_tag 'BrowserPrint-Zebra-1.0.216.min' %>
<% end %>

View file

@ -77,4 +77,5 @@
</li>
</ul>
<%= render partial: 'label_printers/zebra_printer_library' %>
<%= javascript_include_tag "label_printers/zebra_settings" %>