|
|
@ -59,7 +59,7 @@ function getBase64(file) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class EditReleaseModal extends React.Component {
|
|
|
|
class EditReleaseModal extends React.Component {
|
|
|
|
|
|
|
|
// To add subscription type & tenancy sharing, refer https://gitlab.com/entgra/carbon-device-mgt/merge_requests/331
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
@ -162,12 +162,6 @@ class EditReleaseModal extends React.Component {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
releaseDescription: {
|
|
|
|
releaseDescription: {
|
|
|
|
value: release.description
|
|
|
|
value: release.description
|
|
|
|
},
|
|
|
|
|
|
|
|
price: {
|
|
|
|
|
|
|
|
value: release.price
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isSharedWithAllTenants: {
|
|
|
|
|
|
|
|
value: release.isSharedWithAllTenants
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -252,7 +246,7 @@ class EditReleaseModal extends React.Component {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
loading: true
|
|
|
|
loading: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const {price, isSharedWithAllTenants, releaseDescription, releaseType} = values;
|
|
|
|
const {releaseDescription, releaseType} = values;
|
|
|
|
|
|
|
|
|
|
|
|
const {icons, screenshots, binaryFiles} = this.state;
|
|
|
|
const {icons, screenshots, binaryFiles} = this.state;
|
|
|
|
|
|
|
|
|
|
|
@ -261,8 +255,8 @@ class EditReleaseModal extends React.Component {
|
|
|
|
//add release data
|
|
|
|
//add release data
|
|
|
|
const release = {
|
|
|
|
const release = {
|
|
|
|
description: releaseDescription,
|
|
|
|
description: releaseDescription,
|
|
|
|
price: (price === undefined) ? 0 : parseInt(price),
|
|
|
|
price: 0,
|
|
|
|
isSharedWithAllTenants,
|
|
|
|
isSharedWithAllTenants: false,
|
|
|
|
metaData: JSON.stringify(this.state.metaData),
|
|
|
|
metaData: JSON.stringify(this.state.metaData),
|
|
|
|
releaseType: releaseType,
|
|
|
|
releaseType: releaseType,
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -282,10 +276,6 @@ class EditReleaseModal extends React.Component {
|
|
|
|
if (specificElements.hasOwnProperty("url")) {
|
|
|
|
if (specificElements.hasOwnProperty("url")) {
|
|
|
|
release.url = values.url;
|
|
|
|
release.url = values.url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (specificElements.hasOwnProperty("packageName")) {
|
|
|
|
|
|
|
|
// release.packageName = values.packageName;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (icons.length === 1) {
|
|
|
|
if (icons.length === 1) {
|
|
|
|
data.append('icon', icons[0].originFileObj);
|
|
|
|
data.append('icon', icons[0].originFileObj);
|
|
|
@ -589,30 +579,6 @@ class EditReleaseModal extends React.Component {
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<Form.Item {...formItemLayout} label="Price">
|
|
|
|
|
|
|
|
{getFieldDecorator('price', {
|
|
|
|
|
|
|
|
rules: [{
|
|
|
|
|
|
|
|
required: false
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
})(
|
|
|
|
|
|
|
|
<Input prefix="$" placeholder="00.00"/>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item {...formItemLayout} label="Is Shared?">
|
|
|
|
|
|
|
|
{getFieldDecorator('isSharedWithAllTenants', {
|
|
|
|
|
|
|
|
rules: [{
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
message: 'Please select'
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
initialValue: false
|
|
|
|
|
|
|
|
})(
|
|
|
|
|
|
|
|
<Switch checkedChildren={<Icon type="check"/>}
|
|
|
|
|
|
|
|
unCheckedChildren={<Icon type="close"/>}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
<Form.Item {...formItemLayout} label="Meta Data">
|
|
|
|
<Form.Item {...formItemLayout} label="Meta Data">
|
|
|
|
{getFieldDecorator('meta', {
|
|
|
|
{getFieldDecorator('meta', {
|
|
|
|
rules: [{
|
|
|
|
rules: [{
|
|
|
|