-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport 1.11.x: Backport TTL picker changes (#20797)
* UI: TTL picker cleanup (#18114) * Update config-pki.hbs Unable to make Pki changes because we don't have action handleCrlTtl * fix space * remove test --------- Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
- Loading branch information
1 parent
0fa0e76
commit ef9e30e
Showing
32 changed files
with
792 additions
and
898 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: update TTL picker for consistency | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="field"> | ||
<TtlPicker | ||
@label="Wrap response" | ||
@helperTextDisabled="Will not wrap response" | ||
@helperTextEnabled="Will wrap response with a lease of" | ||
@initialEnabled={{true}} | ||
@initialValue="30m" | ||
@onChange={{this.changedValue}} | ||
@changeOnInit={{true}} | ||
data-test-wrap-ttl-picker | ||
/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,26 @@ | ||
import { assert } from '@ember/debug'; | ||
import Component from '@ember/component'; | ||
import { set, computed } from '@ember/object'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default Component.extend({ | ||
// passed from outside | ||
onChange: null, | ||
wrapResponse: true, | ||
export default class WrapTtlComponent extends Component { | ||
@tracked | ||
wrapResponse = true; | ||
|
||
ttl: '30m', | ||
constructor() { | ||
super(...arguments); | ||
assert('`onChange` handler is a required attr in `' + this.toString() + '`.', this.args.onChange); | ||
} | ||
|
||
wrapTTL: computed('wrapResponse', 'ttl', function () { | ||
get wrapTTL() { | ||
const { wrapResponse, ttl } = this; | ||
return wrapResponse ? ttl : null; | ||
}), | ||
} | ||
|
||
didRender() { | ||
this._super(...arguments); | ||
this.onChange(this.wrapTTL); | ||
}, | ||
|
||
init() { | ||
this._super(...arguments); | ||
assert('`onChange` handler is a required attr in `' + this.toString() + '`.', this.onChange); | ||
}, | ||
|
||
layout: hbs` | ||
<div class="field"> | ||
{{ttl-picker2 | ||
data-test-wrap-ttl-picker=true | ||
label='Wrap response' | ||
helperTextDisabled='Will not wrap response' | ||
helperTextEnabled='Will wrap response with a lease of' | ||
enableTTL=wrapResponse | ||
initialValue=ttl | ||
onChange=(action 'changedValue') | ||
}} | ||
</div> | ||
`, | ||
|
||
actions: { | ||
changedValue(ttlObj) { | ||
set(this, 'wrapResponse', ttlObj.enabled); | ||
set(this, 'ttl', `${ttlObj.seconds}s`); | ||
this.onChange(this.wrapTTL); | ||
}, | ||
}, | ||
}); | ||
@action | ||
changedValue(ttlObj) { | ||
this.wrapResponse = ttlObj.enabled; | ||
this.ttl = ttlObj.goSafeTimeString; | ||
this.args.onChange(this.wrapTTL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.