mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): fix typings for input localisation functions
This commit is contained in:
parent
ca52ee4d07
commit
25d4a5077d
|
@ -762,12 +762,12 @@ export default mixins(
|
||||||
? this.$locale.credText().placeholder(this.parameter)
|
? this.$locale.credText().placeholder(this.parameter)
|
||||||
: this.$locale.nodeText().placeholder(this.parameter, this.path);
|
: this.$locale.nodeText().placeholder(this.parameter, this.path);
|
||||||
},
|
},
|
||||||
getOptionsOptionDisplayName(option: { value: string; name: string }): string {
|
getOptionsOptionDisplayName(option: INodePropertyOptions): string {
|
||||||
return this.isForCredential
|
return this.isForCredential
|
||||||
? this.$locale.credText().optionsOptionDisplayName(this.parameter, option)
|
? this.$locale.credText().optionsOptionDisplayName(this.parameter, option)
|
||||||
: this.$locale.nodeText().optionsOptionDisplayName(this.parameter, option, this.path);
|
: this.$locale.nodeText().optionsOptionDisplayName(this.parameter, option, this.path);
|
||||||
},
|
},
|
||||||
getOptionsOptionDescription(option: { value: string; description: string }): string {
|
getOptionsOptionDescription(option: INodePropertyOptions): string {
|
||||||
return this.isForCredential
|
return this.isForCredential
|
||||||
? this.$locale.credText().optionsOptionDescription(this.parameter, option)
|
? this.$locale.credText().optionsOptionDescription(this.parameter, option)
|
||||||
: this.$locale.nodeText().optionsOptionDescription(this.parameter, option, this.path);
|
: this.$locale.nodeText().optionsOptionDescription(this.parameter, option, this.path);
|
||||||
|
|
|
@ -105,7 +105,7 @@ export class I18nClass {
|
||||||
* Display name for a top-level param.
|
* Display name for a top-level param.
|
||||||
*/
|
*/
|
||||||
inputLabelDisplayName(
|
inputLabelDisplayName(
|
||||||
{ name: parameterName, displayName }: Pick<INodeProperties, 'name' | 'displayName'>,
|
{ name: parameterName, displayName }: INodeProperties,
|
||||||
) {
|
) {
|
||||||
if (['clientId', 'clientSecret'].includes(parameterName)) {
|
if (['clientId', 'clientSecret'].includes(parameterName)) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
|
@ -124,7 +124,7 @@ export class I18nClass {
|
||||||
* Hint for a top-level param.
|
* Hint for a top-level param.
|
||||||
*/
|
*/
|
||||||
hint(
|
hint(
|
||||||
{ name: parameterName, hint }: Pick<INodeProperties, 'name' | 'hint'>,
|
{ name: parameterName, hint }: INodeProperties,
|
||||||
) {
|
) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
key: `${credentialPrefix}.${parameterName}.hint`,
|
key: `${credentialPrefix}.${parameterName}.hint`,
|
||||||
|
@ -136,7 +136,7 @@ export class I18nClass {
|
||||||
* Description (tooltip text) for an input label param.
|
* Description (tooltip text) for an input label param.
|
||||||
*/
|
*/
|
||||||
inputLabelDescription(
|
inputLabelDescription(
|
||||||
{ name: parameterName, description }: Pick<INodeProperties, 'name' | 'description'>,
|
{ name: parameterName, description }: INodeProperties,
|
||||||
) {
|
) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
key: `${credentialPrefix}.${parameterName}.description`,
|
key: `${credentialPrefix}.${parameterName}.description`,
|
||||||
|
@ -148,8 +148,8 @@ export class I18nClass {
|
||||||
* Display name for an option inside an `options` or `multiOptions` param.
|
* Display name for an option inside an `options` or `multiOptions` param.
|
||||||
*/
|
*/
|
||||||
optionsOptionDisplayName(
|
optionsOptionDisplayName(
|
||||||
{ name: parameterName }: Pick<INodeProperties, 'name'>,
|
{ name: parameterName }: INodeProperties,
|
||||||
{ value: optionName, name: displayName }: Pick<INodePropertyOptions, 'value' | 'name'>,
|
{ value: optionName, name: displayName }: INodePropertyOptions,
|
||||||
) {
|
) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
key: `${credentialPrefix}.${parameterName}.options.${optionName}.displayName`,
|
key: `${credentialPrefix}.${parameterName}.options.${optionName}.displayName`,
|
||||||
|
@ -161,8 +161,8 @@ export class I18nClass {
|
||||||
* Description for an option inside an `options` or `multiOptions` param.
|
* Description for an option inside an `options` or `multiOptions` param.
|
||||||
*/
|
*/
|
||||||
optionsOptionDescription(
|
optionsOptionDescription(
|
||||||
{ name: parameterName }: Pick<INodeProperties, 'name'>,
|
{ name: parameterName }: INodeProperties,
|
||||||
{ value: optionName, description }: Pick<INodePropertyOptions, 'value' | 'description'>,
|
{ value: optionName, description }: INodePropertyOptions,
|
||||||
) {
|
) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
key: `${credentialPrefix}.${parameterName}.options.${optionName}.description`,
|
key: `${credentialPrefix}.${parameterName}.options.${optionName}.description`,
|
||||||
|
@ -174,7 +174,7 @@ export class I18nClass {
|
||||||
* Placeholder for a `string` param.
|
* Placeholder for a `string` param.
|
||||||
*/
|
*/
|
||||||
placeholder(
|
placeholder(
|
||||||
{ name: parameterName, placeholder }: Pick<INodeProperties, 'name' | 'placeholder'>,
|
{ name: parameterName, placeholder }: INodeProperties,
|
||||||
) {
|
) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
key: `${credentialPrefix}.${parameterName}.placeholder`,
|
key: `${credentialPrefix}.${parameterName}.placeholder`,
|
||||||
|
@ -247,7 +247,7 @@ export class I18nClass {
|
||||||
* - For a `collection` or `fixedCollection`, the placeholder is the button text.
|
* - For a `collection` or `fixedCollection`, the placeholder is the button text.
|
||||||
*/
|
*/
|
||||||
placeholder(
|
placeholder(
|
||||||
parameter: Pick<INodeProperties, 'name' | 'type' | 'placeholder'>,
|
parameter: INodeProperties,
|
||||||
path: string,
|
path: string,
|
||||||
) {
|
) {
|
||||||
let middleKey = parameter.name;
|
let middleKey = parameter.name;
|
||||||
|
@ -268,8 +268,8 @@ export class I18nClass {
|
||||||
* whether top-level or nested.
|
* whether top-level or nested.
|
||||||
*/
|
*/
|
||||||
optionsOptionDisplayName(
|
optionsOptionDisplayName(
|
||||||
parameter: Pick<INodeProperties, 'name'>,
|
parameter: INodeProperties,
|
||||||
{ value: optionName, name: displayName }: Pick<INodePropertyOptions, 'value' | 'name'>,
|
{ value: optionName, name: displayName }: INodePropertyOptions,
|
||||||
path: string,
|
path: string,
|
||||||
) {
|
) {
|
||||||
let middleKey = parameter.name;
|
let middleKey = parameter.name;
|
||||||
|
@ -290,8 +290,8 @@ export class I18nClass {
|
||||||
* whether top-level or nested.
|
* whether top-level or nested.
|
||||||
*/
|
*/
|
||||||
optionsOptionDescription(
|
optionsOptionDescription(
|
||||||
parameter: Pick<INodeProperties, 'name'>,
|
parameter: INodeProperties,
|
||||||
{ value: optionName, description }: Pick<INodePropertyOptions, 'value' | 'description'>,
|
{ value: optionName, description }: INodePropertyOptions,
|
||||||
path: string,
|
path: string,
|
||||||
) {
|
) {
|
||||||
let middleKey = parameter.name;
|
let middleKey = parameter.name;
|
||||||
|
@ -313,8 +313,8 @@ export class I18nClass {
|
||||||
* be nested in a `collection` or in a `fixedCollection`.
|
* be nested in a `collection` or in a `fixedCollection`.
|
||||||
*/
|
*/
|
||||||
collectionOptionDisplayName(
|
collectionOptionDisplayName(
|
||||||
parameter: Pick<INodeProperties, 'name'>,
|
parameter: INodeProperties,
|
||||||
{ name: optionName, displayName }: Pick<INodePropertyCollection, 'name' | 'displayName'>,
|
{ name: optionName, displayName }: INodePropertyCollection,
|
||||||
path: string,
|
path: string,
|
||||||
) {
|
) {
|
||||||
let middleKey = parameter.name;
|
let middleKey = parameter.name;
|
||||||
|
@ -335,7 +335,7 @@ export class I18nClass {
|
||||||
* `fixedCollection` param having `multipleValues: true`.
|
* `fixedCollection` param having `multipleValues: true`.
|
||||||
*/
|
*/
|
||||||
multipleValueButtonText(
|
multipleValueButtonText(
|
||||||
{ name: parameterName, typeOptions}: Pick<INodeProperties, 'name' | 'typeOptions'>,
|
{ name: parameterName, typeOptions}: INodeProperties,
|
||||||
) {
|
) {
|
||||||
return context.dynamicRender({
|
return context.dynamicRender({
|
||||||
key: `${initialKey}.${parameterName}.multipleValueButtonText`,
|
key: `${initialKey}.${parameterName}.multipleValueButtonText`,
|
||||||
|
|
Loading…
Reference in a new issue