perbaikan interceptor

This commit is contained in:
2024-06-26 14:26:15 +07:00
parent 4630bd2265
commit b5c35ab541
17 changed files with 326 additions and 28 deletions

View File

@@ -0,0 +1,78 @@
<div class="card" style="background-color: #252525 !important">
<div class="card-content">
<div
class="card-header"
style="background-color: #252525 !important"
>
<h2 style="color: #ffffff">
</h2>
</div>
<div class="card-body">
<form
[formGroup]="profilInfo"
(ngSubmit)="onProjectInfoSubmit()"
>
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="name" style="color: #ffffff"
>Full Name</label
>
<input
type="text"
id="name"
class="form-control"
formControlName="name"
placeholder="Device Name"
[ngClass]="{
'is-invalid': submitted && f.name.errors
}"
/>
<small
class="form-text text-muted danger"
*ngIf="submitted && f.name.errors"
class="invalid-feedback"
>
<div *ngIf="f.name.errors.required">
Full Name is required
</div>
</small>
</div>
</div>
<div class="col-md-6">
</div>
</div>
</div>
<div class="form-actions">
<button
type="button"
class="btn btn-warning mr-1"
style="
color: #c3f164 !important;
background-color: #000000 !important;
border-color: #c3f164 !important;
"
(click)="cancel()"
>
<i class="feather ft-x"></i>
Edit
</button>
<button
type="submit"
class="btn btn-primary"
style="
color: #000000 !important;
background-color: #c3f164 !important;
"
(click)="saveEdit()"
>
<i class="la la-check"></i> Save
</button>
</div>
</form>
</div>
</div>
</div>

View File

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

View File

@@ -0,0 +1,46 @@
import { Component, ViewChild } from "@angular/core";
import { FormBuilder, FormGroup, NgForm, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
@Component({
selector: "app-profil-information",
templateUrl: "./profil-information.component.html",
styleUrls: ["./profil-information.component.css"],
})
export class ProfilInformationComponent {
@ViewChild("f", { read: true }) userProfileForm: NgForm;
public breadcrumb: any;
profilInfo: FormGroup;
activeTab: string = "profile-info2";
submitted = false;
constructor(
private formBuilder: FormBuilder,
private router: Router,
private route: ActivatedRoute
) {}
ngOnInit(): void {
this.profilInfo = this.formBuilder.group({
name: ["", Validators.required],
});
}
selectTab(tabName: string) {
this.activeTab = tabName;
}
get f() {
return this.profilInfo.controls;
}
onProjectInfoSubmit() {
this.submitted = true;
}
cancel() {}
saveEdit() {
console.log('save');
}
}