playbook_ui 12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown794 → 12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown815

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: 360413b8af66e57c96b50f7a3d42e090570ce350ffaa9ec7d316ce5f3cffd9df
4
- data.tar.gz: d96327fc8f503da031ffb1cfe9d5dfde31551860650d0ae01a0cc5e249fa5114
3
+ metadata.gz: 3c7cf0818b185948390a703b3ec067d01b137ba056fd2271c18ef8e6fcc28717
4
+ data.tar.gz: a8cb5bb72f10cac1544bed1a62df3f507676e1fdb5c09a47b8178cb49dbb2232
5
5
  SHA512:
6
- metadata.gz: 5350397053b9dba7747150cf2f3a85d074456ecd0afbc70ebe68175c53c7840983427d4c38daf97423e3d09136ce0db11ad9445e38dbd49dcd46f4060f59cb4a
7
- data.tar.gz: 4422d0c952be46f567154bcd58037fb66763aa44cddfc47179de84b62d335083b055ac0edf97b616674e7b5861ff2d6f18b70ca1b41cc12e2ecf22df1be1a89a
6
+ metadata.gz: df28a1c600ef1902f10ee9f05869828af8ab37dbda6a7bb9679019aa7f0024d13c3565f90011120cce3ddd2fd2b7f5d33e6344354f81a5c99c8a99406b3e5239
7
+ data.tar.gz: 7d0a54da2bfb9baa19ea90bb7e1e4666329d9a277f7ce9d8c7a616e35e75f991778c6dde56a9e74a9cecca5a296791fd87a0315314dea4a6bae117344253ce25
@@ -20,16 +20,8 @@
20
20
  placeholder: object.placeholder,
21
21
  required: object.required,
22
22
  }) %>
23
- <% if object.selection_type == "quickpick" %>
24
- <%= pb_rails("text_input", props: {
25
- id: "#{object.start_date}-#{object.picker_id}",
26
- name: object.start_date,
27
- }) %>
28
- <%= pb_rails("text_input", props: {
29
- id: "#{object.end_date}-#{object.picker_id}",
30
- name: object.end_date,
31
- }) %>
32
- <% end %>
23
+ <input type="hidden" id="<%= "#{object.start_date}-#{object.picker_id}" %>" name="<%= "#{object.start_date}-#{object.picker_id}" %>">
24
+ <input type="hidden" id="<%= "#{object.end_date}-#{object.picker_id}" %>" name="<%= "#{object.end_date}-#{object.picker_id}" %>">
33
25
  <% end %>
34
26
  <% if !object.hide_icon %>
35
27
  <div
@@ -70,14 +62,6 @@
70
62
  </div>
71
63
 
72
64
  <%= javascript_tag do %>
73
- if (<%= object.selection_type == "quickpick" %>) {
74
- const startDate = document.getElementById("<%= object.start_date %>-<%= object.picker_id %>")
75
- if (startDate) startDate.style.display = "none"
76
-
77
- const endDate = document.getElementById("<%= object.end_date %>-<%= object.picker_id %>")
78
- if (endDate) endDate.style.display = "none"
79
- }
80
-
81
65
  window.addEventListener("DOMContentLoaded", () => {
82
66
  datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
83
67
 
@@ -196,6 +196,46 @@ describe('DatePicker Kit', () => {
196
196
  }),
197
197
  )
198
198
 
199
+ await waitFor(() => {
200
+ expect(input).toHaveValue(moment().startOf('year').format('MM/DD/YYYY') + " → " + moment().endOf('year').format('MM/DD/YYYY'))
201
+ })
202
+
203
+ })
204
+ test('shows DatePicker QuickPick ranges ending today', async () => {
205
+ const testId = 'datepicker-quick-pick-ends-today'
206
+ render(
207
+ <DatePicker
208
+ allowInput
209
+ data={{ testid: testId }}
210
+ mode="range"
211
+ pickerId="date-picker-quick-pick"
212
+ placeholder="mm/dd/yyyy → mm/dd/yyyy"
213
+ selectionType="quickpick"
214
+ thisRangesEndToday
215
+ />
216
+ )
217
+
218
+ const kit = screen.getByTestId(testId)
219
+ const input = within(kit).getByPlaceholderText('mm/dd/yyyy → mm/dd/yyyy')
220
+
221
+ fireEvent(
222
+ input,
223
+ new MouseEvent('click', {
224
+ bubbles: true,
225
+ cancelable: true,
226
+ }),
227
+ )
228
+
229
+ const thisYear = within(kit).getByText('This year')
230
+
231
+ fireEvent(
232
+ thisYear,
233
+ new MouseEvent('click', {
234
+ bubbles: true,
235
+ cancelable: true,
236
+ }),
237
+ )
238
+
199
239
  await waitFor(() => {
200
240
  expect(input).toHaveValue(moment().startOf('year').format('MM/DD/YYYY') + " → " + moment().format('MM/DD/YYYY'))
201
241
  })
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.26.0"
5
- VERSION = "12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown794"
5
+ VERSION = "12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown815"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown794
4
+ version: 12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown815
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-06-16 00:00:00.000000000 Z
12
+ date: 2023-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack