🐛 Fix naming of events in AffinityTrigger Node

This commit is contained in:
Jan Oberhauser 2020-07-12 09:28:08 +02:00
parent c08ff6cee3
commit bcabdc457b
8 changed files with 33 additions and 9 deletions

View file

@ -204,6 +204,13 @@ const config = convict({
}, },
// How n8n can be reached (Editor & REST-API) // How n8n can be reached (Editor & REST-API)
path: {
format: String,
default: '/',
arg: 'path',
env: 'N8N_PATH',
doc: 'Path n8n is deployed to'
},
host: { host: {
format: String, format: String,
default: 'localhost', default: 'localhost',

View file

@ -1693,9 +1693,21 @@ class App {
}); });
} }
// Read the index file and replace the path placeholder
const editorUiPath = require.resolve('n8n-editor-ui');
const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html');
let readIndexFile = readFileSync(filePath, 'utf8');
const n8nPath = config.get('path');
readIndexFile = readIndexFile.replace(/\/%BASE_PATH%\//g, n8nPath);
// Serve the altered index.html file separately
this.app.get(`/index.html`, async (req: express.Request, res: express.Response) => {
res.send(readIndexFile);
});
// Serve the website // Serve the website
const startTime = (new Date()).toUTCString(); const startTime = (new Date()).toUTCString();
const editorUiPath = require.resolve('n8n-editor-ui');
this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), { this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), {
index: 'index.html', index: 'index.html',
setHeaders: (res, path) => { setHeaders: (res, path) => {

View file

@ -4,7 +4,8 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="/%BASE_PATH%/favicon.ico">
<script type="text/javascript">window.BASE_PATH = "/%BASE_PATH%/";</script>
<title>n8n.io - Workflow Automation</title> <title>n8n.io - Workflow Automation</title>
</head> </head>
<body> <body>

View file

@ -16,7 +16,7 @@
<el-menu-item index="logo" class="logo-item"> <el-menu-item index="logo" class="logo-item">
<a href="https://n8n.io" target="_blank" class="logo"> <a href="https://n8n.io" target="_blank" class="logo">
<img src="/n8n-icon-small.png" class="icon" alt="n8n.io"/> <img :src="basePath + '/n8n-icon-small.png'" class="icon" alt="n8n.io"/>
<span class="logo-text" slot="title">n8n.io</span> <span class="logo-text" slot="title">n8n.io</span>
</a> </a>
</el-menu-item> </el-menu-item>
@ -208,6 +208,8 @@ export default mixins(
data () { data () {
return { return {
aboutDialogVisible: false, aboutDialogVisible: false,
// @ts-ignore
basePath: window.BASE_PATH,
isCollapsed: true, isCollapsed: true,
credentialNewDialogVisible: false, credentialNewDialogVisible: false,
credentialOpenDialogVisible: false, credentialOpenDialogVisible: false,

View file

@ -8,7 +8,8 @@ Vue.use(Router);
export default new Router({ export default new Router({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, // @ts-ignore
base: window.BASE_PATH,
routes: [ routes: [
{ {
path: '/execution/:id', path: '/execution/:id',

View file

@ -38,7 +38,8 @@ export const store = new Vuex.Store({
activeWorkflows: [] as string[], activeWorkflows: [] as string[],
activeActions: [] as string[], activeActions: [] as string[],
activeNode: null as string | null, activeNode: null as string | null,
baseUrl: process.env.VUE_APP_URL_BASE_API ? process.env.VUE_APP_URL_BASE_API : '/', // @ts-ignore
baseUrl: window.BASE_PATH ? window.BASE_PATH : '/',
credentials: null as ICredentialsResponse[] | null, credentials: null as ICredentialsResponse[] | null,
credentialTypes: null as ICredentialType[] | null, credentialTypes: null as ICredentialType[] | null,
endpointWebhook: 'webhook', endpointWebhook: 'webhook',

View file

@ -29,5 +29,5 @@ module.exports = {
}, },
}, },
}, },
publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/', publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/%BASE_PATH%/',
}; };

View file

@ -52,10 +52,10 @@ export class AffinityTrigger implements INodeType {
options: [ options: [
{ {
name: 'file.created', name: 'file.created',
value: 'file.deleted', value: 'file.created',
}, },
{ {
name: 'file.created', name: 'file.deleted',
value: 'file.deleted', value: 'file.deleted',
}, },
{ {
@ -136,7 +136,7 @@ export class AffinityTrigger implements INodeType {
}, },
{ {
name: 'opportunity.deleted', name: 'opportunity.deleted',
value: 'organization.deleted', value: 'opportunity.deleted',
}, },
{ {
name: 'person.created', name: 'person.created',