diff --git a/client-portal/modules/card/components/List.tsx b/client-portal/modules/card/components/List.tsx index 83c029e6f92..22c1fd1a7e3 100644 --- a/client-portal/modules/card/components/List.tsx +++ b/client-portal/modules/card/components/List.tsx @@ -37,7 +37,7 @@ export default function List({ const [viewType, setViewType] = useState("list"); const [showForm, setShowForm] = useState(false); const [activeStageId, setStageId] = useState( - stageId ? stageId : stages[0]._id + stageId ? stageId : stages && stages.length !== 0 ? stages[0]._id : "" ); useEffect(() => { diff --git a/packages/plugin-clientportal-ui/src/components/Form.tsx b/packages/plugin-clientportal-ui/src/components/Form.tsx index f14129c05a6..bef8c19634d 100644 --- a/packages/plugin-clientportal-ui/src/components/Form.tsx +++ b/packages/plugin-clientportal-ui/src/components/Form.tsx @@ -1,14 +1,14 @@ -import Button from '@erxes/ui/src/components/Button'; -import { Alert } from '@erxes/ui/src/utils'; -import { isEnabled, removeTypename } from '@erxes/ui/src/utils/core'; -import React from 'react'; - -import { CONFIG_TYPES } from '../constants'; -import General from '../containers/General'; import { ButtonWrap, Content } from '../styles'; import { ClientPortalConfig, MailConfig } from '../types'; +import { isEnabled, removeTypename } from '@erxes/ui/src/utils/core'; + +import { Alert } from '@erxes/ui/src/utils'; import Appearance from './forms/Appearance'; +import Button from '@erxes/ui/src/components/Button'; +import { CONFIG_TYPES } from '../constants'; import Config from './forms/Config'; +import General from '../containers/General'; +import React from 'react'; type Props = { configType: string; @@ -66,7 +66,9 @@ class Form extends React.Component { return Alert.error('Please choose a Knowledge base topic'); } - delete (formValues.styles || ({} as any)).__typename; + if (formValues.styles) { + formValues.styles = removeTypename(formValues.styles || ({} as any)); + } if (formValues.mailConfig) { const mailConfig: MailConfig = diff --git a/packages/plugin-clientportal-ui/src/components/comments/CardDetailAction.tsx b/packages/plugin-clientportal-ui/src/components/comments/CardDetailAction.tsx index 38e0b34bec6..90e41eb3095 100644 --- a/packages/plugin-clientportal-ui/src/components/comments/CardDetailAction.tsx +++ b/packages/plugin-clientportal-ui/src/components/comments/CardDetailAction.tsx @@ -1,23 +1,24 @@ -import { colors } from '@erxes/ui/src/styles'; -import FormControl from '@erxes/ui/src/components/form/Control'; -import Button from '@erxes/ui/src/components/Button'; import { - TicketLabel, - TicketContent, - TicketComment, + CommentContent, CommentWrapper, CreatedUser, - CommentContent + TicketComment, + TicketContent, + TicketLabel } from './styles'; -import dayjs from 'dayjs'; +import { __, readFile } from '@erxes/ui/src/utils'; + +import Button from '@erxes/ui/src/components/Button'; +import EmptyState from '@erxes/ui/src/components/EmptyState'; +import FormControl from '@erxes/ui/src/components/form/Control'; import Icon from '@erxes/ui/src/components/Icon'; import ModalTrigger from '@erxes/ui/src/components/ModalTrigger'; import React from 'react'; +import { colors } from '@erxes/ui/src/styles'; +import dayjs from 'dayjs'; +import { rgba } from '@erxes/ui/src/styles/ecolor'; import styled from 'styled-components'; import styledTS from 'styled-components-ts'; -import { rgba } from '@erxes/ui/src/styles/ecolor'; -import { readFile, __ } from '@erxes/ui/src/utils'; -import EmptyState from '@erxes/ui/src/components/EmptyState'; type Props = { comments: any[]; @@ -164,7 +165,7 @@ export default class Container extends React.Component { }; const trigger = ( - console.log('clicking')}> + {__('Comments')} diff --git a/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserList.tsx b/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserList.tsx index 1ee7304556d..4a340f93ae8 100755 --- a/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserList.tsx +++ b/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserList.tsx @@ -222,17 +222,17 @@ class ClientportalUserList extends React.Component { }); const onClickConfirm = e => { - const type = e.currentTarget.id; + const kind = e.currentTarget.id; confirm( `This action forces the ${ bulk.length > 1 ? "users'" : "user's" - } ${type} to be verified. Do you want to continue?` + } ${kind} to be verified. Do you want to continue?` ) .then(() => { - this.verifyUsers(type, bulk); + this.verifyUsers(kind, bulk); }) - .catch(e => { - Alert.error(e.message); + .catch(error => { + Alert.error(error.message); }); }; diff --git a/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserRow.tsx b/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserRow.tsx index e081fa4f365..f2ec8d04f15 100755 --- a/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserRow.tsx +++ b/packages/plugin-clientportal-ui/src/components/list/ClientPortalUserRow.tsx @@ -1,12 +1,11 @@ import { FormControl } from '@erxes/ui/src/components/form'; +import { IClientPortalUser } from '../../types'; import Icon from '@erxes/ui/src/components/Icon'; import Label from '@erxes/ui/src/components/Label'; +import React from 'react'; import Tip from '@erxes/ui/src/components/Tip'; import colors from '@erxes/ui/src/styles/colors'; import { formatValue } from '@erxes/ui/src/utils'; -import React from 'react'; - -import { IClientPortalUser } from '../../types'; type Props = { index: number; @@ -125,12 +124,12 @@ class Row extends React.Component { {phone} {username} - {code} + {code || '-'} {firstName || companyName} {lastName} - + {companyName || '-'} {type} - {clientPortal.name} + {clientPortal ? clientPortal.name : '-'}