From 7ed9de730cbc5c8a43e66cffd20eb7bbc26d03de Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Wed, 22 May 2024 15:05:35 -0300 Subject: [PATCH 1/2] Return URLs in Markdown format --- app/models/cluster.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/cluster.rb b/app/models/cluster.rb index 5c10fcdb7f..2b12a3f1ad 100644 --- a/app/models/cluster.rb +++ b/app/models/cluster.rb @@ -38,7 +38,7 @@ def import_medias_to_team(team, claim_title, claim_context, parent_id = nil) existing_items << existing_item existing_item.nil? end - raise ActiveRecord::RecordNotUnique.new(I18n.t(:shared_feed_imported_media_already_exist, urls: existing_items.map(&:full_url).uniq.compact_blank.join(', '))) if from_project_media.nil? + raise ActiveRecord::RecordNotUnique.new(I18n.t(:shared_feed_imported_media_already_exist, urls: "\n" + existing_items.uniq.compact_blank.collect{ |pm| "•︎ [#{pm.title}](#{pm.full_url})" }.join("\n"))) if from_project_media.nil? parent = nil if parent_id.nil? parent = self.import_media_to_team(team, from_project_media, claim_title, claim_context) From f229d9c72587db6dc3f1de0af92ca4a9cd3ea0cd Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Wed, 22 May 2024 15:28:04 -0300 Subject: [PATCH 2/2] Updating copy --- app/models/cluster.rb | 2 +- config/locales/en.yml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/cluster.rb b/app/models/cluster.rb index 2b12a3f1ad..e5ff6cd605 100644 --- a/app/models/cluster.rb +++ b/app/models/cluster.rb @@ -38,7 +38,7 @@ def import_medias_to_team(team, claim_title, claim_context, parent_id = nil) existing_items << existing_item existing_item.nil? end - raise ActiveRecord::RecordNotUnique.new(I18n.t(:shared_feed_imported_media_already_exist, urls: "\n" + existing_items.uniq.compact_blank.collect{ |pm| "•︎ [#{pm.title}](#{pm.full_url})" }.join("\n"))) if from_project_media.nil? + raise ActiveRecord::RecordNotUnique.new(I18n.t(:shared_feed_imported_media_already_exist, urls: existing_items.uniq.compact_blank.collect{ |pm| "•︎ [#{pm.title}](#{pm.full_url})" }.join("\n"))) if from_project_media.nil? parent = nil if parent_id.nil? parent = self.import_media_to_team(team, from_project_media, claim_title, claim_context) diff --git a/config/locales/en.yml b/config/locales/en.yml index 79bf95e292..364f6241f5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -822,7 +822,10 @@ en: send_every_must_be_a_list_of_days_of_the_week: must be a list of days of the week. send_on_must_be_in_the_future: can't be in the past. cant_delete_default_folder: The default folder can't be deleted - shared_feed_imported_media_already_exist: "No media to import. All media items from this item already exist in your workspace: %{urls}" + shared_feed_imported_media_already_exist: |- + No media eligible to be imported into your workspace. + The media selected to import already exist in your workspace in the following items: + %{urls} info: messages: sent_to_trash_by_rule: '"%{item_title}" has been sent to trash by an automation