|
|
@ -35,9 +35,47 @@ class AddPolicy extends React.Component {
|
|
|
|
currentStepIndex: 0,
|
|
|
|
currentStepIndex: 0,
|
|
|
|
isLoading: false,
|
|
|
|
isLoading: false,
|
|
|
|
policyUIConfigurationsList: [],
|
|
|
|
policyUIConfigurationsList: [],
|
|
|
|
|
|
|
|
newPolicyPayload: { compliance: 'enforce' },
|
|
|
|
|
|
|
|
policyProfile: {},
|
|
|
|
|
|
|
|
payloadData: {},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPolicyPayloadData = (dataName, dataValue) => {
|
|
|
|
|
|
|
|
Object.defineProperty(this.state.payloadData, dataName, {
|
|
|
|
|
|
|
|
value: dataValue,
|
|
|
|
|
|
|
|
writable: true,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (dataName === 'publishDevicesData') {
|
|
|
|
|
|
|
|
this.createPayload();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createPayload = () => {
|
|
|
|
|
|
|
|
const { newPolicyPayload } = this.state;
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
|
|
|
publishDevicesData,
|
|
|
|
|
|
|
|
selectedPlatformData,
|
|
|
|
|
|
|
|
policyProfile,
|
|
|
|
|
|
|
|
policyTypeData,
|
|
|
|
|
|
|
|
groupData,
|
|
|
|
|
|
|
|
} = this.state.payloadData;
|
|
|
|
|
|
|
|
let profile = {
|
|
|
|
|
|
|
|
policyName: publishDevicesData.policyName,
|
|
|
|
|
|
|
|
devicetype: selectedPlatformData.deviceType,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let payload = Object.assign(
|
|
|
|
|
|
|
|
newPolicyPayload,
|
|
|
|
|
|
|
|
publishDevicesData,
|
|
|
|
|
|
|
|
policyProfile,
|
|
|
|
|
|
|
|
policyTypeData,
|
|
|
|
|
|
|
|
groupData,
|
|
|
|
|
|
|
|
{ profile: profile },
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
console.log(payload);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
getPolicyConfigJson = type => {
|
|
|
|
getPolicyConfigJson = type => {
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
|
|
|
|
|
|
|
@ -107,6 +145,7 @@ class AddPolicy extends React.Component {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<SelectPlatform
|
|
|
|
<SelectPlatform
|
|
|
|
getPolicyConfigJson={this.getPolicyConfigJson}
|
|
|
|
getPolicyConfigJson={this.getPolicyConfigJson}
|
|
|
|
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
@ -114,6 +153,7 @@ class AddPolicy extends React.Component {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<ConfigureProfile
|
|
|
|
<ConfigureProfile
|
|
|
|
policyUIConfigurationsList={policyUIConfigurationsList}
|
|
|
|
policyUIConfigurationsList={policyUIConfigurationsList}
|
|
|
|
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -122,6 +162,7 @@ class AddPolicy extends React.Component {
|
|
|
|
style={{ display: currentStepIndex === 2 ? 'unset' : 'none' }}
|
|
|
|
style={{ display: currentStepIndex === 2 ? 'unset' : 'none' }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<SelectPolicyType
|
|
|
|
<SelectPolicyType
|
|
|
|
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -130,6 +171,7 @@ class AddPolicy extends React.Component {
|
|
|
|
style={{ display: currentStepIndex === 3 ? 'unset' : 'none' }}
|
|
|
|
style={{ display: currentStepIndex === 3 ? 'unset' : 'none' }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<AssignGroups
|
|
|
|
<AssignGroups
|
|
|
|
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -137,7 +179,10 @@ class AddPolicy extends React.Component {
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
style={{ display: currentStepIndex === 4 ? 'unset' : 'none' }}
|
|
|
|
style={{ display: currentStepIndex === 4 ? 'unset' : 'none' }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<PublishDevices getPrevStep={this.getPrevStep} />
|
|
|
|
<PublishDevices
|
|
|
|
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Card>
|
|
|
|
</Card>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|