Merge pull request #2698 from n313893254/18394

Delete 'client_cert_key' when CA field change
This commit is contained in:
Westly Wright 2019-02-28 09:08:59 -07:00 committed by GitHub
commit 657e0ccfb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 32 deletions

View File

@ -5,9 +5,6 @@ import layout from './template';
import { next } from '@ember/runloop';
import { get, set, observer, computed } from '@ember/object';
import ThrottledResize from 'shared/mixins/throttled-resize';
import { downloadFile } from 'shared/utils/download-files';
import CodeMirror from 'codemirror';
import jsyaml from 'js-yaml';
import { alias } from '@ember/object/computed'
import C from 'ui/utils/constants';
@ -40,14 +37,11 @@ export default Component.extend(ThrottledResize, {
showDownload: true,
deepStr: null,
shouldChangeName: true,
config: alias('model.config'),
init() {
this._super(...arguments);
window.jsyaml || (window.jsyaml = jsyaml);
this.customTypeObserver()
},
actions: {
@ -55,27 +49,6 @@ export default Component.extend(ThrottledResize, {
this.$('INPUT[type=file]')[0].click();
},
wantsChange() {
set(this, 'shouldChangeName', true);
},
download() {
let yaml = get(this, 'value');
const lintError = [];
jsyaml.safeLoadAll(yaml, (y) => {
lintError.pushObjects(CodeMirror.lint.yaml(y));
});
if ( lintError.length ) {
set(this, 'errors', [get(this, 'intl').t('yamlPage.errors')]);
return;
}
downloadFile(get(this, 'filename'), yaml);
},
updateValue(value) {
next(() => {
set(this, 'value', value)
@ -102,7 +75,7 @@ export default Component.extend(ThrottledResize, {
})
}),
caChange: observer('config.clientKey', 'config.clientCert', 'config.certificate', function() {
caChange: observer('clientKeyPath', 'clientCertPath', 'certificatePath', function() {
let { fileObj, deepStrs = [] } = this.parseValue(get(this, 'value'));
const deletedField = [

View File

@ -3,14 +3,14 @@
{{ivy-codemirror
placeholder=placeholder
value=value
valueUpdated=(action 'updateValue')
valueUpdated=(action "updateValue")
options=(hash
autofocus=true
theme="monokai"
tabSize=2
lineNumbers=true
mode="yaml"
readOnly=(if (or (eq modalOpts.type 'review') readOnly) true false)
readOnly=(if (or (eq modalOpts.type "review") readOnly) true false)
gutters=gutters
lint=false
lineWrapping=true
@ -20,7 +20,7 @@
}}
</div>
</div>
{{yield 'description'}}
{{yield "description"}}
<input type="file" accept="{{actualAccept}}" multiple={{multiple}} class="hide">
{{logging/form-log-ssl