playbook_ui 12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680 → 12.22.0.pre.alpha.PBNTR12checkingemptyfilters686

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: 9561ff1283a2c2a61fd7562e899a6c2391f1cbf95010e4365229d432904b878a
4
- data.tar.gz: 8e70472802e711a1d8d304e973f1bca85a9b496c1d7af38af367e931dcf320f6
3
+ metadata.gz: '050709c25af1935687c3472973acb4fe9e7b3e811a0edcf35fb4f01c3d27193c'
4
+ data.tar.gz: dc4f357e487599331949afd8e95e4ce80285c5223c21cb67c5072af31840bd9d
5
5
  SHA512:
6
- metadata.gz: 3bead3870a688c20c322c9bf534ddef966ed46e361eeded0d79b351e99640693bd9bb3f6ab5a2b2e62129145c189b5d2becc7c6fd34647f6b2485c1cc42ed077
7
- data.tar.gz: f572b39bd3f17ea6619df329cd1e5986f8374b7b713e74ffab52094b45180c9f8a5a168651e909ad3d4b1af7d5097503d4dc156ab0f49c334e67b2b1c9c1c94a
6
+ metadata.gz: a9347203cd3f428e866317f66251b82bce4794a6376e9fe4028000a7c91aefdceb34a0d4856ce2ccae64f3ed783bbbda8ec4a16ea4e798a9d0a3c54e765a254d
7
+ data.tar.gz: 8468890749d6669fe3d560741d272de73464c93effe2e7f86301ddd654fbbe7c5601d7b1d3b438363c0bd0278940c8eeea51686b1509bc518c08c9f5930df0cd
@@ -27,7 +27,7 @@ const CurrentFilters = ({ dark, filters }: CurrentFiltersProps): React.ReactElem
27
27
  color="light"
28
28
  paddingLeft="xs"
29
29
  size={4}
30
- tag="h4"
30
+ tag="span"
31
31
  text="No Filter Selected"
32
32
  />
33
33
  </div>
@@ -9,22 +9,23 @@
9
9
  <div class="maskContainer">
10
10
  <div class="filters">
11
11
  <div class="left_gradient"></div>
12
- <% object.filters.each do |filter| %>
13
- <% if filter[:name] == "" %>
14
- <div>
15
- <%= pb_rails("body", props: {
16
- color: "light",
17
- padding_left: "xs",
18
- size: 4,
19
- tag:"h4",
20
- text: "No Filter Selected"
21
- }) %>
22
- </div>
23
- <% else %>
24
- <div class="filter">
25
- <%= pb_rails("caption", props: { text: filter[:name]}) %>
26
- <%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
12
+ <% if object.filters&.none? { |filter| filter[:name].present? } %>
13
+ <div>
14
+ <%= pb_rails("body", props: {
15
+ color: "light",
16
+ padding_left: "xs",
17
+ size: 4,
18
+ tag:"span",
19
+ text: "No Filter Selected"
20
+ }) %>
27
21
  </div>
22
+ <% end %>
23
+ <% object.filters&.each do |filter| %>
24
+ <% if filter[:name].present? %>
25
+ <div class="filter">
26
+ <%= pb_rails("caption", props: { text: filter[:name]}) %>
27
+ <%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
28
+ </div>
28
29
  <% end %>
29
30
  <% end %>
30
31
  <div class="right_gradient"></div>
@@ -20,9 +20,9 @@ const MoreExtensionsDropdown = ({extensions}: any) => {
20
20
 
21
21
  const popoverReference = (
22
22
  <button
23
- className="toolbar_button"
24
- onClick={handleTogglePopover}
25
- >
23
+ className="toolbar_button"
24
+ onClick={handleTogglePopover}
25
+ >
26
26
  <Flex
27
27
  align="center"
28
28
  className="toolbar_button_icon"
@@ -53,14 +53,14 @@ const popoverReference = (
53
53
  cursor="pointer"
54
54
  className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
55
55
  iconLeft={icon}
56
- key={`${text}_${index}`}
56
+ key={`${text}_${index}`}
57
57
  margin='none'
58
58
  onClick={()=> {onclick(); setShowPopover(false)}}
59
59
  text={text}
60
60
  paddingTop='xxs'
61
61
  paddingBottom='xxs'
62
62
  />
63
- ))}
63
+ ))}
64
64
  </Nav>
65
65
  </PbReactPopover>
66
66
  )
@@ -53,13 +53,12 @@ const EditorToolbar = ({ editor, extensions }:any) => {
53
53
  <SectionSeparator orientation="vertical" />
54
54
  <ToolbarNodes editor={editor} />
55
55
  {
56
- extensions && (
57
- <>
58
- <MoreExtensionsDropdown extensions={extensions}/>
59
- </>
60
- )
61
- }
62
-
56
+ extensions && (
57
+ <>
58
+ <MoreExtensionsDropdown extensions={extensions}/>
59
+ </>
60
+ )
61
+ }
63
62
  </FlexItem>
64
63
  <ToolbarHistoryItems editor={editor} />
65
64
  </Flex>
@@ -12,18 +12,17 @@ import DateTime from '../pb_kit/dateTime'
12
12
 
13
13
  type WeekdayStackedProps = {
14
14
  align?: "left" | "center" | "right",
15
- aria?: object,
15
+ aria?: {[key:string]:string },
16
16
  className?: string,
17
17
  dark?: boolean,
18
18
  data?: object,
19
- date: date,
19
+ date: Date,
20
20
  id?: string,
21
21
  variant?: "day_only" | "month_day" | "expanded",
22
22
  compact?: boolean,
23
- id?: string,
24
23
  }
25
24
 
