-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: uuid changes * changes * linting * test cases * fixes tests tests tests test fix * fixes * changes * changes * changes * changes to backend * changes to backend * ui * changes * changes * merge changes * changes * changes * changes * changes * changes * changes * changes * changes * tests * create sequence backend * fixing css * cahnegs * comment fixes * change * tests * fixes * changes * changes * comment changes * comment changes * test * test
- Loading branch information
1 parent
4af4747
commit 8c5e085
Showing
38 changed files
with
963 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
ui/dist/ui/runtime.7cb62255c16cf7ce.js → ui/dist/ui/runtime.30e542cf552662e5.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
ui/src/app/components/add-new-sequence/add-new-sequence.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<div mat-dialog-content> | ||
<form [formGroup]="addNewSequenceForm" class="add-new-sequence-form"> | ||
<h2>Sequence Details</h2> | ||
<mat-form-field class="full-width" appearance="outline"> | ||
<mat-label>Name</mat-label> | ||
<input matInput placeholder="Sequence Name" type="text" formControlName="name" /> | ||
</mat-form-field> | ||
<br> | ||
<mat-form-field appearance="outline"> | ||
<mat-label>Sequence Type</mat-label> | ||
<mat-select [(ngModel)]="selectedSequenceKind" class="input-field" formControlName="sequenceKind" required="true"> | ||
<mat-option *ngFor="let sk of sequenceKinds" [value]="sk">{{sk}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<br> | ||
<mat-form-field class="full-width" appearance="outline"> | ||
<mat-label>Skip Range Minimum</mat-label> | ||
<input matInput placeholder="Skip Range Min" type="text" formControlName="skipRangeMin" /> | ||
</mat-form-field> | ||
<br> | ||
<mat-form-field class="full-width" appearance="outline"> | ||
<mat-label>Skip Range Maximum</mat-label> | ||
<input matInput placeholder="Skip Range Max" type="text" formControlName="skipRangeMax" /> | ||
</mat-form-field> | ||
<br> | ||
<mat-form-field class="full-width" appearance="outline"> | ||
<mat-label>Start With Counter</mat-label> | ||
<input matInput placeholder="Start With Counter" type="text" formControlName="startWithCounter" /> | ||
</mat-form-field> | ||
<br> | ||
</form> | ||
<div mat-dialog-actions class="buttons-container"> | ||
<button mat-button color="primary" mat-dialog-close>CANCEL</button> | ||
<button mat-button type="submit" color="primary" [disabled]="!(addNewSequenceForm.valid)" | ||
(click)="addNewSequence()"> | ||
ADD | ||
</button> | ||
</div> | ||
</div> |
Empty file.
55 changes: 55 additions & 0 deletions
55
ui/src/app/components/add-new-sequence/add-new-sequence.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; | ||
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { MatInputModule } from '@angular/material/input'; | ||
import { MatSelectModule } from '@angular/material/select'; | ||
import { MatSnackBarModule } from '@angular/material/snack-bar'; | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
|
||
import { AddNewSequenceComponent } from './add-new-sequence.component'; | ||
import { DataService } from 'src/app/services/data/data.service'; | ||
|
||
describe('AddNewSequenceComponent', () => { | ||
let component: AddNewSequenceComponent; | ||
let fixture: ComponentFixture<AddNewSequenceComponent>; | ||
let dataServiceSpy: jasmine.SpyObj<DataService>; | ||
|
||
beforeEach(async () => { | ||
dataServiceSpy = jasmine.createSpyObj('DataService', ['addSequence']); | ||
await TestBed.configureTestingModule({ | ||
declarations: [AddNewSequenceComponent], | ||
imports: [ReactiveFormsModule, HttpClientModule, MatSnackBarModule, MatDialogModule, MatSelectModule, MatInputModule, BrowserAnimationsModule], | ||
providers: [ | ||
{ | ||
provide: MatDialogRef, | ||
useValue: { | ||
close: () => { }, | ||
}, | ||
}, | ||
{ | ||
provide: DataService, | ||
useValue: dataServiceSpy | ||
} | ||
], | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AddNewSequenceComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
it('add new sequence', () => { | ||
let formBuilder = new FormBuilder() | ||
component.addNewSequenceForm = formBuilder.group({}) | ||
component.addNewSequence() | ||
expect(dataServiceSpy.addSequence).toHaveBeenCalled() | ||
}); | ||
}); |
51 changes: 51 additions & 0 deletions
51
ui/src/app/components/add-new-sequence/add-new-sequence.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Component, OnInit} from '@angular/core'; | ||
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | ||
import { MatDialogRef} from '@angular/material/dialog'; | ||
import ICreateSequence from 'src/app/model/auto-gen'; | ||
import { DataService } from 'src/app/services/data/data.service'; | ||
import { FetchService } from 'src/app/services/fetch/fetch.service' | ||
import { linkedFieldsValidatorSequence } from 'src/app/utils/utils'; | ||
@Component({ | ||
selector: 'app-add-new-sequence', | ||
templateUrl: './add-new-sequence.component.html', | ||
styleUrls: ['./add-new-sequence.component.scss'] | ||
}) | ||
|
||
export class AddNewSequenceComponent implements OnInit { | ||
addNewSequenceForm: FormGroup | ||
selectedSequenceKind: string = "" | ||
sequenceKinds : string[] = [] | ||
constructor( | ||
private formBuilder: FormBuilder, | ||
private dataService: DataService, | ||
private fetchSerice: FetchService, | ||
private dialogRef: MatDialogRef<AddNewSequenceComponent>) { | ||
this.addNewSequenceForm = this.formBuilder.group({ | ||
name: ['', [Validators.required, Validators.minLength(1), Validators.maxLength(128), Validators.pattern('^[a-zA-Z][a-zA-Z0-9_]*$')]], | ||
sequenceKind: ['', Validators.required], | ||
skipRangeMin: ['', Validators.pattern('^[0-9]+$')], | ||
skipRangeMax: ['', Validators.pattern('^[0-9]+$')], | ||
startWithCounter: ['', Validators.pattern('^[0-9]+$')], | ||
}, { validator: linkedFieldsValidatorSequence('skipRangeMin', 'skipRangeMax') }) | ||
this.fetchSerice.getSequenceKind().subscribe( | ||
(sequenceKinds: any) => { | ||
this.sequenceKinds = sequenceKinds; | ||
} | ||
); | ||
} | ||
|
||
ngOnInit(): void {} | ||
|
||
addNewSequence() { | ||
let formValue = this.addNewSequenceForm.value | ||
let payload: ICreateSequence = { | ||
Name: formValue.name, | ||
SequenceKind: this.selectedSequenceKind, | ||
SkipRangeMin: formValue.skipRangeMin, | ||
SkipRangeMax: formValue.skipRangeMax, | ||
StartWithCounter: formValue.startWithCounter | ||
} | ||
this.dataService.addSequence(payload) | ||
this.dialogRef.close() | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.