mengw15 commented on code in PR #8456:
URL: https://github.com/apache/texera/pull/8456#discussion_r3999995462


##########
frontend/src/app/workspace/component/menu/menu.component.html:
##########
@@ -75,6 +75,30 @@
         <span *ngIf="!displayParticularWorkflowVersion"> {{autoSaveState}} 
</span>
       </div>
 
+      <!-- One workflow, two ways of working on it: the Canvas and the Form 
View. The
+           same control sits in the same place on both, so switching never 
means hunting
+           for a different affordance; the pressed segment is the view you are 
looking at.
+           Every workflow offers both views, so this shows wherever the 
feature flag is on. -->
+      <div
+        class="view-switch"
+        *ngIf="this.config.env.formViewEnabled && 
!displayParticularWorkflowVersion">

Review Comment:
   The `Closes #8028` line is still in the description (twice), and #8028's 
title is "…entry points, remember the computing unit, **and turn it on**". 
Merging this would close it and tick the last box on #8011 while the feature is 
still off — and #8528 is a PR with no issue of its own, so nothing on the 
parent tracks the flip. Moving `Closes #8028` to #8528 (this one saying "Part 
of #8028") would keep the issue open until the rollout it names is actually 
done.
   



##########
frontend/src/app/workspace/component/menu/menu.component.ts:
##########
@@ -617,14 +628,94 @@ export class MenuComponent implements OnInit, OnDestroy {
   }
 
   public onClickExportWorkflow(): void {
-    const workflowContent: WorkflowContent = 
this.workflowActionService.getWorkflowContent();
-    const workflowContentJson = JSON.stringify(workflowContent, null, 2);
-    const fileName = this.currentWorkflowName + ".json";
-    // Through the injectable wrapper (as the dashboard downloads already do), 
so a spec stubs it
-    // with TestBed instead of module-mocking the CommonJS file-saver package, 
which the unit-test
-    // builder cannot hoist reliably.
-    this.fileSaverService.saveAs(new Blob([workflowContentJson], { type: 
"text/plain;charset=utf-8" }), fileName);
+    // The same shape the dashboard download produces (see exportedWorkflow): 
the content plus the
+    // landing view as a sibling key, so a file exported here uploads as a 
form-default workflow too.
+    // The content is what is on screen at the click; the landing view is read 
from the row now,
+    // not from this page's copy, since it is set from the dashboard and may 
have changed since load.
+    const content = this.workflowActionService.getWorkflowContent();
+    const { wid, defaultView } = 
this.workflowActionService.getWorkflowMetadata();
+    this.workflowPersistService
+      .currentDefaultView(wid, defaultView)

Review Comment:
   This turns Export, until now an instant local action, into one that waits on 
a full `retrieveWorkflow` — the whole content, to read one field — with no 
progress shown, and silently does nothing if the page is left before the answer 
arrives. The window it closes is narrow: the page's copy is refreshed by every 
save's response, so it is only out of date if the default was changed elsewhere 
since the last save here. It also was not part of the export point raised above.



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