open-vault/ui/app/templates/components/pricing-metrics-config.hbs
Angel Garbarino 5ce35d1c52
Updating date-fns library from 1.x to 2.x (#10848)
* first round of fixes and setup

* test fixes

* fix dumb options on new method

* test fix

* clean up

* fixes

* clean up

* handle utc time

* add changelog
2021-02-08 13:13:00 -07:00

77 lines
2.4 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{#if (eq mode "edit")}}
<form onsubmit={{action "onSaveChanges"}} data-test-pricing-metrics-config-form>
<div class="box is-sideless is-fullwidth is-marginless">
{{message-error model=model errorMessage=error}}
{{#each model.configAttrs as |attr|}}
<FormField
data-test-field
@attr={{attr}}
@model={{model}}
/>
{{/each}}
</div>
<div class="field is-grouped-split box is-fullwidth is-bottomless">
<div class="control">
<button
type="submit"
disabled={{buttonDisabled}}
class="button is-primary"
data-test-edit-metrics-config-save=true
>
Save
</button>
{{#link-to
"vault.cluster.metrics.config"
class="button"
}}
Cancel
{{/link-to}}
</div>
</div>
</form>
<Modal
@title={{modalTitle}}
@onClose={{action (mut modalOpen) false}}
@isActive={{modalOpen}}
@type="warning"
@showCloseButton={{true}}
>
<section class="modal-card-body">
{{#if (eq model.enabled "On")}}
<p class="has-bottom-margin-s">Vault will start tracking data starting from todays date, {{date-format (now) "d MMMM yyyy"}}. You will not be able to see or query usage until the end of the month.</p>
<p>If youve previously enabled usage tracking, that historical data will still be available to you.</p>
{{else}}
<p class="has-bottom-margin-s">Turning usage tracking off means that all data for the current month will be deleted. You will still be able to query previous months.</p>
<p>Are you sure?</p>
{{/if}}
</section>
<footer class="modal-card-foot modal-card-foot-outlined">
<button
type="button"
class="button is-secondary"
onclick={{action (mut modalOpen) false}}
data-test-metrics-config-cancel
>
Cancel
</button>
<button
type="button"
class="button is-primary"
onclick={{perform save}}
>
Continue
</button>
</footer>
</Modal>
{{else}}
<div class="tabs-container box is-bottomless is-marginless is-fullwidth is-paddingless" data-test-pricing-metrics-config-table>
{{#each infoRows as |item|}}
<InfoTableRow
@label={{item.label}}
@helperText={{item.helperText}}
@value={{get model item.valueKey}}
/>
{{/each}}
</div>
{{/if}}