pg_rails 7.0.8.pre.alpha.100 → 7.0.8.pre.alpha.102

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: '0896ed88c290ad3d15d1b4edc18af987081ce34e1a0ae2cbf9e3620b4f217d04'
4
- data.tar.gz: 9fa01a280e302e3f9f5c01edadf6cc5d526637e944b312162fe54c3518219794
3
+ metadata.gz: b4a985ed6d5c8db53c3fcfba554f3f3d51ae978a8ac3f11466f0395beda84732
4
+ data.tar.gz: f193f6098fbc5142b28ba3f2c8b548da56d00365884de5314bda20aaefb481b0
5
5
  SHA512:
6
- metadata.gz: 2304afeed57445774e783dd2e14be001b3b732564b7d212cd4fe79f5d26f45a3f770f8b7ca1789e6ce12656c16c228afba2b2c483ea20f53f1c552a2c82aff0e
7
- data.tar.gz: 5212a262a94cf9a81d140cedde07d16e719d5731913c80106265c94c7b1abc2c5719c65face0257381c42252285fb7c3f96c60e4f79d0f9e4119e0d2a51eb2e0
6
+ metadata.gz: f1ae6ad8fadcc741bca839466c9becafe82aa29741406faa321de9f812e084609151e8fd4750514be88c1204b4c3b17931e0feba6d4541fa54b061bce4ca1629
7
+ data.tar.gz: ee6d5de059cfa776d6373bf57d1ca7ccb7a70fbd3a5c7b72677a0daffe4b9269faad2379554a9622ac1e544353f62c27152dfbd7c497951f0697b6c2ba0c1afc
@@ -0,0 +1 @@
1
+ span#tooltip data-bs-toggle="tooltip" data-bs-title="El tooltip" las cosas
@@ -7,4 +7,6 @@ class AlertComponentPreview < ViewComponent::Preview
7
7
  def dismisible; end
8
8
 
9
9
  def colours; end
10
+
11
+ def tooltips; end
10
12
  end
@@ -0,0 +1,34 @@
1
+ require 'rails_helper'
2
+
3
+ describe 'Tooltips' do
4
+ context 'en desktop' do
5
+ before do
6
+ # byebug
7
+ driven_by :selenium_chrome_headless
8
+ # Capybara.current_driver = :selenium_chrome
9
+ end
10
+
11
+ it 'se activan con hover' do
12
+ visit '/rails/view_components/alert_component/tooltips'
13
+ expect(page).to have_no_text('tooltip')
14
+ find_by_id('tooltip').hover
15
+ expect(page).to have_text('tooltip')
16
+ end
17
+ end
18
+
19
+ context 'en mobile' do
20
+ before do
21
+ # driven_by :selenium_chrome_headless_iphone
22
+ driven_by :selenium_chrome_iphone
23
+ # driven_by :selenium_chrome_headless_notebook
24
+ # Capybara.current_driver = :selenium_chrome_headless_iphone
25
+ end
26
+
27
+ it 'se activan con click' do
28
+ visit '/rails/view_components/alert_component/tooltips'
29
+ expect(page).to have_no_text('tooltip')
30
+ find_by_id('tooltip').click
31
+ expect(page).to have_text('tooltip')
32
+ end
33
+ end
34
+ end
@@ -46,9 +46,9 @@ $chevron-color: 200,200,200,.5;
46
46
  // background-color: #d2f4ea;
47
47
  }
48
48
 
49
- #sidebar li a.active {
50
- font-weight: bold;
49
+ .pg--nav-button.active {
51
50
  --bs-link-color-rgb: white!important;
51
+ background-color: tint-color($primary, 17%);
52
52
  }
53
53
  // Los small-items están deprecados
54
54
  #sidebar {
@@ -94,11 +94,29 @@ $chevron-color: 200,200,200,.5;
94
94
  flex-basis: 10em;
95
95
  }
96
96
  & > * {
97
- width: 9em;
97
+ width: 10em;
98
98
  position:fixed;
99
99
  }
100
100
  }
101
101
 
