@woosmap/ui 4.164.4 → 4.164.5

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.164.4",
3
+ "version": "4.164.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -95,9 +95,7 @@ const Pricing = {
95
95
  unit: "Monthly Requests",
96
96
  description:
97
97
  "Get suggestions on addresses, localities, postcodes and more. Search on full words as well as substrings, with high flexibility on typos",
98
- pricing: [
99
- [50000000, 0],
100
- ],
98
+ pricing: [],
101
99
  discountEligible: true,
102
100
  },
103
101
  'Details': {
@@ -13,7 +13,7 @@ class PricingSimulator extends Component {
13
13
  sliders[category] = {};
14
14
  }
15
15
  sliders[category][pricingKey] = {
16
- queries: PricingData[category].pricings[pricingKey].defaultQueries || 0,
16
+ queries: 0,
17
17
  amount: 0,
18
18
  computedQueries: PricingData[category].pricings[pricingKey].defaultQueries || 0,
19
19
  };
@@ -20,12 +20,12 @@ class PricingSlider extends Component {
20
20
  const valueToRemove = Math.min(tier[0] - previousPricingTier[0], q);
21
21
  if (valueToRemove > 0) {
22
22
  q -= valueToRemove;
23
- return amount + (valueToRemove / 100000) * tier[1] * coef;
23
+ return amount + (valueToRemove / 1000) * tier[1] * coef;
24
24
  }
25
25
  } else {
26
26
  const valueToRemove = Math.min(tier[0], q);
27
27
  q -= valueToRemove;
28
- return amount + (valueToRemove / 100000) * tier[1] * coef;
28
+ return amount + (valueToRemove / 1000) * tier[1] * coef;
29
29
  }
30
30
  return amount;
31
31
  }, 0)
@@ -35,7 +35,11 @@ class PricingSlider extends Component {
35
35
  computeQueries = (valueNow) => {
36
36
  const { productPricing, publicMode } = this.props;
37
37
  const { pricing, publicTierCount } = productPricing;
38
+ if (pricing.length === 0) {
39
+ return valueNow;
40
+ }
38
41
  const tierIndex = Math.min(Math.floor(valueNow / 100000), pricing.length - 1);
42
+
39
43
  // eslint-disable-next-line prefer-destructuring
40
44
  const tier = pricing[tierIndex][0];
41
45
  const value = valueNow - tierIndex * 100000;
@@ -140,7 +144,7 @@ class PricingSlider extends Component {
140
144
  displayedAmount = this.contactSalesButton();
141
145
  } else if (amount > 0) {
142
146
  displayedAmount = <span className="amount">{`${parseInt(amount, 10)}${currency}`}</span>;
143
- } else if (amount === 0 && computedQueries > 0) {
147
+ } else if (displayedPricing.length === 0) {
144
148
  displayedAmount = <span className="free-label">FREE</span>;
145
149
  }
146
150
  return (
@@ -170,7 +174,7 @@ class PricingSlider extends Component {
170
174
  onChange={(_queries) => {
171
175
  this.onChange(_queries);
172
176
  }}
173
- max={displayedPricing.length * 100000}
177
+ max={displayedPricing.length * 100000 || 50000000}
174
178
  />
175
179
  <div className="pricing-slider__queries">
176
180
  <div className="pricing-slider__queries__label">{productPricing.unit}</div>