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:
2026-02-15 03:56:17 +05:30
parent 9e34de73ee
commit 55b436c7d2
43 changed files with 2043 additions and 186 deletions
+50
View File
@@ -0,0 +1,50 @@
import { Injectable } from '@angular/core';
import { Store, StoreConfig } from '@datorama/akita';
import { IAbout } from '../about/about.model';
import { IContactModel } from '../contact/contact.model';
import { IProjects } from '../projects/projects.model';
import { IResume } from '../resume/resume.model';
export type AdminSection = 'about' | 'contact' | 'projects' | 'resume';
export interface AdminState {
candidateId: number;
about: IAbout | null;
contact: IContactModel | null;
projects: IProjects | null;
resume: IResume | null;
loading: Record<AdminSection, boolean>;
error: Record<AdminSection, string | null>;
}
export function createInitialState(): AdminState {
return {
candidateId: 1,
about: null,
contact: null,
projects: null,
resume: null,
loading: { about: false, contact: false, projects: false, resume: false },
error: { about: null, contact: null, projects: null, resume: null }
};
}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'admin', resettable: true })
export class AdminStore extends Store<AdminState> {
constructor() {
super(createInitialState());
}
setSectionLoading(section: AdminSection, loading: boolean) {
this.update(state => ({
loading: { ...state.loading, [section]: loading }
}));
}
setSectionError(section: AdminSection, error: string | null) {
this.update(state => ({
error: { ...state.error, [section]: error }
}));
}
}