Skip to content

Commit

Permalink
fix(nav): spacing bug (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
ariunzayarin committed Jan 10, 2023
1 parent fa2fdbb commit 6a2fa2b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/core-ui/src/modules/layout/styles.ts
Expand Up @@ -337,7 +337,7 @@ const NavImage = styledTS<{ navCollapse?: number }>(styled.img)`
: props.navCollapse === 2
? dimensions.headerSpacing * 2 - 1
: dimensions.headerSpacing * 3 + dimensions.unitSpacing}px !important;
margin: 5px;
padding: 5px;
`;

const BottomMenu = styled.div`
Expand Down
Expand Up @@ -175,8 +175,8 @@ export const generateCommonFilters = async (

let filterIds: string[] = [];

if(parentId){
filter.parentId = parentId
if (parentId) {
filter.parentId = parentId;
}

if (assignedUserIds) {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-cards-api/src/models/definitions/boards.ts
Expand Up @@ -175,7 +175,7 @@ const relationSchema = new Schema(

export const commonItemFieldsSchema = {
_id: field({ pkey: true }),
parentId: field({ type: String,optional:true,label: 'Parent Id'}),
parentId: field({ type: String, optional: true, label: 'Parent Id' }),
userId: field({ type: String, optional: true, esType: 'keyword' }),
createdAt: field({ type: Date, label: 'Created at', esType: 'date' }),
order: field({ type: Number }),
Expand Down
@@ -1,4 +1,11 @@
import { ModalTrigger, Button, Box, EmptyState, Tip, Icon } from '@erxes/ui/src/components';
import {
ModalTrigger,
Button,
Box,
EmptyState,
Tip,
Icon
} from '@erxes/ui/src/components';
import React from 'react';
import { AddForm } from '@erxes/ui-cards/src/boards/containers/portable';
import EditForm from '@erxes/ui-cards/src/boards/containers/editForm/EditForm';
Expand Down Expand Up @@ -50,7 +57,13 @@ class ChildrenSection extends React.Component<Props, State> {
</Tip>
</Button>
);
return <ModalTrigger title="Add New Child Card" trigger={trigger} content={content} />;
return (
<ModalTrigger
title="Add New Child Card"
trigger={trigger}
content={content}
/>
);
}

renderParentForm() {
Expand Down Expand Up @@ -129,7 +142,9 @@ class ChildrenSection extends React.Component<Props, State> {
<Box title="Children" extraButtons={extraButtons()} isOpen={true}>
{children?.length ? (
(children as Array<IDeal | ITicket | ITask>).map(child => (
<SectionBodyItem key={child._id}>{this.renderChildForm(child)}</SectionBodyItem>
<SectionBodyItem key={child._id}>
{this.renderChildForm(child)}
</SectionBodyItem>
))
) : (
<EmptyState text="No Children" icon="list-ui-alt" />
Expand Down
Expand Up @@ -17,7 +17,7 @@ import ChildrenSectionComponent from '../../components/editForm/ChildrenSection'
type Props = {
type: string;
parentId?: string;
itemId:string;
itemId: string;
stageId: string;
queryParams: IQueryParams;
options: IOptions;
Expand All @@ -32,7 +32,14 @@ type FinalProps = {

class ChildrenSection extends React.Component<FinalProps> {
render() {
const { type, dealQueries, taskQueries, ticketQueries, parentId, options } = this.props;
const {
type,
dealQueries,
taskQueries,
ticketQueries,
parentId,
options
} = this.props;

let children: any[] = [];
let refetch;
Expand All @@ -53,7 +60,7 @@ class ChildrenSection extends React.Component<FinalProps> {
const updatedProps = {
...this.props,
children,
parentId:parentId||'',
parentId: parentId || '',
options,
refetch
};
Expand All @@ -72,7 +79,7 @@ const commonFilter = ({
options: IOptions;
}) => ({
variables: {
parentId:itemId,
parentId: itemId,
...getFilterParams(queryParams, options.getExtraParams),
hasStartAndCloseDate: false
}
Expand Down
9 changes: 3 additions & 6 deletions packages/ui-cards/src/deals/components/DealEditForm.tsx
Expand Up @@ -183,8 +183,7 @@ export default class DealEditForm extends React.Component<Props, State> {
);
};


renderChildrenSection = () =>{
renderChildrenSection = () => {
const { item, options } = this.props;

const updatedProps = {
Expand All @@ -197,10 +196,8 @@ export default class DealEditForm extends React.Component<Props, State> {
queryParams: queryString.parse(window.location.search) || {}
};

return <ChildrenSection {...updatedProps} />

}

return <ChildrenSection {...updatedProps} />;
};

renderItems = () => {
const { item } = this.props;
Expand Down

0 comments on commit 6a2fa2b

Please sign in to comment.