26
- const getDayOfWeek = (value, compact) => {
25
+ const getDayOfWeek = (value: Date | string, compact: boolean) => {
27
26
  const dateTime = new DateTime({ value })
28
27
  if (compact) {
29
28
  return dateTime.toDayAbbr()
@@ -32,7 +31,7 @@ const getDayOfWeek = (value, compact) => {
32
31
  }
33
32
  }
34
33
 
35
- const getFormattedDate = (value, variant) => {
34
+ const getFormattedDate = (value: Date | string, variant: "day_only" | "month_day" | "expanded") => {
36
35
  const dateTime = new DateTime({ value })
37
36
  if (variant === 'day_only') {
38
37
  return dateTime.toDay()
@@ -0,0 +1,105 @@
1
+ import React from "react";
2
+ import { render, screen } from "../utilities/test-utils";
3
+
4
+ import WeekdayStacked from "./_weekday_stacked";
5
+
6
+ const TEST_DATE = "01/01/2020 00:00:000 GMT-0500";
7
+ jest.setSystemTime(new Date(TEST_DATE));
8
+ const testId = "weekdaystacked-kit";
9
+ const realDate = Date;
10
+
11
+ beforeEach(() => {
12
+ global.Date.now = jest.fn(() => new Date(TEST_DATE));
13
+ });
14
+
15
+ afterEach(() => {
16
+ global.Date = realDate;
17
+ });
18
+
19
+ describe("WeekdayStacked Kit", () => {
20
+ test("renders className", () => {
21
+ render(
22
+ <WeekdayStacked
23
+ data={{ testid: testId }}
24
+ />
25
+ );
26
+
27
+ const kit = screen.getByTestId(testId);
28
+ expect(kit).toHaveClass("pb_weekday_stacked_kit_left");
29
+ });
30
+
31
+ test("renders Caption with weekday", () => {
32
+ render(
33
+ <WeekdayStacked
34
+ data={{ testid: testId }}
35
+ />
36
+ );
37
+
38
+ const kit = screen.getByTestId(testId);
39
+ const text = kit.querySelector(".pb_caption_kit_md");
40
+ expect(text.textContent).toEqual("Wed")
41
+ });
42
+
43
+ test("renders Title with date", () => {
44
+ render(
45
+ <WeekdayStacked
46
+ data={{ testid: testId }}
47
+ />
48
+ );
49
+
50
+ const kit = screen.getByTestId(testId);
51
+ const text = kit.querySelector(".pb_title_kit_size_4");
52
+ expect(text.textContent).toEqual("1/1")
53
+ });
54
+
55
+ test("renders compact prop", () => {
56
+ render(
57
+ <WeekdayStacked
58
+ compact
59
+ data={{ testid: testId }}
60
+ />
61
+ );
62
+
63
+ const kit = screen.getByTestId(testId);
64
+ const text = kit.querySelector(".pb_caption_kit_md");
65
+ expect(text.textContent).toEqual("W")
66
+ });
67
+
68
+ test("renders align prop", () => {
69
+ render(
70
+ <WeekdayStacked
71
+ align="left"
72
+ data={{ testid: testId }}
73
+ />
74
+ );
75
+
76
+ const kit = screen.getByTestId(testId);
77
+ expect(kit).toHaveClass("pb_weekday_stacked_kit_left")
78
+ });
79
+
80
+ test("renders day_only variant prop", () => {
81
+ render(
82
+ <WeekdayStacked
83
+ data={{ testid: testId }}
84
+ variant="day_only"
85
+ />
86
+ );
87
+
88
+ const kit = screen.getByTestId(testId);
89
+ const text = kit.querySelector(".pb_title_kit_size_4");
90
+ expect(text.textContent).toEqual("1")
91
+ });
92
+
93
+ test("renders expanded variant prop", () => {
94
+ render(
95
+ <WeekdayStacked
96
+ data={{ testid: testId }}
97
+ variant="expanded"
98
+ />
99
+ );
100
+
101
+ const kit = screen.getByTestId(testId);
102
+ const text = kit.querySelector(".pb_title_kit_size_4");
103
+ expect(text.textContent).toEqual("Jan 1")
104
+ });
105
+ });
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "12.21.0"
5
- VERSION = "12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680"
4
+ PREVIOUS_VERSION = "12.22.0"
5
+ VERSION = "12.22.0.pre.alpha.PBNTR12checkingemptyfilters686"
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.21.0.pre.alpha.PLAY807RTEcustomtoolbar680
4
+ version: 12.22.0.pre.alpha.PBNTR12checkingemptyfilters686
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-05-18 00:00:00.000000000 Z
12
+ date: 2023-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2350,8 +2350,8 @@ files:
2350
2350
  - app/pb_kits/playbook/pb_walkthrough/docs/example.yml
2351
2351
  - app/pb_kits/playbook/pb_walkthrough/docs/index.js
2352
2352
  - app/pb_kits/playbook/pb_walkthrough/walkthrough.test.jsx
2353
- - app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx
2354
2353
  - app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.scss
2354
+ - app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx
2355
2355
  - app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_compact.html.erb
2356
2356
  - app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_compact.jsx
2357
2357
  - app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_default.html.erb
@@ -2362,6 +2362,7 @@ files:
2362
2362
  - app/pb_kits/playbook/pb_weekday_stacked/docs/index.js
2363
2363
  - app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb
2364
2364
  - app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb
2365
+ - app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.test.jsx
2365
2366
  - app/pb_kits/playbook/playbook-doc.js
2366
2367
  - app/pb_kits/playbook/playbook-rails-react-bindings.js
2367
2368
  - app/pb_kits/playbook/playbook-rails.js