Skip to content

Commit

Permalink
fix(integration): messenger form select (#4620)
Browse files Browse the repository at this point in the history
  • Loading branch information
ariunzayarin committed Sep 19, 2023
1 parent b8f66ea commit 0b75e92
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/erxes-ui/src/components/step/styles.ts
Expand Up @@ -168,7 +168,8 @@ const StepContent = styledTS<{ direction?: string; fullWidth?: boolean }>(
)`
width: ${props =>
props.direction === 'vertical' ? 'calc(100% - 35px)' : '100%'};
height: 100%;
height: ${props =>
props.direction === 'vertical' ? 'calc(100% - 35px)' : 'calc(100% - 55px)'};
margin-left: ${props => props.direction && 'auto'};
overflow: ${props => props.fullWidth && 'hidden'};
`;
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-inbox-ui/src/forms/components/List.tsx
Expand Up @@ -180,6 +180,7 @@ class List extends React.Component<Props, {}> {
<SortHandler sortField={'createdDate'} label={__('Created at')} />
</th>
{isEnabled('tags') && <th>{__('Tags')}</th>}
<th>{__('Flow type')}</th>
<th>{__('Actions')}</th>
</tr>
</thead>
Expand Down Expand Up @@ -212,7 +213,7 @@ class List extends React.Component<Props, {}> {
}
/>
}
hasBorder
hasBorder={true}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-inbox-ui/src/forms/components/Row.tsx
Expand Up @@ -241,6 +241,9 @@ class Row extends React.Component<Props> {
<Tags tags={tags} limit={2} />
</td>
)}
<td>
<Label>{integration.leadData.loadType}</Label>
</td>
<td>
<ActionButtons>
{this.manageAction(integration)}
Expand Down
Expand Up @@ -32,17 +32,29 @@ type Props = {
type FinalProps = {
knowledgeBaseTopicsQuery: TopicsQueryResponse;
leadIntegrationsQuery: IntegrationsQueryResponse;
leadIntegrationsTotalCountQuery: any;
} & IRouterProps &
Props;

class KnowledgeBaseContainer extends React.Component<FinalProps> {
render() {
const { knowledgeBaseTopicsQuery, leadIntegrationsQuery } = this.props;
const {
knowledgeBaseTopicsQuery,
leadIntegrationsQuery,
leadIntegrationsTotalCountQuery
} = this.props;

if (knowledgeBaseTopicsQuery.loading) {
return <Spinner objective={true} />;
}

if (leadIntegrationsTotalCountQuery?.integrationsTotalCount) {
leadIntegrationsQuery.refetch({
perPage:
leadIntegrationsTotalCountQuery?.integrationsTotalCount?.byKind?.lead
});
}

const topics = knowledgeBaseTopicsQuery.knowledgeBaseTopics || [];
const leads = leadIntegrationsQuery.integrations || [];

Expand All @@ -56,16 +68,20 @@ class KnowledgeBaseContainer extends React.Component<FinalProps> {
}
}

export default withProps<Props>(
export default withProps<FinalProps>(
compose(
graphql<Props, TopicsQueryResponse>(gql(kbQueries.knowledgeBaseTopics), {
name: 'knowledgeBaseTopicsQuery'
}),
graphql<{}>(gql(queries.integrationTotalCount), {
name: 'leadIntegrationsTotalCountQuery'
}),
graphql<Props, IntegrationsQueryResponse>(gql(queries.integrations), {
name: 'leadIntegrationsQuery',
options: () => ({
variables: {
kind: 'lead'
kind: 'lead',
perPage: 20
}
})
}),
Expand Down

0 comments on commit 0b75e92

Please sign in to comment.