Copilot commented on code in PR #6104:
URL: https://github.com/apache/texera/pull/6104#discussion_r3547831145
##########
frontend/src/app/common/component/computing-unit-create-modal/computing-unit-create-modal.component.ts:
##########
@@ -157,6 +161,24 @@ export class ComputingUnitCreateModalComponent implements
OnInit {
});
}
+ ngOnChanges(changes: SimpleChanges): void {
+ // Re-collapse the advanced panel every time the modal opens so it always
+ // starts on the simple path (name / RAM / CPU).
+ if (changes["visible"]?.currentValue === true) {
+ this.showAdvancedSettings = false;
+ }
+ }
+
+ toggleAdvancedSettings(): void {
+ this.showAdvancedSettings = !this.showAdvancedSettings;
+ }
+
+ // Surfaces the shared-memory warning on the collapsed header so an invalid
+ // value tucked inside the panel can't be submitted unseen.
+ hasCollapsedWarning(): boolean {
+ return !this.showAdvancedSettings && this.isShmTooLarge();
+ }
Review Comment:
`hasCollapsedWarning()` can show a false warning before resource options
load because `selectedMemory` starts as an empty string; `isShmTooLarge()` then
compares shm against 0 and returns true. This would make the Advanced Settings
header immediately display the warning on first render/open even though the
user hasn’t picked/loaded a memory limit yet. Guard on `selectedMemory` being
initialized before evaluating the shm check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]