mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 06:35:56 +08:00
Fix smart annotations on storage locations [SCI-11072]
This commit is contained in:
parent
926a9ee6d4
commit
f2796e54c2
|
@ -183,6 +183,9 @@ export default {
|
|||
}
|
||||
},
|
||||
saveLocation() {
|
||||
// Smart annotation fix
|
||||
this.object.description = $(this.$refs.description).val();
|
||||
|
||||
if (this.object.code) {
|
||||
axios.put(this.object.urls.update, this.object)
|
||||
.then(() => {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div v-html="params.data.sa_description"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DescriptionRenderer',
|
||||
props: {
|
||||
params: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -53,6 +53,7 @@ import EditModal from './modals/new_edit.vue';
|
|||
import MoveModal from './modals/move.vue';
|
||||
import ConfirmationModal from '../shared/confirmation_modal.vue';
|
||||
import ShareObjectModal from '../shared/share_modal.vue';
|
||||
import DescriptionRenderer from './renderers/description.vue';
|
||||
|
||||
export default {
|
||||
name: 'RepositoriesTable',
|
||||
|
@ -61,7 +62,8 @@ export default {
|
|||
EditModal,
|
||||
MoveModal,
|
||||
ConfirmationModal,
|
||||
ShareObjectModal
|
||||
ShareObjectModal,
|
||||
DescriptionRenderer
|
||||
},
|
||||
props: {
|
||||
dataSource: {
|
||||
|
@ -136,9 +138,11 @@ export default {
|
|||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
field: 'sa_description',
|
||||
headerName: this.i18n.t('storage_locations.index.table.description'),
|
||||
sortable: false
|
||||
sortable: false,
|
||||
notSelectable: true,
|
||||
cellRenderer: 'DescriptionRenderer'
|
||||
}];
|
||||
|
||||
return columns;
|
||||
|
|
|
@ -4,9 +4,11 @@ module Lists
|
|||
class StorageLocationSerializer < ActiveModel::Serializer
|
||||
include Rails.application.routes.url_helpers
|
||||
include ShareableSerializer
|
||||
include ApplicationHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
attributes :id, :code, :name, :container, :description, :owned_by, :created_by,
|
||||
:created_on, :urls, :metadata, :file_name, :sub_location_count, :is_empty
|
||||
:created_on, :urls, :metadata, :file_name, :sub_location_count, :is_empty, :sa_description
|
||||
|
||||
def owned_by
|
||||
object['team_name']
|
||||
|
@ -16,6 +18,14 @@ module Lists
|
|||
object.empty?
|
||||
end
|
||||
|
||||
def sa_description
|
||||
@user = scope[:user] || @instance_options[:user]
|
||||
custom_auto_link(object.description,
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
team: object.team)
|
||||
end
|
||||
|
||||
def metadata
|
||||
{
|
||||
display_type: object.metadata['display_type'],
|
||||
|
|
Loading…
Reference in a new issue