|
|
@ -63,10 +63,38 @@ class AddNewReleaseFormComponent extends React.Component {
|
|
|
|
screenshots: [],
|
|
|
|
screenshots: [],
|
|
|
|
loading: false,
|
|
|
|
loading: false,
|
|
|
|
binaryFiles: [],
|
|
|
|
binaryFiles: [],
|
|
|
|
isFree: true
|
|
|
|
isFree: true,
|
|
|
|
|
|
|
|
supportedOsVersions: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
this.lowerOsVersion = null;
|
|
|
|
|
|
|
|
this.upperOsVersion = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
this.getSupportedOsVersions(this.props.deviceType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getSupportedOsVersions = (deviceType) => {
|
|
|
|
|
|
|
|
const config = this.props.context;
|
|
|
|
|
|
|
|
axios.get(
|
|
|
|
|
|
|
|
window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.deviceMgt +
|
|
|
|
|
|
|
|
`/admin/device-types/${deviceType}/versions`
|
|
|
|
|
|
|
|
).then(res => {
|
|
|
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
|
|
|
let supportedOsVersions = JSON.parse(res.data.data);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
supportedOsVersions,
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
handleApiError(error, "Error occurred while trying to load supported OS versions.");
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
loading: false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
handleSubmit = e => {
|
|
|
|
handleSubmit = e => {
|
|
|
|
const config = this.props.context;
|
|
|
|
const config = this.props.context;
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
@ -89,9 +117,8 @@ class AddNewReleaseFormComponent extends React.Component {
|
|
|
|
isSharedWithAllTenants,
|
|
|
|
isSharedWithAllTenants,
|
|
|
|
metaData: "string",
|
|
|
|
metaData: "string",
|
|
|
|
releaseType: releaseType,
|
|
|
|
releaseType: releaseType,
|
|
|
|
supportedOsVersions: "4-30"
|
|
|
|
supportedOsVersions: `${this.lowerOsVersion}-${this.upperOsVersion}`
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
data.append('binaryFile', binaryFile[0].originFileObj);
|
|
|
|
data.append('binaryFile', binaryFile[0].originFileObj);
|
|
|
|
data.append('icon', icon[0].originFileObj);
|
|
|
|
data.append('icon', icon[0].originFileObj);
|
|
|
|
data.append('screenshot1', screenshots[0].originFileObj);
|
|
|
|
data.append('screenshot1', screenshots[0].originFileObj);
|
|
|
@ -105,7 +132,7 @@ class AddNewReleaseFormComponent extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
data.append("applicationRelease", blob);
|
|
|
|
data.append("applicationRelease", blob);
|
|
|
|
|
|
|
|
|
|
|
|
const url = window.location.origin+ config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/"+deviceType+"/ent-app/" + appId;
|
|
|
|
const url = window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + deviceType + "/ent-app/" + appId;
|
|
|
|
|
|
|
|
|
|
|
|
axios.post(
|
|
|
|
axios.post(
|
|
|
|
url,
|
|
|
|
url,
|
|
|
@ -124,7 +151,7 @@ class AddNewReleaseFormComponent extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
const uuid = res.data.data.uuid;
|
|
|
|
const uuid = res.data.data.uuid;
|
|
|
|
|
|
|
|
|
|
|
|
this.props.history.push('/publisher/apps/releases/'+uuid);
|
|
|
|
this.props.history.push('/publisher/apps/releases/' + uuid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
@ -155,8 +182,16 @@ class AddNewReleaseFormComponent extends React.Component {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleLowerOsVersionChange = (lowerOsVersion) => {
|
|
|
|
|
|
|
|
this.lowerOsVersion = lowerOsVersion;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleUpperOsVersionChange = (upperOsVersion) => {
|
|
|
|
|
|
|
|
this.upperOsVersion = upperOsVersion;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const {isFree, icons, screenshots, loading, binaryFiles} = this.state;
|
|
|
|
const {isFree, icons, screenshots, loading, binaryFiles, supportedOsVersions} = this.state;
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
@ -264,6 +299,45 @@ class AddNewReleaseFormComponent extends React.Component {
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item {...formItemLayout} label="Supported OS Versions">
|
|
|
|
|
|
|
|
{getFieldDecorator('supportedOS')(
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<InputGroup>
|
|
|
|
|
|
|
|
<Row gutter={8}>
|
|
|
|
|
|
|
|
<Col span={11}>
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
|
|
|
placeholder="Lower version"
|
|
|
|
|
|
|
|
style={{width: "100%"}}
|
|
|
|
|
|
|
|
onChange={this.handleLowerOsVersionChange}>
|
|
|
|
|
|
|
|
{supportedOsVersions.map(version => (
|
|
|
|
|
|
|
|
<Option key={version.versionName}
|
|
|
|
|
|
|
|
value={version.versionName}>
|
|
|
|
|
|
|
|
{version.versionName}
|
|
|
|
|
|
|
|
</Option>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col span={2}>
|
|
|
|
|
|
|
|
<p> - </p>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col span={11}>
|
|
|
|
|
|
|
|
<Select style={{width: "100%"}}
|
|
|
|
|
|
|
|
placeholder="Upper version"
|
|
|
|
|
|
|
|
onChange={this.handleUpperOsVersionChange}>
|
|
|
|
|
|
|
|
{supportedOsVersions.map(version => (
|
|
|
|
|
|
|
|
<Option key={version.versionName}
|
|
|
|
|
|
|
|
value={version.versionName}>
|
|
|
|
|
|
|
|
{version.versionName}
|
|
|
|
|
|
|
|
</Option>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
</InputGroup>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item {...formItemLayout} label="Price Type">
|
|
|
|
<Form.Item {...formItemLayout} label="Price Type">
|
|
|
|
{getFieldDecorator('select', {
|
|
|
|
{getFieldDecorator('select', {
|
|
|
|
rules: [{required: true, message: 'Please select price Type'}],
|
|
|
|
rules: [{required: true, message: 'Please select price Type'}],
|
|
|
|