#74 added an alert in case of no eligible jobs

This commit is contained in:
Fabio Formosa
2022-11-08 00:35:54 +01:00
parent 461c31e7ea
commit 9dfe06e346
3 changed files with 32 additions and 2 deletions

View File

@@ -6,6 +6,14 @@
<mat-card-content *ngIf="shouldShowTheTriggerCardContent()" style="position: relative; height: 100%">
<div fxLayout="column" style="overflow-y: auto; position: absolute; left: 0; right: 0; top: 0; bottom: 0;
overflow: auto;height: calc(100% - 3em); padding-top: 1em;">
<mat-card id="noEligibleJobsAlert" *ngIf="jobs?.length === 0" style="background-color: #ff6385">
<mat-card-content>
<i class="fas fa-exclamation-circle" style="color: #fff"></i>&nbsp;<strong>WARNING</strong>
Not found any eligible job classes for quartz-manager! <br/>
<p style="font-size: 0.8em">Please, make sure you have extended <i>AbstractQuartzManagerJob</i> and set the
app prop <i>quartz-manager.jobClassPackages</i> with the correct java package </p>
</mat-card-content>
</mat-card>
<form name="triggerConfigForm" fxFlex="1 1 100%"
[formGroup]="simpleTriggerReactiveForm" (ngSubmit)="onSubmitTriggerConfig()">
<div>

View File

@@ -220,6 +220,28 @@ describe('SimpleTriggerConfig', () => {
expect(submitButton.nativeElement.textContent.trim()).toEqual('Submit');
});
it('should display the warning if there are no eligible jobs', () => {
fixture.detectChanges();
const getJobsReq = httpTestingController.expectOne(`${CONTEXT_PATH}/jobs`);
getJobsReq.flush([]);
fixture.detectChanges();
const componentDe: DebugElement = fixture.debugElement;
const warningCard = componentDe.query(By.css('#noEligibleJobsAlert'));
expect(warningCard).toBeTruthy();
});
it('should not display the warning if there are eligible jobs', () => {
fixture.detectChanges();
const getJobsReq = httpTestingController.expectOne(`${CONTEXT_PATH}/jobs`);
getJobsReq.flush(['sampleJob']);
fixture.detectChanges();
const componentDe: DebugElement = fixture.debugElement;
const warningCard = componentDe.query(By.css('#noEligibleJobsAlert'));
expect(warningCard).toBeFalsy();
});
});

View File

@@ -23,10 +23,10 @@ describe('NotFoundComponent', () => {
expect(component).toBeTruthy();
});
it('<h1> tag should contains \'Page Not Found\'', () => {
it('should contains the text \'Not Found\'', () => {
fixture = TestBed.createComponent(NotFoundComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Page Not Found');
expect(compiled.querySelector('p').textContent).toContain('Not Found');
});
});