feat(election): remove election type field, simplify post to Director only, hide empty eligibility section

- Removed Election Type dropdown from config form (hardcoded DIRECTOR in payload)
- Post name options reduced to Director only, Add Post button removed
- Eligibility section in nomination-apply hidden when no criteria configured

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-07-01 16:50:52 +05:30
co-authored by Claude Sonnet 4.6
parent ed54db2e74
commit f2f2338c78
3 changed files with 11 additions and 34 deletions
@@ -34,15 +34,6 @@
<mat-error *ngIf="basicForm.get('title')?.hasError('required')">Title is required</mat-error>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Election Type *</mat-label>
<mat-select formControlName="electionType">
@for (type of electionTypes; track type) {
<mat-option [value]="type">{{ type }}</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" class="full-width">
<mat-label>Description</mat-label>
<textarea
@@ -121,7 +112,6 @@
<form [formGroup]="postsForm" class="step-form">
<div class="posts-header">
<h3>Define Election Posts</h3>
<button class="btn-add-post" type="button" (click)="addPost()"><mat-icon>add</mat-icon> Add Post</button>
</div>
<div formArrayName="posts">
@@ -182,10 +172,6 @@
<span class="review-label">Title</span>
<span class="review-value">{{ basicForm.value.title || '—' }}</span>
</div>
<div class="review-item">
<span class="review-label">Type</span>
<span class="review-value">{{ basicForm.value.electionType }}</span>
</div>
<div class="review-item">
<span class="review-label">Nomination Period</span>
<span class="review-value">
@@ -63,20 +63,7 @@ export class ElectionConfigComponent implements OnInit {
basicForm!: FormGroup;
postsForm!: FormGroup;
electionTypes = [
'DIRECTOR',
'GENERAL',
'BY_ELECTION'
];
postNames = [
'Director',
'Chairman',
'Vice Chairman',
'Secretary',
'Treasurer',
'President',
'Managing Director'
];
postNames = ['Director'];
today = new Date();
@@ -95,10 +82,6 @@ export class ElectionConfigComponent implements OnInit {
Validators.required
],
description: [''],
electionType: [
'DIRECTOR',
Validators.required
],
nominationStartDate: [
null,
Validators.required
@@ -124,7 +107,7 @@ export class ElectionConfigComponent implements OnInit {
createPostGroup(): FormGroup {
return this.fb.group({
postName: [
'',
'Director',
Validators.required
],
totalSeats: [
@@ -234,6 +217,7 @@ export class ElectionConfigComponent implements OnInit {
const bv = this.basicForm.value;
const payload = {
...bv,
electionType: 'DIRECTOR',
nominationStartDate: this.toDateString(bv.nominationStartDate),
nominationEndDate: this.toDateString(bv.nominationEndDate),
electionDate: this.toDateString(bv.electionDate),
@@ -1429,7 +1429,14 @@
<mat-error>Please select a post</mat-error>
</mat-form-field>
@if (selectedPost()) {
@if (
selectedPost() &&
(selectedPost().minAge ||
selectedPost().maxAge ||
selectedPost().casteCategory ||
(selectedPost().genderType && selectedPost().genderType !== 'ANY') ||
selectedPost().minShareHolding > 0)
) {
<div class="post-criteria full-width">
<h4>Eligibility for this post</h4>
<div class="criteria-grid">