tanishqgandhi1908 commented on code in PR #8078:
URL: https://github.com/apache/texera/pull/8078#discussion_r3891582732


##########
frontend/src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.ts:
##########
@@ -350,4 +429,131 @@ export class ModelDetailComponent implements OnInit {
     }
     return this.modelIsDownloadable && (this.modelIsPublic || 
this.userModelAccessLevel !== "NONE");
   }
+
+  userHasWriteAccess(): boolean {
+    return this.userModelAccessLevel === "WRITE";
+  }
+
+  onPreviouslyUploadedFileDeleted(node: DatasetFileNode): void {
+    if (!this.mid) {
+      return;
+    }
+    const relativePath = getRelativePathFromDatasetFileNode(node);
+    this.stagedFileService
+      .deleteFile(this.modelEndpoint, this.mid, relativePath)
+      .pipe(untilDestroyed(this))
+      .subscribe({
+        next: () => {
+          this.notificationService.success(
+            `File ${node.name} is successfully deleted. You may finalize it or 
revert it at the "Create Version" panel`
+          );
+          // Undefined only when the panel is not rendered, which is the same 
write-access
+          // condition that gates the tree's delete control.
+          this.versionUploader?.notePathStaged(relativePath);
+        },
+        error: () => this.notificationService.error("Failed to delete the 
file"),
+      });
+  }
+
+  /** Commits the staged files; the panel owns the rest of the version flow. */
+  createModelVersion = (versionName: string): Observable<unknown> =>
+    this.modelService.createModelVersion(this.mid!, versionName);
+
+  onVersionCreated(): void {
+    this.retrieveModelVersionList();
+  }
+
+  // 
===========================================================================
+  // Settings
+  // 
===========================================================================
+
+  onSaveModelName(): void {

Review Comment:
   Confirmed, good catch. The engine takes resourceName by value at upload 
start (:190) while the abort reads it at click time (:370), so a rename between 
the two desyncs them and orphans the session.
   
   Fixed in 22ac69fa6 with your suggestion: the panel emits 
uploadsInFlightChange and Settings disables the name field until it's idle, 
with onSaveModelName guarding the same invariant. Tests cover it.
   
   The dataset page has the same bug (pre-existing). Left out to keep this PR's 
"no dataset behavior change" claim; it's queued for the dataset cleanup PR.



-- 
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]

Reply via email to