@ordergroove/offers 2.26.4-alpha-PR-605-1.6 → 2.26.6

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.
package/examples/index.js CHANGED
@@ -105,6 +105,18 @@ const exampleTemplates = [
105
105
  textCopy: { ...textCopy }
106
106
  }
107
107
  },
108
+ {
109
+ name: 'cart',
110
+ selector: 'og-offer[location="cart"]',
111
+ defaultPreviewMode: 'subscribed',
112
+ config: {
113
+ settings: {
114
+ ...settings,
115
+ offerType: 'cart'
116
+ },
117
+ textCopy: { ...textCopy }
118
+ }
119
+ },
108
120
  {
109
121
  name: 'side-by-side',
110
122
  selector: 'og-offer[location="side-by-side"]',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordergroove/offers",
3
- "version": "2.26.4-alpha-PR-605-1.6+ce8c57dd",
3
+ "version": "2.26.6",
4
4
  "description": "offer state component",
5
5
  "author": "Eugenio Lattanzio <eugenio63@gmail.com>",
6
6
  "homepage": "https://github.com/ordergroove/plush-toys#readme",
@@ -43,7 +43,7 @@
43
43
  "throttle-debounce": "^2.1.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@ordergroove/offers-templates": "^0.4.5"
46
+ "@ordergroove/offers-templates": "^0.4.8"
47
47
  },
48
- "gitHead": "ce8c57dd3a79f6aee087f0c1ed3cfb81b088f31e"
48
+ "gitHead": "b5fb97c05098fd061373711d02f03b0c4d16019a"
49
49
  }
@@ -1,4 +1,4 @@
1
- import { html } from 'lit-element';
1
+ import { html, css } from 'lit-element';
2
2
 
3
3
  import { optinProduct, optoutProduct } from '../core/actions';
4
4
  import { OptinStatus, mapStateToProps } from './OptinStatus';
@@ -12,6 +12,42 @@ export class OptinToggle extends OptinStatus {
12
12
  };
13
13
  }
14
14
 
15
+ static get styles() {
16
+ return css`
17
+ :host {
18
+ cursor: default;
19
+ display: inline-block;
20
+ }
21
+
22
+ .btn {
23
+ position: relative;
24
+ width: var(--og-radio-width, 1.4em);
25
+ height: var(--og-radio-height, 1.4em);
26
+ margin: var(--og-radio-margin, 0);
27
+ padding: 0;
28
+ border: 1px solid var(--og-primary-color, black);
29
+ background: #fff;
30
+ vertical-align: middle;
31
+ color: var(--og-primary-color, black);
32
+ display: inline-flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ border-radius: 3px;
36
+ }
37
+
38
+ .btn.active {
39
+ background: #090909;
40
+ }
41
+
42
+ .btn.active:after {
43
+ content: '✓';
44
+ color: #fff;
45
+ transform: scale(1.6);
46
+ margin-left: 2px;
47
+ }
48
+ `;
49
+ }
50
+
15
51
  handleClick(ev) {
16
52
  if (this.subscribed) this.optoutProduct(this.product);
17
53
  else this.optinProduct(this.product, this.frequency || this.defaultFrequency);
@@ -221,9 +221,7 @@ describe('api.fetchOrders', () => {
221
221
 
222
222
  it('should call endpoint default params', async () => {
223
223
  await underTest('https://host.com', { some: 'auth' }, 2, 'foo');
224
- expect(fetchMock.lastUrl(MATCHED)).toEqual(
225
- 'https://host.com/orders/?status=2&ordering=foo&exclude_prepaid_orders=true'
226
- );
224
+ expect(fetchMock.lastUrl(MATCHED)).toEqual('https://host.com/orders/?status=2&ordering=foo');
227
225
  });
228
226
  });
229
227
 
package/src/core/api.js CHANGED
@@ -88,8 +88,7 @@ export const fetchOrders = memoize(
88
88
  withAuth((status = 1, ordering = 'place') => [
89
89
  `/orders/?${toQuery([
90
90
  ['status', status],
91
- ['ordering', ordering],
92
- ['exclude_prepaid_orders', 'true']
91
+ ['ordering', ordering]
93
92
  ])}`
94
93
  ])
95
94
  )