🔥 Remove mixin-related lines

This commit is contained in:
Iván Ovejero 2021-12-07 16:14:40 +01:00
parent 7805b21a15
commit 858d0d0160
47 changed files with 39 additions and 337 deletions

View file

@ -31,13 +31,11 @@ import {
} from 'n8n-workflow';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(
nodeHelpers,
renderText,
)
.extend({
name: 'BinaryDataDisplay',

View file

@ -13,10 +13,9 @@
<script lang="ts">
import mixins from 'vue-typed-mixins';
import { copyPaste } from './mixins/copyPaste';
import { renderText } from './mixins/renderText';
import { showMessage } from './mixins/showMessage';
export default mixins(copyPaste, showMessage, renderText).extend({
export default mixins(copyPaste, showMessage).extend({
props: {
label: {
type: String,

View file

@ -80,12 +80,11 @@ import Banner from '../Banner.vue';
import CopyInput from '../CopyInput.vue';
import CredentialInputs from './CredentialInputs.vue';
import OauthButton from './OauthButton.vue';
import { renderText } from '../mixins/renderText';
import { restApi } from '@/components/mixins/restApi';
import { addNodeTranslation } from '@/i18n';
import mixins from 'vue-typed-mixins';
export default mixins(renderText, restApi).extend({
export default mixins(restApi).extend({
name: 'CredentialConfig',
components: {
Banner,

View file

@ -118,7 +118,6 @@ import CredentialIcon from '../CredentialIcon.vue';
import mixins from 'vue-typed-mixins';
import { nodeHelpers } from '../mixins/nodeHelpers';
import { renderText } from '../mixins/renderText';
import { showMessage } from '../mixins/showMessage';
import CredentialConfig from './CredentialConfig.vue';
@ -131,7 +130,7 @@ interface NodeAccessMap {
[nodeType: string]: ICredentialNodeAccess | null;
}
export default mixins(renderText, showMessage, nodeHelpers).extend({
export default mixins(showMessage, nodeHelpers).extend({
name: 'CredentialsDetail',
components: {
CredentialConfig,

View file

@ -58,13 +58,11 @@
<script lang="ts">
import Vue from 'vue';
import { renderText } from '../mixins/renderText';
import TimeAgo from '../TimeAgo.vue';
import mixins from 'vue-typed-mixins';
import { INodeTypeDescription } from 'n8n-workflow';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'CredentialInfo',
props: ['nodesWithAccess', 'nodeAccess', 'currentCredential'],
components: {

View file

@ -18,10 +18,9 @@
<script lang="ts">
import Vue from 'vue';
import { renderText } from '../mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
props: {
isGoogleOAuthType: {
type: Boolean,

View file

@ -52,10 +52,8 @@ import { mapGetters } from "vuex";
import Modal from './Modal.vue';
import { CREDENTIAL_SELECT_MODAL_KEY } from '../constants';
import mixins from 'vue-typed-mixins';
import { renderText } from './mixins/renderText';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'CredentialsSelectModal',
components: {
Modal,

View file

@ -49,7 +49,6 @@ import {
import { externalHooks } from '@/components/mixins/externalHooks';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { renderText } from '@/components/mixins/renderText';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import NodeSettings from '@/components/NodeSettings.vue';
@ -57,7 +56,7 @@ import RunData from '@/components/RunData.vue';
import mixins from 'vue-typed-mixins';
export default mixins(externalHooks, nodeHelpers, renderText, workflowHelpers).extend({
export default mixins(externalHooks, nodeHelpers, workflowHelpers).extend({
name: 'DataDisplay',
components: {
NodeSettings,

View file

@ -44,11 +44,10 @@ import mixins from "vue-typed-mixins";
import { MAX_WORKFLOW_NAME_LENGTH } from "@/constants";
import { workflowHelpers } from "@/components/mixins/workflowHelpers";
import { showMessage } from "@/components/mixins/showMessage";
import { renderText } from "@/components/mixins/renderText";
import TagsDropdown from "@/components/TagsDropdown.vue";
import Modal from "./Modal.vue";
export default mixins(showMessage, renderText, workflowHelpers).extend({
export default mixins(showMessage, workflowHelpers).extend({
components: { TagsDropdown, Modal },
name: "DuplicateWorkflow",
props: ["modalName", "isActive"],

View file

@ -79,12 +79,10 @@ import mixins from 'vue-typed-mixins';
import {
MAX_DISPLAY_DATA_SIZE,
} from '@/constants';
import { renderText } from '../mixins/renderText';
export default mixins(
copyPaste,
showMessage,
renderText,
).extend({
name: 'NodeErrorView',
props: [

View file

@ -48,10 +48,9 @@ import { IExecutionResponse } from "../../../Interface";
import { titleChange } from "@/components/mixins/titleChange";
import WorkflowNameShort from "@/components/WorkflowNameShort.vue";
import { renderText } from "@/components/mixins/renderText";
import ReadOnly from "@/components/MainHeader/ExecutionDetails/ReadOnly.vue";
export default mixins(titleChange, renderText).extend({
export default mixins(titleChange).extend({
name: "ExecutionDetails",
components: {
WorkflowNameShort,

View file

@ -11,10 +11,9 @@
</template>
<script lang="ts">
import { renderText } from "@/components/mixins/renderText";
import mixins from "vue-typed-mixins";
import Vue from 'vue';
export default mixins(renderText).extend({
export default Vue.extend({
name: "ReadOnly",
});
</script>

View file

@ -90,7 +90,6 @@ import SaveButton from "@/components/SaveButton.vue";
import TagsDropdown from "@/components/TagsDropdown.vue";
import InlineTextEdit from "@/components/InlineTextEdit.vue";
import BreakpointsObserver from "@/components/BreakpointsObserver.vue";
import { renderText } from "@/components/mixins/renderText";
const hasChanged = (prev: string[], curr: string[]) => {
if (prev.length !== curr.length) {
@ -101,7 +100,7 @@ const hasChanged = (prev: string[], curr: string[]) => {
return curr.reduce((accu, val) => accu || !set.has(val), false);
};
export default mixins(renderText, workflowHelpers).extend({
export default mixins(workflowHelpers).extend({
name: "WorkflowDetails",
components: {
TagsContainer,

View file

@ -155,7 +155,6 @@ import GiftNotificationIcon from './GiftNotificationIcon.vue';
import WorkflowSettings from '@/components/WorkflowSettings.vue';
import { genericHelpers } from '@/components/mixins/genericHelpers';
import { renderText } from '@/components/mixins/renderText';
import { restApi } from '@/components/mixins/restApi';
import { showMessage } from '@/components/mixins/showMessage';
import { titleChange } from '@/components/mixins/titleChange';
@ -172,7 +171,6 @@ import { CREDENTIAL_LIST_MODAL_KEY, CREDENTIAL_SELECT_MODAL_KEY, DUPLICATE_MODAL
export default mixins(
genericHelpers,
restApi,
renderText,
showMessage,
titleChange,
workflowHelpers,

View file

@ -79,7 +79,6 @@ import { WAIT_TIME_UNLIMITED } from '@/constants';
import { externalHooks } from '@/components/mixins/externalHooks';
import { nodeBase } from '@/components/mixins/nodeBase';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { renderText } from '@/components/mixins/renderText';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import {
@ -96,7 +95,7 @@ import { get } from 'lodash';
import { getStyleTokenValue } from './helpers';
import { INodeUi, XYPosition } from '@/Interface';
export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflowHelpers).extend({
export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).extend({
name: 'Node',
components: {
NodeIcon,

View file

@ -15,10 +15,8 @@
<script lang="ts">
import Vue from 'vue';
import camelcase from 'lodash.camelcase';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
props: ['item'],
computed: {
categoryName() {

View file

@ -55,10 +55,9 @@ import { INodeCreateElement, INodeItemProps, ISubcategoryItemProps } from '@/Int
import { ALL_NODE_FILTER, CORE_NODES_CATEGORY, REGULAR_NODE_FILTER, TRIGGER_NODE_FILTER } from '@/constants';
import SlideTransition from '../transitions/SlideTransition.vue';
import { matchesNodeType, matchesSelectType } from './helpers';
import { renderText } from '../mixins/renderText';
export default mixins(externalHooks, renderText).extend({
export default mixins(externalHooks).extend({
name: 'NodeCreateList',
components: {
ItemIterator,

View file

@ -41,11 +41,9 @@
<script lang="ts">
import { HTTP_REQUEST_NODE_TYPE, REQUEST_NODE_FORM_URL, WEBHOOK_NODE_TYPE } from '@/constants';
import Vue from 'vue';
import { renderText } from '../mixins/renderText';
import mixins from 'vue-typed-mixins';
import NoResultsIcon from './NoResultsIcon.vue';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'NoResults',
components: {
NoResultsIcon,

View file

@ -33,13 +33,10 @@ import { INodeTypeDescription } from 'n8n-workflow';
import NodeIcon from '../NodeIcon.vue';
import TriggerIcon from '../TriggerIcon.vue';
import mixins from 'vue-typed-mixins';
import { renderText } from '@/components/mixins/renderText';
Vue.component('NodeIcon', NodeIcon);
Vue.component('TriggerIcon', TriggerIcon);
export default mixins(renderText).extend({
export default Vue.extend({
name: 'NodeItem',
props: [
'active',

View file

@ -22,9 +22,8 @@
import mixins from 'vue-typed-mixins';
import { externalHooks } from '@/components/mixins/externalHooks';
import { renderText } from '../mixins/renderText';
export default mixins(externalHooks, renderText).extend({
export default mixins(externalHooks).extend({
name: "SearchBar",
props: ["value", "eventBus"],
mounted() {

View file

@ -15,11 +15,10 @@
</template>
<script lang="ts">
import Vue from 'vue';
import camelcase from 'lodash.camelcase';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
props: ['item'],
computed: {
subcategoryName() {

View file

@ -26,10 +26,7 @@ import Vue from 'vue';
import ItemIterator from './ItemIterator.vue';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'SubcategoryPanel',
components: {
ItemIterator,

View file

@ -50,11 +50,9 @@ import { showMessage } from '@/components/mixins/showMessage';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import mixins from 'vue-typed-mixins';
import { renderText } from './mixins/renderText';
export default mixins(
copyPaste,
renderText,
showMessage,
workflowHelpers,
)

View file

@ -30,10 +30,8 @@
import { IUpdateInformation } from '@/Interface';
import ParameterInput from './ParameterInput.vue';
import Vue from 'vue';
import mixins from 'vue-typed-mixins';
import { renderText } from './mixins/renderText';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'ParameterInputExpanded',
components: {
ParameterInput,

View file

@ -27,10 +27,8 @@ import {
} from '@/Interface';
import ParameterInput from '@/components/ParameterInput.vue';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText)
export default Vue
.extend({
name: 'ParameterInputFull',
components: {

View file

@ -247,13 +247,12 @@ import {
} from "../constants";
import { workflowHelpers } from "@/components/mixins/workflowHelpers";
import { showMessage } from "@/components/mixins/showMessage";
import { renderText } from "@/components/mixins/renderText";
import Modal from "./Modal.vue";
import { IPersonalizationSurveyAnswers, IPersonalizationSurveyKeys } from "@/Interface";
import Vue from "vue";
import { mapGetters } from "vuex";
export default mixins(showMessage, renderText, workflowHelpers).extend({
export default mixins(showMessage, workflowHelpers).extend({
components: { Modal },
name: "PersonalizationModal",
data() {

View file

@ -18,10 +18,7 @@
import Vue from "vue";
import { mapGetters } from "vuex";
import mixins from 'vue-typed-mixins';
import { renderText } from "./mixins/renderText";
export default mixins(renderText).extend({
export default Vue.extend({
name: "PushConnectionTracker",
computed: {
...mapGetters(["pushConnectionActive"]),

View file

@ -13,10 +13,8 @@
<script lang="ts">
import Vue from 'vue';
import mixins from 'vue-typed-mixins';
import { renderText } from './mixins/renderText';
export default mixins(renderText).extend({
export default Vue.extend({
name: "SaveButton",
props: {
saved: {

View file

@ -60,12 +60,11 @@ import { ITag } from "@/Interface";
import { MAX_TAG_NAME_LENGTH, TAGS_MANAGER_MODAL_KEY } from "@/constants";
import { showMessage } from "@/components/mixins/showMessage";
import { renderText } from "@/components/mixins/renderText";
const MANAGE_KEY = "__manage";
const CREATE_KEY = "__create";
export default mixins(showMessage, renderText).extend({
export default mixins(showMessage).extend({
name: "TagsDropdown",
props: ["placeholder", "currentTagIds", "createEnabled", "eventBus"],
data() {

View file

@ -38,13 +38,12 @@ import { mapGetters } from "vuex";
import { ITag } from "@/Interface";
import { showMessage } from "@/components/mixins/showMessage";
import { renderText } from "@/components/mixins/renderText";
import TagsView from "@/components/TagsManager/TagsView/TagsView.vue";
import NoTagsView from "@/components/TagsManager/NoTagsView.vue";
import Modal from "@/components/Modal.vue";
import { TAGS_MANAGER_MODAL_KEY } from '../../constants';
export default mixins(renderText, showMessage).extend({
export default mixins(showMessage).extend({
name: "TagsManager",
created() {
this.$store.dispatch("tags/fetchAll", {force: true, withUsageCount: true});

View file

@ -66,16 +66,14 @@
</template>
<script lang="ts">
import { renderText } from "@/components/mixins/renderText";
import { MAX_TAG_NAME_LENGTH } from "@/constants";
import { ITagRow } from "@/Interface";
import Vue from "vue";
import mixins from 'vue-typed-mixins';
const INPUT_TRANSITION_TIMEOUT = 350;
const DELETE_TRANSITION_TIMEOUT = 100;
export default mixins(renderText).extend({
export default Vue.extend({
name: "TagsTable",
props: ["rows", "isLoading", "newName", "isSaving"],
data() {

View file

@ -19,12 +19,10 @@
</template>
<script lang="ts">
import { renderText } from "@/components/mixins/renderText";
import { MAX_TAG_NAME_LENGTH } from "@/constants";
import Vue from "vue";
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
props: {
disabled: {
default: false,

View file

@ -32,11 +32,10 @@ import { ITag, ITagRow } from "@/Interface";
import TagsTableHeader from "@/components/TagsManager/TagsView/TagsTableHeader.vue";
import TagsTable from "@/components/TagsManager/TagsView/TagsTable.vue";
import mixins from "vue-typed-mixins";
import { renderText } from "@/components/mixins/renderText";
const matches = (name: string, filter: string) => name.toLowerCase().trim().includes(filter.toLowerCase().trim());
export default mixins(renderText).extend({
export default Vue.extend({
components: { TagsTableHeader, TagsTable },
name: "TagsView",
props: ["tags", "isLoading"],

View file

@ -16,10 +16,8 @@
<script lang="ts">
import Vue from 'vue';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'TextEdit',
props: [
'dialogVisible',

View file

@ -9,10 +9,8 @@ import { format, LocaleFunc, register } from 'timeago.js';
import { convertToHumanReadableDate } from './helpers';
import Vue from 'vue';
import { mapGetters } from 'vuex';
import mixins from 'vue-typed-mixins';
import { renderText } from './mixins/renderText';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'TimeAgo',
props: {
date: {

View file

@ -61,10 +61,8 @@ import ModalDrawer from './ModalDrawer.vue';
import TimeAgo from './TimeAgo.vue';
import VersionCard from './VersionCard.vue';
import { VERSIONS_MODAL_KEY } from '../constants';
import { renderText } from './mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'UpdatesPanel',
components: {
ModalDrawer,

View file

@ -41,10 +41,8 @@ import {
IVariableSelectorOption,
IVariableItemSelected,
} from '@/Interface';
import { renderText } from './mixins/renderText';
import mixins from 'vue-typed-mixins';
export default mixins(renderText).extend({
export default Vue.extend({
name: 'VariableSelectorItem',
props: [
'allowParentSelect',

View file

@ -48,15 +48,13 @@ import TimeAgo from './TimeAgo.vue';
import Badge from './Badge.vue';
import WarningTooltip from './WarningTooltip.vue';
import { IVersionNode } from '@/Interface';
import { renderText } from './mixins/renderText';
import mixins from 'vue-typed-mixins';
Vue.component('NodeIcon', NodeIcon);
Vue.component('TimeAgo', TimeAgo);
Vue.component('Badge', Badge);
Vue.component('WarningTooltip', WarningTooltip);
export default mixins(renderText).extend({
export default Vue.extend({
components: { NodeIcon, TimeAgo, Badge, WarningTooltip },
name: 'VersionCard',
props: ['version'],

View file

@ -67,12 +67,10 @@ import TagsDropdown from '@/components/TagsDropdown.vue';
import WorkflowActivator from '@/components/WorkflowActivator.vue';
import { convertToDisplayDate } from './helpers';
import { WORKFLOW_OPEN_MODAL_KEY } from '../constants';
import { renderText } from '@/components/mixins/renderText';
export default mixins(
genericHelpers,
restApi,
renderText,
showMessage,
workflowHelpers,
).extend({

View file

@ -1,10 +1,9 @@
import { showMessage } from '@/components/mixins/showMessage';
import { renderText } from '@/components/mixins/renderText';
import { debounce } from 'lodash';
import mixins from 'vue-typed-mixins';
export const genericHelpers = mixins(showMessage, renderText).extend({
export const genericHelpers = mixins(showMessage).extend({
data () {
return {
loadingService: null as any | null, // tslint:disable-line:no-any

View file

@ -12,12 +12,10 @@ import {
INodeTypeDescription,
} from 'n8n-workflow';
import { getStyleTokenValue } from '../helpers';
import { renderText } from './renderText';
export const nodeBase = mixins(
deviceSupportHelpers,
nodeIndex,
renderText,
).extend({
mounted () {
// Initialize the node

View file

@ -1,222 +0,0 @@
import Vue from 'vue';
const REUSABLE_DYNAMIC_TEXT_KEY = 'reusableDynamicText';
const CREDENTIALS_MODAL_KEY = 'credentialsModal';
const NODE_VIEW_KEY = 'nodeView';
export const renderText = Vue.extend({
methods: {
$shortNodeType(longNodeType: string) {
return longNodeType.replace('n8n-nodes-base.', '');
},
/**
* Render a string of base text, i.e. a string with a fixed path to the localized value in the base text object. Optionally allows for [interpolation](https://kazupon.github.io/vue-i18n/guide/formatting.html#named-formatting) when the localized value contains a string between curly braces.
*/
$baseText(
key: string, options?: { interpolate: { [key: string]: string } },
): string {
return this.$t(key, options && options.interpolate).toString();
},
/**
* Render a string of dynamic header text, used in the nodes panel and in the node view.
*/
$headerText(arg: { key: string; fallback: string; }) {
return this.__render(arg);
},
/**
* Render a string of dynamic text, i.e. a string with a constructed path to the localized value in the node text object - in the credentials modal (`$i18n2.credText`), in the node view (`$i18n2.nodeText`), or in the headers (`$i18n2.headerText`) in the nodes panel and node view. _Private method_, to be called only from within this mixin.
*
* Unlike in `$i18n2.baseText`, the fallback has to be set manually for dynamic text.
*/
__render(
{ key, fallback }: { key: string; fallback: string; },
) {
return this.$te(key) ? this.$t(key).toString() : fallback;
},
},
computed: {
$credText () {
const { credentialTextRenderKeys: keys } = this.$store.getters;
const nodeType = keys ? keys.nodeType : '';
const credentialType = keys ? keys.credentialType : '';
const credentialPrefix = `${nodeType}.${CREDENTIALS_MODAL_KEY}.${credentialType}`;
const context = this;
return {
/**
* Display name for a top-level parameter in the credentials modal.
*/
topParameterDisplayName(
{ name: parameterName, displayName }: { name: string; displayName: string; },
) {
if (['clientId', 'clientSecret'].includes(parameterName)) {
return context.__render({
key: `${REUSABLE_DYNAMIC_TEXT_KEY}.oauth2.${parameterName}`,
fallback: displayName,
});
}
return context.__render({
key: `${credentialPrefix}.${parameterName}.displayName`,
fallback: displayName,
});
},
/**
* Description for a top-level parameter in the credentials modal.
*/
topParameterDescription(
{ name: parameterName, description }: { name: string; description: string; },
) {
return context.__render({
key: `${credentialPrefix}.${parameterName}.description`,
fallback: description,
});
},
/**
* Display name for an option inside an `options` or `multiOptions` parameter in the credentials modal.
*/
optionsOptionDisplayName(
{ name: parameterName }: { name: string; },
{ value: optionName, name: displayName }: { value: string; name: string; },
) {
return context.__render({
key: `${credentialPrefix}.${parameterName}.options.${optionName}.displayName`,
fallback: displayName,
});
},
/**
* Description for an option inside an `options` or `multiOptions` parameter in the credentials modal.
*/
optionsOptionDescription(
{ name: parameterName }: { name: string; },
{ value: optionName, description }: { value: string; description: string; },
) {
return context.__render({
key: `${credentialPrefix}.${parameterName}.options.${optionName}.description`,
fallback: description,
});
},
/**
* Placeholder for a `string` or `collection` or `fixedCollection` parameter in the credentials modal.
* - For a `string` parameter, the placeholder is unselectable greyed-out sample text.
* - For a `collection` or `fixedCollection` parameter, the placeholder is the button text.
*/
placeholder(
{ name: parameterName, displayName }: { name: string; displayName: string; },
) {
return context.__render({
key: `${credentialPrefix}.${parameterName}.placeholder`,
fallback: displayName,
});
},
};
},
$nodeText () {
const nodePrefix = `${this.$store.getters.activeNode.type}.${NODE_VIEW_KEY}`;
const context = this;
return {
/**
* Display name for a top-level parameter in the node view.
*/
topParameterDisplayName(
{ name: parameterName, displayName }: { name: string; displayName: string; },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.displayName`,
fallback: displayName,
});
},
/**
* Description for a top-level parameter in the node view in the node view.
*/
topParameterDescription(
{ name: parameterName, description }: { name: string; description: string; },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.description`,
fallback: description,
});
},
/**
* Display name for an option inside a `collection` or `fixedCollection` parameter in the node view.
*/
collectionOptionDisplayName(
{ name: parameterName }: { name: string; },
{ name: optionName, displayName }: { name: string; displayName: string; },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.options.${optionName}.displayName`,
fallback: displayName,
});
},
/**
* Display name for an option inside an `options` or `multiOptions` parameter in the node view.
*/
optionsOptionDisplayName(
{ name: parameterName }: { name: string; },
{ value: optionName, name: displayName }: { value: string; name: string; },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.options.${optionName}.displayName`,
fallback: displayName,
});
},
/**
* Description for an option inside an `options` or `multiOptions` parameter in the node view.
*/
optionsOptionDescription(
{ name: parameterName }: { name: string; },
{ value: optionName, description }: { value: string; description: string; },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.options.${optionName}.description`,
fallback: description,
});
},
/**
* Text for a button to add another option inside a `collection` or `fixedCollection` parameter having`multipleValues: true` in the node view.
*/
multipleValueButtonText(
{ name: parameterName, typeOptions: { multipleValueButtonText } }:
{ name: string; typeOptions: { multipleValueButtonText: string; } },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.multipleValueButtonText`,
fallback: multipleValueButtonText,
});
},
/**
* Placeholder for a `string` or `collection` or `fixedCollection` parameter in the node view.
* - For a `string` parameter, the placeholder is unselectable greyed-out sample text.
* - For a `collection` or `fixedCollection` parameter, the placeholder is the button text.
*/
placeholder(
{ name: parameterName, placeholder }: { name: string; placeholder: string; },
) {
return context.__render({
key: `${nodePrefix}.${parameterName}.placeholder`,
fallback: placeholder,
});
},
};
},
},
});

View file

@ -7,11 +7,10 @@ import { ExecutionError } from 'n8n-workflow';
import { ElMessageBoxOptions } from 'element-ui/types/message-box';
import { MessageType } from 'element-ui/types/message';
import { isChildOf } from './helpers';
import { renderText } from '@/components/mixins/renderText';
let stickyNotificationQueue: ElNotificationComponent[] = [];
export const showMessage = mixins(externalHooks, renderText).extend({
export const showMessage = mixins(externalHooks).extend({
methods: {
$showMessage(messageData: ElNotificationOptions, track = true) {
messageData.dangerouslyUseHTMLString = true;

View file

@ -45,17 +45,15 @@ import { externalHooks } from '@/components/mixins/externalHooks';
import { restApi } from '@/components/mixins/restApi';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { showMessage } from '@/components/mixins/showMessage';
import { renderText } from '@/components/mixins/renderText';
import { isEqual } from 'lodash';
import mixins from 'vue-typed-mixins';
import { v4 as uuidv4} from 'uuid';
import { v4 as uuidv4 } from 'uuid';
export const workflowHelpers = mixins(
externalHooks,
nodeHelpers,
renderText,
restApi,
showMessage,
)

View file

@ -14,7 +14,6 @@ import { externalHooks } from '@/components/mixins/externalHooks';
import { restApi } from '@/components/mixins/restApi';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import { showMessage } from '@/components/mixins/showMessage';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins';
import { titleChange } from './titleChange';
@ -22,7 +21,6 @@ import { titleChange } from './titleChange';
export const workflowRun = mixins(
externalHooks,
restApi,
renderText,
workflowHelpers,
showMessage,
titleChange,

View file

@ -19,7 +19,6 @@ import router from './router';
import { runExternalHook } from './components/mixins/externalHooks';
import { TelemetryPlugin } from './plugins/telemetry';
import { I18nPlugin } from './plugins/i18n';
// import { i18n } from './i18n'; // legacy i18n
import { store } from './store';
@ -34,7 +33,6 @@ Vue.use((vue) => I18nPlugin(vue, store));
new Vue({
router,
store,
// i18n, // legacy i18n
render: h => h(App),
}).$mount('#app');

View file

@ -128,7 +128,6 @@ import { newVersions } from '@/components/mixins/newVersions';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import { workflowRun } from '@/components/mixins/workflowRun';
import { renderText } from '@/components/mixins/renderText';
import DataDisplay from '@/components/DataDisplay.vue';
import Modals from '@/components/Modals.vue';
@ -188,7 +187,6 @@ export default mixins(
mouseSelect,
moveNodeWorkflow,
restApi,
renderText,
showMessage,
titleChange,
workflowHelpers,