111 lines
3.7 KiB
Handlebars
Raw Normal View History

2019-08-31 20:51:14 -07:00
{{! template-lint-disable }}
{{!-- template lint is running into a strange non-templating error on this file. Temporary measure --}}
<form {{action "onUpdateDeprecation" on="submit"}}>
<div class="entity-deprecation__toggle-header">
<p class="entity-deprecation__toggle-header__label">
Is this {{this.entityName}} deprecated?
2019-08-31 20:51:14 -07:00
</p>
{{input
id=(concat this.entityName "-is-deprecated")
2019-08-31 20:51:14 -07:00
type="checkbox"
title=(concat "Is this " this.entityName " deprecated?")
2019-08-31 20:51:14 -07:00
class="toggle-switch toggle-switch--light"
checked=(readonly this.isDeprecatedAlias)
2019-08-31 20:51:14 -07:00
change=(action "toggleDeprecatedStatus")
}}
<label for="{{this.entityName}}-is-deprecated" class="toggle-button">
2019-08-31 20:51:14 -07:00
</label>
</div>
{{#if this.isDeprecatedAlias}}
2019-08-31 20:51:14 -07:00
<MediumEditor
2019-08-31 20:51:14 -07:00
class="entity-deprecation__note-editor"
@value={{this.deprecationNoteAlias}}
@options={{this.editorOptions}}
@onInput={{action (mut this.deprecationNoteAlias)}} />
2019-08-31 20:51:14 -07:00
<h4 class="dataset-deprecation__header">When should this {{this.entityName}} be decommissioned?</h4>
2019-08-31 20:51:14 -07:00
{{#basic-dropdown as |dropdown|}}
<input
type="text"
placeholder="Enter Date"
data-ebd-id="{{dropdown.uniqueId}}-trigger"
class="entity-deprecation__cal-input-trigger"
value={{if this.decommissionTimeAlias (moment-format this.decommissionTimeAlias 'DD-MMM-YYYY')}}
2019-08-31 20:51:14 -07:00
onclick={{dropdown.actions.toggle}}
readonly>
{{#dropdown.content class="entity-deprecation__cal-dropdown"}}
<PowerCalendar
class="entity-deprecation__decommission-calendar"
@selected={{this.selectedDate}}
@center={{this.centeredDate}}
2019-08-31 20:51:14 -07:00
@onSelect={{action "onDecommissionDateChange" value="date"}}
@onCenterChange={{action (mut this.centeredDate) value="date"}} as |calendar|>
2019-08-31 20:51:14 -07:00
<nav class="ember-power-calendar-nav">
<button
type="button"
class="ember-power-calendar-nav-control"
onclick={{action calendar.actions.moveCenter -1 'month'}}>
&lt;
</button>
<div class="ember-power-calendar-nav-title">
{{moment-format calendar.center 'MMMM YYYY'}}
</div>
<button
type="button"
class="ember-power-calendar-nav-control"
onclick={{action calendar.actions.moveCenter 1 'month'}}>
&gt;
</button>
</nav>
<calendar.Days @minDate={{this.minSelectableDecommissionDate}}/>
2019-08-31 20:51:14 -07:00
</PowerCalendar>
{{/dropdown.content}}
{{/basic-dropdown}}
<p class="entity-decommission-date {{unless this.decommissionTimeAlias 'entity-decommission-date--required'}}">
{{#unless this.decommissionTimeAlias}}
2019-08-31 20:51:14 -07:00
Please specify a date when this {{entityName}} will be decommissioned
{{/unless}}
<strong>
{{if this.decommissionTimeAlias (concat 'Will be decommissioned on ' (moment-format this.decommissionTimeAlias 'MMMM DD YYYY')) ''}}
2019-08-31 20:51:14 -07:00
</strong>
</p>
<span>
{{input
type="checkbox"
name="deprecated.acknowledge"
id="acknowledge-deprecation"
checked=(readonly this.isDeprecationAcknowledged)
change=(action "onAcknowledgeDeprecationNotice")}}
<label for="acknowledge-deprecation">
{{partial deprecationAcknowledgementTemplate}}
</label>
</span>
2019-08-31 20:51:14 -07:00
{{/if}}
<div class="entity-deprecation__actions">
<button
type="submit"
class="nacho-button--large nacho-button--secondary"
disabled={{and this.isDeprecatedAlias (or (not this.decommissionTimeAlias) (not this.isDeprecationAcknowledged))}}>
2019-08-31 20:51:14 -07:00
Update Deprecation Status
</button>
</div>
</form>
{{yield}}