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:
co-authored by
Claude Sonnet 4.6
parent
ed54db2e74
commit
f2f2338c78
@@ -34,15 +34,6 @@
|
|||||||
<mat-error *ngIf="basicForm.get('title')?.hasError('required')">Title is required</mat-error>
|
<mat-error *ngIf="basicForm.get('title')?.hasError('required')">Title is required</mat-error>
|
||||||
</mat-form-field>
|
</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-form-field appearance="outline" class="full-width">
|
||||||
<mat-label>Description</mat-label>
|
<mat-label>Description</mat-label>
|
||||||
<textarea
|
<textarea
|
||||||
@@ -121,7 +112,6 @@
|
|||||||
<form [formGroup]="postsForm" class="step-form">
|
<form [formGroup]="postsForm" class="step-form">
|
||||||
<div class="posts-header">
|
<div class="posts-header">
|
||||||
<h3>Define Election Posts</h3>
|
<h3>Define Election Posts</h3>
|
||||||
<button class="btn-add-post" type="button" (click)="addPost()"><mat-icon>add</mat-icon> Add Post</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div formArrayName="posts">
|
<div formArrayName="posts">
|
||||||
@@ -182,10 +172,6 @@
|
|||||||
<span class="review-label">Title</span>
|
<span class="review-label">Title</span>
|
||||||
<span class="review-value">{{ basicForm.value.title || '—' }}</span>
|
<span class="review-value">{{ basicForm.value.title || '—' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="review-item">
|
|
||||||
<span class="review-label">Type</span>
|
|
||||||
<span class="review-value">{{ basicForm.value.electionType }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="review-item">
|
<div class="review-item">
|
||||||
<span class="review-label">Nomination Period</span>
|
<span class="review-label">Nomination Period</span>
|
||||||
<span class="review-value">
|
<span class="review-value">
|
||||||
|
|||||||
@@ -63,20 +63,7 @@ export class ElectionConfigComponent implements OnInit {
|
|||||||
basicForm!: FormGroup;
|
basicForm!: FormGroup;
|
||||||
postsForm!: FormGroup;
|
postsForm!: FormGroup;
|
||||||
|
|
||||||
electionTypes = [
|
postNames = ['Director'];
|
||||||
'DIRECTOR',
|
|
||||||
'GENERAL',
|
|
||||||
'BY_ELECTION'
|
|
||||||
];
|
|
||||||
postNames = [
|
|
||||||
'Director',
|
|
||||||
'Chairman',
|
|
||||||
'Vice Chairman',
|
|
||||||
'Secretary',
|
|
||||||
'Treasurer',
|
|
||||||
'President',
|
|
||||||
'Managing Director'
|
|
||||||
];
|
|
||||||
|
|
||||||
today = new Date();
|
today = new Date();
|
||||||
|
|
||||||
@@ -95,10 +82,6 @@ export class ElectionConfigComponent implements OnInit {
|
|||||||
Validators.required
|
Validators.required
|
||||||
],
|
],
|
||||||
description: [''],
|
description: [''],
|
||||||
electionType: [
|
|
||||||
'DIRECTOR',
|
|
||||||
Validators.required
|
|
||||||
],
|
|
||||||
nominationStartDate: [
|
nominationStartDate: [
|
||||||
null,
|
null,
|
||||||
Validators.required
|
Validators.required
|
||||||
@@ -124,7 +107,7 @@ export class ElectionConfigComponent implements OnInit {
|
|||||||
createPostGroup(): FormGroup {
|
createPostGroup(): FormGroup {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
postName: [
|
postName: [
|
||||||
'',
|
'Director',
|
||||||
Validators.required
|
Validators.required
|
||||||
],
|
],
|
||||||
totalSeats: [
|
totalSeats: [
|
||||||
@@ -234,6 +217,7 @@ export class ElectionConfigComponent implements OnInit {
|
|||||||
const bv = this.basicForm.value;
|
const bv = this.basicForm.value;
|
||||||
const payload = {
|
const payload = {
|
||||||
...bv,
|
...bv,
|
||||||
|
electionType: 'DIRECTOR',
|
||||||
nominationStartDate: this.toDateString(bv.nominationStartDate),
|
nominationStartDate: this.toDateString(bv.nominationStartDate),
|
||||||
nominationEndDate: this.toDateString(bv.nominationEndDate),
|
nominationEndDate: this.toDateString(bv.nominationEndDate),
|
||||||
electionDate: this.toDateString(bv.electionDate),
|
electionDate: this.toDateString(bv.electionDate),
|
||||||
|
|||||||
@@ -1429,7 +1429,14 @@
|
|||||||
<mat-error>Please select a post</mat-error>
|
<mat-error>Please select a post</mat-error>
|
||||||
</mat-form-field>
|
</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">
|
<div class="post-criteria full-width">
|
||||||
<h4>Eligibility for this post</h4>
|
<h4>Eligibility for this post</h4>
|
||||||
<div class="criteria-grid">
|
<div class="criteria-grid">
|
||||||
|
|||||||
Reference in New Issue
Block a user