Skip to content

Commit

Permalink
reports pagination completed
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhu subhash committed Feb 24, 2020
1 parent ff5ea2c commit 03d03a5
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ const PushNotificationForm = Form.create<iProps>({ name: 'form_in_modal' })(
})(<TextArea rows={3} />)}
</Form.Item>
<Form.Item style={{ paddingLeft: '16px' }}>
<Upload {...this.props.uploadProps}>
{/* <Upload {...this.props.uploadProps}>
<Button>Attach image</Button>
</Upload>
</Upload> */}
</Form.Item>
{/* <Form.Item size={'large'} label="Deep linking path" {...formItemLayout}>
{getFieldDecorator('deepLinking', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class EditableCell extends React.Component<editableCellProps> {
children,
...restProps
} = this.props;
console.log(this.props);

return (
<td {...restProps}>
Expand Down
2 changes: 1 addition & 1 deletion src/walkin-components/src/components/UserInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class UserInfo extends Component<IProps, IState> {
? this.props.client
.query({
query: USER_DATA,
variables: { userId: id },
variables: { id, organizationId: org_id },
fetchPolicy: 'cache-first',
})
.then(res => {
Expand Down
6 changes: 3 additions & 3 deletions src/walkin-core/src/PlatformQueries/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import gql from 'graphql-tag';

export const USER_DATA = gql`
query userData($userId: ID!) {
user(id: $userId) {
query userData($id: ID!, $organizationId: String!) {
user(id: $id, organizationId: $organizationId) {
firstName
lastName
email
Expand Down Expand Up @@ -296,7 +296,7 @@ export const RULES = gql`
`;

export const UPDATE_RULE = gql`
mutation updateRule($id: ID, $input: UpdateRuleInput!) {
mutation updateRule($id: ID!, $input: UpdateRuleInput!) {
updateRule(id: $id, input: $input) {
id
name
Expand Down
6 changes: 3 additions & 3 deletions src/walkin-core/src/containers/SidebarContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class SidebarContent extends React.Component<
<Menu.Item key="business-rules">
<Link to={`/core/business-rules`}>
<i className="icon icon-inbox" />
<span>Business Rules</span>
<span>Rules</span>
</Link>
</Menu.Item>
<Menu.Item key="stores">
Expand All @@ -136,7 +136,7 @@ class SidebarContent extends React.Component<
// theme={sidebarTheme}
mode="inline"
>
<Menu.SubMenu
{/* <Menu.SubMenu
key="profile"
title={
<span>
Expand All @@ -154,7 +154,7 @@ class SidebarContent extends React.Component<
<span>Account & Privacy Settings</span>
</span>
}
></Menu.SubMenu>
></Menu.SubMenu> */}

<Menu.SubMenu
style={{ backgroundColor: '#F3F3F3' }}
Expand Down
30 changes: 14 additions & 16 deletions src/walkin-core/src/routes/BusinessRules/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,20 @@ class BusinessRules extends React.Component<
}

onChangeData = (row: any, index: number) => {
console.log(row, 'row');
let { tableData, rules } = this.state;
// console.log(tableData, rules[index]);

tableData[index] = row;
let input = { ...rules[index] };
delete input['id'];
delete input['status'];
delete input['__typename'];
if (!input.ruleConfiguration.rules) {
input.ruleConfiguration.rules = [{}];
input.ruleConfiguration.rules = [{ attributeValue: [null] }];
}
input.ruleConfiguration.rules[0].attributeValue = row.rule_value;
input.ruleConfiguration = JSON.stringify(input.ruleConfiguration);
input.ruleExpression = JSON.stringify(input.ruleExpression);
input.ruleConfiguration.rules[0].attributeValue[0] = row.rule_value;
// input.ruleConfiguration = JSON.stringify(input.ruleConfiguration);
// input.ruleExpression = JSON.stringify(input.ruleExpression);

// // // {
// // // name:rules.name,
Expand All @@ -108,8 +109,6 @@ class BusinessRules extends React.Component<
// // // ruleEXpression:,
// // // }

console.log(input);

this.props.client
.mutate({
mutation: UPDATE_RULE,
Expand All @@ -124,11 +123,10 @@ class BusinessRules extends React.Component<
render() {
const jwtToken: any = localStorage.getItem('jwt');
const { org_id }: any = jwt.decode(jwtToken);
console.log('org_id', org_id);
let { tableData, loading } = this.state;
return (
<div>
<div className="fontSize-header">Business Rules</div>
<div className="fontSize-header">Rules</div>
{loading ? (
<div className="justifyContent-center">
<Spin size="large" />
Expand All @@ -144,15 +142,15 @@ class BusinessRules extends React.Component<
onChangeData={this.onChangeData}
/>
</TabPane>
<TabPane tab="HyperX" key="2">
Content of Tab Pane 2
</TabPane>
<TabPane tab="NearX" key="3">
Content of Tab Pane 3
{/* <TabPane tab="HyperX" key="2">
Content of Tab Pane 2
</TabPane>
<TabPane tab="RefineX" key="4">
Content of Tab Pane 3
<TabPane tab="NearX" key="3">
Content of Tab Pane 3
</TabPane>
<TabPane tab="RefineX" key="4">
Content of Tab Pane 3
</TabPane> */}
</Tabs>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/walkin-nearx/src/routes/App/AppCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AppCreation extends React.Component<iProps, iState> {
? this.props.client
.query({
query: USER_DATA,
variables: { userId: id },
variables: { id, organizationId: org_id },
fetchPolicy: 'cache-first',
})
.then(res => {
Expand Down
2 changes: 1 addition & 1 deletion src/walkin-refinex/src/containers/App/AppCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class AppCreation extends React.Component<
? this.props.client
.query({
query: USER_DATA,
variables: { userId: id },
variables: { id, organizationId: org_id },
fetchPolicy: 'cache-first',
})
.then(res => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ const PushNotificationForm = Form.create<PushNotificationFormProps>({
})(<TextArea rows={3} />)}
</Form.Item>
<Form.Item style={{ paddingLeft: '16px' }}>
<Upload {...this.props.uploadProps}>
{/* <Upload {...this.props.uploadProps}>
<Button>Attach image</Button>
</Upload>
</Upload> */}
</Form.Item>
</Form>
);
Expand Down
Loading

0 comments on commit 03d03a5

Please sign in to comment.