[CST-5535] WIP

This commit is contained in:
Pratik Rajkotiya
2022-03-25 18:28:26 +05:30
parent 3ecb3c2209
commit 46a0ea10f4
6 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { HealthComponent } from './health/health.component';
@NgModule({
declarations: [
HealthComponent
]
})
export class HealthModule {
}

View File

@@ -0,0 +1,25 @@
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { HealthComponent } from './health/health.component';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
canActivate: [AuthenticatedGuard],
children: [
{
path: '',
component: HealthComponent,
},
]
},
])
]
})
export class HealthPageRoutingModule {
}

View File

@@ -0,0 +1 @@
<p>health works!</p>

View File

@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HealthComponent } from './health.component';
describe('HealthComponent', () => {
let component: HealthComponent;
let fixture: ComponentFixture<HealthComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HealthComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HealthComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { DspaceRestService } from '../../core/dspace-rest/dspace-rest.service';
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
@Component({
selector: 'ds-health',
templateUrl: './health.component.html',
styleUrls: ['./health.component.scss']
})
export class HealthComponent implements OnInit {
constructor(protected halService: HALEndpointService,
protected restService: DspaceRestService) {
}
ngOnInit(): void {
this.halService.getRootHref();
console.log('this.halService.getRootHref()',);
this.restService.get(this.halService.getRootHref() + '/actuator' + '/health').subscribe((data)=>{
console.log(data);
})
}
}