mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
✨ Allow custom documentation URLs on credentials & nodes
This commit is contained in:
parent
9fee42b2a8
commit
639bdd2ceb
|
@ -20,7 +20,7 @@
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="doc-link-text">Need help? <a class="doc-hyperlink" :href="'https://docs.n8n.io/credentials/' + documentationUrl + '/?utm_source=n8n_app&utm_medium=left_nav_menu&utm_campaign=create_new_credentials_modal'" target="_blank">Open credential docs</a></span>
|
<span class="doc-link-text">Need help? <a class="doc-hyperlink" :href="documentationUrl" target="_blank">Open credential docs</a></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -119,7 +119,11 @@ export default mixins(
|
||||||
|
|
||||||
const credentialType = this.$store.getters.credentialType(credentialTypeName);
|
const credentialType = this.$store.getters.credentialType(credentialTypeName);
|
||||||
if (credentialType.documentationUrl !== undefined) {
|
if (credentialType.documentationUrl !== undefined) {
|
||||||
return `${credentialType.documentationUrl}`;
|
if (credentialType.documentationUrl.startsWith('http')) {
|
||||||
|
return credentialType.documentationUrl;
|
||||||
|
} else {
|
||||||
|
return 'https://docs.n8n.io/credentials/' + credentialType.documentationUrl + '/?utm_source=n8n_app&utm_medium=left_nav_menu&utm_campaign=create_new_credentials_modal';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
<div v-if="showDocumentHelp && nodeType" class="doc-help-wrapper">
|
<div v-if="showDocumentHelp && nodeType" class="doc-help-wrapper">
|
||||||
<svg id="help-logo" v-if="showDocumentHelp && nodeType" :href="'https://docs.n8n.io/nodes/' + nodeType.name" target="_blank" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
<svg id="help-logo" v-if="showDocumentHelp && nodeType" :href="documentationUrl" target="_blank" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<title>Node Documentation</title>
|
<title>Node Documentation</title>
|
||||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
<g transform="translate(-1127.000000, -836.000000)" fill-rule="nonzero">
|
<g transform="translate(-1127.000000, -836.000000)" fill-rule="nonzero">
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
<div v-if="showDocumentHelp && nodeType" class="text">
|
<div v-if="showDocumentHelp && nodeType" class="text">
|
||||||
Need help? <a id="doc-hyperlink" v-if="showDocumentHelp && nodeType" :href="'https://docs.n8n.io/nodes/' + nodeType.name + '?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=' + nodeType.name" target="_blank">Open {{nodeType.displayName}} documentation</a>
|
Need help? <a id="doc-hyperlink" v-if="showDocumentHelp && nodeType" :href="documentationUrl" target="_blank">Open {{nodeType.displayName}} documentation</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -65,6 +65,13 @@ export default Vue.extend({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
documentationUrl (): string {
|
||||||
|
if (this.nodeType.documentationUrl && this.nodeType.documentationUrl.startsWith('http')) {
|
||||||
|
return this.nodeType.documentationUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'https://docs.n8n.io/nodes/' + (this.nodeType.documentationUrl || this.nodeType.name) + '?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=' + this.nodeType.name;
|
||||||
|
},
|
||||||
node (): INodeUi {
|
node (): INodeUi {
|
||||||
return this.$store.getters.activeNode;
|
return this.$store.getters.activeNode;
|
||||||
},
|
},
|
||||||
|
|
|
@ -536,6 +536,7 @@ export interface INodeTypeDescription {
|
||||||
version: number;
|
version: number;
|
||||||
description: string;
|
description: string;
|
||||||
defaults: INodeParameters;
|
defaults: INodeParameters;
|
||||||
|
documentationUrl?: string;
|
||||||
inputs: string[];
|
inputs: string[];
|
||||||
inputNames?: string[];
|
inputNames?: string[];
|
||||||
outputs: string[];
|
outputs: string[];
|
||||||
|
|
Loading…
Reference in a new issue