1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-10-07 01:58:50 +03:00

🔀 Merge branch 'master' into depfu/update/packagescli/npm/open-7.0.0

This commit is contained in:
Jan Oberhauser 2019-12-30 09:11:53 -06:00
commit a3bc35d971
19 changed files with 66 additions and 68 deletions

View File

@ -65,7 +65,7 @@
"@types/parseurl": "^1.3.1",
"@types/request-promise-native": "^1.0.15",
"jest": "^24.9.0",
"nodemon": "^1.19.1",
"nodemon": "^2.0.2",
"run-script-os": "^1.0.7",
"ts-jest": "^24.0.2",
"tslint": "^5.17.0",

View File

@ -5,7 +5,6 @@ module.exports = {
},
'extends': [
'plugin:vue/essential',
'@vue/standard',
'@vue/typescript',
],
rules: {
@ -18,6 +17,6 @@ module.exports = {
'no-labels': 0,
},
parserOptions: {
parser: 'typescript-eslint-parser',
parser: '@typescript-eslint/parser',
},
};

View File

@ -34,23 +34,27 @@
"@types/jest": "^24.0.18",
"@types/lodash.get": "^4.4.5",
"@types/lodash.set": "^4.3.6",
"@types/node": "12.12.22",
"@types/quill": "^2.0.1",
"@vue/cli-plugin-babel": "^3.8.0",
"@vue/cli-plugin-e2e-cypress": "^3.8.0",
"@vue/cli-plugin-eslint": "^3.8.0",
"@vue/cli-plugin-typescript": "~3.8.1",
"@vue/cli-plugin-unit-jest": "^3.8.0",
"@vue/cli-service": "^3.8.0",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/eslint-config-typescript": "~3.2.0",
"@vue/test-utils": "^1.0.0-beta.20",
"axios": "^0.18.1",
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
"@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-e2e-cypress": "^4.1.2",
"@vue/cli-plugin-eslint": "^4.1.2",
"@vue/cli-plugin-typescript": "~4.1.2",
"@vue/cli-plugin-unit-jest": "^4.1.2",
"@vue/cli-service": "^4.1.2",
"@vue/eslint-config-standard": "^5.0.1",
"@vue/eslint-config-typescript": "~5.0.1",
"@vue/test-utils": "^1.0.0-beta.24",
"axios": "^0.19.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"dateformat": "^3.0.3",
"element-ui": "~2.4.11",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0-0",
"element-ui": "~2.13.0",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-vue": "^6.1.1",
"file-saver": "^2.0.2",
"flatted": "^2.0.0",
"jquery": "^3.4.1",
@ -64,18 +68,18 @@
"prismjs": "^1.17.1",
"quill": "^2.0.0-dev.3",
"quill-autoformat": "^0.1.1",
"sass-loader": "^7.0.1",
"sass-loader": "^8.0.0",
"string-template-parser": "^1.2.6",
"ts-jest": "^24.0.2",
"tslint": "^5.17.0",
"typescript": "~3.5.2",
"typescript": "~3.7.4",
"vue": "^2.6.9",
"vue-cli-plugin-webpack-bundle-analyzer": "^1.3.0",
"vue-cli-plugin-webpack-bundle-analyzer": "^2.0.0",
"vue-json-tree": "^0.4.1",
"vue-prism-editor": "^0.3.0",
"vue-router": "^3.0.6",
"vue-template-compiler": "^2.5.17",
"vue-typed-mixins": "^0.1.0",
"vue-typed-mixins": "^0.2.0",
"vuex": "^3.1.1"
}
}

View File

@ -21,14 +21,10 @@
</template>
<script lang="ts">
import Vue from 'vue';
import {
IBinaryData,
IBinaryKeyData,
IRunData,
IRunExecutionData,
Workflow,
} from 'n8n-workflow';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';

View File

