-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Angular Components For Modules And Errors . ( Basic )
- Loading branch information
Showing
23 changed files
with
720 additions
and
27 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
50 changes: 50 additions & 0 deletions
50
...aWine.AspNetCore.Web/ClientApp/src/app/erikawinemodule/errormodule/adderror/adderror.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,50 @@ | ||
<nb-card > | ||
<nb-card-body> | ||
<h6>Define New Error To | {{GetModuleHttpDTO.moduleName}} | {{GetProjectHttpDTO.projectName}} | ||
<button nbButton status="danger" style="float: right;" size='tiny' (click)="cancel()">X</button> | ||
</h6> | ||
<hr> | ||
<div style="width: 600px !important;height:250px !important;"> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
Error Code | ||
<hr> | ||
<div class="input-group"> | ||
<input shape="semi-round" | ||
[(ngModel)]='AddErrorHttpDTO.ErrorCode' | ||
nbInput type="text" class="form-control" placeholder="Error Code" /> | ||
</div> | ||
<hr> | ||
Error Message | ||
<hr> | ||
<div class="input-group"> | ||
<textarea shape="semi-round" cols="1" rows="3" | ||
[(ngModel)]='AddErrorHttpDTO.ErroMessage' | ||
nbInput type="text" class="form-control" placeholder="Error Message" ></textarea> | ||
</div> | ||
<hr> | ||
</div> | ||
<div class="col-md-6"> | ||
Error Description | ||
<hr> | ||
<div class="input-group"> | ||
<textarea shape="semi-round" | ||
[(ngModel)]='AddErrorHttpDTO.ErrorDescription' | ||
nbInput type="text" class="form-control" cols="1" rows="8" placeholder="Error Description" ></textarea> | ||
</div> | ||
<hr> | ||
</div> | ||
<div class="col-md-12"> | ||
<div> | ||
<button nbButton size='small' (click)='Add()' status='success'> | ||
Add New Error | ||
</button> | ||
<button nbButton size='small' (click)="cancel()" style="margin-left: 10px;" status='danger'> | ||
Cancel | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</nb-card-body> | ||
</nb-card> |
46 changes: 46 additions & 0 deletions
46
ErikaWine.AspNetCore.Web/ClientApp/src/app/erikawinemodule/errormodule/adderror/adderror.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,46 @@ | ||
import { Component, Input ,OnInit } from '@angular/core'; | ||
import { NbDialogRef } from '@nebular/theme'; | ||
import { AddErrorHttpDTO } from '../../dto/erikawineerrordto'; | ||
import { GetProjectHttpDTO } from '../../dto/erikawineprojectdto'; | ||
import {GetModuleHttpDTO} from '../../dto/erikawinemodulesdto'; | ||
import { ErrorHttpService } from '../../services/httpservices/errorhttpservice'; | ||
@Component({ | ||
selector: 'add-error', | ||
templateUrl: './adderror.html', | ||
styles: [` | ||
nb-card { | ||
transform: translate3d(0, 0, 0); | ||
} | ||
`], | ||
}) | ||
export class AddErrorComponent implements OnInit { | ||
@Input() GetProjectHttpDTO:GetProjectHttpDTO; | ||
@Input() GetModuleHttpDTO:GetModuleHttpDTO; | ||
public AddErrorHttpDTO:AddErrorHttpDTO; | ||
constructor( | ||
protected ref: NbDialogRef<AddErrorComponent>, | ||
private svc:ErrorHttpService, | ||
) | ||
{ | ||
} | ||
ngOnInit() | ||
{ | ||
this.AddErrorHttpDTO = new AddErrorHttpDTO(this.GetModuleHttpDTO.modulesId); | ||
} | ||
cancel() { | ||
this.ref.close(); | ||
} | ||
submit(name) { | ||
this.ref.close(name); | ||
} | ||
Loader:boolean = false; | ||
Add() | ||
{ | ||
this.Loader = true; | ||
this.svc.Add(this.AddErrorHttpDTO).subscribe(data=>{ | ||
this.Loader = false; | ||
this.submit('Refresh'); | ||
}) | ||
} | ||
} | ||
|
50 changes: 50 additions & 0 deletions
50
...ine.AspNetCore.Web/ClientApp/src/app/erikawinemodule/errormodule/editerror/editerror.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,50 @@ | ||
<nb-card > | ||
<nb-card-body> | ||
<h6>Update Error | {{GetModuleHttpDTO.moduleName}} | {{GetProjectHttpDTO.projectName}} | ||
<button nbButton status="danger" style="float: right;" size='tiny' (click)="cancel()">X</button> | ||
</h6> | ||
<hr> | ||
<div style="width: 600px !important;height:250px !important;"> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
Error Code | ||
<hr> | ||
<div class="input-group"> | ||
<input shape="semi-round" | ||
[(ngModel)]='UpdateErrorHttpDTO.ErrorCode' | ||
nbInput type="text" class="form-control" placeholder="Error Code" /> | ||
</div> | ||
<hr> | ||
Error Message | ||
<hr> | ||
<div class="input-group"> | ||
<textarea shape="semi-round" cols="1" rows="3" | ||
[(ngModel)]='UpdateErrorHttpDTO.ErroMessage' | ||
nbInput type="text" class="form-control" placeholder="Error Message" ></textarea> | ||
</div> | ||
<hr> | ||
</div> | ||
<div class="col-md-6"> | ||
Error Description | ||
<hr> | ||
<div class="input-group"> | ||
<textarea shape="semi-round" | ||
[(ngModel)]='UpdateErrorHttpDTO.ErrorDescription' | ||
nbInput type="text" class="form-control" cols="1" rows="8" placeholder="Error Description" ></textarea> | ||
</div> | ||
<hr> | ||
</div> | ||
<div class="col-md-12"> | ||
<div> | ||
<button nbButton size='small' (click)='Add()' status='success'> | ||
Update Error | ||
</button> | ||
<button nbButton size='small' (click)="cancel()" style="margin-left: 10px;" status='danger'> | ||
Cancel | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</nb-card-body> | ||
</nb-card> |
47 changes: 47 additions & 0 deletions
47
...aWine.AspNetCore.Web/ClientApp/src/app/erikawinemodule/errormodule/editerror/editerror.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,47 @@ | ||
import { Component, Input ,OnInit } from '@angular/core'; | ||
import { NbDialogRef } from '@nebular/theme'; | ||
import { GetModuleHttpDTO} from '../../dto/erikawinemodulesdto'; | ||
import { GetProjectHttpDTO } from '../../dto/erikawineprojectdto'; | ||
import { ErrorHttpService } from '../../services/httpservices/errorhttpservice'; | ||
import { UpdateErrorHttpDTO ,GetErrorHttpDTO } from '../../dto/erikawineerrordto'; | ||
@Component({ | ||
selector: 'edit-error', | ||
templateUrl: './editerror.html', | ||
styles: [` | ||
nb-card { | ||
transform: translate3d(0, 0, 0); | ||
} | ||
`], | ||
}) | ||
export class EditErrorComponent implements OnInit { | ||
@Input() GetProjectHttpDTO:GetProjectHttpDTO; | ||
@Input() GetModuleHttpDTO:GetModuleHttpDTO; | ||
@Input() GetErrorHttpDTO:GetErrorHttpDTO; | ||
public UpdateErrorHttpDTO:UpdateErrorHttpDTO; | ||
constructor( | ||
protected ref: NbDialogRef<EditErrorComponent>, | ||
private svc:ErrorHttpService, | ||
) | ||
{ | ||
} | ||
ngOnInit() | ||
{ | ||
this.UpdateErrorHttpDTO = new UpdateErrorHttpDTO(this.GetErrorHttpDTO); | ||
} | ||
cancel() { | ||
this.ref.close(); | ||
} | ||
submit(name) { | ||
this.ref.close(name); | ||
} | ||
Loader:boolean = false; | ||
Edit() | ||
{ | ||
this.Loader = true; | ||
this.svc.Update(this.UpdateErrorHttpDTO).subscribe(data=>{ | ||
this.Loader = false; | ||
this.submit('Refresh'); | ||
}) | ||
} | ||
} | ||
|
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
53 changes: 53 additions & 0 deletions
53
...ine.AspNetCore.Web/ClientApp/src/app/erikawinemodule/errormodule/errorlist/errorlist.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,53 @@ | ||
|
||
<nb-card > | ||
<nb-card-body> | ||
<h6>Error List | {{GetModuleHttpDTO.moduleName}} | {{GetProjectHttpDTO.projectName}} | ||
<button nbButton status="danger" style="float: right;" size='tiny' (click)="cancel()">X</button> | ||
</h6> | ||
<hr> | ||
<div style="width: 1000px !important;height:450px !important;"> | ||
<button style="margin-bottom: 20px;" nbButton size='small' (click)='Add()' status='primary'> | ||
Add New Error | ||
</button> | ||
<div *ngIf='GetErrorHttpDTO.length === 0'> | ||
<span style="margin-right: 10px;padding-left: 10px;padding-right: 10px;" class="badge badge-warning"> ! </span> | ||
opps looks like there is no error defined found in this module | ||
</div> | ||
<div *ngIf='GetErrorHttpDTO.length !== 0'> | ||
<div class="row"> | ||
<div class='col-md-2'> | ||
Error Code | ||
</div> | ||
<div class='col-md-8'> | ||
Error Message | ||
</div> | ||
<div class='col-md-2'> | ||
</div> | ||
<div class='col-md-12'> | ||
<hr> | ||
</div> | ||
</div> | ||
<div class="row" *ngFor='let errors of GetErrorHttpDTO'> | ||
<div class='col-md-2'> | ||
{{errors.errorCode}} | ||
</div> | ||
<div class='col-md-8'> | ||
{{errors.erroMessage}} | ||
</div> | ||
<div class='col-md-2'> | ||
<button style="margin-left: 10px;" (click)='Edit(errors)' nbButton size='tiny' status='info'> | ||
Edit | ||
</button> | ||
<button style="margin-left: 10px;" nbButton size='tiny' (click)='Delete(errors)' status='danger'> | ||
Delete | ||
</button> | ||
</div> | ||
<div class='col-md-12'> | ||
<hr> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<br> | ||
</nb-card-body> | ||
</nb-card> |
91 changes: 91 additions & 0 deletions
91
...aWine.AspNetCore.Web/ClientApp/src/app/erikawinemodule/errormodule/errorlist/errorlist.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,91 @@ | ||
import { Component, OnInit ,Input } from '@angular/core'; | ||
import {ErrorHttpService} from '../../services/httpservices/errorhttpservice'; | ||
import { NbDialogService , NbDialogRef } from '@nebular/theme'; | ||
import {GetModuleHttpDTO}from '../../dto/erikawinemodulesdto'; | ||
import {GetErrorHttpDTO, DeleteErrorHttpDTO} from '../../dto/erikawineerrordto'; | ||
import {GetProjectHttpDTO} from '../../dto/erikawineprojectdto'; | ||
import { AddErrorComponent }from '../adderror/adderror'; | ||
import {EditErrorComponent} from '../editerror/editerror'; | ||
@Component({ | ||
selector: 'error-list', | ||
templateUrl: './errorlist.html', | ||
}) | ||
export class ErrorListComponent implements OnInit { | ||
@Input() GetProjectHttpDTO:GetProjectHttpDTO; | ||
@Input() GetModuleHttpDTO:GetModuleHttpDTO; | ||
DeleteErrorHttpDTO:DeleteErrorHttpDTO; | ||
constructor( | ||
private svc:ErrorHttpService, | ||
private NbDialogService:NbDialogService, | ||
protected ref: NbDialogRef<AddErrorComponent>, | ||
) | ||
{ | ||
} | ||
ngOnInit(){ | ||
this.Get(); | ||
|
||
} | ||
cancel() { | ||
this.ref.close(); | ||
} | ||
GetErrorHttpDTO:GetErrorHttpDTO[]=[]; | ||
Get() | ||
{ | ||
this.svc.Get('/api/error/klg4kK8O2JfyXLWDlcEpC9UtqJjq87naHEWXKxtR6gOd9?moduleid='+this.GetModuleHttpDTO.modulesId).subscribe(data=>{ | ||
this.GetErrorHttpDTO = data; | ||
}) | ||
} | ||
Add() | ||
{ | ||
this.NbDialogService.open(AddErrorComponent, { | ||
context: { | ||
GetProjectHttpDTO:this.GetProjectHttpDTO, | ||
GetModuleHttpDTO:this.GetModuleHttpDTO, | ||
}, | ||
closeOnBackdropClick: false, | ||
}).onClose.subscribe(action => { | ||
if (action === "Refresh") { | ||
this.Get(); | ||
} | ||
}); | ||
} | ||
Details(dto:GetErrorHttpDTO) | ||
{ | ||
// this.NbDialogService.open(ProjectDetailsComponent, { | ||
// context: { | ||
// GetProjectHttpDTO:dto, | ||
// }, | ||
// closeOnBackdropClick: false, | ||
// }).onClose.subscribe(action => { | ||
// if (action === "Refresh") { | ||
// this.Get(); | ||
// } | ||
// }); | ||
|
||
} | ||
Edit(dto:GetErrorHttpDTO) | ||
{ | ||
this.NbDialogService.open(EditErrorComponent, { | ||
context: { | ||
GetProjectHttpDTO:this.GetProjectHttpDTO, | ||
GetModuleHttpDTO:this.GetModuleHttpDTO, | ||
GetErrorHttpDTO:dto | ||
|
||
}, | ||
closeOnBackdropClick: false, | ||
}).onClose.subscribe(action => { | ||
if (action === "Refresh") { | ||
this.Get(); | ||
} | ||
}); | ||
} | ||
Delete(dto:GetErrorHttpDTO) | ||
{ | ||
this.DeleteErrorHttpDTO = new DeleteErrorHttpDTO(dto.errorId); | ||
this.svc.Delete(this.DeleteErrorHttpDTO).subscribe( | ||
data=>{ | ||
this.Get(); | ||
} | ||
) | ||
} | ||
} |
Oops, something went wrong.