🧹 clean up editor based on #1418 (#2010)

* clean up editor based on #1418

* remove unused ref

* address comment on guard style
This commit is contained in:
Mutasem Aldmour 2021-07-23 17:50:47 +02:00 committed by GitHub
parent 5602929210
commit a9550202df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 8 additions and 54 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -38,8 +38,6 @@
</template>
<script lang="ts">
import Vue from 'vue';
import { genericHelpers } from '@/components/mixins/genericHelpers';
import { showMessage } from '@/components/mixins/showMessage';

View file

@ -37,11 +37,7 @@
</template>
<script lang="ts">
import Vue from 'vue';
import {
IRunData,
INodeTypeDescription,
} from 'n8n-workflow';
import {

View file

@ -28,8 +28,6 @@ export default mixins(genericHelpers).extend({
return this.$store.getters.activeNode;
},
currentValue (): string {
const parameterNameParts = this.keyName.split('.');
const getDescendantProp = (obj: object, path: string): string => {
// @ts-ignore
return path.split('.').reduce((acc, part) => acc && acc[part], obj);

View file

@ -6,8 +6,6 @@
<script lang="ts">
import Vue from 'vue';
import { genericHelpers } from '@/components/mixins/genericHelpers';
import mixins from 'vue-typed-mixins';

View file

@ -167,7 +167,6 @@ import {
IExecutionDeleteFilter,
IExecutionsListResponse,
IExecutionShortResponse,
IExecutionsStopData,
IExecutionsSummary,
IWorkflowShortResponse,
} from '@/Interface';
@ -632,7 +631,7 @@ export default mixins(
// can show the user in the UI that it is in progress
this.stoppingExecutions.push(activeExecutionId);
const stopData: IExecutionsStopData = await this.restApi().stopCurrentExecution(activeExecutionId);
await this.restApi().stopCurrentExecution(activeExecutionId);
// Remove it from the list of currently stopping executions
const index = this.stoppingExecutions.indexOf(activeExecutionId);

View file

@ -262,9 +262,7 @@ export default mixins(
// Convert the expression string into a Quill Operations
const editorOperations: DeltaOperation[] = [];
currentValue.replace(/\{\{(.*?)\}\}/ig, '*%%#_@^$1*%%#_@').split('*%%#_@').forEach((value: string) => {
if (!value) {
} else if (value.charAt(0) === '^') {
if (value && value.charAt(0) === '^') {
// Is variable
let displayValue = `{{${value.slice(1)}}}` as string | number | boolean | null | undefined;
if (this.resolvedValue) {

View file

@ -47,8 +47,6 @@
</template>
<script lang="ts">
import Vue from 'vue';
import {
IUpdateInformation,
} from '@/Interface';

View file

@ -148,7 +148,6 @@ import { MessageBoxInputData } from 'element-ui/types/message-box';
import {
IExecutionResponse,
IExecutionsStopData,
IWorkflowDataUpdate,
IMenuItem,
} from '../Interface';
@ -336,7 +335,7 @@ export default mixins(
try {
this.stopExecutionInProgress = true;
const stopData: IExecutionsStopData = await this.restApi().stopCurrentExecution(executionId);
await this.restApi().stopCurrentExecution(executionId);
this.$showMessage({
title: 'Execution stopped',
message: `The execution with the id "${executionId}" got stopped!`,
@ -405,9 +404,8 @@ export default mixins(
return;
}
let result;
try {
result = await this.restApi().deleteWorkflow(this.currentWorkflow);
await this.restApi().deleteWorkflow(this.currentWorkflow);
} catch (error) {
this.$showError(error, 'Problem deleting the workflow', 'There was a problem deleting the workflow:');
return;

View file

@ -36,8 +36,6 @@
</template>
<script lang="ts">
import Vue from 'vue';
import {
IUpdateInformation,
} from '@/Interface';

View file

@ -49,7 +49,6 @@ import {
ICredentialsResponse,
INodeUi,
INodeUpdatePropertiesInformation,
IUpdateInformation,
} from '@/Interface';
import {
ICredentialType,
@ -212,8 +211,6 @@ export default mixins(
return node.issues.credentials[credentialTypeName];
},
updateCredentials (credentialType: string): void {
const credentials = this.credentials[credentialType];
const name = this.credentials[credentialType];
const credentialData = this.credentialOptions[credentialType].find((optionData: ICredentialsResponse) => optionData.name === name);
if (credentialData === undefined) {

View file

@ -79,8 +79,6 @@ export default mixins(
},
computed: {
nodeType (): INodeTypeDescription | null {
const activeNode = this.node;
if (this.node) {
return this.$store.getters.nodeType(this.node.type);
}

View file

@ -38,12 +38,9 @@
</template>
<script lang="ts">
import Vue from 'vue';
import {
IWebhookDescription,
NodeHelpers,
Workflow,
} from 'n8n-workflow';
import { copyPaste } from '@/components/mixins/copyPaste';

View file

@ -115,13 +115,10 @@
</template>
<script lang="ts">
import Vue from 'vue';
import { get } from 'lodash';
import {
INodeUi,
IVariableItemSelected,
IVariableSelectorOption,
} from '@/Interface';
import {
NodeHelpers,

View file

@ -196,20 +196,16 @@
</template>
<script lang="ts">
import Vue from 'vue';
//@ts-ignore
import VueJsonPretty from 'vue-json-pretty';
import {
GenericValue,
IBinaryData,
IBinaryKeyData,
IDataObject,
INodeExecutionData,
IRun,
IRunData,
IRunExecutionData,
ITaskData,
ITaskDataConnections,
} from 'n8n-workflow';
import {

View file

@ -18,10 +18,6 @@
<script lang="ts">
import Vue from 'vue';
import {
Workflow,
} from 'n8n-workflow';
export default Vue.extend({
name: 'TextEdit',

View file

@ -12,13 +12,10 @@
<script lang="ts">
import Vue from 'vue';
import {
GenericValue,
IContextObject,
IDataObject,
IRun,
IRunData,
IRunExecutionData,
Workflow,

View file

@ -355,7 +355,6 @@ export default mixins(
Vue.set(this, 'workflows', workflows);
},
async openDialog () {
const workflowId = this.$route.params.name;
if (this.$route.params.name === undefined) {
this.$showMessage({
title: 'No workflow active',

View file

@ -149,7 +149,6 @@ import {
INodeConnections,
INodeIssues,
INodeTypeDescription,
NodeInputConnections,
NodeHelpers,
Workflow,
IRun,
@ -157,7 +156,6 @@ import {
import {
IConnectionsUi,
IExecutionResponse,
IExecutionsStopData,
IN8nUISettings,
IWorkflowDb,
IWorkflowData,
@ -910,7 +908,7 @@ export default mixins(
try {
this.stopExecutionInProgress = true;
const stopData: IExecutionsStopData = await this.restApi().stopCurrentExecution(executionId);
await this.restApi().stopCurrentExecution(executionId);
this.$showMessage({
title: 'Execution stopped',
message: `The execution with the id "${executionId}" got stopped!`,
@ -950,9 +948,8 @@ export default mixins(
},
async stopWaitingForWebhook () {
let result;
try {
result = await this.restApi().removeTestWebhook(this.$store.getters.workflowId);
await this.restApi().removeTestWebhook(this.$store.getters.workflowId);
} catch (error) {
this.$showError(error, 'Problem deleting the test-webhook', 'There was a problem deleting webhook:');
return;
@ -2037,7 +2034,6 @@ export default mixins(
const nodeSourceConnections = [];
if (currentConnections[sourceNode][type][sourceIndex]) {
for (connectionIndex = 0; connectionIndex < currentConnections[sourceNode][type][sourceIndex].length; connectionIndex++) {
const nodeConnection: NodeInputConnections = [];
connectionData = currentConnections[sourceNode][type][sourceIndex][connectionIndex];
if (!createNodeNames.includes(connectionData.node)) {
// Node does not get created so skip input connection
@ -2235,7 +2231,7 @@ export default mixins(
async mounted () {
this.$root.$on('importWorkflowData', async (data: IDataObject) => {
const resData = await this.importWorkflowData(data.data as IWorkflowDataUpdate);
await this.importWorkflowData(data.data as IWorkflowDataUpdate);
});
this.$root.$on('newWorkflow', this.newWorkflow);
@ -2243,7 +2239,7 @@ export default mixins(
this.$root.$on('importWorkflowUrl', async (data: IDataObject) => {
const workflowData = await this.getWorkflowDataFromUrl(data.url as string);
if (workflowData !== undefined) {
const resData = await this.importWorkflowData(workflowData);
await this.importWorkflowData(workflowData);
}
});