Skip to content

Commit

Permalink
Merge pull request #153 from slovensko-digital/RF-496/Fix-syncing-issues
Browse files Browse the repository at this point in the history
RF-496/Fix-syncing-issues
  • Loading branch information
celuchmarek authored Dec 9, 2024
2 parents 1a19cc6 + 8df1f5e commit 42a2ec1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/controllers/admin/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def preview
@phase_revision = @phase.revisions.find_by(revision: @page.revisions.find_by(version: params['version']))
end
@ratings_by_type = @phase_revision.ratings.index_by(&:rating_type)

@project = @phase.project

else
if params['version'] == 'latest'
@phase_revision = @page.latest_revision
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/sync_one_topic_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def process_row(row, indices, target_id)
product_page_id = row[indices["ID produktu"]]

if target_id == preparation_page_id.to_i
if platform_link != ''
if platform_link == 'Platforma link'
SyncTopicJob.perform_now(project_id, preparation_page_id)
else
enqueue_job_for_update("#{project_name} - Príprava", project_id, preparation_document_id, preparation_page_id, 'Prípravná fáza')
Expand All @@ -54,4 +54,4 @@ def has_template_name?(document_id)
document_name = GoogleApiService.get_document(document_id)&.title
document_name == 'Kópia dokumentu RF-priprava-template' || document_name == 'Kópia dokumentu RF-produkt-template'
end
end
end
1 change: 0 additions & 1 deletion app/views/admin/pages/preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</div>

<% if @phase.present? %>
<% @project = @phase_revision %>
<%= render file: 'phase_revision/show' %>
<% else %>
<% @page = @phase_revision %>
Expand Down
2 changes: 1 addition & 1 deletion spec/jobs/sync_one_topic_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[],
['Projekt', 'Projekt ID', 'Platforma', 'ID draft prípravy', 'ID prípravy', 'ID draft produktu', 'ID produktu'],
['Projekt1', 'ABC1', '', 'ABC1', 'ABC1', 'ABC1', 'ABC1'],
['Projekt2', 'ABC2', 'http://google.com', 'ABC2', 'ABC2', 'ABC2', 'ABC2']
['Projekt2', 'ABC2', 'Platforma link', 'ABC2', 'ABC2', 'ABC2', 'ABC2']
]
end

Expand Down

0 comments on commit 42a2ec1

Please sign in to comment.