Fix hound

This commit is contained in:
Anton 2023-08-25 09:46:53 +02:00
parent f31d2b8912
commit e66968357a
4 changed files with 9 additions and 9 deletions

View file

@ -68,10 +68,10 @@ class AssetsController < ApplicationController
def move_targets def move_targets
if @assoc.is_a?(Step) if @assoc.is_a?(Step)
protocol = @assoc.protocol protocol = @assoc.protocol
render json: { targets: protocol.steps.order(:position).where.not(id: @assoc.id).map{|i| [i.id, i.name] } } render json: { targets: protocol.steps.order(:position).where.not(id: @assoc.id).map { |i| [i.id, i.name] } }
elsif @assoc.is_a?(Result) elsif @assoc.is_a?(Result)
my_module = @assoc.my_module my_module = @assoc.my_module
render json: { targets: my_module.results.where.not(id: @assoc.id).map{ |i| [i.id, i.name] } } render json: { targets: my_module.results.where.not(id: @assoc.id).map { |i| [i.id, i.name] } }
else else
render json: { targets: [] } render json: { targets: [] }
end end

View file

@ -144,7 +144,7 @@
return `${attachment.attributes.view_mode}Attachment` return `${attachment.attributes.view_mode}Attachment`
}, },
deleteAttachment(id) { deleteAttachment(id) {
this.$emit('attachment:deleted', id, ) this.$emit('attachment:deleted', id)
}, },
initMarvinJS() { initMarvinJS() {
// legacy logic from app/assets/javascripts/sitewide/marvinjs_editor.js // legacy logic from app/assets/javascripts/sitewide/marvinjs_editor.js

View file

@ -4,4 +4,4 @@ export default {
this.$emit('attachment:moved', attachmentId, targetId); this.$emit('attachment:moved', attachmentId, targetId);
} }
} }
} };

View file

@ -9,16 +9,16 @@ export default {
methods: { methods: {
showMoveModal(event) { showMoveModal(event) {
event.stopPropagation(); event.stopPropagation();
this.movingAttachment= true; this.movingAttachment = true;
}, },
closeMoveModal() { closeMoveModal() {
this.movingAttachment = false; this.movingAttachment = false;
}, },
moveAttachment(target_id) { moveAttachment(targetId) {
axios.post(this.attachment.attributes.urls.move, { target_id: target_id }). axios.post(this.attachment.attributes.urls.move, { target_id: targetId })
then(() => { .then(() => {
this.movingAttachment = false; this.movingAttachment = false;
this.$emit('attachment:moved', this.attachment.id, target_id); this.$emit('attachment:moved', this.attachment.id, targetId);
}); });
} }
} }