Skip to content

Commit

Permalink
Merge branch 'dev' into update-tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilguun1324 committed Aug 13, 2021
2 parents 240b7ce + 22021ba commit 0d8db77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 47 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "erxes-ui",
"version": "0.0.61",
"version": "0.0.62",
"license": "SEE LICENSE IN LICENSE",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
6 changes: 2 additions & 4 deletions src/components/EditorCK.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class EditorCK extends React.Component<IEditorProps, { content: string }> {
autoGrowMinHeight = 180,
autoGrowMaxHeight,
toolbarLocation = 'top',
formItems,
onChange
} = this.props;

Expand Down Expand Up @@ -123,14 +122,13 @@ class EditorCK extends React.Component<IEditorProps, { content: string }> {
dialog_backgroundCoverColor: '#30435C',
allowedContent: true,
toolbarLocation,
extraPlugins: `codemirror,strinsert,formInsert,onCtrlEnter${
extraPlugins: `codemirror,strinsert,onCtrlEnter${
autoGrow ? ',autogrow' : ''
}`,
autoGrow_minHeight: autoGrowMinHeight,
autoGrow_maxHeight: autoGrowMaxHeight,
autoGrow_onStartup: true,
strinsert: insertItems,
formInsert: formItems,
autoGrowOnStartup: true,
toolbar: toolbar || [
{
Expand Down Expand Up @@ -172,7 +170,7 @@ class EditorCK extends React.Component<IEditorProps, { content: string }> {
},
{
name: 'others',
items: [formItems && 'formInsert', insertItems && 'strinsert']
items: [insertItems && 'strinsert']
},
{ name: 'clear', items: ['RemoveFormat'] },
{ name: 'tools', items: ['Maximize'] }
Expand Down
43 changes: 1 addition & 42 deletions src/containers/EditorCK.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import gql from 'graphql-tag';
import * as compose from 'lodash.flowright';
import { combinedFields } from '../segments/graphql';
import { leadIntegrations } from '../leads/graphql';
import { LeadIntegrationsQueryResponse } from '../leads/types';
import {
FieldsCombinedByType,
Expand Down Expand Up @@ -45,34 +44,6 @@ const generateAttributes = (combinedFields?: FieldsCombinedByType[]) => {
};
};

const generateFormItems = forms => {
if (!forms) {
return;
}

const items: Array<{ name: string; value?: string }> = [];

forms.forEach(field => {
const { form, brand, name } = field;

if (!brand || !brand.code || !form || !form.code) {
return;
}

return items.push({ value: `${form.code},${brand.code}`, name });
});

if (items.length === 0) {
return;
}

return {
items,
title: 'Forms',
label: 'Forms'
};
};

type Props = {
showMentions?: boolean;
} & IEditorProps;
Expand All @@ -84,7 +55,7 @@ type FinalProps = {
} & Props;

const EditorContainer = (props: FinalProps) => {
const { usersQuery, combinedFieldsQuery, leadsQuery } = props;
const { usersQuery, combinedFieldsQuery } = props;

if (usersQuery.loading || combinedFieldsQuery.loading) {
return null;
Expand Down Expand Up @@ -113,7 +84,6 @@ const EditorContainer = (props: FinalProps) => {
{...props}
mentionUsers={mentionUsers}
insertItems={insertItems}
formItems={generateFormItems(leadsQuery.integrations || [])}
/>
);
};
Expand All @@ -134,17 +104,6 @@ export default withProps<Props>(
contentType: 'customer'
}
})
}),
graphql<Props, LeadIntegrationsQueryResponse>(gql(leadIntegrations), {
name: 'leadsQuery',
options: () => {
return {
variables: {
kind: 'lead',
formLoadType: 'embedded'
}
};
}
})
)(EditorContainer)
);

0 comments on commit 0d8db77

Please sign in to comment.