pg_rails 7.0.8.pre.alpha.6 → 7.0.8.pre.alpha.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54b808ee15e453ddfc9031c04c599eea58099615a03b4d23abadec9ee3951d8c
4
- data.tar.gz: 552aabdd132314da31928c4fcb2b59969ad7afe21c7a239f45fbc7738a1356ca
3
+ metadata.gz: 8b3571f15d522de34ce58f735dd40b7dd3b44bc2f8292233dbcc5e451dd49f7a
4
+ data.tar.gz: 315e2de0d4c61085eaf12fb48bc2298d928e1909c2546a9bfda57e8e3e9c88ed
5
5
  SHA512:
6
- metadata.gz: 5dddf3ab456741e7f671be016484caf643c1ad09a76ba96900707ab4e992049c5eb7da1273ab82b3fd83975278b72797cf4f9c0a178da5097f6343103e7968e7
7
- data.tar.gz: 87c679f069138a579790599626636fcf31c44ea9a1393bd13314cb2c5268c6add6c46dc89eabcb742739a2d19179d0cf475860bdf108cd981e743183f0ae1a30
6
+ metadata.gz: 305ac09bdf7ac2a6172f71979253e8dbf90123d5c4218d5ffda7ab7a035052271ea9c6c9f3f182a7b76064075294ba2e71e3b157b49461753b954a762f9d1de4
7
+ data.tar.gz: 7d4744860de97968cd3e67710bd859a64e4610dcca69439daba8a05422fd6b8d092fbf56ef55eddee79aacc9a43154d7545b481bde7060c492694bdefebfb843
@@ -1,5 +1,6 @@
1
1
  @use 'sass:color';
2
2
 
3
+ // TODO: Quitar .pg-form?
3
4
  .pg-form {
4
5
  .pg_associable {
5
6
  .limpiar {
@@ -17,6 +17,10 @@ input[disabled] {
17
17
  color: black;
18
18
  }
19
19
 
20
+ form label {
21
+ font-weight: bold;
22
+ }
23
+
20
24
  .form-control,
21
25
  .form-select {
22
26
  border: 1px solid #a7b7bb;
@@ -3,6 +3,7 @@ require 'English'
3
3
  module PgEngine
4
4
  class PdfPreviewGenerator
5
5
  def open_tempfile
6
+ FileUtils.mkdir_p('tmp')
6
7
  tempfile = Tempfile.open('PgEnginePdfPreview-', 'tmp')
7
8
 
8
9
  begin
@@ -0,0 +1,50 @@
1
+ def add_emulate_device(browser_options, emulate_device)
2
+ if emulate_device == 'notebook'
3
+ browser_options.add_emulation(device_metrics: { width: 800, height: 400, pixelRatio: 1, touch: true })
4
+ else
5
+ browser_options.add_emulation(device_name: emulate_device)
6
+ end
7
+
8
+ browser_options
9
+ end
10
+
11
+ def default_options(headless:)
12
+ options = Selenium::WebDriver::Chrome::Options.new
13
+ options.args << '--disable-site-isolation-trials'
14
+ # options.args << '--start-maximized'
15
+
16
+ if headless
17
+ options.args << '--headless'
18
+ options.args << '--disable-gpu' if Gem.win_platform?
19
+ end
20
+
21
+ options
22
+ end
23
+
24
+ def chrome_driver_gen(headless: true, emulate_device: nil, debugger: false)
25
+ lambda do |app|
26
+ Capybara::Selenium::Driver.load_selenium
27
+ browser_options = default_options(headless:)
28
+
29
+ if debugger
30
+ port = ENV.fetch('CHROME_PORT') { '9014' }
31
+ browser_options.debugger_address = "127.0.0.1:#{port}"
32
+ end
33
+
34
+ browser_options = add_emulate_device(browser_options, emulate_device) if emulate_device
35
+
36
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
37
+ end
38
+ end
39
+
40
+ Capybara.register_driver :selenium_chrome, &chrome_driver_gen(headless: false)
41
+ Capybara.register_driver :selenium_chrome_notebook, &chrome_driver_gen(headless: false, emulate_device: 'notebook')
42
+ Capybara.register_driver :selenium_chrome_iphone, &chrome_driver_gen(headless: false, emulate_device: 'iPhone 6')
43
+ Capybara.register_driver :selenium_chrome_headless, &chrome_driver_gen(headless: true)
44
+ Capybara.register_driver :selenium_chrome_headless_notebook,
45
+ &chrome_driver_gen(headless: true, emulate_device: 'notebook')
46
+ Capybara.register_driver :selenium_chrome_headless_iphone,
47
+ &chrome_driver_gen(headless: true, emulate_device: 'iPhone 6')
48
+ Capybara.register_driver :selenium_chrome_debugger, &chrome_driver_gen(headless: false, debugger: true)
49
+
50
+ Capybara.javascript_driver = ENV.fetch('WEBDRIVER') { 'selenium_chrome_notebook' }.to_sym
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.6'
4
+ VERSION = '7.0.8-alpha.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.6
4
+ version: 7.0.8.pre.alpha.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
@@ -156,6 +156,7 @@ files:
156
156
  - pg_layout/lib/pg_layout/engine.rb
157
157
  - pg_rails/js/index.js
158
158
  - pg_rails/lib/pg_rails.rb
159
+ - pg_rails/lib/pg_rails/capybara_support.rb
159
160
  - pg_rails/lib/version.rb
160
161
  - pg_rails/scss/pg_rails.scss
161
162
  - pg_scaffold/lib/generators/pg_active_record/model/model_generator.rb