Skip to content

Commit

Permalink
fix(clientportal): list bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Anu-Ujin Bat-Ulzii authored and Anu-Ujin Bat-Ulzii committed Jun 7, 2023
1 parent 0790d57 commit 086658d
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 44 deletions.
2 changes: 1 addition & 1 deletion client-portal/modules/card/components/List.tsx
Expand Up @@ -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(() => {
Expand Down
18 changes: 10 additions & 8 deletions 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;
Expand Down Expand Up @@ -66,7 +66,9 @@ class Form extends React.Component<Props, State> {
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 =
Expand Down
@@ -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[];
Expand Down Expand Up @@ -164,7 +165,7 @@ export default class Container extends React.Component<Props, State> {
};

const trigger = (
<TriggerButton onClick={() => console.log('clicking')}>
<TriggerButton>
<Icon icon="comment-1" />
{__('Comments')}
</TriggerButton>
Expand Down
Expand Up @@ -222,17 +222,17 @@ class ClientportalUserList extends React.Component<IProps, State> {
});

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);
});
};

Expand Down
@@ -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;
Expand Down Expand Up @@ -125,12 +124,12 @@ class Row extends React.Component<Props> {
{phone}
</td>
<td>{username}</td>
<td>{code}</td>
<td>{code || '-'}</td>
<td>{firstName || companyName}</td>
<td>{lastName}</td>

<td>{companyName || '-'}</td>
<td>{type}</td>
<td>{clientPortal.name}</td>
<td>{clientPortal ? clientPortal.name : '-'}</td>
<td>
<Label
key={clientPortalUser._id}
Expand Down
@@ -1,20 +1,21 @@
import Bulk from '@erxes/ui/src/components/Bulk';
import { IRouterProps } from '@erxes/ui/src/types';
import { Alert, withProps } from '@erxes/ui/src/utils';
import { generatePaginationParams } from '@erxes/ui/src/utils/router';
import { gql } from '@apollo/client';
import * as compose from 'lodash.flowright';
import React from 'react';
import { graphql } from '@apollo/client/react/hoc';

import ClientPortalUserList from '../components/list/ClientPortalUserList';
import { mutations, queries } from '../graphql';
import { Alert, withProps } from '@erxes/ui/src/utils';
import {
ClientPortalUserRemoveMutationResponse,
ClientPortalUsersQueryResponse,
ClientPortalUserTotalCountQueryResponse,
ClientPortalUsersQueryResponse,
ClientPortalVerifyUsersMutationResponse
} from '../types';
import { mutations, queries } from '../graphql';

import Bulk from '@erxes/ui/src/components/Bulk';
import ClientPortalUserList from '../components/list/ClientPortalUserList';
import { IRouterProps } from '@erxes/ui/src/types';
import React from 'react';
import { generatePaginationParams } from '@erxes/ui/src/utils/router';
import { gql } from '@apollo/client';
import { graphql } from '@apollo/client/react/hoc';

type Props = {
queryParams: any;
Expand Down Expand Up @@ -47,8 +48,6 @@ class ClientportalUserListContainer extends React.Component<FinalProps, State> {
const {
clientPortalUsersQuery,
clientPortalUsersRemove,
type,
history,
queryParams,
clientPortalUserTotalCountQuery
} = this.props;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-clientportal-ui/src/types.ts
Expand Up @@ -179,6 +179,7 @@ export type Styles = {
dividerColor?: string;
baseFont?: string;
headingFont?: string;
__typename?: string;
};

export type ClientPortalConfigsQueryResponse = {
Expand Down

0 comments on commit 086658d

Please sign in to comment.