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' %>