feat(editor): Add node name and version to NDV node settings (#7731)
<img width="580" alt="image" src="https://github.com/n8n-io/n8n/assets/8850410/85ac1c6e-9116-436a-a2ed-8d0ac162a287"> <img width="580" alt="image" src="https://github.com/n8n-io/n8n/assets/8850410/08b37377-cef5-4f80-80c0-addfdd37f728"> --------- Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -152,6 +152,17 @@
|
||||
@valueChanged="valueChanged"
|
||||
@parameterBlur="onParameterBlur"
|
||||
/>
|
||||
<div class="node-version" data-test-id="node-version">
|
||||
{{
|
||||
$locale.baseText('nodeSettings.nodeVersion', {
|
||||
interpolate: {
|
||||
node: nodeType?.displayName as string,
|
||||
version: node.typeVersion.toString(),
|
||||
},
|
||||
})
|
||||
}}
|
||||
<span>({{ nodeVersionTag }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<n8n-block-ui :show="blockUI" />
|
||||
@@ -258,6 +269,29 @@ export default defineComponent({
|
||||
|
||||
return '';
|
||||
},
|
||||
nodeTypeVersions(): number[] {
|
||||
if (!this.node) return [];
|
||||
return this.nodeTypesStore.getNodeVersions(this.node.type);
|
||||
},
|
||||
latestVersion(): number {
|
||||
return Math.max(...this.nodeTypeVersions);
|
||||
},
|
||||
isLatestNodeVersion(): boolean {
|
||||
return this.latestVersion === this.node?.typeVersion;
|
||||
},
|
||||
nodeVersionTag(): string {
|
||||
if (!this.nodeType || this.nodeType.hidden) {
|
||||
return this.$locale.baseText('nodeSettings.deprecated');
|
||||
}
|
||||
|
||||
if (this.isLatestNodeVersion) {
|
||||
return this.$locale.baseText('nodeSettings.latest');
|
||||
}
|
||||
|
||||
return this.$locale.baseText('nodeSettings.latestVersion', {
|
||||
interpolate: { version: this.latestVersion.toString() },
|
||||
});
|
||||
},
|
||||
nodeTypeDescription(): string {
|
||||
if (this.nodeType?.description) {
|
||||
const shortNodeType = this.$locale.shortNodeType(this.nodeType.name);
|
||||
@@ -1126,6 +1160,14 @@ export default defineComponent({
|
||||
top: -25px;
|
||||
}
|
||||
|
||||
.node-version {
|
||||
border-top: var(--border-base);
|
||||
font-size: var(--font-size-xs);
|
||||
font-size: var(--font-size-2xs);
|
||||
padding: var(--spacing-xs) 0 var(--spacing-2xs) 0;
|
||||
color: var(--color-text-light);
|
||||
}
|
||||
|
||||
.parameter-value {
|
||||
input.expression {
|
||||
border-style: dashed;
|
||||
|
||||
Reference in New Issue
Block a user