🔥 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'; } from 'n8n-workflow';
import { nodeHelpers } from '@/components/mixins/nodeHelpers'; import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { renderText } from '@/components/mixins/renderText';
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
export default mixins( export default mixins(
nodeHelpers, nodeHelpers,
renderText,
) )
.extend({ .extend({
name: 'BinaryDataDisplay', name: 'BinaryDataDisplay',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -52,10 +52,8 @@ import { mapGetters } from "vuex";
import Modal from './Modal.vue'; import Modal from './Modal.vue';
import { CREDENTIAL_SELECT_MODAL_KEY } from '../constants'; 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', name: 'CredentialsSelectModal',
components: { components: {
Modal, Modal,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,10 +15,8 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import camelcase from 'lodash.camelcase'; 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'], props: ['item'],
computed: { computed: {
categoryName() { 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 { ALL_NODE_FILTER, CORE_NODES_CATEGORY, REGULAR_NODE_FILTER, TRIGGER_NODE_FILTER } from '@/constants';
import SlideTransition from '../transitions/SlideTransition.vue'; import SlideTransition from '../transitions/SlideTransition.vue';
import { matchesNodeType, matchesSelectType } from './helpers'; import { matchesNodeType, matchesSelectType } from './helpers';
import { renderText } from '../mixins/renderText';
export default mixins(externalHooks, renderText).extend({ export default mixins(externalHooks).extend({
name: 'NodeCreateList', name: 'NodeCreateList',
components: { components: {
ItemIterator, ItemIterator,

View file

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

View file

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

View file

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

View file

@ -15,11 +15,10 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue';
import camelcase from 'lodash.camelcase'; 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'], props: ['item'],
computed: { computed: {
subcategoryName() { subcategoryName() {

View file

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

View file

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

View file

@ -30,10 +30,8 @@
import { IUpdateInformation } from '@/Interface'; import { IUpdateInformation } from '@/Interface';
import ParameterInput from './ParameterInput.vue'; import ParameterInput from './ParameterInput.vue';
import Vue from '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', name: 'ParameterInputExpanded',
components: { components: {
ParameterInput, ParameterInput,

View file

@ -27,10 +27,8 @@ import {
} from '@/Interface'; } from '@/Interface';
import ParameterInput from '@/components/ParameterInput.vue'; 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({ .extend({
name: 'ParameterInputFull', name: 'ParameterInputFull',
components: { components: {

View file

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

View file

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

View file

@ -13,10 +13,8 @@
<script lang="ts"> <script lang="ts">
import Vue from '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: "SaveButton", name: "SaveButton",
props: { props: {
saved: { saved: {

View file

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

View file

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

View file

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

View file

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

View file

@ -32,11 +32,10 @@ import { ITag, ITagRow } from "@/Interface";
import TagsTableHeader from "@/components/TagsManager/TagsView/TagsTableHeader.vue"; import TagsTableHeader from "@/components/TagsManager/TagsView/TagsTableHeader.vue";
import TagsTable from "@/components/TagsManager/TagsView/TagsTable.vue"; import TagsTable from "@/components/TagsManager/TagsView/TagsTable.vue";
import mixins from "vue-typed-mixins"; 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()); 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 }, components: { TagsTableHeader, TagsTable },
name: "TagsView", name: "TagsView",
props: ["tags", "isLoading"], props: ["tags", "isLoading"],

View file

@ -16,10 +16,8 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; 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', name: 'TextEdit',
props: [ props: [
'dialogVisible', 'dialogVisible',

View file

@ -9,10 +9,8 @@ import { format, LocaleFunc, register } from 'timeago.js';
import { convertToHumanReadableDate } from './helpers'; import { convertToHumanReadableDate } from './helpers';
import Vue from 'vue'; import Vue from 'vue';
import { mapGetters } from 'vuex'; 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', name: 'TimeAgo',
props: { props: {
date: { date: {

View file

@ -61,10 +61,8 @@ import ModalDrawer from './ModalDrawer.vue';
import TimeAgo from './TimeAgo.vue'; import TimeAgo from './TimeAgo.vue';
import VersionCard from './VersionCard.vue'; import VersionCard from './VersionCard.vue';
import { VERSIONS_MODAL_KEY } from '../constants'; 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', name: 'UpdatesPanel',
components: { components: {
ModalDrawer, ModalDrawer,

View file

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

View file

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

View file

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

View file

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

View file

@ -12,12 +12,10 @@ import {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { getStyleTokenValue } from '../helpers'; import { getStyleTokenValue } from '../helpers';
import { renderText } from './renderText';
export const nodeBase = mixins( export const nodeBase = mixins(
deviceSupportHelpers, deviceSupportHelpers,
nodeIndex, nodeIndex,
renderText,
).extend({ ).extend({
mounted () { mounted () {
// Initialize the node // 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 { ElMessageBoxOptions } from 'element-ui/types/message-box';
import { MessageType } from 'element-ui/types/message'; import { MessageType } from 'element-ui/types/message';
import { isChildOf } from './helpers'; import { isChildOf } from './helpers';
import { renderText } from '@/components/mixins/renderText';
let stickyNotificationQueue: ElNotificationComponent[] = []; let stickyNotificationQueue: ElNotificationComponent[] = [];
export const showMessage = mixins(externalHooks, renderText).extend({ export const showMessage = mixins(externalHooks).extend({
methods: { methods: {
$showMessage(messageData: ElNotificationOptions, track = true) { $showMessage(messageData: ElNotificationOptions, track = true) {
messageData.dangerouslyUseHTMLString = true; messageData.dangerouslyUseHTMLString = true;

View file

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

View file

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

View file

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

View file

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