mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
✨ Allow custom documentation URLs on credentials & nodes
This commit is contained in:
parent
9fee42b2a8
commit
639bdd2ceb
|
@ -20,7 +20,7 @@
|
|||
</g>
|
||||
</g>
|
||||
</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>
|
||||
|
@ -119,7 +119,11 @@ export default mixins(
|
|||
|
||||
const credentialType = this.$store.getters.credentialType(credentialTypeName);
|
||||
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;
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<transition name="fade">
|
||||
<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>
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-1127.000000, -836.000000)" fill-rule="nonzero">
|
||||
|
@ -26,7 +26,7 @@
|
|||
</svg>
|
||||
|
||||
<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>
|
||||
</transition>
|
||||
|
@ -65,6 +65,13 @@ export default Vue.extend({
|
|||
};
|
||||
},
|
||||
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 {
|
||||
return this.$store.getters.activeNode;
|
||||
},
|
||||
|
|
|
@ -536,6 +536,7 @@ export interface INodeTypeDescription {
|
|||
version: number;
|
||||
description: string;
|
||||
defaults: INodeParameters;
|
||||
documentationUrl?: string;
|
||||
inputs: string[];
|
||||
inputNames?: string[];
|
||||
outputs: string[];
|
||||
|
|
Loading…
Reference in a new issue