diff --git a/src/app/organization/offices/view-office/general-tab/general-tab.component.html b/src/app/organization/offices/view-office/general-tab/general-tab.component.html index 000756a88..2ab1a4ccd 100644 --- a/src/app/organization/offices/view-office/general-tab/general-tab.component.html +++ b/src/app/organization/offices/view-office/general-tab/general-tab.component.html @@ -2,7 +2,7 @@
- diff --git a/src/app/organization/organization-routing.module.ts b/src/app/organization/organization-routing.module.ts index 41a7fa5f5..49b79fade 100644 --- a/src/app/organization/organization-routing.module.ts +++ b/src/app/organization/organization-routing.module.ts @@ -206,16 +206,16 @@ const routes: Routes = [ } } ] - }, - { - path: 'edit', - component: EditOfficeComponent, - data: { title: extract('Edit Office'), breadcrumb: 'Edit', routeParamBreadcrumb: false }, - resolve: { - officeTemplate: EditOfficeResolver - } } ] + }, + { + path: ':officeId/edit', + component: EditOfficeComponent, + data: { title: extract('Edit Office'), breadcrumb: 'Edit', routeParamBreadcrumb: false }, + resolve: { + officeTemplate: EditOfficeResolver + } } ] }, diff --git a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.html b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.html new file mode 100644 index 000000000..d949b6ad3 --- /dev/null +++ b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.html @@ -0,0 +1,10 @@ +
+
+

COB Catch-Up is:{{ isCatchUpRunning ? 'Running' : 'Inactive' }} +

+
+ +
diff --git a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.scss b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.scss new file mode 100644 index 000000000..6035649d8 --- /dev/null +++ b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.scss @@ -0,0 +1,33 @@ +.success { + color: #32cd32; +} + +.fail { + color: #f44366; +} + +.currently-running { + color: #32cd32; +} + +.not-currently-running { + color: #f44366; +} + +.errorlog { + color: #ffa726; +} + +.suspend { + background: #32cd32; + color: #ffffff; +} + +.activate { + background: #f44366; + color: #ffffff; +} + +.space-top { + margin-top: 30px; +} diff --git a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts new file mode 100644 index 000000000..1a285d514 --- /dev/null +++ b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CobWorkflowComponent } from './cob-workflow.component'; + +describe('CobWorkflowComponent', () => { + let component: CobWorkflowComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CobWorkflowComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CobWorkflowComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts new file mode 100644 index 000000000..7580cbc9d --- /dev/null +++ b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts @@ -0,0 +1,41 @@ +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { SystemService } from 'app/system/system.service'; + +@Component({ + selector: 'mifosx-cob-workflow', + templateUrl: './cob-workflow.component.html', + styleUrls: ['./cob-workflow.component.scss'] +}) +export class CobWorkflowComponent implements OnInit, OnDestroy { + + waitTime: number = 30000; + + isCatchUpRunning = false; + /** Timer to refetch COB Catch-Up status every 5 seconds */ + timer: any; + + constructor(private systemService: SystemService) { } + + ngOnInit(): void { + setTimeout(() => { this.getCOBCatchUpStatus(); }, this.waitTime); + } + + ngOnDestroy() { + clearTimeout(this.timer); + } + + getCOBCatchUpStatus(): void { + this.systemService.getCOBCatchUpStatus().subscribe((response: any) => { + this.isCatchUpRunning = response.isCatchUpRunning; + }); + this.timer = setTimeout(() => { this.getCOBCatchUpStatus(); }, this.waitTime); + } + + runCatchUp(): void { + this.systemService.runCOBCatchUp().subscribe((response: any) => { + this.isCatchUpRunning = true; + this.waitTime = 5000; + }); + } + +} diff --git a/src/app/system/manage-jobs/manage-jobs.component.html b/src/app/system/manage-jobs/manage-jobs.component.html index a66989dbb..679cb6c02 100644 --- a/src/app/system/manage-jobs/manage-jobs.component.html +++ b/src/app/system/manage-jobs/manage-jobs.component.html @@ -7,6 +7,9 @@ + + + diff --git a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.html b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.html index c24b44794..7ac870ffa 100644 --- a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.html +++ b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.html @@ -1,6 +1,6 @@ -
+
-

Scheduler Status: {{ schedulerActive ? 'Active' : 'Inactive' }}

+

Scheduler Status:{{ schedulerActive ? 'Active' : 'Inactive' }}