@ -37,8 +37,6 @@
</template>
<script lang="ts">
import Vue from 'vue';
import { restApi } from '@/components/mixins/restApi';
import { ICredentialsResponse } from '@/Interface';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
@ -72,7 +70,7 @@ export default mixins(
};
},
watch: {
dialogVisible (newValue, oldValue) {
dialogVisible (newValue) {
if (newValue) {
this.loadCredentials();
this.loadCredentialTypes();
@ -146,9 +144,8 @@ export default mixins(
return;
}
let result;
try {
result = await this.restApi().deleteCredentials(credential.id!);
await this.restApi().deleteCredentials(credential.id!);
} catch (error) {
this.$showError(error, 'Problem deleting credentials', 'There was a problem deleting the credentials:');
return;

View File

@ -160,6 +160,7 @@
<script lang="ts">
import Vue from 'vue';
import { MessageBoxInputData } from 'element-ui/types/message-box';
import {
IExecutionResponse,
@ -349,7 +350,7 @@ export default mixins(
cancelButtonText: 'Cancel',
inputErrorMessage: 'Invalid URL',
inputPattern: /^http[s]?:\/\/.*\.json$/i,
});
}) as MessageBoxInputData;
this.$root.$emit('importWorkflowUrl', { url: promptResponse.value });
} catch (e) {}
@ -361,7 +362,7 @@ export default mixins(
inputValue: this.workflowName,
confirmButtonText: 'Rename',
cancelButtonText: 'Cancel',
}
},
)
.then((data) => {
// @ts-ignore

View File

@ -10,7 +10,7 @@
<prism-editor v-if="!codeEditDialogVisible" :lineNumbers="true" :readonly="true" :code="displayValue" language="js"></prism-editor>
</div>
<el-input v-else ref="inputField" size="small" :type="getStringInputType" :rows="getArgument('rows')" :value="displayValue" :disabled="isReadOnly" @change="valueChanged" @keydown.stop @focus="setFocus" :title="displayTitle" :placeholder="isValueExpression?'':parameter.placeholder">
<el-input v-else v-model="tempValue" ref="inputField" size="small" :type="getStringInputType" :rows="getArgument('rows')" :value="displayValue" :disabled="isReadOnly" @change="valueChanged" @keydown.stop @focus="setFocus" :title="displayTitle" :placeholder="isValueExpression?'':parameter.placeholder">
<font-awesome-icon v-if="!isValueExpression && !isReadOnly" slot="suffix" icon="external-link-alt" class="edit-window-button clickable" title="Open Edit Window" @click="displayEditDialog()" />
</el-input>
</div>
@ -83,7 +83,7 @@
<div v-else-if="parameter.type === 'color'" ref="inputField" class="color-input">
<el-color-picker :value="displayValue" :disabled="isReadOnly" @change="valueChanged" size="small" class="color-picker" @focus="setFocus" :title="displayTitle" ></el-color-picker>
<el-input size="small" type="text" :value="displayValue" :disabled="isReadOnly" @change="valueChanged" @keydown.stop @focus="setFocus" :title="displayTitle" ></el-input>
<el-input v-model="tempValue" size="small" type="text" :value="displayValue" :disabled="isReadOnly" @change="valueChanged" @keydown.stop @focus="setFocus" :title="displayTitle" ></el-input>
</div>
<div v-else-if="parameter.type === 'boolean'">
@ -173,7 +173,7 @@ export default mixins(
remoteParameterOptionsLoading: false,
remoteParameterOptionsLoadingIssues: null as string | null,
textEditDialogVisible: false,
tempValue: '', // el-date-picker does not seem to work without v-model so add one
tempValue: '', // el-date-picker and el-input does not seem to work without v-model so add one
dateTimePickerOptions: {
shortcuts: [
{

View File

@ -123,7 +123,7 @@ export default mixins(
},
getArgument (
argumentName: string,
parameter: INodeProperties
parameter: INodeProperties,
): string | number | boolean | undefined {
if (parameter.typeOptions === undefined) {
return undefined;

View File

@ -190,7 +190,7 @@ export default mixins(
key: fullpath,
allowParentSelect: true,
dataType: 'array',
} as IVariableSelectorOption
} as IVariableSelectorOption,
);
} else if (typeof inputData === 'object') {
const tempValue: IVariableSelectorOption[] = [];
@ -207,7 +207,7 @@ export default mixins(
key: fullpath,
allowParentSelect: true,
dataType: 'object',
} as IVariableSelectorOption
} as IVariableSelectorOption,
);
}
} else {
@ -222,7 +222,7 @@ export default mixins(
name: propertyName,
key: fullpath,
value: inputData,
} as IVariableSelectorOption
} as IVariableSelectorOption,
);
}
}
@ -294,7 +294,7 @@ export default mixins(
{
name: 'JSON',
options: this.sortOptions(jsonDataOptions),
}
},
);
}
}
@ -321,7 +321,7 @@ export default mixins(
name: propertyName,
key: `$node["${nodeName}"].binary.${dataPropertyName}.${propertyName}`,
value: outputData.binary![dataPropertyName][propertyName],
}
},
);
}
@ -332,7 +332,7 @@ export default mixins(
key: `$node["${nodeName}"].binary.${dataPropertyName}`,
options: this.sortOptions(binaryPropertyData),
allowParentSelect: true,
}
},
);
}
}
@ -343,7 +343,7 @@ export default mixins(
key: `$node["${nodeName}"].binary`,
options: this.sortOptions(binaryData),
allowParentSelect: true,
}
},
);
}
}
@ -476,7 +476,7 @@ export default mixins(
{
name: 'Input Data',
options: this.sortOptions(tempOutputData),
}
},
);
} else {
// Data is to large so do not add
@ -488,7 +488,7 @@ export default mixins(
name: '[Data to large]',
},
],
}
},
);
}
}
@ -504,14 +504,14 @@ export default mixins(
{
name: 'Parameters',
options: this.sortOptions(this.getNodeParameters(activeNode.name, initialPath, skipParameter, filterText) as IVariableSelectorOption[]),
}
},
);
returnData.push(
{
name: 'Current Node',
options: this.sortOptions(currentNodeData),
}
},
);
// Add the input data
@ -562,7 +562,7 @@ export default mixins(
{
name: 'Output Data',
options: this.sortOptions(tempOutputData),
} as IVariableSelectorOption
} as IVariableSelectorOption,
);
}
}
@ -571,7 +571,7 @@ export default mixins(
{
name: nodeName,
options: this.sortOptions(nodeOptions),
}
},
);
}
@ -579,7 +579,7 @@ export default mixins(
{
name: 'Nodes',
options: this.sortOptions(allNodesData),
}
},
);
// Remove empty entries and return

