diff --git a/backend/src/main/java/rpc/ConfigExecutorRpcService.java b/backend/src/main/java/rpc/ConfigExecutorRpcService.java index ff169b4..ad8ba1c 100644 --- a/backend/src/main/java/rpc/ConfigExecutorRpcService.java +++ b/backend/src/main/java/rpc/ConfigExecutorRpcService.java @@ -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 ids) { - configExecutorService.call(methodPath, ids); - } + @RpcCall + public String callConfigExecutor(String methodPath, List ids) { + return configExecutorService.call(methodPath, ids); + } } diff --git a/backend/src/main/java/service/ConfigExecutorService.java b/backend/src/main/java/service/ConfigExecutorService.java index a2fee0d..f5f51c7 100644 --- a/backend/src/main/java/service/ConfigExecutorService.java +++ b/backend/src/main/java/service/ConfigExecutorService.java @@ -57,7 +57,7 @@ public class ConfigExecutorService { return fileModel; } - public void call(String methodPath, List ids) { + public String call(String methodPath, List ids) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity> entity = new HttpEntity<>(ids, headers); @@ -65,12 +65,13 @@ public class ConfigExecutorService { ids ); try { - ResponseEntity response = restTemplate.exchange(url.concat(methodPath), - HttpMethod.POST, entity, Object.class + ResponseEntity 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( diff --git a/frontend/src/ts/ervu/ConfigExecuteBtn.ts b/frontend/src/ts/ervu/ConfigExecuteBtn.ts index c547602..9c0f0b6 100644 --- a/frontend/src/ts/ervu/ConfigExecuteBtn.ts +++ b/frontend/src/ts/ervu/ConfigExecuteBtn.ts @@ -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 { @@ -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)); } } diff --git a/frontend/src/ts/modules/webbpm/component/webbpm.component.ts b/frontend/src/ts/modules/webbpm/component/webbpm.component.ts index df6a67a..6e5efa3 100644 --- a/frontend/src/ts/modules/webbpm/component/webbpm.component.ts +++ b/frontend/src/ts/modules/webbpm/component/webbpm.component.ts @@ -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) {