Merge branch 'feature/SUPPORT-8746_small_fix' into develop
This commit is contained in:
commit
f5edc7989c
4 changed files with 22 additions and 17 deletions
|
|
@ -1,12 +1,13 @@
|
|||
package rpc;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import service.ConfigExecutorService;
|
||||
|
||||
import ru.cg.webbpm.modules.webkit.annotations.RpcCall;
|
||||
import ru.cg.webbpm.modules.webkit.annotations.RpcService;
|
||||
import ru.cg.webbpm.modules.webkit.beans.Behavior;
|
||||
import service.ConfigExecutorService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Evgenii Malkov
|
||||
|
|
@ -14,14 +15,14 @@ import java.util.List;
|
|||
@RpcService
|
||||
public class ConfigExecutorRpcService extends Behavior {
|
||||
|
||||
private final ConfigExecutorService configExecutorService;
|
||||
private final ConfigExecutorService configExecutorService;
|
||||
|
||||
public ConfigExecutorRpcService(@Autowired ConfigExecutorService configExecutorService) {
|
||||
this.configExecutorService = configExecutorService;
|
||||
}
|
||||
public ConfigExecutorRpcService(@Autowired ConfigExecutorService configExecutorService) {
|
||||
this.configExecutorService = configExecutorService;
|
||||
}
|
||||
|
||||
@RpcCall
|
||||
public void callConfigExecutor(String methodPath, List<String> ids) {
|
||||
configExecutorService.call(methodPath, ids);
|
||||
}
|
||||
@RpcCall
|
||||
public String callConfigExecutor(String methodPath, List<String> ids) {
|
||||
return configExecutorService.call(methodPath, ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class ConfigExecutorService {
|
|||
return fileModel;
|
||||
}
|
||||
|
||||
public void call(String methodPath, List<String> ids) {
|
||||
public String call(String methodPath, List<String> ids) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
HttpEntity<List<String>> entity = new HttpEntity<>(ids, headers);
|
||||
|
|
@ -65,12 +65,13 @@ public class ConfigExecutorService {
|
|||
ids
|
||||
);
|
||||
try {
|
||||
ResponseEntity<Object> response = restTemplate.exchange(url.concat(methodPath),
|
||||
HttpMethod.POST, entity, Object.class
|
||||
ResponseEntity<String> response = restTemplate.exchange(url.concat(methodPath),
|
||||
HttpMethod.POST, entity, String.class
|
||||
);
|
||||
LOGGER.info("Method: {}, executed with status: {}, for ids:{}", methodPath,
|
||||
response.getStatusCode().value(), ids
|
||||
);
|
||||
return response.getBody();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef} from "@angular/core";
|
||||
import {AbstractButton, NotNull, ObjectRef, TextArea} from "@webbpm/base-package";
|
||||
import {AbstractButton, MessagesService, NotNull, ObjectRef, TextArea} from "@webbpm/base-package";
|
||||
import {ConfigExecutorRpcService} from "../generated/rpc/ConfigExecutorRpcService";
|
||||
|
||||
/**
|
||||
|
|
@ -19,6 +19,7 @@ export class ConfigExecuteBtn extends AbstractButton {
|
|||
@NotNull()
|
||||
public methodPath: string;
|
||||
private script: ConfigExecutorRpcService;
|
||||
private messagesService: MessagesService;
|
||||
|
||||
constructor(el: ElementRef, cd: ChangeDetectorRef) {
|
||||
super(el, cd);
|
||||
|
|
@ -26,7 +27,8 @@ export class ConfigExecuteBtn extends AbstractButton {
|
|||
|
||||
initialize() {
|
||||
super.initialize();
|
||||
this.script = this.getScript(ConfigExecutorRpcService)
|
||||
this.script = this.getScript(ConfigExecutorRpcService);
|
||||
this.messagesService = this.injector.get(MessagesService);
|
||||
}
|
||||
|
||||
doClickActions(): Promise<any> {
|
||||
|
|
@ -37,6 +39,7 @@ export class ConfigExecuteBtn extends AbstractButton {
|
|||
.map(id => id.trim().replace(/"/g, ''));
|
||||
|
||||
return this.script.callConfigExecutor(this.methodPath, ids, true)
|
||||
.then(successMsg => this.messagesService.success(successMsg))
|
||||
.catch(error => Promise.reject(error));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import {ProgressIndicationService} from "@webbpm/base-package";
|
|||
})
|
||||
export class WebbpmComponent {
|
||||
public headerVisible: boolean = true;
|
||||
public footerVisible: boolean = true;
|
||||
public footerVisible: boolean = false;
|
||||
|
||||
constructor(private router: Router,
|
||||
private progressIndicationService: ProgressIndicationService) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue