mirror of
https://github.com/hashicorp/vault.git
synced 2026-01-04 16:21:11 +01:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { tracked } from '@glimmer/tracking';
|
|
import { action, set } from '@ember/object';
|
|
|
|
/**
|
|
* @module TransformAdvancedTemplating
|
|
* TransformAdvancedTemplating components are used to modify encode/decode formats of transform templates
|
|
*
|
|
* @example
|
|
* ```js
|
|
* <TransformAdvancedTemplating @model={{this.model}} />
|
|
* ```
|
|
* @param {Object} model - transform template model
|
|
*/
|
|
|
|
export default class TransformAdvancedTemplating extends Component {
|
|
@tracked inputOptions = [];
|
|
|
|
@action
|
|
setInputOptions(testValue, captureGroups) {
|
|
if (captureGroups && captureGroups.length) {
|
|
this.inputOptions = captureGroups.map(({ position, value }) => {
|
|
return {
|
|
label: `${position}: ${value}`,
|
|
value: position,
|
|
};
|
|
});
|
|
} else {
|
|
this.inputOptions = [];
|
|
}
|
|
}
|
|
@action
|
|
decodeFormatValueChange(kvObject, kvData, value) {
|
|
set(kvObject, 'value', value);
|
|
this.args.model.decodeFormats = kvData.toJSON();
|
|
}
|
|
}
|