Merge pull request #8340 from artoscinote/ma_SCI_11695

Handle non-existant smart anotation records [SCI-11695]
This commit is contained in:
Martin Artnik 2025-03-21 12:58:44 +01:00 committed by GitHub
commit 4319caa83f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 19 deletions

View file

@ -5,17 +5,6 @@ class SmartAnnotationsController < ApplicationController
include ActionView::Helpers::TextHelper
include ApplicationHelper
def parse_string
render json: {
annotations: custom_auto_link(
params[:string],
simple_format: false,
tags: %w(img),
team: current_team
)
}
end
def show
if params[:data]
render json: {
@ -29,7 +18,6 @@ class SmartAnnotationsController < ApplicationController
def user
user_team_assignment = resource.user_assignments.find_by(assignable: current_team)
render json: {
name: resource.name,
email: resource.email,
@ -72,10 +60,12 @@ class SmartAnnotationsController < ApplicationController
RepositoryRow
end
@resource ||= resource_class.find(resource_id)
@resource ||= resource_class.find_by(id: resource_id)
end
def resource_readable?
return false unless resource
@resource_readable ||=
case resource
when RepositoryRow

View file

@ -86,12 +86,6 @@ Rails.application.routes.draw do
get :update_progress_modal, on: :member
end
resource :smart_annotations, only: [] do
collection do
post :parse_string
end
end
get 'users/settings/account/connected_accounts',
to: 'users/settings/account/connected_accounts#index',
as: 'connected_accounts'