mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
Merge branch 'master' into features/templates
This commit is contained in:
commit
fdf7db425b
35 changed files with 231 additions and 78 deletions
|
@ -1,10 +1,11 @@
|
|||
FROM ruby:2.4.4
|
||||
FROM ruby:2.4.5
|
||||
MAINTAINER BioSistemika <info@biosistemika.com>
|
||||
|
||||
# additional dependecies
|
||||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
|
||||
apt-get update -qq && \
|
||||
apt-get install -y \
|
||||
libjemalloc1 \
|
||||
nodejs \
|
||||
postgresql-client \
|
||||
default-jre-headless \
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
FROM ruby:2.4.4
|
||||
FROM ruby:2.4.5
|
||||
MAINTAINER BioSistemika <info@biosistemika.com>
|
||||
|
||||
# additional dependecies
|
||||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
|
||||
apt-get update -qq && \
|
||||
apt-get install -y \
|
||||
libjemalloc1 \
|
||||
nodejs \
|
||||
groff-base \
|
||||
awscli \
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,6 +1,6 @@
|
|||
source 'http://rubygems.org'
|
||||
|
||||
ruby '2.4.4'
|
||||
ruby '2.4.5'
|
||||
|
||||
gem 'rails', '5.1.6'
|
||||
gem 'webpacker', '~> 2.0'
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.15.2
|
||||
1.15.3
|
||||
|
|
|
@ -873,18 +873,21 @@ function bindEditTagsAjax(elements) {
|
|||
manageTagsModalBody = manageTagsModal.find(".modal-body");
|
||||
|
||||
// Reload tags HTML element when modal is closed
|
||||
manageTagsModal.on("hide.bs.modal", function(){
|
||||
manageTagsModal.off().on("hide.bs.modal", function(){
|
||||
var task = $("div.panel[data-module-id='" +
|
||||
manageTagsModal.data('module-id') + "']");
|
||||
|
||||
// Load HTML
|
||||
$.ajax({
|
||||
url: task.attr("data-module-tags-url"),
|
||||
url: $('#canvas-container').attr('data-module-tags-url'),
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
task.find(".edit-tags-link")
|
||||
.html(data.html_canvas);
|
||||
success: function(data) {
|
||||
$.each(data.my_modules, function(index, my_module){
|
||||
$('div.panel[data-module-id=' + my_module.id + ']')
|
||||
.find(".edit-tags-link")
|
||||
.html(my_module.tags_html);
|
||||
});
|
||||
// initialize tooltips again
|
||||
$.initTooltips();
|
||||
},
|
||||
|
|
27
app/assets/javascripts/secondary_navigation.js
Normal file
27
app/assets/javascripts/secondary_navigation.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
|
||||
function initRepositoriesDropDown() {
|
||||
var dropDown = $('.repositories-dropdown');
|
||||
var dropDownMenu = $('.repositories-dropdown-menu');
|
||||
dropDown.on('show.bs.dropdown', function() {
|
||||
dropDownMenu
|
||||
.find('.assigned-items-counter')
|
||||
.html('<i class="fas fa-spinner fa-spin"></i>');
|
||||
$.ajax({
|
||||
url: dropDown.data('url'),
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
dropDownMenu.html(data.html);
|
||||
},
|
||||
error: function() {
|
||||
dropDownMenu.find('.assigned-items-counter').html('');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// init
|
||||
initRepositoriesDropDown();
|
||||
}());
|
|
@ -56,6 +56,9 @@
|
|||
modal.modal('hide');
|
||||
});
|
||||
modal.modal();
|
||||
modal.find('a[disabled=disabled]').click(function(ev){
|
||||
ev.preventDefault();
|
||||
});
|
||||
$('.modal-backdrop').last().css('z-index', modal.css('z-index') - 1);
|
||||
},
|
||||
error: function(ev) {
|
||||
|
|
|
@ -206,6 +206,11 @@ label {
|
|||
padding-top: 10px;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
|
||||
.report-export-img {
|
||||
max-height: 300px;
|
||||
max-width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.report-element-children {
|
||||
|
|
|
@ -1945,10 +1945,6 @@ a.disabled-with-click-events {
|
|||
padding-bottom: 60px;
|
||||
}
|
||||
|
||||
.tiny-mce-pdf-ready {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.doorkeeper-authorization {
|
||||
|
||||
margin-bottom: 45px;
|
||||
|
|
|
@ -78,9 +78,28 @@ class AssetsController < ApplicationController
|
|||
elsif @assoc.class == RepositoryCell
|
||||
can_manage_repository_rows?(@repository.team)
|
||||
end
|
||||
file_ext = @asset.file_file_name.split('.').last
|
||||
if Constants::WOPI_EDITABLE_FORMATS.include?(file_ext)
|
||||
edit_supported = true
|
||||
title = ''
|
||||
else
|
||||
edit_supported = false
|
||||
title = if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
I18n.t('assets.wopi_supported_text_formats_title')
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
I18n.t('assets.wopi_supported_table_formats_title')
|
||||
else
|
||||
I18n.t('assets.wopi_supported_presentation_formats_title')
|
||||
end
|
||||
end
|
||||
response_json['wopi-controls'] = render_to_string(
|
||||
partial: 'shared/file_wopi_controlls.html.erb',
|
||||
locals: { asset: @asset, can_edit: can_edit }
|
||||
locals: {
|
||||
asset: @asset,
|
||||
can_edit: can_edit,
|
||||
edit_supported: edit_supported,
|
||||
title: title
|
||||
}
|
||||
)
|
||||
end
|
||||
respond_to do |format|
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class MyModuleTagsController < ApplicationController
|
||||
before_action :load_vars
|
||||
before_action :load_vars, except: :canvas_index
|
||||
before_action :check_view_permissions, only: :index
|
||||
before_action :check_manage_permissions, only: %i(create index_edit destroy)
|
||||
|
||||
|
@ -25,10 +25,6 @@ class MyModuleTagsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.json do
|
||||
render json: {
|
||||
html_canvas: render_to_string(
|
||||
partial: 'canvas/tags.html.erb',
|
||||
locals: { my_module: @my_module }
|
||||
),
|
||||
html_module_header: render_to_string(
|
||||
partial: 'my_modules/tags.html.erb',
|
||||
locals: { my_module: @my_module }
|
||||
|
@ -38,6 +34,26 @@ class MyModuleTagsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def canvas_index
|
||||
experiment = Experiment.find(params[:id])
|
||||
render_403 unless can_read_experiment?(experiment)
|
||||
res = []
|
||||
experiment.active_my_modules.each do |my_module|
|
||||
res << {
|
||||
id: my_module.id,
|
||||
tags_html: render_to_string(
|
||||
partial: 'canvas/tags.html.erb',
|
||||
locals: { my_module: my_module }
|
||||
)
|
||||
}
|
||||
end
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: { my_modules: res }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@mt = MyModuleTag.new(mt_params.merge(my_module: @my_module))
|
||||
@mt.created_by = current_user
|
||||
|
|
|
@ -14,7 +14,8 @@ class MyModulesController < ApplicationController
|
|||
complete_my_module repository repository_index
|
||||
assign_repository_records unassign_repository_records
|
||||
unassign_repository_records_modal
|
||||
assign_repository_records_modal)
|
||||
assign_repository_records_modal
|
||||
repositories_dropdown)
|
||||
before_action :load_vars_nested, only: %i(new create)
|
||||
before_action :load_repository, only: %i(assign_repository_records
|
||||
unassign_repository_records
|
||||
|
@ -27,7 +28,7 @@ class MyModulesController < ApplicationController
|
|||
before_action :check_manage_permissions, only: %i(description due_date)
|
||||
before_action :check_view_permissions, only:
|
||||
%i(show activities activities_tab protocols results samples samples_index
|
||||
archive)
|
||||
archive repositories_dropdown)
|
||||
before_action :check_complete_module_permission, only: :complete_my_module
|
||||
before_action :check_assign_repository_records_permissions,
|
||||
only: %i(unassign_repository_records_modal
|
||||
|
@ -403,6 +404,20 @@ class MyModulesController < ApplicationController
|
|||
render 'repository_rows/index.json'
|
||||
end
|
||||
|
||||
def repositories_dropdown
|
||||
load_repository if params[:repository_id].present?
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: {
|
||||
html: render_to_string(
|
||||
partial: 'repositories_dropdown.html.erb',
|
||||
locals: { enable_counters: true }
|
||||
)
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Submit actions
|
||||
def assign_repository_records
|
||||
if params[:selected_rows].present? && params[:repository_id].present?
|
||||
|
|
|
@ -7,11 +7,11 @@ module FileIconsHelper
|
|||
# For showing next to file
|
||||
def file_fa_icon_class(asset)
|
||||
file_ext = asset.file_file_name.split('.').last
|
||||
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
fa_class = 'fa-file-word'
|
||||
elsif %w(ods xls xlsb xlsm xlsx).include?(file_ext)
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
fa_class = 'fa-file-excel'
|
||||
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
|
||||
elsif Constants::FILE_PRESENTATION_FORMATS.include?(file_ext)
|
||||
fa_class = 'fa-file-powerpoint'
|
||||
elsif %w(pdf).include?(file_ext)
|
||||
fa_class = 'fa-file-pdf'
|
||||
|
@ -31,11 +31,11 @@ module FileIconsHelper
|
|||
# For showing next to file
|
||||
def file_extension_icon(asset)
|
||||
file_ext = asset.file_file_name.split('.').last
|
||||
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
image_link = 'office/Word-docx_20x20x32.png'
|
||||
elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext)
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
image_link = 'office/Excel-xlsx_20x20x32.png'
|
||||
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
|
||||
elsif Constants::FILE_PRESENTATION_FORMATS.include?(file_ext)
|
||||
image_link = 'office/PowerPoint-pptx_20x20x32.png'
|
||||
end
|
||||
|
||||
|
@ -54,11 +54,11 @@ module FileIconsHelper
|
|||
# For showing in view/edit buttons (WOPI)
|
||||
def file_application_icon(asset)
|
||||
file_ext = asset.file_file_name.split('.').last
|
||||
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
image_link = 'office/Word-color_16x16x32.png'
|
||||
elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext)
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
image_link = 'office/Excel-color_16x16x32.png'
|
||||
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
|
||||
elsif Constants::FILE_PRESENTATION_FORMATS.include?(file_ext)
|
||||
image_link = 'office/PowerPoint-Color_16x16x32.png'
|
||||
end
|
||||
|
||||
|
@ -72,11 +72,11 @@ module FileIconsHelper
|
|||
# Shows correct WOPI application text (Word Online/Excel ..)
|
||||
def wopi_button_text(asset, action)
|
||||
file_ext = asset.file_file_name.split('.').last
|
||||
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
|
||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||
app = 'Word Online'
|
||||
elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext)
|
||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||
app = 'Excel Online'
|
||||
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
|
||||
elsif Constants::FILE_PRESENTATION_FORMATS.include?(file_ext)
|
||||
app = 'PowerPoint Online'
|
||||
end
|
||||
|
||||
|
|
|
@ -26,7 +26,15 @@ module TinyMceHelper
|
|||
img = TinyMceAsset.find_by_id(match[1])
|
||||
next unless img && check_image_permissions(obj, img)
|
||||
if pdf_export_ready
|
||||
report_image_asset_url(img, :tiny_mce_asset, 'tiny-mce-pdf-ready')
|
||||
tmp_f = Tempfile.open(img.image_file_name, Rails.root.join('tmp'))
|
||||
begin
|
||||
img.image.copy_to_local_file(:large, tmp_f.path)
|
||||
encoded_image = Base64.strict_encode64(tmp_f.read)
|
||||
"<img src='data:image/jpg;base64,#{encoded_image}'>"
|
||||
ensure
|
||||
tmp_f.close
|
||||
tmp_f.unlink
|
||||
end
|
||||
else
|
||||
image_tag(img.url,
|
||||
class: 'img-responsive',
|
||||
|
|
|
@ -174,6 +174,12 @@ class MyModule < ApplicationRecord
|
|||
restored
|
||||
end
|
||||
|
||||
def repository_rows_count(repository)
|
||||
my_module_repository_rows.joins(repository_row: :repository)
|
||||
.where('repositories.id': repository.id)
|
||||
.count
|
||||
end
|
||||
|
||||
def unassigned_users
|
||||
User.find_by_sql(
|
||||
"SELECT DISTINCT users.id, users.full_name FROM users " +
|
||||
|
|
|
@ -6,7 +6,10 @@ class MyModuleRepositoryRow < ApplicationRecord
|
|||
belongs_to :repository_row,
|
||||
optional: true,
|
||||
inverse_of: :my_module_repository_rows
|
||||
belongs_to :my_module, optional: true, inverse_of: :my_module_repository_rows
|
||||
belongs_to :my_module,
|
||||
optional: true,
|
||||
touch: true,
|
||||
inverse_of: :my_module_repository_rows
|
||||
|
||||
validates :repository_row, :my_module, presence: true
|
||||
validates :repository_row, uniqueness: { scope: :my_module }
|
||||
|
|
|
@ -193,12 +193,7 @@ class TeamZipExport < ZipExport
|
|||
name = "#{directory}/#{append_file_suffix(asset.file_file_name,
|
||||
"_#{i}")}"
|
||||
end
|
||||
file = FileUtils.touch(name).first
|
||||
if asset.file.exists?
|
||||
File.open(file, 'wb') do |f|
|
||||
f.write(Paperclip.io_adapters.for(asset.file).read)
|
||||
end
|
||||
end
|
||||
asset.file.copy_to_local_file(:original, name) if asset.file.exists?
|
||||
asset_indexes[asset.id] = name
|
||||
end
|
||||
|
||||
|
@ -266,8 +261,7 @@ class TeamZipExport < ZipExport
|
|||
|
||||
# Save all attachments (it doesn't work directly in callback function
|
||||
assets.each do |asset, asset_path|
|
||||
file = FileUtils.touch(asset_path).first
|
||||
File.open(file, 'wb') { |f| f.write asset.open.read }
|
||||
asset.file.copy_to_local_file(:original, asset_path)
|
||||
end
|
||||
|
||||
csv_file_path
|
||||
|
@ -301,7 +295,7 @@ class TeamZipExport < ZipExport
|
|||
write_entries(input_dir, subdir, zip_file_path, io)
|
||||
else
|
||||
io.get_output_stream(zip_file_path) do |f|
|
||||
f.puts File.open(disk_file_path, 'rb').read
|
||||
f.write(File.open(disk_file_path, 'rb').read)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ module Api
|
|||
attr_accessor :core_api_token_ttl
|
||||
attr_accessor :core_api_token_iss
|
||||
attr_accessor :azure_ad_apps
|
||||
attr_accessor :core_api_v1_preview
|
||||
attr_accessor :core_api_v1_enabled
|
||||
attr_accessor :core_api_rate_limit
|
||||
|
||||
def initialize
|
||||
|
@ -24,7 +24,7 @@ module Api
|
|||
@core_api_token_ttl = 30.minutes
|
||||
@core_api_token_iss = 'SciNote'
|
||||
@azure_ad_apps = {}
|
||||
@core_api_v1_preview = false
|
||||
@core_api_v1_enabled = false
|
||||
@core_api_rate_limit = 1000
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
data-module-x="<%= my_module.x %>"
|
||||
data-module-y="<%= my_module.y %>"
|
||||
data-module-conns="<%= construct_module_connections(my_module) %>"
|
||||
data-module-tags-url="<%= my_module_my_module_tags_url(my_module, format: :json) %>"
|
||||
data-module-users-tab-url="<%= my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>">
|
||||
data-module-tags-url="<%= my_module_tags_experiment_path(my_module.experiment, format: :json) %>">
|
||||
|
||||
<% if can_manage_module?(my_module) %>
|
||||
<a class="edit-tags-link pull-right" data-remote="true" href="<%= my_module_tags_edit_url(my_module, format: :json) %>">
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
<% end %>
|
||||
data-module-x="<%= my_module.x %>"
|
||||
data-module-y="<%= my_module.y %>"
|
||||
data-module-conns="<%= construct_module_connections(my_module) %>"
|
||||
data-module-tags-url="<%= my_module_my_module_tags_url(my_module, format: :json) %>">
|
||||
data-module-conns="<%= construct_module_connections(my_module) %>">
|
||||
|
||||
<% if can_manage_module?(my_module) %>
|
||||
<a class="edit-tags-link pull-right" data-remote="true" href="<%= my_module_tags_edit_url(my_module, format: :json) %>">
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="canvas-container" data-project-id="<%= @project.id %>">
|
||||
<div id="canvas-container" data-project-id="<%= @project.id %>" data-module-tags-url="<%= my_module_tags_experiment_path(@experiment, format: :json) %>">
|
||||
<%= render partial: 'canvas/full_zoom', locals: { experiment: @experiment, my_modules: @active_modules } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
22
app/views/my_modules/_repositories_dropdown.html.erb
Normal file
22
app/views/my_modules/_repositories_dropdown.html.erb
Normal file
|
@ -0,0 +1,22 @@
|
|||
<% @my_module.experiment.project.team.repositories.order(created_at: :asc).each do |repository| %>
|
||||
<li>
|
||||
<a class="dropdown-item <%= "active-item" if @repository == repository %> help_tooltips"
|
||||
data-tooltiplink="<%= I18n.t('tooltips.link.protocol.inventories') %>"
|
||||
data-tooltipcontent="<%= I18n.t('tooltips.text.protocol.inventories') %>"
|
||||
href="<%= repository_my_module_url(id: @my_module, repository_id: repository) %>"
|
||||
title="<%= repository.name %>">
|
||||
<% if enable_counters %>
|
||||
<% cache [repository, @my_module] do %>
|
||||
<%= truncate(repository.name) %>
|
||||
<span class="assigned-items-counter"><%= "(#{@my_module.repository_rows_count(repository)})" %></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= truncate(repository.name) %>
|
||||
<span class="assigned-items-counter"><i class="fas fa-spinner fa-spin"></i></span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<% unless @my_module.experiment.project.team.repositories.last == repository %>
|
||||
<li class="divider"></li>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,5 +1,7 @@
|
|||
<p><%=t 'projects.export_projects.modal_text_p1_html', num_projects: num_projects, team: @team.name %></p>
|
||||
<p><%=t 'projects.export_projects.modal_text_p2_html' %></p>
|
||||
<p>
|
||||
<i><%=t 'projects.export_projects.modal_text_p3_html', limit: limit, num: num_of_requests_left %></i>
|
||||
</p>
|
||||
<% unless limit.zero? %>
|
||||
<p>
|
||||
<i><%=t 'projects.export_projects.modal_text_p3_html', limit: limit, num: num_of_requests_left %></i>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
@ -38,7 +38,11 @@
|
|||
<div class="report-element-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 file-image">
|
||||
<%= report_image_asset_url(asset) %>
|
||||
<% if defined?(export_all) && export_all %>
|
||||
<img class="report-export-img" src="<%= path %>">
|
||||
<% else %>
|
||||
<%= report_image_asset_url(asset) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<% comments = result.result_comments %>
|
||||
<% timestamp = result.created_at %>
|
||||
<% name = result.name %>
|
||||
<% pdf_export_ready = defined?(export_all) && export_all %>
|
||||
<div class="report-element report-result-element report-result-text-element" data-ts="<%= timestamp.to_i %>" data-type="result_text" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-modal-title="<%=t "projects.reports.elements.modals.result_contents.head_title", result: result.name %>" data-name="<%= name %>" data-icon-class="fas fa-asterisk">
|
||||
<div class="report-element-header">
|
||||
<div class="row">
|
||||
|
@ -23,7 +24,7 @@
|
|||
<div class="report-element-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-container ql-editor">
|
||||
<%= custom_auto_link(generate_image_tag_from_token(result_text.text, result_text, true),
|
||||
<%= custom_auto_link(generate_image_tag_from_token(result_text.text, result_text, pdf_export_ready),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img)) %>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<% assets = step.assets %>
|
||||
<% checklists = step.checklists %>
|
||||
<% comments = step.step_comments %>
|
||||
<% pdf_export_ready = defined?(export_all) && export_all %>
|
||||
<div class="report-element report-step-element" data-ts="<%= timestamp.to_i %>" data-type="step" data-id='{ "step_id": <%= step.id %> }' data-scroll-id="<%= step.id %>" data-modal-title="<%=t "projects.reports.elements.modals.step_contents.head_title", step: step.name %>" data-name="<%=t "projects.reports.elements.step.sidebar_name", pos: (step.position + 1), name: step.name %>" data-icon-class="fas fa-arrow-circle-right">
|
||||
<div class="report-element-header">
|
||||
<div class="row">
|
||||
|
@ -30,7 +31,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 ql-editor">
|
||||
<% if strip_tags(step.description).present? %>
|
||||
<%= custom_auto_link(generate_image_tag_from_token(step.description, step, true),
|
||||
<%= custom_auto_link(generate_image_tag_from_token(step.description, step, pdf_export_ready),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img)) %>
|
||||
|
|
|
@ -32,7 +32,11 @@
|
|||
<% if is_image %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 file-image">
|
||||
<%= report_image_asset_url(asset) %>
|
||||
<% if defined?(export_all) && export_all %>
|
||||
<img class="report-export-img" src="<%= path %>">
|
||||
<% else %>
|
||||
<%= report_image_asset_url(asset) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= file_application_icon(asset) %>
|
||||
<%= wopi_button_text(asset, 'view') %>
|
||||
<% end %>
|
||||
<% if can_edit %>
|
||||
<% if can_edit && edit_supported %>
|
||||
<%= link_to edit_asset_url(id: asset),
|
||||
class: 'btn btn-default btn-sm',
|
||||
target: '_blank',
|
||||
|
@ -13,4 +13,14 @@
|
|||
<%= file_application_icon(asset) %>
|
||||
<%= wopi_button_text(asset, 'edit') %>
|
||||
<% end %>
|
||||
<% elsif can_edit %>
|
||||
<%= link_to edit_asset_url(id: asset),
|
||||
class: 'btn btn-default btn-sm',
|
||||
target: '_blank',
|
||||
title: title,
|
||||
disabled: true,
|
||||
style: 'display: inline-block' do %>
|
||||
<%= file_application_icon(asset) %>
|
||||
<%= wopi_button_text(asset, 'edit') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -123,27 +123,16 @@
|
|||
<li data-hook="secondary-navigation-tabs"></li>
|
||||
<% if can_read_team?(@my_module.experiment.project.team) &&
|
||||
@my_module.experiment.project.team.repositories.exists? %>
|
||||
<li id="repositories-nav-tab" class="<%= "active" if module_repository_page? %>">
|
||||
<li id="repositories-nav-tab"
|
||||
class="<%= "active" if module_repository_page? %> dropdown repositories-dropdown"
|
||||
data-url="<%= module_repository_page? ? repositories_dropdown_repository_tab_my_module_path(repository: @repository) : repositories_dropdown_my_module_path %>">
|
||||
<a href="#" id="repositoriesDropdownMenuLink" title="<%=t "nav2.modules.repositories" %>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="hidden-sm hidden-md"><%=t "nav2.modules.repositories" %></span>
|
||||
<span class="hidden-xs hidden-lg fas fa-list-alt"></span>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu repositories-dropdown-menu" aria-labelledby="repositoriesDropdownMenuLink">
|
||||
<% @my_module.experiment.project.team.repositories.order(created_at: :asc).each do |repository| %>
|
||||
<li>
|
||||
<a class="dropdown-item <%= "active-item" if module_repository_page? && @repository == repository %> help_tooltips"
|
||||
data-tooltiplink="<%= I18n.t('tooltips.link.protocol.inventories') %>"
|
||||
data-tooltipcontent="<%= I18n.t('tooltips.text.protocol.inventories') %>"
|
||||
href="<%= repository_my_module_url(id: @my_module, repository_id: repository) %>"
|
||||
title="<%= repository.name %>">
|
||||
<%= truncate(repository.name) %>
|
||||
</a>
|
||||
</li>
|
||||
<% unless @my_module.experiment.project.team.repositories.last == repository %>
|
||||
<li class="divider"></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render partial: "repositories_dropdown.html.erb", locals: { enable_counters: false } %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -168,4 +157,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<%= javascript_include_tag('secondary_navigation') %>
|
||||
|
||||
<% end %>
|
||||
|
|
|
@ -12,9 +12,9 @@ Api.configure do |config|
|
|||
config.core_api_rate_limit =
|
||||
ENV['CORE_API_RATE_LIMIT'] ? ENV['CORE_API_RATE_LIMIT'].to_i : 1000
|
||||
|
||||
config.core_api_v1_preview = true if ENV['CORE_API_V1_PREVIEW']
|
||||
config.core_api_v1_enabled = true if ENV['CORE_API_V1_ENABLED']
|
||||
|
||||
Paperclip::DataUriAdapter.register if ENV['CORE_API_V1_PREVIEW']
|
||||
Paperclip::DataUriAdapter.register if ENV['CORE_API_V1_ENABLED']
|
||||
|
||||
vars = ENV.select { |name, _| name =~ /^[[:alnum:]]*_AZURE_AD_APP_ID/ }
|
||||
vars.each do |name, value|
|
||||
|
|
|
@ -66,6 +66,7 @@ Rails.application.config.assets.precompile +=
|
|||
Rails.application.config.assets.precompile += %w(datatables.js)
|
||||
Rails.application.config.assets.precompile += %w(search/index.js)
|
||||
Rails.application.config.assets.precompile += %w(navigation.js)
|
||||
Rails.application.config.assets.precompile += %w(secondary_navigation.js)
|
||||
Rails.application.config.assets.precompile += %w(datatables.css)
|
||||
Rails.application.config.assets.precompile += %w(my_modules.js)
|
||||
Rails.application.config.assets.precompile += %w(canvas-to-blob.min.js)
|
||||
|
|
|
@ -187,6 +187,17 @@ class Constants
|
|||
# Other
|
||||
#=============================================================================
|
||||
|
||||
FILE_TEXT_FORMATS = %w(doc docm docx dot dotm dotx odt rtf).freeze
|
||||
|
||||
FILE_TABLE_FORMATS = %w(csv ods xls xlsb xlsm xlsx).freeze
|
||||
|
||||
FILE_PRESENTATION_FORMATS =
|
||||
%w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).freeze
|
||||
|
||||
WOPI_EDITABLE_FORMATS = %w(
|
||||
docx docm odt xlsx xlsm xlsb ods pptx ppsx odp
|
||||
).freeze
|
||||
|
||||
TEXT_EXTRACT_FILE_TYPES = [
|
||||
'application/msword',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||
|
|
|
@ -1918,6 +1918,9 @@ en:
|
|||
add_image: 'Add'
|
||||
file_name: 'File name'
|
||||
file_name_placeholder: 'Image'
|
||||
wopi_supported_text_formats_title: 'Only .docx, .docm, .odt file formats are supported for editing in Word Online.'
|
||||
wopi_supported_table_formats_title: 'Only .xlsx, .xlsm, .xlsb, .ods file formats are supported for editing in Excel Online.'
|
||||
wopi_supported_presentation_formats_title: 'Only .pptx, ppsx, .odp file formats are supported for editing in Powerpoint Online.'
|
||||
atwho:
|
||||
no_results: "No results found"
|
||||
users:
|
||||
|
|
|
@ -311,6 +311,7 @@ Rails.application.routes.draw do
|
|||
get 'canvas/small_zoom', to: 'canvas#small_zoom' # AJAX-loaded canvas zoom
|
||||
post 'canvas', to: 'canvas#update' # Save updated canvas action
|
||||
get 'module_archive' # Module archive for single experiment
|
||||
get 'my_module_tags', to: 'my_module_tags#canvas_index'
|
||||
get 'archive' # archive experiment
|
||||
get 'clone_modal' # return modal with clone options
|
||||
post 'clone' # clone experiment
|
||||
|
@ -374,6 +375,12 @@ Rails.application.routes.draw do
|
|||
get 'archive' # Archive view for single module
|
||||
get 'complete_my_module'
|
||||
post 'toggle_task_state'
|
||||
get 'repositories_dropdown',
|
||||
to: 'my_modules#repositories_dropdown',
|
||||
as: :repositories_dropdown
|
||||
get 'repositories_dropdown/:repository_id',
|
||||
to: 'my_modules#repositories_dropdown',
|
||||
as: :repositories_dropdown_repository_tab
|
||||
# Renders sample datatable for single module (ajax action)
|
||||
# post 'samples_index'
|
||||
# post :assign_samples,
|
||||
|
@ -561,7 +568,7 @@ Rails.application.routes.draw do
|
|||
namespace :api, defaults: { format: 'json' } do
|
||||
get 'health', to: 'api#health'
|
||||
get 'status', to: 'api#status'
|
||||
if Api.configuration.core_api_v1_preview
|
||||
if Api.configuration.core_api_v1_enabled
|
||||
namespace :v1 do
|
||||
resources :teams, only: %i(index show) do
|
||||
resources :inventories,
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'devise'
|
|||
require_relative 'support/controller_macros'
|
||||
ENV['RAILS_ENV'] = 'test'
|
||||
|
||||
ENV['CORE_API_V1_PREVIEW'] = 'true'
|
||||
ENV['CORE_API_V1_ENABLED'] = 'true'
|
||||
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
# Prevent database truncation if the environment is production
|
||||
|
|
Loading…
Reference in a new issue