Skip to content

Commit

Permalink
ran yarn format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vthai321 committed May 28, 2024
1 parent b137404 commit 45cf43b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,23 @@ <h6 style="font-weight: lighter; font-size: 0.9em">Choose a Version:</h6>
(click)="onClickCreateWorkflowFromDataset()">
Create Workflow
</button>
<br>
<label for="scan-options">Select an option:</label>
<select id="scan-options" name="scan-options" [(ngModel)]="scanOption">
<br />
<div style="padding: 20px">
<label for="scan-options">Select an option:</label>
<select
id="scan-options"
name="scan-options"
[(ngModel)]="scanOption">
<option value="JSONLFileScan">JSONL File Scan</option>
<option value="CSVFileScan">CSV File Scan</option>
<option value="TextInput">Text Input</option>
<option value="FileScan" selected>File Scan</option>
</select>
<option
value="FileScan"
selected>
File Scan
</option>
</select>
</div>
</div>
</nz-sider>
</nz-layout>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Point } from "plotly.js-basic-dist-min";
styleUrls: ["./user-dataset-explorer.component.scss"],
})
export class UserDatasetExplorerComponent implements OnInit {
public scanOption: string = "";
public scanOption: string = "";
public did: number | undefined;
public datasetName: string = "";
public datasetDescription: string = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import { WorkflowActionService } from "../../../../workspace/service/workflow-gr
import { WorkflowUtilService } from "../../../../workspace/service/workflow-graph/util/workflow-util.service";

import { observe } from "@ngx-formly/core/lib/utils";
import { Point } from "../../../../workspace/types/workflow-common.interface"

import { Point } from "../../../../workspace/types/workflow-common.interface";

/**
* UserWorkflowService facilitates creating a new workflow from the dataset dashboard
Expand All @@ -35,7 +34,6 @@ import { Point } from "../../../../workspace/types/workflow-common.interface"
@Injectable({
providedIn: "root",
})

export class UserWorkflowService {
public ROUTER_WORKFLOW_BASE_URL = "workflow";
private _searchResultsComponent?: SearchResultsComponent;
Expand Down Expand Up @@ -75,20 +73,23 @@ export class UserWorkflowService {
) {}

/* Creates a workflow from the dataset dashboard with a pre-initialized scan operator*/
public onClickCreateNewWorkflowFromDatasetDashboard(datasetFile: string, scanOption: string): Observable<number | undefined> {
public onClickCreateNewWorkflowFromDatasetDashboard(
datasetFile: string,
scanOption: string
): Observable<number | undefined> {
let operatorPredicate = this.workflowUtilService.getNewOperatorPredicate(scanOption);
operatorPredicate = this.workflowUtilService.addFileName(operatorPredicate, datasetFile); // add the filename

let localPid = this.pid;
let point: Point = {x: 474, y: 235};
let point: Point = { x: 474, y: 235 };
let emptyWorkflowContent: WorkflowContent = {
operators: [operatorPredicate],
commentBoxes: [],
groups: [],
links: [],
operatorPositions: {
[operatorPredicate.operatorID]: { x: 474, y: 235 }
}
[operatorPredicate.operatorID]: { x: 474, y: 235 },
},
};

return this.workflowPersistService.createWorkflow(emptyWorkflowContent, DEFAULT_WORKFLOW_NAME).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ export class WorkflowUtilService {

/* Helper function for initializing scan operators with file to scan included.*/
public addFileName(op: OperatorPredicate, fileName: string): OperatorPredicate {
const updatedPredicate: OperatorPredicate = { ...op };
const updatedProperties = { ...updatedPredicate.operatorProperties, fileName };
const updatedPredicate: OperatorPredicate = { ...op };
const updatedProperties = { ...updatedPredicate.operatorProperties, fileName };

const updatedOperatorPredicate: OperatorPredicate = {
...updatedPredicate,
operatorProperties: updatedProperties,
};
const updatedOperatorPredicate: OperatorPredicate = {
...updatedPredicate,
operatorProperties: updatedProperties,
};

return updatedOperatorPredicate;
return updatedOperatorPredicate;
}
}

0 comments on commit 45cf43b

Please sign in to comment.