feat : added pool replace

This commit is contained in:
karthik 2025-08-07 13:36:51 +05:30
parent 5bfaec747d
commit 39910e2c21
2 changed files with 40 additions and 6 deletions

View File

@ -168,15 +168,13 @@
</div>
<div class="pool-replace-body">
<p>Select an option to replace the pool:</p>
<button class="btn btn-light">WIN</button>
<button class="btn btn-light">SHP</button>
<button class="btn btn-light">THP</button>
<button class="btn btn-light">PLC</button>
<button class="btn btn-light">SHW</button>
<ng-container *ngFor="let label of poolReplaceOptions">
<button class="btn btn-light" (click)="handlePoolReplace(label)">{{ label }}</button>
</ng-container>
</div>
<div class="pool-replace-footer">
<button class="btn btn-secondary" (click)="closePoolReplaceModal()">Cancel</button>
<button class="btn btn-primary">Confirm</button>
<button class="btn btn-primary" style="display:none;">Confirm</button>
</div>
</div>
</div>

View File

@ -78,6 +78,7 @@ export class TouchPadMenuComponent implements OnInit, OnDestroy {
// POOL REPLACE modal
poolReplaceOpen = false;
poolReplaceOptions: string[] = [];
// TRE popup
trePopupVisible = false;
@ -1307,9 +1308,44 @@ const winLabels = allRows.map(row => {
openPoolReplaceModal() {
if (this.totalAmountLimitReached) return;
// Determine allowed group based on current selection
const groupA = ['WIN', 'SHP', 'THP', 'PLC', 'SHW'];
const groupB = ['FOR', 'QUI', 'TAN'];
if (groupA.includes(this.selectedLabel || '')) {
this.poolReplaceOptions = groupA;
} else if (groupB.includes(this.selectedLabel || '')) {
this.poolReplaceOptions = groupB;
} else {
this.poolReplaceOptions = [];
}
this.poolReplaceOpen = true;
}
handlePoolReplace(label: string) {
this.selectedLabel = label;
this.selectedNumbers = [];
this.padValue = '';
this.canPrint = false;
this.isBoxed = false;
this.tanGroupStage = 0;
this.tanGroups = [[], [], []];
this.isFirstGroupComplete = false;
this.firstGroup = [];
this.secondGroup = [];
this.multiLegStage = 0;
this.multiLegGroups = [[], [], [], [], []];
this.multiLegBaseRaceIdx = 0;
this.currentLegRaceDisplay = '';
this.currentPool = null;
this.fieldModalOpen = false;
this.fieldInput = '';
this.fieldFEntered = false;
this.wspTicketStage = 0;
this.poolReplaceOpen = false;
// Update selection service with new label
this.selectionService.updatePartial({ label });
}
closePoolReplaceModal() {
this.poolReplaceOpen = false;
}