feat: implement dynamic form and popup components
- Added DynamicField interface to define form field structure. - Created DynamicFormConfig interface for form configuration. - Developed DynamicFormComponent to handle dynamic form rendering and validation. - Implemented DynamicPopupComponent for displaying forms in a modal dialog. - Added HTML and SCSS for dynamic form and popup styling. - Integrated Material Design components for form inputs and buttons. - Implemented form submission logic with API integration. - Added tests for DynamicForm and DynamicPopup components. - Updated global styles for Material components in themed popups. - Included Material Icons in index.html for better UI representation.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Query } from '@datorama/akita';
|
||||
import { AdminStore, AdminState } from './admin.store';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class AdminQuery extends Query<AdminState> {
|
||||
protected override store = inject(AdminStore);
|
||||
|
||||
constructor() {
|
||||
super(inject(AdminStore));
|
||||
}
|
||||
// Candidate
|
||||
candidateId$ = this.select('candidateId');
|
||||
|
||||
// About
|
||||
about$ = this.select('about');
|
||||
aboutLoading$ = this.select(s => s.loading.about);
|
||||
aboutError$ = this.select(s => s.error.about);
|
||||
|
||||
// Contact
|
||||
contact$ = this.select('contact');
|
||||
contactLoading$ = this.select(s => s.loading.contact);
|
||||
contactError$ = this.select(s => s.error.contact);
|
||||
|
||||
// Projects
|
||||
projects$ = this.select('projects');
|
||||
projectsLoading$ = this.select(s => s.loading.projects);
|
||||
projectsError$ = this.select(s => s.error.projects);
|
||||
|
||||
// Resume
|
||||
resume$ = this.select('resume');
|
||||
resumeLoading$ = this.select(s => s.loading.resume);
|
||||
resumeError$ = this.select(s => s.error.resume);
|
||||
|
||||
getAbout() {
|
||||
return this.getValue().about;
|
||||
}
|
||||
|
||||
getContact() {
|
||||
return this.getValue().contact;
|
||||
}
|
||||
|
||||
getProjects() {
|
||||
return this.getValue().projects;
|
||||
}
|
||||
|
||||
getResume() {
|
||||
return this.getValue().resume;
|
||||
}
|
||||
|
||||
getCandidateId() {
|
||||
return this.getValue().candidateId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user