Skip to content

Commit

Permalink
UI Configuration: Invoke Reload Service on Archive Backend which Conf…
Browse files Browse the repository at this point in the history
…iguration was updated #3732
  • Loading branch information
shral committed Jul 26, 2022
1 parent c1700db commit 86473e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Expand Up @@ -134,7 +134,7 @@ export class DeviceConfiguratorComponent implements OnInit, OnDestroy {
}catch (e){
console.warn('error on chagning breadcrumbs', e);
}
$this.controlService.reloadArchive().subscribe((res) => {
$this.service.reloadArchive().subscribe((res) => {
console.log('res', res);
// $this.message = 'Reload successful';
$this.mainservice.showMsg( $localize `:@@reload_successful:Reload successful`);
Expand Down Expand Up @@ -182,7 +182,7 @@ export class DeviceConfiguratorComponent implements OnInit, OnDestroy {
});
}
}
$this.controlService.reloadArchive().subscribe((res) => {
$this.service.reloadArchive().subscribe((res) => {
console.log('res', res);
// $this.message = 'Reload successful';
$this.mainservice.showMsg($localize `:@@reload_successful:Reload successful`);
Expand Down
Expand Up @@ -19,6 +19,7 @@ import {DevicesService} from "../devices/devices.service";
import {WebAppsListService} from "../web-apps-list/web-apps-list.service";
import {LocalLanguageObject} from "../../interfaces";
import {map, switchMap} from "rxjs/operators";
import {ControlService} from "../control/control.service";

@Injectable()
export class DeviceConfiguratorService{
Expand All @@ -34,7 +35,8 @@ export class DeviceConfiguratorService{
private deviceService:DevicesService,
private aeListService:AeListService,
private hl7service:Hl7ApplicationsService,
private webAppListService:WebAppsListService
private webAppListService:WebAppsListService,
private controlService:ControlService
) {
this.breadcrumbs = [
{
Expand Down Expand Up @@ -1352,4 +1354,22 @@ export class DeviceConfiguratorService{
return path;
}
}

reloadArchive(){
let archiveUrl;
try{
const deviceName = _.get(this.device, 'dicomDeviceName');
if(_.hasIn(this.mainservice,'dcm4cheeArcConfig.deviceNameUrlMap')){
const mappedArchiveDevices = this.mainservice['dcm4cheeArcConfig']['deviceNameUrlMap'];
Object.keys(mappedArchiveDevices).forEach(url=>{
if(mappedArchiveDevices[url] === deviceName){
archiveUrl = url;
}
});
}
}catch (e){
console.error(e);
}
return this.controlService.reloadArchive(archiveUrl);
}
}

0 comments on commit 86473e1

Please sign in to comment.