|
|
@ -37,9 +37,45 @@ class AddPolicy extends React.Component {
|
|
|
|
policyUIConfigurationsList: [],
|
|
|
|
policyUIConfigurationsList: [],
|
|
|
|
newPolicyPayload: { compliance: 'enforce' },
|
|
|
|
newPolicyPayload: { compliance: 'enforce' },
|
|
|
|
policyProfile: {},
|
|
|
|
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 });
|
|
|
|
|
|
|
|
|
|
|
@ -109,8 +145,7 @@ class AddPolicy extends React.Component {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<SelectPlatform
|
|
|
|
<SelectPlatform
|
|
|
|
getPolicyConfigJson={this.getPolicyConfigJson}
|
|
|
|
getPolicyConfigJson={this.getPolicyConfigJson}
|
|
|
|
newPolicyPayload={this.state.newPolicyPayload}
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
policyProfile={this.state.policyProfile}
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
@ -118,7 +153,7 @@ class AddPolicy extends React.Component {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<ConfigureProfile
|
|
|
|
<ConfigureProfile
|
|
|
|
policyUIConfigurationsList={policyUIConfigurationsList}
|
|
|
|
policyUIConfigurationsList={policyUIConfigurationsList}
|
|
|
|
policyProfile={this.state.policyProfile}
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -127,7 +162,7 @@ class AddPolicy extends React.Component {
|
|
|
|
style={{ display: currentStepIndex === 2 ? 'unset' : 'none' }}
|
|
|
|
style={{ display: currentStepIndex === 2 ? 'unset' : 'none' }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<SelectPolicyType
|
|
|
|
<SelectPolicyType
|
|
|
|
newPolicyPayload={this.state.newPolicyPayload}
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -136,7 +171,7 @@ class AddPolicy extends React.Component {
|
|
|
|
style={{ display: currentStepIndex === 3 ? 'unset' : 'none' }}
|
|
|
|
style={{ display: currentStepIndex === 3 ? 'unset' : 'none' }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<AssignGroups
|
|
|
|
<AssignGroups
|
|
|
|
newPolicyPayload={this.state.newPolicyPayload}
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
getNextStep={this.getNextStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -145,8 +180,7 @@ class AddPolicy extends React.Component {
|
|
|
|
style={{ display: currentStepIndex === 4 ? 'unset' : 'none' }}
|
|
|
|
style={{ display: currentStepIndex === 4 ? 'unset' : 'none' }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<PublishDevices
|
|
|
|
<PublishDevices
|
|
|
|
newPolicyPayload={this.state.newPolicyPayload}
|
|
|
|
getPolicyPayloadData={this.getPolicyPayloadData}
|
|
|
|
policyProfile={this.state.policyProfile}
|
|
|
|
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
getPrevStep={this.getPrevStep}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|