Merge branch 'application-mgt-new' into 'master'

Add ent. app installation feature to APPM UI

See merge request entgra/carbon-device-mgt!362
feature/appm-store/pbac
Dharmakeerthi Lasantha 5 years ago
commit 5d08e98b8a

@ -31,10 +31,16 @@ class ListApps extends React.Component {
super(props); super(props);
this.state = { this.state = {
filters: {} filters: {}
} };
this.appName = '';
} }
setFilters = (filters) => { setFilters = (filters) => {
if (this.appName === '' && filters.hasOwnProperty("appName")) {
delete filters["appName"];
} else {
filters.appName = this.appName;
}
this.setState({ this.setState({
filters filters
}); });
@ -42,6 +48,7 @@ class ListApps extends React.Component {
setSearchText = (appName) => { setSearchText = (appName) => {
const filters = {...this.state.filters}; const filters = {...this.state.filters};
this.appName = appName;
if (appName === '' && filters.hasOwnProperty("appName")) { if (appName === '' && filters.hasOwnProperty("appName")) {
delete filters["appName"]; delete filters["appName"];
} else { } else {
@ -52,6 +59,17 @@ class ListApps extends React.Component {
}); });
}; };
onChangeSearchText = (e) => {
const filters = {...this.state.filters};
const appName = e.target.value;
if (appName === '' && filters.hasOwnProperty("appName")) {
delete filters["appName"];
this.setState({
filters
});
}
};
render() { render() {
const {isDrawerVisible, filters} = this.state; const {isDrawerVisible, filters} = this.state;
return ( return (
@ -67,9 +85,10 @@ class ListApps extends React.Component {
</Col> </Col>
<Col span={18} style={{textAlign: "right"}}> <Col span={18} style={{textAlign: "right"}}>
<Search <Search
placeholder="input search text" placeholder="Search by app name"
onSearch={this.setSearchText} onSearch={this.setSearchText}
style={{width: 170, zIndex:0}} onChange={this.onChangeSearchText}
style={{width: 240, zIndex: 0}}
/> />
</Col> </Col>
</Row> </Row>

@ -46,15 +46,27 @@ class ReleaseView extends React.Component {
const config = this.props.context; const config = this.props.context;
const release = this.props.app.applicationReleases[0]; const release = this.props.app.applicationReleases[0];
const {uuid} = release; const {uuid} = release;
const {isAndroidEnterpriseApp} = this.props.app;
this.setState({ this.setState({
loading: true, loading: true,
}); });
const parameters = {};
let url = window.location.origin + config.serverConfig.invoker.uri + let url = window.location.origin + config.serverConfig.invoker.uri +
config.serverConfig.invoker.store + "/subscription/" + uuid + "/" + type + "/" + operation; config.serverConfig.invoker.store + "/subscription/" + uuid + "/" + type + "/";
if (isAndroidEnterpriseApp) {
url += "ent-app-install/"; // add ent-app-install path param for android enterprise app
parameters.requiresUpdatingExternal = true;
}
url += operation; // add operation to url
if (timestamp != null) { if (timestamp != null) {
url += `?timestamp=${timestamp}`; parameters.timestamp = timestamp; // add timestamp for scheduled operations
} }
const queryParams = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&');
url += '?' + queryParams;
axios.post( axios.post(
url, url,
payload, payload,

@ -1767,6 +1767,11 @@
<version>${carbon.multitenancy.version}</version> <version>${carbon.multitenancy.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven.checkstyle.vesion}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -2247,6 +2252,8 @@
<node.version>v10.15.3</node.version> <node.version>v10.15.3</node.version>
<npm.version>6.9.0</npm.version> <npm.version>6.9.0</npm.version>
<maven.checkstyle.vesion>3.1.0</maven.checkstyle.vesion>
<!--websocket related lib versions--> <!--websocket related lib versions-->
<tomcat.websocket.version>7.0.85</tomcat.websocket.version> <tomcat.websocket.version>7.0.85</tomcat.websocket.version>
<javax.websocket.version>1.0</javax.websocket.version> <javax.websocket.version>1.0</javax.websocket.version>

Loading…
Cancel
Save