@woosmap/ui 4.226.5 → 4.226.7

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.226.5",
3
+ "version": "4.226.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -163,7 +163,7 @@ export default class PricingSimulator extends Component {
163
163
 
164
164
  render() {
165
165
  const { sliders } = this.state;
166
- const { currency, hlPricings } = this.props;
166
+ const { currency, hlPricings, planId } = this.props;
167
167
  const { total, contactSale, totalBeforeDiscount } = this.computeTotal();
168
168
  const totalDisplayed = this.displayAmount(parseInt(total, 10), currency);
169
169
  // if (contactSale) {
@@ -225,6 +225,7 @@ export default class PricingSimulator extends Component {
225
225
  values={sliders[category][pricingKey]}
226
226
  onChange={this.onChange(category, pricingKey)}
227
227
  hlPricings={hlPricings}
228
+ planId={planId}
228
229
  />
229
230
  );
230
231
  })}
@@ -261,9 +262,10 @@ export default class PricingSimulator extends Component {
261
262
  }
262
263
  }
263
264
 
264
- PricingSimulator.defaultProps = { currency: '€' };
265
+ PricingSimulator.defaultProps = { currency: '€', planId: 'plan_ohNpgeVMtJ3veT' };
265
266
 
266
267
  PricingSimulator.propTypes = {
267
268
  currency: PropTypes.string,
268
269
  hlPricings: PropTypes.object.isRequired,
270
+ planId: PropTypes.string,
269
271
  };
@@ -94,7 +94,6 @@ export default class PricingSlider extends Component {
94
94
  );
95
95
 
96
96
  renderMarks = (props) => {
97
- const { publicMode } = this.props;
98
97
  const displayedPricing = this.getDisplayedPricing();
99
98
 
100
99
  let value;
@@ -102,7 +101,7 @@ export default class PricingSlider extends Component {
102
101
  value = 0;
103
102
  } else {
104
103
  const index = props.key / 100000 - 1;
105
- if (index === displayedPricing.length - 1 && publicMode) {
104
+ if (index === displayedPricing.length - 1) {
106
105
  value = '∞';
107
106
  } else {
108
107
  const tier = displayedPricing[props.key / 100000 - 1];
@@ -127,10 +126,12 @@ export default class PricingSlider extends Component {
127
126
  getDisplayedPricing = () => {
128
127
  const { productPricing, currency, planId } = this.props;
129
128
  const product = this.findProduct(productPricing.productId);
130
-
131
- return product && product.pricings[planId] && product.pricings[planId][currencyMap[currency]]
132
- ? product.pricings[planId][currencyMap[currency]]
133
- : [];
129
+ const displayedPricing =
130
+ product && product.pricings[planId] && product.pricings[planId][currencyMap[currency]]
131
+ ? product.pricings[planId][currencyMap[currency]]
132
+ : [];
133
+ displayedPricing.append([displayedPricing[displayedPricing.length - 1][0] * 2, null]);
134
+ return displayedPricing;
134
135
  };
135
136
 
136
137
  getDisplayedData = (queries) => {
@@ -182,6 +183,14 @@ export default class PricingSlider extends Component {
182
183
  {displayedPricing.map((tier, index) => {
183
184
  const lower = index > 0 ? displayedPricing[index - 1][0] : 0;
184
185
  if (index === displayedPricing.length - 1) {
186
+ return (
187
+ <tr>
188
+ <td>{`${numeral(lower).format('0.[0]a')}+`}</td>
189
+ <td>{tr('Contact us for discount')}</td>
190
+ </tr>
191
+ );
192
+ }
193
+ if (index === displayedPricing.length - 2) {
185
194
  return (
186
195
  <tr>
187
196
  <td>{`${numeral(lower).format('0.[0]a')}+`}</td>
@@ -197,7 +206,6 @@ export default class PricingSlider extends Component {
197
206
  );
198
207
  })}
199
208
  </table>
200
- {displayedPricing.length === 1 && displayedPricing[0][1] === 0 ? null : tr('For more, contact us')}
201
209
  </div>
202
210
  );
203
211
  };
@@ -296,7 +304,6 @@ export default class PricingSlider extends Component {
296
304
  PricingSlider.defaultProps = {
297
305
  defaultQueries: 1500,
298
306
  onChange: null,
299
- planId: 'plan_ohNpgeVMtJ3veT',
300
307
  };
301
308
 
302
309
  PricingSlider.propTypes = {
@@ -308,6 +315,6 @@ PricingSlider.propTypes = {
308
315
  onChange: PropTypes.func,
309
316
  values: PropTypes.object.isRequired,
310
317
  id: PropTypes.string.isRequired,
311
- planId: PropTypes.string,
318
+ planId: PropTypes.string.isRequired,
312
319
  hlPricings: PropTypes.object.isRequired,
313
320
  };