-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use actioncable to track indexing progress
- Loading branch information
Showing
21 changed files
with
1,348 additions
and
72 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div data-behavior='progress-panel' data-exhibit-id="<%= exhibit.id %>" data-monitor-url="<%= helpers.actioncable? ? false : helpers.monitor_exhibit_bulk_updates_path(exhibit) %>"> | ||
<div class="card index-status border-info mb-3"> | ||
<h3 class="card-header bg-info text-white h4"><%= t("heading", scope: translation_field) %></h3> | ||
<div class="card-body"> | ||
<p data-behavior='monitor-start'> | ||
<span class="text-muted" data-behavior='date'></span> <%= t("begin_html", scope: translation_field) %> | ||
</p> | ||
|
||
<% if I18n.exists?("current_html", scope: translation_field) %> | ||
<p data-behavior='monitor-current'> | ||
<span class="text-muted" data-behavior='date'></span> <%= t("current_html", scope: translation_field) %> | ||
</p> | ||
<% end %> | ||
<% if I18n.exists?("completed_html", scope: translation_field) %> | ||
<p data-behavior='monitor-completed'> | ||
<span class="text-muted" data-behavior='date'></span> <%= t("completed_html", scope: translation_field) %> | ||
</p> | ||
<% end %> | ||
|
||
<p class="bg-warning" data-behavior='monitor-error' style='display:none;'> | ||
<%= t("error", scope: translation_field) %> | ||
</p> | ||
|
||
<div class="progress"> | ||
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="" aria-valuemin="0" aria-valuemax=""></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Spotlight | ||
# Renders progress bar html which is updated by progress_monitor.js | ||
class ProgressBarComponent < ViewComponent::Base | ||
attr_reader :exhibit, :translation_field | ||
|
||
def initialize(exhibit:, translation_field:) | ||
@exhibit = exhibit | ||
@translation_field = translation_field | ||
super | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Spotlight | ||
## | ||
# General helper for checking and using ActionCable | ||
module ActioncableHelper | ||
def actioncable? | ||
defined?(ActionCable.server) && ActionCable.server.config.cable.present? | ||
end | ||
|
||
def ws_broadcast(channel, data) | ||
if actioncable? | ||
ActionCable.server.broadcast channel, data | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Action Cable provides the framework to deal with WebSockets in Rails. | ||
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command. | ||
|
||
import { createConsumer } from "@rails/actioncable" | ||
|
||
export default createConsumer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
app/views/spotlight/catalog/_reindex_progress_panel.html.erb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.