Repository navigation
Conversation
snitzelbread
left a comment
There was a problem hiding this comment.
Thanks a lot! I'm not gonna be able to read all of this but I left some comments, mostly readability and consistency issues. I'd like them fixed, but also I'm a bit confused as to what the plan is now for the pricing-calculator repository...? Will this be archived/not used anymore? If possible, please figure this out.
| pricing_description: 'Scegli ciò di cui ha bisogno la tua app.<br>Tutti i prezzi in CHF al mese, IVA esclusa.' | ||
| pricing_calc_preset_label: 'Carica un modello:' | ||
| pricing_calc_preset_hobby: 'Hobby' | ||
| pricing_calc_preset_production: 'Produzione' | ||
| pricing_calc_preset_scale: 'Scala' | ||
| pricing_calc_per_month: '/ mese' | ||
| pricing_calc_excl_vat: 'IVA esclusa' | ||
| pricing_calc_none: 'Nessuno' | ||
| pricing_calc_optional: 'facoltativo' | ||
| pricing_calc_decrease: 'Diminuisci' | ||
| pricing_calc_increase: 'Aumenta' | ||
| pricing_calc_app: 'App' | ||
| pricing_calc_app_choose: 'Scegli la quantità per ogni dimensione di istanza' | ||
| pricing_calc_app_choose_mobile: 'Scegli una dimensione di istanza' |
There was a problem hiding this comment.
You can remove the quotes around 99% of these and the other translations. For consistency sake.
| /* The dark minus icon already comes faded, it only shows while the quantity is zero */ | ||
| .pricing-stepper[data-active='true'] [data-stepper-icon='idle'], | ||
| .pricing-stepper:not([data-active='true']) [data-stepper-icon='active'] { | ||
| @apply hidden; | ||
| } | ||
|
|
||
| .pricing-step:disabled [data-stepper-icon='active'] { | ||
| @apply opacity-50; | ||
| } | ||
|
|
||
| .pricing-link { | ||
| @apply whitespace-nowrap underline decoration-1 underline-offset-4 transition-opacity hover:opacity-70; | ||
| } | ||
|
|
||
| .pricing-print { | ||
| @apply text-deploio; | ||
| print-color-adjust: exact; | ||
| -webkit-print-color-adjust: exact; | ||
| } | ||
| } | ||
|
|
||
| /* The first page starts at the paper edge so the logo hangs from the top like on the site */ |
There was a problem hiding this comment.
the comments can be removed
| {% comment %} | ||
| One add-on line. Pass `toggle` or `stepper` with the state field the control edits, and either `price_slot` with | ||
| `unit_key` or a ready-made `price`. `hint_key` or `hint` and `details` are optional. | ||
| {% endcomment %} |
There was a problem hiding this comment.
I dont even know what this comment is trying to tell me
| const { addOns } = catalog; | ||
| if (state.objectStorage && state.storageGiB > 0 && addOns.object_storage_space) { | ||
| const { price } = addOns.object_storage_space; | ||
| add('add_ons', strings.object_storage_space, `${formatQuantity(state.storageGiB)} GiB`, state.storageGiB * price); | ||
| } | ||
| if (state.objectStorage && state.trafficGiB > 0 && addOns.object_storage_traffic) { | ||
| const detail = strings.gib_outgoing.replace('{gib}', formatQuantity(state.trafficGiB)); | ||
| add('add_ons', strings.object_storage_traffic, detail, state.trafficGiB * addOns.object_storage_traffic.price); | ||
| } | ||
| if (state.staticEgress && addOns.static_egress) { | ||
| add('add_ons', strings.static_egress, 'deplo.io', addOns.static_egress.price); | ||
| } | ||
| if (state.ipv4 > 0 && addOns.ipv4) { | ||
| const { price } = addOns.ipv4; | ||
| add('add_ons', strings.additional_ipv4, `${state.ipv4} × ${formatAmount(price)}`, state.ipv4 * price); | ||
| } | ||
| if (state.blockStorage > 0 && addOns.block_storage) { | ||
| const { price } = addOns.block_storage; | ||
| add('add_ons', strings.block_storage, `${state.blockStorage * 10} GiB`, state.blockStorage * price); | ||
| } | ||
| if (state.grafana > 0 && addOns.grafana) { | ||
| const { price } = addOns.grafana; | ||
| add('add_ons', strings.grafana, `${state.grafana} × ${formatAmount(price)}`, state.grafana * price); | ||
| } |
There was a problem hiding this comment.
Seems like you're doing the same thing here multiple times. Could be simplified.
| all('[data-value-of]').forEach((element) => { | ||
| const field = element.dataset.valueOf; | ||
| // Block storage is bought in 10 GiB blocks but shown in GiB | ||
| showQuantity(element, state[field], field === 'blockStorage' ? state[field] * 10 : state[field]); |
There was a problem hiding this comment.
What does the * 10 stand for? Magic number?
| catalog.kvs[entry.key] = slot(entry); | ||
| }); | ||
| config.search.sizes.forEach((size) => { | ||
| ['single', 'multi'].forEach((level) => { |
There was a problem hiding this comment.
You defined SEARCH_LEVELS, why not use it here? Also, you seem to use the string 'none' a lot in this file. Putting it in a constant would be better.
TICKET-26745