From b9fe7c3d3e6ecc3d3a1f0d74db0c5ed7679e17a5 Mon Sep 17 00:00:00 2001 From: Andrej Date: Thu, 14 Sep 2023 17:10:52 +0200 Subject: [PATCH] Fix gene sequence html compiling with deface [SCI-9032] --- app/javascript/vue/ove/OpenVectorEditor.vue | 8 +++++--- app/views/gene_sequence_assets/edit.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/javascript/vue/ove/OpenVectorEditor.vue b/app/javascript/vue/ove/OpenVectorEditor.vue index ae52453ea..e148c267a 100644 --- a/app/javascript/vue/ove/OpenVectorEditor.vue +++ b/app/javascript/vue/ove/OpenVectorEditor.vue @@ -39,18 +39,20 @@ fileUrl: { type: String }, fileName: { type: String }, updateUrl: { type: String }, - canEditFile: { type: Boolean, default: false }, - oveEnabledDaysLeft: { type: Number } + canEditFile: { type: String }, + oveEnabledDaysLeftString: { type: String } }, data() { return { editor: null, sequenceName: null, closeAfterSave: false, - readOnly: !this.canEditFile + readOnly: this.canEditFile !== 'true', + oveEnabledDaysLeft: 0 } }, mounted() { + this.oveEnabledDaysLeft = parseInt(this.oveEnabledDaysLeftString); let editorConfig = { onSave: this.saveFile, generatePng: true, diff --git a/app/views/gene_sequence_assets/edit.html.erb b/app/views/gene_sequence_assets/edit.html.erb index e5a6b1b1d..a515df627 100644 --- a/app/views/gene_sequence_assets/edit.html.erb +++ b/app/views/gene_sequence_assets/edit.html.erb @@ -19,8 +19,8 @@ file-url="<%= @file_url %>" file-name="<%= @file_name %>" update-url="<%= @asset ? gene_sequence_asset_url(@asset) : gene_sequence_assets_url(parent_type: params[:parent_type], parent_id: params[:parent_id]) %>" - :can-edit-file="<%= asset_managable? %>" - :ove-enabled-days-left="<%= OpenVectorEditorService.evaluation_period_left %>" + can-edit-file="<%= asset_managable? %>" + ove-enabled-days-left-string="<%= OpenVectorEditorService.evaluation_period_left %>" /> <%= javascript_include_tag 'open_vector_editor' %>