View File

@ -158,7 +158,7 @@ export default mixins(
});
},
},
}
},
);
</script>

View File

@ -104,13 +104,13 @@ export default mixins(
workflowData.updatedAt = this.convertToDisplayDate(workflowData.updatedAt as number);
});
this.isDataLoading = false;
}
},
)
.catch(
(error: Error) => {
this.$showError(error, 'Problem loading workflows', 'There was a problem loading the workflows:');
this.isDataLoading = false;
}
},
);
},
workflowActiveChanged (data: { id: string, active: boolean }) {

View File

@ -185,7 +185,7 @@ export default mixins(
key: 'none',
value: 'Do not save',
},
]
],
);
},
async loadSaveDataSuccessExecutionOptions () {
@ -204,7 +204,7 @@ export default mixins(
key: 'none',
value: 'Do not save',
},
]
],
);
},
async loadSaveManualOptions () {

View File

@ -63,7 +63,7 @@ export const genericHelpers = mixins(showMessage).extend({
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.8)',
}
},
);
},
stopLoading () {

View File

@ -122,7 +122,7 @@ export const pushConnection = mixins(
// @ts-ignore
receivedData = JSON.parse(event.data);
} catch (error) {
console.error('The received push data is not valid JSON.');
console.error('The received push data is not valid JSON.'); // eslint-disable-line no-console
return;
}

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import { parse } from 'flatted';
import axios, { AxiosRequestConfig } from 'axios';
import axios, { AxiosRequestConfig, Method } from 'axios';
import {
IActivationError,
ICredentialsDecryptedResponse,
@ -94,7 +94,7 @@ export const restApi = Vue.extend({
restApi (): IRestApi {
const self = this;
return {
async makeRestApiRequest (method: string, endpoint: string, data?: IDataObject): Promise<any> { // tslint:disable-line:no-any
async makeRestApiRequest (method: Method, endpoint: string, data?: IDataObject): Promise<any> { // tslint:disable-line:no-any
try {
const options: AxiosRequestConfig = {
method,

View File

@ -370,7 +370,7 @@ export const workflowHelpers = mixins(
{
confirmButtonText: 'Save',
cancelButtonText: 'Cancel',
}
},
)
.then((data) => {
// @ts-ignore
@ -403,7 +403,7 @@ export const workflowHelpers = mixins(
if (currentWorkflow === undefined || withNewName === true) {
// Workflow is new or is supposed to get saved under a new name
// so create a new entry in database
workflowData.name = workflowName.trim() as string;
workflowData.name = workflowName!.trim() as string;
if (withNewName === true) {
// If an existing workflow gets resaved with a new name

View File

@ -29,7 +29,7 @@ export const workflowSave = mixins(
{
confirmButtonText: 'Save',
cancelButtonText: 'Cancel',
}
},
)
.then((data) => {
// @ts-ignore
@ -62,7 +62,7 @@ export const workflowSave = mixins(
if (currentWorkflow === undefined || withNewName === true) {
// Workflow is new or is supposed to get saved under a new name
// so create a new entry in database
workflowData.name = workflowName.trim() as string;
workflowData.name = workflowName!.trim() as string;
if (withNewName === true) {
// If an existing workflow gets resaved with a new name

View File

@ -102,6 +102,7 @@
<script lang="ts">
import Vue from 'vue';
import { MessageBoxInputData } from 'element-ui/types/message-box';
import { jsPlumb, Endpoint, OnConnectionBindInfo } from 'jsplumb';
import { NODE_NAME_PREFIX, PLACEHOLDER_EMPTY_WORKFLOW_ID } from '@/constants';
import { copyPaste } from '@/components/mixins/copyPaste';
@ -943,7 +944,7 @@ export default mixins(
// newNodeData.position = [activeNode.position[0], activeNode.position[1] + 60];
newNodeData.position = this.getNewNodePosition(
[lastSelectedNode.position[0] + 150, lastSelectedNode.position[1]],
[100, 0]
[100, 0],
);
} else {
// If no node is active find a free spot
@ -970,7 +971,7 @@ export default mixins(
// Add connections of active node to newly created one
let connections = this.$store.getters.connectionsByNodeName(
lastSelectedNode.name
lastSelectedNode.name,
);
connections = JSON.parse(JSON.stringify(connections));
@ -1406,7 +1407,7 @@ export default mixins(
newNodeData.position = this.getNewNodePosition(
[node.position[0], node.position[1] + 150],
[0, 150]
[0, 150],
);
await this.addNodes([newNodeData]);
@ -1504,7 +1505,7 @@ export default mixins(
nameInput.select();
}
const promptResponse = await promptResponsePromise;
const promptResponse = await promptResponsePromise as MessageBoxInputData;
this.renameNode(currentName, promptResponse.value);
} catch (e) {}
@ -1602,7 +1603,7 @@ export default mixins(
for (const type of Object.keys(connections[sourceNode])) {
for (let sourceIndex = 0; sourceIndex < connections[sourceNode][type].length; sourceIndex++) {
connections[sourceNode][type][sourceIndex].forEach((
targetData
targetData,
) => {
connectionData = [
{

View File

@ -23,7 +23,7 @@ module.exports = {
css: {
loaderOptions: {
sass: {
data: `
prependData: `
@import "@/n8n-theme-variables.scss";
`,
},