102
+ .pg--nav-button {
103
+ padding: 0.4em 1.7em;
104
+ width: 100%;
105
+ text-align: right;
106
+ display: inline-block !important;
107
+ }
108
+ .offcanvas-body {
109
+ padding: 0!important;
110
+ }
111
+ .pg--nav-button:hover {
112
+ background-color: tint-color($primary, 20%);
113
+ }
114
+
115
+ .offcanvas .pg--nav-button {
116
+ padding: 0.7em 1.7em;
117
+ text-align: right;
118
+ }
119
+
102
120
  .with-sidebar > :last-child {
103
121
  flex-basis: 0;
104
122
  flex-grow: 999;
@@ -2,3 +2,4 @@ import './cable_ready'
2
2
  import './turbo_rails'
3
3
  import './rollbar'
4
4
  import './bootstrap'
5
+ import './tooltips'
@@ -0,0 +1,13 @@
1
+ import * as bootstrap from 'bootstrap'
2
+
3
+ document.addEventListener('turbo:load', bindTooltips)
4
+ document.addEventListener('turbo:render', bindTooltips)
5
+
6
+ function bindTooltips () {
7
+ const tooltipsQuery = '[data-bs-toggle="tooltip"]'
8
+
9
+ const toastElList = document.querySelectorAll(tooltipsQuery)
10
+ Array.from(toastElList).map(tooltipEl => {
11
+ return new bootstrap.Tooltip(tooltipEl)
12
+ })
13
+ }
@@ -1,5 +1,5 @@
1
1
  <nav class="navbar navbar-expand-<%= @breakpoint_navbar_expand %>" data-bs-theme="dark">
2
- <div class="container-fluid">
2
+ <div class="container-fluid gap-2">
3
3
  <% unless @sidebar == false %>
4
4
  <button data-controller="navbar" data-action="navbar#expandNavbar"
5
5
  class="btn btn-outline-light me-2 d-none d-<%= @breakpoint_navbar_expand %>-inline-block">
@@ -4,7 +4,7 @@
4
4
  <%= @navbar.logo if @navbar.logo.present? %>
5
5
  </div>
6
6
  <% if user_signed_in? %>
7
- <span class="ms-3 text-light"><%= Current.user %></span>
7
+ <span class="d-inline-block px-3 text-end text-light"><%= Current.user %></span>
8
8
  <hr>
9
9
  <% end %>
10
10
  <ul class="list-unstyled ps-0">
@@ -15,7 +15,7 @@
15
15
  <a
16
16
  href="<%= entry[:path] %>"
17
17
  class="
18
- d-inline-flex text-decoration-none ms-3
18
+ d-inline-flex text-decoration-none pg--nav-button
19
19
  <%= @navbar.active_entry?(entry, request) ? 'active' : '' %>"
20
20
  <%= entry[:attributes] %>
21
21
  >
@@ -3,9 +3,9 @@
3
3
  <h5 class="offcanvas-title" id="offcanvasExampleLabel"></h5>
4
4
  <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
5
5
  </div>
6
- <div class="offcanvas-body">
6
+ <div class="offcanvas-body text-end">
7
7
  <% if user_signed_in? %>
8
- <span class="text-light"><%= Current.user %></span>
8
+ <span class="text-light pe-4 mt-4 d-inline-block"><%= Current.user %></span>
9
9
  <hr>
10
10
  <% end %>
11
11
  <ul class="list-unstyled mt-4">
@@ -15,7 +15,7 @@
15
15
  <li>
16
16
  <a
17
17
  href="<%= entry[:path] %>"
18
- class="text-light <%= @navbar.active_entry?(entry, request) ? 'active' : '' %>"
18
+ class="pg--nav-button pe-4 text-light <%= @navbar.active_entry?(entry, request) ? 'active' : '' %>"
19
19
  <%= entry[:attributes] %>
20
20
  >
21
21
  <%= entry[:title] %>
@@ -30,6 +30,6 @@
30
30
  text-decoration: none;
31
31
  }
32
32
  .offcanvas li {
33
- margin-top: 0.75em;
33
+ xmargin-top: 0.75em;
34
34
  }
35
35
  </style>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.100'
4
+ VERSION = '7.0.8-alpha.102'
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.100
4
+ version: 7.0.8.pre.alpha.102
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
@@ -1122,6 +1122,7 @@ files:
1122
1122
  - pg_engine/spec/components/previews/alert_component_preview/colours.html.slim
1123
1123
  - pg_engine/spec/components/previews/alert_component_preview/default.html.slim
1124
1124
  - pg_engine/spec/components/previews/alert_component_preview/dismisible.html.slim
1125
+ - pg_engine/spec/components/previews/alert_component_preview/tooltips.html.slim
1125
1126
  - pg_engine/spec/components/previews/internal_error_preview.rb
1126
1127
  - pg_engine/spec/components/previews/internal_error_preview/default.html.slim
1127
1128
  - pg_engine/spec/controllers/admin/accounts_controller_spec.rb
@@ -1166,6 +1167,7 @@ files:
1166
1167
  - pg_engine/spec/system/noticed_spec.rb
1167
1168
  - pg_engine/spec/system/send_mail_spec.rb
1168
1169
  - pg_engine/spec/system/signup_spec.rb
1170
+ - pg_engine/spec/system/tooltips_spec.rb
1169
1171
  - pg_layout/app/assets/stylesheets/animations.scss
1170
1172
  - pg_layout/app/assets/stylesheets/sidebar.scss
1171
1173
  - pg_layout/app/javascript/application.js
@@ -1175,6 +1177,7 @@ files:
1175
1177
  - pg_layout/app/javascript/config/cable_ready.js
1176
1178
  - pg_layout/app/javascript/config/index.js
1177
1179
  - pg_layout/app/javascript/config/rollbar.js
1180
+ - pg_layout/app/javascript/config/tooltips.js
1178
1181
  - pg_layout/app/javascript/config/turbo_rails/index.js
1179
1182
  - pg_layout/app/javascript/config/turbo_rails/set_consumer.js
1180
1183
  - pg_layout/app/javascript/controllers/application.js