@woosmap/ui 4.162.10 → 4.162.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/ui",
3
- "version": "4.162.10",
3
+ "version": "4.162.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -32,23 +32,27 @@ class PricingSimulator extends Component {
32
32
  let freeQueriesTotal = 0;
33
33
  let eligibleTotal = 0;
34
34
  let notEligibleTotal = 0;
35
+ let contactSale = false;
35
36
 
36
37
  const { sliders } = this.state;
37
38
  Object.keys(sliders).forEach((category) => {
38
39
  Object.keys(sliders[category]).forEach((pricingKey) => {
39
40
  const { discountEligible } = PricingData[category].pricings[pricingKey];
40
- const { amount, queries } = sliders[category][pricingKey];
41
- if (typeof amount !== 'number' || typeof queries !== 'number') {
42
- console.log('REJECT', pricingKey, amount, queries);
41
+ const { amount, computedQueries, queries } = sliders[category][pricingKey];
42
+ if (typeof amount !== 'number' || typeof computedQueries !== 'number') {
43
+ console.log('REJECT', pricingKey, amount, computedQueries);
44
+ if (queries === '∞') {
45
+ contactSale = true;
46
+ }
43
47
  return;
44
48
  }
45
49
  if (discountEligible) {
46
50
  if (typeof freeQueriesTotal === 'number') {
47
- freeQueriesTotal += queries;
51
+ freeQueriesTotal += computedQueries;
48
52
  }
49
- console.log('Eligible', pricingKey, eligibleTotal, amount, queries, freeQueriesTotal);
53
+ console.log('Eligible', pricingKey, eligibleTotal, amount, computedQueries, freeQueriesTotal);
50
54
  eligibleTotal += amount;
51
- } else if (queries > 0) {
55
+ } else if (computedQueries > 0) {
52
56
  freeQueriesTotal = false;
53
57
  notEligibleTotal += amount;
54
58
  console.log('Not Eligible', pricingKey, notEligibleTotal, amount);
@@ -58,16 +62,18 @@ class PricingSimulator extends Component {
58
62
  const { currency } = this.props;
59
63
  const discount = currency === '$' ? 180 : 200;
60
64
  const total = notEligibleTotal + Math.max(eligibleTotal - discount, 0);
61
- return { total, freeQueriesTotal, notEligibleTotal, eligibleTotal };
65
+ return { total, freeQueriesTotal, notEligibleTotal, eligibleTotal, contactSale };
62
66
  };
63
67
 
64
68
  render() {
65
69
  const { sliders } = this.state;
66
70
  const { publicMode, currency } = this.props;
67
- const { total, freeQueriesTotal, notEligibleTotal } = this.computeTotal();
71
+ const { total, freeQueriesTotal, notEligibleTotal, contactSale } = this.computeTotal();
68
72
  let totalDisplayed = total;
69
73
  if (notEligibleTotal === 0 && freeQueriesTotal && freeQueriesTotal < 10000) {
70
74
  totalDisplayed = 0;
75
+ } else if (contactSale) {
76
+ totalDisplayed = 'Contact Sale';
71
77
  }
72
78
  return (
73
79
  <>