Browse Source

role with all project

pull/1/head
farhantock 11 months ago
parent
commit
7f30fdf882
  1. 30
      src/views/Master/MasterRoles/DialogForm.js
  2. 6
      src/views/Master/MasterRoles/index.js

30
src/views/Master/MasterRoles/DialogForm.js

@ -29,6 +29,7 @@ class DialogForm extends Component {
isParentClick: false, isParentClick: false,
menu: [], menu: [],
selectedMenu: null, selectedMenu: null,
all_project: false,
company_id company_id
} }
} }
@ -53,7 +54,8 @@ class DialogForm extends Component {
id: 0, id: 0,
name: "", name: "",
description: "", description: "",
selectedMenu: null selectedMenu: null,
company_id
}) })
} }
this.setState({ isParentClick: false }); this.setState({ isParentClick: false });
@ -99,7 +101,8 @@ class DialogForm extends Component {
name, name,
description, description,
selectedMenu, selectedMenu,
company_id company_id,
all_project
} = this.state } = this.state
let data = ''; let data = '';
@ -111,7 +114,8 @@ class DialogForm extends Component {
name, name,
description, description,
selectedMenu, selectedMenu,
company_id company_id,
all_project
} }
// console.log('data', data); // console.log('data', data);
this.props.closeDialog('save', data); this.props.closeDialog('save', data);
@ -121,7 +125,8 @@ class DialogForm extends Component {
name, name,
description, description,
selectedMenu, selectedMenu,
company_id company_id,
all_project
} }
this.props.closeDialog('edit', data); this.props.closeDialog('edit', data);
} }
@ -173,7 +178,22 @@ class DialogForm extends Component {
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</Form> <FormGroup check>
<Input
id="checkedAllProject"
name="checkedAllProject"
checked={this.state.all_project}
onChange={(e) => this.setState({ all_project: e.target.checked })}
type="checkbox"
/>
<Label
check
for="checkedAllProject"
>
See All Project
</Label>
</FormGroup>
</Form >
) )
} }

6
src/views/Master/MasterRoles/index.js

@ -198,7 +198,8 @@ class index extends Component {
name: data.name, name: data.name,
description: data.description, description: data.description,
default_page: data.selectedMenu, default_page: data.selectedMenu,
company_id: data.company_id company_id: data.company_id,
all_project: data.all_project
} }
const result = await axios.post(ROLE_ADD, formData, this.config) const result = await axios.post(ROLE_ADD, formData, this.config)
@ -219,7 +220,8 @@ class index extends Component {
name: data.name, name: data.name,
description: data.description, description: data.description,
default_page: data.selectedMenu, default_page: data.selectedMenu,
company_id: data.company_id company_id: data.company_id,
all_project: data.all_project
} }
const url = ROLE_EDIT(data.id) const url = ROLE_EDIT(data.id)
const result = await axios.put(url, formData, this.config) const result = await axios.put(url, formData, this.config)

Loading…
Cancel
Save