rush_job 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45d655c9aeaf9774ecc53b6adca11f23cf537fa9eaeca9868d1740348e65e076
4
- data.tar.gz: 257e886e1d20d3195e92fe4779266124901a9110219a29ffc85336a91da33fa8
3
+ metadata.gz: 0eb9df24e7c11682daffe5668b62cf2a990221e660e2caa24013a2ce213895b8
4
+ data.tar.gz: 91b6504b8ef25c7cc6d127f07e443a5809f21ada4d9401cce5644e78179ea480
5
5
  SHA512:
6
- metadata.gz: 73ee2521a393805f943fe963bfe1ad73a8517cbf158ce3f0a5ba117702edc64aad6ca839ffd185629032fce23f8ab02e6513b56562d50bc9fe5252358a0e2572
7
- data.tar.gz: 27b45f1e3f33976c8147c39dbcf5742abf660cf6cce52d64b9842df961b513db04ac763b99d055ed1e90ebcb5af5b92861ec27131b9891c137b59489e0ee209f
6
+ metadata.gz: d15e808676c9eaa01d10c795898d8a545d2885544010a788a664281a25b6f4ab984b640c2ecd9335e1b2adb48f473d1c49d9edb9a00af69f1d02f9bd8e2cbfa3
7
+ data.tar.gz: 92bd89d583eb12ff8e82c751cffd7fb364b35f9eb3143b9cedeca0656514980175a016e1cccc094ec21b44a599c2b7e4965bd8798e65f3fb866a5643c1c207bc
data/README.md CHANGED
@@ -17,7 +17,7 @@ Navigate to the `/rush_job` route in your application to see the Delayed Jobs. L
17
17
  Add this line to your Ruby on Rails application's Gemfile:
18
18
 
19
19
  ```ruby
20
- gem 'rush_job', '~> 1.1'
20
+ gem 'rush_job', '~> 1.2'
21
21
  ```
22
22
 
23
23
  And then execute:
@@ -1,7 +1,7 @@
1
1
  import { Application } from '@hotwired/stimulus';
2
- import RushJobConfirmController from './controllers/rush_job_confirm_controller';
3
- import RushJobPollingController from './controllers/rush_job_polling_controller';
4
- import RushJobReloadJobsTableController from './controllers/rush_job_reload_jobs_table_controller';
2
+ import RushJobConfirmController from 'rush_job/controllers/rush_job_confirm_controller';
3
+ import RushJobPollingController from 'rush_job/controllers/rush_job_polling_controller';
4
+ import RushJobReloadJobsTableController from 'rush_job/controllers/rush_job_reload_jobs_table_controller';
5
5
  import 'bootstrap';
6
6
  import '@hotwired/turbo-rails';
7
7
 
@@ -1,4 +1,4 @@
1
- import { RushJobTableUpdateController } from './rush_job_table_update_controller';
1
+ import { RushJobTableUpdateController } from 'rush_job/controllers/rush_job_table_update_controller';
2
2
 
3
3
  let intervalID;
4
4
  let progressInterveralID;
@@ -1,4 +1,4 @@
1
- import { RushJobTableUpdateController } from './rush_job_table_update_controller';
1
+ import { RushJobTableUpdateController } from 'rush_job/controllers/rush_job_table_update_controller';
2
2
 
3
3
  export default class extends RushJobTableUpdateController {
4
4
  reloadJobs() {
@@ -1,15 +1,24 @@
1
1
  import { Controller } from '@hotwired/stimulus';
2
2
 
3
3
  export class RushJobTableUpdateController extends Controller {
4
- updateJobs() {
4
+ async updateJobs() {
5
5
  const headers = { 'Accept': 'text/vnd.turbo-stream.html' };
6
6
 
7
7
  this.blurTable();
8
8
  this.clearFlash();
9
9
 
10
- fetch(document.location.href, { headers: headers })
11
- .then(response => response.text())
12
- .then(html => Turbo.renderStreamMessage(html));
10
+ try {
11
+ const response = await fetch(document.location.href, { headers: headers })
12
+
13
+ if (!response.ok) {
14
+ throw new Error(`Failed to fetch job data. Status: ${response.status}`);
15
+ }
16
+
17
+ const response_text = await response.text();
18
+ Turbo.renderStreamMessage(response_text);
19
+ } catch (error) {
20
+ console.error(error.message);
21
+ }
13
22
  }
14
23
 
15
24
  blurTable() {
data/config/importmap.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  pin 'rush_job/application', preload: true
2
+ pin 'rush_job/controllers/rush_job_confirm_controller', preload: true
3
+ pin 'rush_job/controllers/rush_job_polling_controller', preload: true
4
+ pin 'rush_job/controllers/rush_job_reload_jobs_table_controller', preload: true
5
+ pin 'rush_job/controllers/rush_job_table_update_controller', preload: true
2
6
  pin 'bootstrap', to: 'https://ga.jspm.io/npm:bootstrap@5.3.1/dist/js/bootstrap.esm.js'
3
7
  pin '@popperjs/core', to: 'https://ga.jspm.io/npm:@popperjs/core@2.11.8/lib/index.js'
4
8
  pin '@hotwired/stimulus', to: 'https://ga.jspm.io/npm:@hotwired/stimulus@3.2.2/dist/stimulus.js'
@@ -1,3 +1,3 @@
1
1
  module RushJob
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rush_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JavaKoala
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-12 00:00:00.000000000 Z
11
+ date: 2024-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.0'
89
+ version: '2.1'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '2.0'
96
+ version: '2.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pagy
99
99
  requirement: !ruby/object:Gem::Requirement