You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by li...@apache.org on 2026/04/15 04:53:49 UTC
(texera) branch main updated: feat: add File Lister operator (#4364)
This is an automated email from the ASF dual-hosted git repository.
linxinyuan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new e0fc7df17e feat: add File Lister operator (#4364)
e0fc7df17e is described below
commit e0fc7df17ecbc346bd68fdc3d7110311f52d8a27
Author: Xinyuan Lin <xi...@uci.edu>
AuthorDate: Tue Apr 14 21:53:43 2026 -0700
feat: add File Lister operator (#4364)
### What changes were proposed in this PR?
This PR adds a new File Lister operator that allows users to select a
dataset from the property panel and output one tuple per filepath in
that version. The emitted values follow Texera’s existing dataset file
path format, so they can be consumed directly by downstream operators.
On the frontend, this PR adds a dedicated dataset-version selector field
in the property panel and wires datasetVersionPath to that custom UI.
<img width="1020" height="498" alt="image"
src="https://github.com/user-attachments/assets/c00f4c09-6893-4537-8aae-3862114e2ad5"
/>
<img width="1186" height="757" alt="image"
src="https://github.com/user-attachments/assets/8e0bc00e-1355-471b-afcd-0700c2929e7e"
/>
### Any related issues, documentation, discussions?
Closes #4363.
### How was this PR tested?
Tested manually, and a test case was added.
The test covers the dataset selector descriptor metadata and output
schema.
### Was this PR authored or co-authored using generative AI tooling?
No.
---------
Co-authored-by: Kunwoo (Chris) <14...@users.noreply.github.com>
---
.../apache/texera/amber/operator/LogicalOp.scala | 2 +
.../source/dataset/FileListerSourceOpDesc.scala | 68 +++++++++++
.../source/dataset/FileListerSourceOpExec.scala | 59 ++++++++++
.../dataset/FileListerSourceOpDescSpec.scala | 45 +++-----
frontend/src/app/app.module.ts | 10 +-
frontend/src/app/common/formly/formly-config.ts | 6 +-
.../dataset-file-selector.component.html} | 37 +++---
.../dataset-file-selector.component.ts} | 34 ++----
.../dataset-selection-modal.component.html | 67 +++++++++++
.../dataset-selection-modal.component.scss} | 36 ++----
.../dataset-selection-modal.component.ts | 108 ++++++++++++++++++
.../dataset-version-selector.component.html} | 36 ++----
.../dataset-version-selector.component.ts | 60 ++++++++++
.../file-selection/file-selection.component.html | 77 -------------
.../file-selection/file-selection.component.scss | 89 ---------------
.../file-selection/file-selection.component.ts | 127 ---------------------
.../input-autocomplete.component.spec.ts | 49 --------
.../operator-property-edit-frame.component.ts | 6 +-
frontend/src/assets/operator_images/FileLister.png | Bin 0 -> 22499 bytes
19 files changed, 443 insertions(+), 473 deletions(-)
diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala
index 931596b1bf..3a0f0a5c4b 100644
--- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala
+++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala
@@ -75,6 +75,7 @@ import org.apache.texera.amber.operator.source.apis.twitter.v2.{
TwitterFullArchiveSearchSourceOpDesc,
TwitterSearchSourceOpDesc
}
+import org.apache.texera.amber.operator.source.dataset.FileListerSourceOpDesc
import org.apache.texera.amber.operator.source.fetcher.URLFetcherOpDesc
import org.apache.texera.amber.operator.source.scan.FileScanSourceOpDesc
import org.apache.texera.amber.operator.source.scan.arrow.ArrowSourceOpDesc
@@ -158,6 +159,7 @@ trait StateTransferFunc
new Type(value = classOf[IfOpDesc], name = "If"),
new Type(value = classOf[SankeyDiagramOpDesc], name = "SankeyDiagram"),
new Type(value = classOf[IcicleChartOpDesc], name = "IcicleChart"),
+ new Type(value = classOf[FileListerSourceOpDesc], name = "FileLister"),
new Type(value = classOf[CSVScanSourceOpDesc], name = "CSVFileScan"),
// disabled the ParallelCSVScanSourceOpDesc so that it does not confuse user. it can be re-enabled when doing experiments.
// new Type(value = classOf[ParallelCSVScanSourceOpDesc], name = "ParallelCSVFileScan"),
diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpDesc.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpDesc.scala
new file mode 100644
index 0000000000..1101dce7e0
--- /dev/null
+++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpDesc.scala
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.source.dataset
+
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
+import org.apache.texera.amber.core.executor.OpExecWithClassName
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.virtualidentity.{ExecutionIdentity, WorkflowIdentity}
+import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp, SchemaPropagationFunc}
+import org.apache.texera.amber.operator.LogicalOp
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants, OperatorInfo}
+import org.apache.texera.amber.util.JSONUtils.objectMapper
+
+class FileListerSourceOpDesc extends LogicalOp {
+
+ @JsonProperty(required = true)
+ @JsonSchemaTitle("Dataset")
+ var datasetVersionPath: String = _
+
+ override def getPhysicalOp(
+ workflowId: WorkflowIdentity,
+ executionId: ExecutionIdentity
+ ): PhysicalOp =
+ PhysicalOp
+ .sourcePhysicalOp(
+ workflowId,
+ executionId,
+ operatorIdentifier,
+ OpExecWithClassName(
+ "org.apache.texera.amber.operator.source.dataset.FileListerSourceOpExec",
+ objectMapper.writeValueAsString(this)
+ )
+ )
+ .withInputPorts(operatorInfo.inputPorts)
+ .withOutputPorts(operatorInfo.outputPorts)
+ .withPropagateSchema(
+ SchemaPropagationFunc(_ =>
+ Map(operatorInfo.outputPorts.head.id -> Schema().add("filename", AttributeType.STRING))
+ )
+ )
+
+ override def operatorInfo: OperatorInfo =
+ OperatorInfo(
+ userFriendlyName = "File Lister",
+ operatorDescription = "Select a dataset version and output one filename tuple per file",
+ operatorGroupName = OperatorGroupConstants.INPUT_GROUP,
+ inputPorts = List.empty,
+ outputPorts = List(OutputPort())
+ )
+}
diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpExec.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpExec.scala
new file mode 100644
index 0000000000..c58da8ca84
--- /dev/null
+++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpExec.scala
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.source.dataset
+
+import org.apache.texera.amber.core.executor.SourceOperatorExecutor
+import org.apache.texera.amber.core.storage.util.LakeFSStorageClient
+import org.apache.texera.amber.core.tuple.TupleLike
+import org.apache.texera.amber.util.JSONUtils.objectMapper
+import org.apache.texera.dao.SqlServer
+import org.apache.texera.dao.jooq.generated.tables.Dataset.DATASET
+import org.apache.texera.dao.jooq.generated.tables.DatasetVersion.DATASET_VERSION
+import org.apache.texera.dao.jooq.generated.tables.User.USER
+
+class FileListerSourceOpExec private[dataset] (descString: String) extends SourceOperatorExecutor {
+ private val desc: FileListerSourceOpDesc =
+ objectMapper.readValue(descString, classOf[FileListerSourceOpDesc])
+
+ override def produceTuple(): Iterator[TupleLike] = {
+ val Seq(_, ownerEmail, datasetName, versionName, _*) =
+ desc.datasetVersionPath.split("/").toSeq
+
+ val (repositoryName, versionHash) =
+ SqlServer
+ .getInstance()
+ .createDSLContext()
+ .select(DATASET.REPOSITORY_NAME, DATASET_VERSION.VERSION_HASH)
+ .from(DATASET)
+ .join(USER)
+ .on(USER.UID.eq(DATASET.OWNER_UID))
+ .join(DATASET_VERSION)
+ .on(DATASET_VERSION.DID.eq(DATASET.DID))
+ .where(USER.EMAIL.eq(ownerEmail))
+ .and(DATASET.NAME.eq(datasetName))
+ .and(DATASET_VERSION.NAME.eq(versionName))
+ .fetchOne(r => (r.value1(), r.value2()))
+
+ LakeFSStorageClient
+ .retrieveObjectsOfVersion(repositoryName, versionHash)
+ .map(obj => TupleLike("filename" -> s"${desc.datasetVersionPath}/${obj.getPath}"))
+ .iterator
+ }
+}
diff --git a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.scss b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpDescSpec.scala
similarity index 50%
copy from frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.scss
copy to common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpDescSpec.scala
index cc76590399..a5aa744ff5 100644
--- a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.scss
+++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/dataset/FileListerSourceOpDescSpec.scala
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -17,34 +17,27 @@
* under the License.
*/
-mat-form-field {
- width: 100%;
-}
-.input-autocomplete-container {
- display: flex;
- align-items: center;
- width: 100%;
-
- input {
- flex: 1;
- margin-right: 10px;
- }
+package org.apache.texera.amber.operator.source.dataset
- button {
- white-space: nowrap;
- }
+import org.apache.texera.amber.core.tuple.AttributeType
+import org.scalatest.flatspec.AnyFlatSpec
+
+class FileListerSourceOpDescSpec extends AnyFlatSpec {
- .file-select-button {
- border: 2px solid #1890ff;
- color: #1890ff;
+ "FileListerSourceOpDesc" should "expose a filename output column" in {
+ val opDesc = new FileListerSourceOpDesc()
+
+ val outputSchema = opDesc.getExternalOutputSchemas(Map.empty).values.head
+
+ assert(outputSchema.getAttributes.length == 1)
+ assert(outputSchema.getAttribute("filename").getType == AttributeType.STRING)
+ }
- &:hover {
- background-color: #e6f7ff;
- border-color: #1890ff;
- }
+ it should "use the expected operator metadata" in {
+ val opDesc = new FileListerSourceOpDesc()
- &:focus {
- box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
- }
+ assert(opDesc.operatorInfo.userFriendlyName == "File Lister")
+ assert(opDesc.operatorInfo.inputPorts.isEmpty)
+ assert(opDesc.operatorInfo.outputPorts.length == 1)
}
}
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts
index b6364e781f..11ce2f26f8 100644
--- a/frontend/src/app/app.module.ts
+++ b/frontend/src/app/app.module.ts
@@ -103,7 +103,9 @@ import { CoeditorUserIconComponent } from "./workspace/component/menu/coeditor-u
import { AgentPanelComponent } from "./workspace/component/agent-panel/agent-panel.component";
import { AgentChatComponent } from "./workspace/component/agent-panel/agent-chat/agent-chat.component";
import { AgentRegistrationComponent } from "./workspace/component/agent-panel/agent-registration/agent-registration.component";
-import { InputAutoCompleteComponent } from "./workspace/component/input-autocomplete/input-autocomplete.component";
+import { DatasetFileSelectorComponent } from "./workspace/component/dataset-file-selector/dataset-file-selector.component";
+import { DatasetVersionSelectorComponent } from "./workspace/component/dataset-version-selector/dataset-version-selector.component";
+import { DatasetSelectionModalComponent } from "./workspace/component/dataset-selection-modal/dataset-selection-modal.component";
import { CollabWrapperComponent } from "./common/formly/collab-wrapper/collab-wrapper/collab-wrapper.component";
import { TexeraCopilot } from "./workspace/service/copilot/texera-copilot";
import { NzSwitchModule } from "ng-zorro-antd/switch";
@@ -152,7 +154,6 @@ import { NzTreeModule } from "ng-zorro-antd/tree";
import { NzTreeViewModule } from "ng-zorro-antd/tree-view";
import { NzNoAnimationModule } from "ng-zorro-antd/core/no-animation";
import { TreeModule } from "@ali-hm/angular-tree-component";
-import { FileSelectionComponent } from "./workspace/component/file-selection/file-selection.component";
import { ResultExportationComponent } from "./workspace/component/result-exportation/result-exportation.component";
import { ReportGenerationService } from "./workspace/service/report-generation/report-generation.service";
import { SearchBarComponent } from "./dashboard/component/user/search-bar/search-bar.component";
@@ -257,8 +258,9 @@ registerLocaleData(en);
AgentPanelComponent,
AgentChatComponent,
AgentRegistrationComponent,
- InputAutoCompleteComponent,
- FileSelectionComponent,
+ DatasetFileSelectorComponent,
+ DatasetVersionSelectorComponent,
+ DatasetSelectionModalComponent,
CollabWrapperComponent,
AboutComponent,
UserWorkflowListItemComponent,
diff --git a/frontend/src/app/common/formly/formly-config.ts b/frontend/src/app/common/formly/formly-config.ts
index d950bd3690..c3995abb54 100644
--- a/frontend/src/app/common/formly/formly-config.ts
+++ b/frontend/src/app/common/formly/formly-config.ts
@@ -24,9 +24,10 @@ import { MultiSchemaTypeComponent } from "./multischema.type";
import { FormlyFieldConfig } from "@ngx-formly/core";
import { CodeareaCustomTemplateComponent } from "../../workspace/component/codearea-custom-template/codearea-custom-template.component";
import { PresetWrapperComponent } from "./preset-wrapper/preset-wrapper.component";
-import { InputAutoCompleteComponent } from "../../workspace/component/input-autocomplete/input-autocomplete.component";
+import { DatasetFileSelectorComponent } from "../../workspace/component/dataset-file-selector/dataset-file-selector.component";
import { CollabWrapperComponent } from "./collab-wrapper/collab-wrapper/collab-wrapper.component";
import { FormlyRepeatDndComponent } from "./repeat-dnd/repeat-dnd.component";
+import { DatasetVersionSelectorComponent } from "../../workspace/component/dataset-version-selector/dataset-version-selector.component";
/**
* Configuration for using Json Schema with Formly.
@@ -76,7 +77,8 @@ export const TEXERA_FORMLY_CONFIG = {
{ name: "object", component: ObjectTypeComponent },
{ name: "multischema", component: MultiSchemaTypeComponent },
{ name: "codearea", component: CodeareaCustomTemplateComponent },
- { name: "inputautocomplete", component: InputAutoCompleteComponent, wrappers: ["form-field"] },
+ { name: "inputautocomplete", component: DatasetFileSelectorComponent, wrappers: ["form-field"] },
+ { name: "datasetversionselector", component: DatasetVersionSelectorComponent, wrappers: ["form-field"] },
{ name: "repeat-section-dnd", component: FormlyRepeatDndComponent },
],
wrappers: [
diff --git a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.html b/frontend/src/app/workspace/component/dataset-file-selector/dataset-file-selector.component.html
similarity index 52%
copy from frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.html
copy to frontend/src/app/workspace/component/dataset-file-selector/dataset-file-selector.component.html
index 53ee531fa6..9fbc1ddffd 100644
--- a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.html
+++ b/frontend/src/app/workspace/component/dataset-file-selector/dataset-file-selector.component.html
@@ -16,27 +16,16 @@
specific language governing permissions and limitations
under the License.
-->
-
-<div [ngClass]="{'input-autocomplete-container': isFileSelectionEnabled}">
- <input
- *ngIf="selectedFilePath || !isFileSelectionEnabled"
- nz-input
- [readOnly]="isFileSelectionEnabled"
- required
- [formControl]="formControl"
- [formlyAttributes]="field" />
- <button
- *ngIf="isFileSelectionEnabled"
- nz-button
- class="file-select-button"
- nzSize="small"
- (click)="isFileSelectionEnabled && onClickOpenFileSelectionModal()">
- {{ selectedFilePath ? 'Reselect File' : 'Select File' }}
- </button>
-</div>
-<div
- class="alert alert-danger"
- role="alert"
- *ngIf="props.showError && formControl.errors">
- <formly-validation-message [field]="field"></formly-validation-message>
-</div>
+<input
+ *ngIf="formControl.value || !isFileSelectionEnabled"
+ nz-input
+ required
+ [readOnly]="isFileSelectionEnabled"
+ [formControl]="formControl" />
+<button
+ *ngIf="isFileSelectionEnabled"
+ nz-button
+ nzSize="small"
+ (click)="isFileSelectionEnabled && onClickOpenFileSelectionModal()">
+ Select File
+</button>
diff --git a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.ts b/frontend/src/app/workspace/component/dataset-file-selector/dataset-file-selector.component.ts
similarity index 64%
rename from frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.ts
rename to frontend/src/app/workspace/component/dataset-file-selector/dataset-file-selector.component.ts
index 38839f377e..d3192fbd23 100644
--- a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.ts
+++ b/frontend/src/app/workspace/component/dataset-file-selector/dataset-file-selector.component.ts
@@ -22,17 +22,14 @@ import { FieldType, FieldTypeConfig } from "@ngx-formly/core";
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
import { WorkflowActionService } from "../../service/workflow-graph/model/workflow-action.service";
import { NzModalService } from "ng-zorro-antd/modal";
-import { FileSelectionComponent } from "../file-selection/file-selection.component";
-import { DatasetFileNode, getFullPathFromDatasetFileNode } from "../../../common/type/datasetVersionFileTree";
+import { DatasetSelectionModalComponent } from "../dataset-selection-modal/dataset-selection-modal.component";
import { GuiConfigService } from "../../../common/service/gui-config.service";
@UntilDestroy()
@Component({
- selector: "texera-input-autocomplete-template",
- templateUrl: "./input-autocomplete.component.html",
- styleUrls: ["input-autocomplete.component.scss"],
+ templateUrl: "dataset-file-selector.component.html",
})
-export class InputAutoCompleteComponent extends FieldType<FieldTypeConfig> {
+export class DatasetFileSelectorComponent extends FieldType<FieldTypeConfig> {
constructor(
private modalService: NzModalService,
public workflowActionService: WorkflowActionService,
@@ -43,14 +40,13 @@ export class InputAutoCompleteComponent extends FieldType<FieldTypeConfig> {
onClickOpenFileSelectionModal(): void {
const modal = this.modalService.create({
- nzTitle: "Please select one file from datasets",
- nzContent: FileSelectionComponent,
+ nzContent: DatasetSelectionModalComponent,
nzFooter: null,
nzData: {
- selectedFilePath: this.formControl.getRawValue(),
+ fileMode: true,
+ selectedPath: this.formControl.getRawValue(),
},
nzBodyStyle: {
- // Enables the file selection window to be resizable
resize: "both",
overflow: "auto",
minHeight: "200px",
@@ -60,22 +56,14 @@ export class InputAutoCompleteComponent extends FieldType<FieldTypeConfig> {
},
nzWidth: "fit-content",
});
- // Handle the selection from the modal
- modal.afterClose.pipe(untilDestroyed(this)).subscribe(fileNode => {
- const node: DatasetFileNode = fileNode as DatasetFileNode;
- this.formControl.setValue(getFullPathFromDatasetFileNode(node));
+ modal.afterClose.pipe(untilDestroyed(this)).subscribe(selectedPath => {
+ if (selectedPath) {
+ this.formControl.setValue(selectedPath);
+ }
});
}
- get enableDatasetSource(): boolean {
- return this.config.env.selectingFilesFromDatasetsEnabled;
- }
-
get isFileSelectionEnabled(): boolean {
- return this.enableDatasetSource;
- }
-
- get selectedFilePath(): string | null {
- return this.formControl.value;
+ return this.config.env.selectingFilesFromDatasetsEnabled;
}
}
diff --git a/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.html b/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.html
new file mode 100644
index 0000000000..f8189ddb3f
--- /dev/null
+++ b/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.html
@@ -0,0 +1,67 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<br />
+<div
+ nz-row
+ nzGutter="8">
+ <nz-select
+ nz-col
+ nzFlex="auto"
+ nzPlaceHolder="Select dataset"
+ [(ngModel)]="selectedDataset"
+ (ngModelChange)="onDatasetChange()">
+ <nz-option
+ *ngFor="let dataset of datasets"
+ [nzValue]="dataset"
+ [nzLabel]="dataset.dataset.name"
+ [nzCustomContent]="true">
+ <div class="dataset-row">
+ <span class="dataset-name"> #{{ dataset.dataset.did }} {{ dataset.dataset.name }} </span>
+ <span class="access-level"> {{ dataset.isOwner ? 'OWNER' : dataset.accessPrivilege }} </span>
+ </div>
+ </nz-option>
+ </nz-select>
+
+ <nz-select
+ nz-col
+ nzFlex="130px"
+ nzPlaceHolder="Select version"
+ [(ngModel)]="selectedVersion"
+ (ngModelChange)="onVersionChange()">
+ <nz-option
+ *ngFor="let version of datasetVersions"
+ [nzValue]="version"
+ [nzLabel]="version.name">
+ </nz-option>
+ </nz-select>
+</div>
+<br />
+<texera-user-dataset-version-filetree
+ [isExpandAllAfterViewInit]="true"
+ [fileTreeNodes]="fileTree"
+ (selectedTreeNode)="onFileSelected($event)">
+</texera-user-dataset-version-filetree>
+<br />
+<button
+ nz-button
+ nzType="primary"
+ [disabled]="!selectedPath"
+ (click)="onConfirmSelection()">
+ Select
+</button>
diff --git a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.scss b/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.scss
similarity index 65%
rename from frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.scss
rename to frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.scss
index cc76590399..6a63837c43 100644
--- a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.scss
+++ b/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.scss
@@ -17,34 +17,16 @@
* under the License.
*/
-mat-form-field {
- width: 100%;
-}
-.input-autocomplete-container {
+.dataset-row {
display: flex;
- align-items: center;
- width: 100%;
-
- input {
- flex: 1;
- margin-right: 10px;
- }
-
- button {
- white-space: nowrap;
- }
-
- .file-select-button {
- border: 2px solid #1890ff;
- color: #1890ff;
+ justify-content: space-between;
+}
- &:hover {
- background-color: #e6f7ff;
- border-color: #1890ff;
- }
+.dataset-name {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
- &:focus {
- box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
- }
- }
+.access-level {
+ color: grey;
}
diff --git a/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.ts b/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.ts
new file mode 100644
index 0000000000..8f87eedff7
--- /dev/null
+++ b/frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.ts
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, inject, OnInit } from "@angular/core";
+import { NZ_MODAL_DATA, NzModalRef } from "ng-zorro-antd/modal";
+import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
+import { DatasetFileNode, getFullPathFromDatasetFileNode } from "../../../common/type/datasetVersionFileTree";
+import { DatasetVersion } from "../../../common/type/dataset";
+import { DashboardDataset } from "../../../dashboard/type/dashboard-dataset.interface";
+import { DatasetService } from "../../../dashboard/service/user/dataset/dataset.service";
+
+@UntilDestroy()
+@Component({
+ templateUrl: "dataset-selection-modal.component.html",
+ styleUrls: ["dataset-selection-modal.component.scss"],
+})
+export class DatasetSelectionModalComponent implements OnInit {
+ private readonly data = inject(NZ_MODAL_DATA) as {
+ fileMode: boolean;
+ selectedPath?: string | null;
+ };
+
+ datasets: ReadonlyArray<DashboardDataset> = [];
+ datasetVersions: ReadonlyArray<DatasetVersion> = [];
+ fileTree: DatasetFileNode[] = [];
+ selectedDataset?: DashboardDataset;
+ selectedVersion?: DatasetVersion;
+ selectedPath?: string;
+
+ constructor(
+ private modalRef: NzModalRef,
+ private datasetService: DatasetService
+ ) {}
+
+ ngOnInit() {
+ this.datasetService
+ .retrieveAccessibleDatasets()
+ .pipe(untilDestroyed(this))
+ .subscribe(datasets => {
+ this.datasets = datasets;
+ const selectedPath = this.data.selectedPath;
+ if (selectedPath) {
+ const [ownerEmail, datasetName, versionName] = selectedPath.split("/").filter(part => part.length > 0);
+ this.selectedDataset = this.datasets.find(
+ dataset => dataset.ownerEmail === ownerEmail && dataset.dataset.name === datasetName
+ );
+ this.onDatasetChange(versionName);
+ }
+ });
+ }
+
+ onDatasetChange(versionName?: string) {
+ this.fileTree = [];
+ if (this.selectedDataset?.dataset.did !== undefined) {
+ this.datasetService
+ .retrieveDatasetVersionList(this.selectedDataset.dataset.did)
+ .pipe(untilDestroyed(this))
+ .subscribe(versions => {
+ this.datasetVersions = versions;
+ if (this.data.fileMode) {
+ this.selectedVersion = versions.find(version => version.name === versionName) ?? versions[0];
+ this.onVersionChange();
+ }
+ });
+ }
+ }
+
+ onVersionChange() {
+ if (this.selectedDataset?.dataset.did !== undefined && this.selectedVersion?.dvid !== undefined) {
+ this.selectedPath = undefined;
+ this.datasetService
+ .retrieveDatasetVersionFileTree(this.selectedDataset.dataset.did, this.selectedVersion.dvid)
+ .pipe(untilDestroyed(this))
+ .subscribe(data => {
+ this.fileTree = data.fileNodes;
+ });
+ if (!this.data.fileMode) {
+ this.selectedPath = `/${this.selectedDataset.ownerEmail}/${this.selectedDataset.dataset.name}/${this.selectedVersion.name}`;
+ }
+ }
+ }
+
+ onFileSelected(node: DatasetFileNode) {
+ if (this.data.fileMode) {
+ this.selectedPath = getFullPathFromDatasetFileNode(node);
+ }
+ }
+
+ onConfirmSelection() {
+ this.modalRef.close(this.selectedPath);
+ }
+}
diff --git a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.html b/frontend/src/app/workspace/component/dataset-version-selector/dataset-version-selector.component.html
similarity index 52%
rename from frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.html
rename to frontend/src/app/workspace/component/dataset-version-selector/dataset-version-selector.component.html
index 53ee531fa6..c3bce19d42 100644
--- a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.html
+++ b/frontend/src/app/workspace/component/dataset-version-selector/dataset-version-selector.component.html
@@ -16,27 +16,15 @@
specific language governing permissions and limitations
under the License.
-->
-
-<div [ngClass]="{'input-autocomplete-container': isFileSelectionEnabled}">
- <input
- *ngIf="selectedFilePath || !isFileSelectionEnabled"
- nz-input
- [readOnly]="isFileSelectionEnabled"
- required
- [formControl]="formControl"
- [formlyAttributes]="field" />
- <button
- *ngIf="isFileSelectionEnabled"
- nz-button
- class="file-select-button"
- nzSize="small"
- (click)="isFileSelectionEnabled && onClickOpenFileSelectionModal()">
- {{ selectedFilePath ? 'Reselect File' : 'Select File' }}
- </button>
-</div>
-<div
- class="alert alert-danger"
- role="alert"
- *ngIf="props.showError && formControl.errors">
- <formly-validation-message [field]="field"></formly-validation-message>
-</div>
+<input
+ *ngIf="formControl.value"
+ nz-input
+ readonly
+ required
+ [formControl]="formControl" />
+<button
+ nz-button
+ nzSize="small"
+ (click)="onClickOpenDatasetSelectionModal()">
+ Select Dataset
+</button>
diff --git a/frontend/src/app/workspace/component/dataset-version-selector/dataset-version-selector.component.ts b/frontend/src/app/workspace/component/dataset-version-selector/dataset-version-selector.component.ts
new file mode 100644
index 0000000000..b03ec14f59
--- /dev/null
+++ b/frontend/src/app/workspace/component/dataset-version-selector/dataset-version-selector.component.ts
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component } from "@angular/core";
+import { FieldType, FieldTypeConfig } from "@ngx-formly/core";
+import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
+import { NzModalService } from "ng-zorro-antd/modal";
+import { DatasetSelectionModalComponent } from "../dataset-selection-modal/dataset-selection-modal.component";
+
+@UntilDestroy()
+@Component({
+ templateUrl: "dataset-version-selector.component.html",
+})
+export class DatasetVersionSelectorComponent extends FieldType<FieldTypeConfig> {
+ constructor(private modalService: NzModalService) {
+ super();
+ }
+
+ onClickOpenDatasetSelectionModal(): void {
+ const modal = this.modalService.create({
+ nzContent: DatasetSelectionModalComponent,
+ nzFooter: null,
+ nzData: {
+ fileMode: false,
+ selectedPath: this.formControl.getRawValue(),
+ },
+ nzBodyStyle: {
+ resize: "both",
+ overflow: "auto",
+ minHeight: "200px",
+ minWidth: "550px",
+ maxWidth: "90vw",
+ maxHeight: "80vh",
+ },
+ nzWidth: "fit-content",
+ });
+
+ modal.afterClose.pipe(untilDestroyed(this)).subscribe(selectedPath => {
+ if (selectedPath) {
+ this.formControl.setValue(selectedPath);
+ }
+ });
+ }
+}
diff --git a/frontend/src/app/workspace/component/file-selection/file-selection.component.html b/frontend/src/app/workspace/component/file-selection/file-selection.component.html
deleted file mode 100644
index f78d46102d..0000000000
--- a/frontend/src/app/workspace/component/file-selection/file-selection.component.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<nz-spin [nzSpinning]="isAccessibleDatasetsLoading">
- <div class="container">
- <div class="selection-row">
- <nz-select
- nzShowSearch
- nzAllowClear
- nzPlaceHolder="Select dataset"
- [(ngModel)]="selectedDataset"
- (ngModelChange)="onDatasetChange()"
- [ngStyle]="{'width': isDatasetSelected ? '60%' : '100%'}"
- class="select-dataset">
- <nz-option
- *ngFor="let dataset of datasets"
- [nzValue]="dataset"
- [nzLabel]="dataset.dataset.name"
- [nzCustomContent]="true">
- <div class="dataset-option">
- <div class="dataset-id-container">{{ dataset.dataset.did }}</div>
- <span class="dataset-name">{{ dataset.dataset.name }}</span>
- <span
- class="dataset-owner"
- *ngIf="dataset.isOwner">
- OWNER
- </span>
- <span
- class="dataset-access-privilege"
- *ngIf="!dataset.isOwner">
- {{ dataset.accessPrivilege }}
- </span>
- </div>
- </nz-option>
- </nz-select>
-
- <nz-select
- *ngIf="selectedDataset"
- nzShowSearch
- nzAllowClear
- nzPlaceHolder="Select version"
- [(ngModel)]="selectedVersion"
- (ngModelChange)="onVersionChange()"
- class="select-version">
- <nz-option
- *ngFor="let version of datasetVersions"
- [nzValue]="version"
- [nzLabel]="version.name">
- </nz-option>
- </nz-select>
- </div>
-
- <texera-user-dataset-version-filetree
- *ngIf="suggestedFileTreeNodes.length > 0"
- [isExpandAllAfterViewInit]="true"
- [fileTreeNodes]="suggestedFileTreeNodes"
- (selectedTreeNode)="onFileTreeNodeSelected($event)"
- class="texera-user-dataset-version-filetree">
- </texera-user-dataset-version-filetree>
- </div>
-</nz-spin>
diff --git a/frontend/src/app/workspace/component/file-selection/file-selection.component.scss b/frontend/src/app/workspace/component/file-selection/file-selection.component.scss
deleted file mode 100644
index 0e7ceadbf9..0000000000
--- a/frontend/src/app/workspace/component/file-selection/file-selection.component.scss
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-:host {
- display: block;
- padding: 16px;
-}
-
-.container {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.selection-row {
- display: flex;
- gap: 16px;
-}
-
-.nz-select {
- width: 100%;
-}
-
-.select-dataset {
- transition: width 0.3s; /* Add animation effect */
-}
-
-.select-version {
- flex: 1;
- min-width: 0;
-}
-
-.texera-user-dataset-version-filetree {
- margin-top: 16px;
-}
-
-.dataset-option {
- display: flex;
- align-items: center;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.dataset-name {
- display: inline-block;
- max-width: calc(100% - 100px); /* Adjust to fit other elements */
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.dataset-id-container {
- background-color: grey;
- color: white;
- width: 23px;
- height: 23px;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 12px;
- margin-right: 5px;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
- overflow: hidden;
-}
-
-.dataset-owner,
-.dataset-access-privilege {
- margin-left: 10px;
- font-size: 12px;
- color: grey;
-}
diff --git a/frontend/src/app/workspace/component/file-selection/file-selection.component.ts b/frontend/src/app/workspace/component/file-selection/file-selection.component.ts
deleted file mode 100644
index dfae2e4835..0000000000
--- a/frontend/src/app/workspace/component/file-selection/file-selection.component.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { Component, inject, OnInit } from "@angular/core";
-import { NZ_MODAL_DATA, NzModalRef } from "ng-zorro-antd/modal";
-import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
-import { DatasetFileNode } from "../../../common/type/datasetVersionFileTree";
-import { DatasetVersion } from "../../../common/type/dataset";
-import { DashboardDataset } from "../../../dashboard/type/dashboard-dataset.interface";
-import { DatasetService } from "../../../dashboard/service/user/dataset/dataset.service";
-import { parseFilePathToDatasetFile } from "../../../common/type/dataset-file";
-
-@UntilDestroy()
-@Component({
- selector: "texera-file-selection-model",
- templateUrl: "file-selection.component.html",
- styleUrls: ["file-selection.component.scss"],
-})
-export class FileSelectionComponent implements OnInit {
- readonly selectedFilePath: string = inject(NZ_MODAL_DATA).selectedFilePath;
- private _datasets: ReadonlyArray<DashboardDataset> = [];
-
- // indicate whether the accessible datasets have been loaded from the backend
- isAccessibleDatasetsLoading = true;
-
- selectedDataset?: DashboardDataset;
- selectedVersion?: DatasetVersion;
- datasetVersions?: DatasetVersion[];
- suggestedFileTreeNodes: DatasetFileNode[] = [];
- isDatasetSelected: boolean = false;
-
- constructor(
- private modalRef: NzModalRef,
- private datasetService: DatasetService
- ) {}
-
- ngOnInit() {
- this.isAccessibleDatasetsLoading = true;
-
- // retrieve all the accessible datasets from the backend
- this.datasetService
- .retrieveAccessibleDatasets()
- .pipe(untilDestroyed(this))
- .subscribe(datasets => {
- this._datasets = datasets;
- this.isAccessibleDatasetsLoading = false;
- if (!this.selectedFilePath || this.selectedFilePath == "") {
- return;
- }
- // if users already select some file, then ONLY show that selected dataset & related version
- const selectedDatasetFile = parseFilePathToDatasetFile(this.selectedFilePath);
- this.selectedDataset = this.datasets.find(
- d => d.ownerEmail === selectedDatasetFile.ownerEmail && d.dataset.name === selectedDatasetFile.datasetName
- );
- this.isDatasetSelected = !!this.selectedDataset;
- if (this.selectedDataset && this.selectedDataset.dataset.did !== undefined) {
- this.datasetService
- .retrieveDatasetVersionList(this.selectedDataset.dataset.did)
- .pipe(untilDestroyed(this))
- .subscribe(versions => {
- this.datasetVersions = versions;
- this.selectedVersion = this.datasetVersions.find(v => v.name === selectedDatasetFile.versionName);
- this.onVersionChange();
- });
- }
- });
- }
-
- onDatasetChange() {
- this.selectedVersion = undefined;
- this.suggestedFileTreeNodes = [];
- this.isDatasetSelected = !!this.selectedDataset;
- if (this.selectedDataset && this.selectedDataset.dataset.did !== undefined) {
- this.datasetService
- .retrieveDatasetVersionList(this.selectedDataset.dataset.did)
- .pipe(untilDestroyed(this))
- .subscribe(versions => {
- this.datasetVersions = versions;
- if (this.datasetVersions && this.datasetVersions.length > 0) {
- this.selectedVersion = this.datasetVersions[0];
- this.onVersionChange();
- }
- });
- }
- }
-
- onVersionChange() {
- this.suggestedFileTreeNodes = [];
- if (
- this.selectedDataset &&
- this.selectedDataset.dataset.did !== undefined &&
- this.selectedVersion &&
- this.selectedVersion.dvid !== undefined
- ) {
- this.datasetService
- .retrieveDatasetVersionFileTree(this.selectedDataset.dataset.did, this.selectedVersion.dvid)
- .pipe(untilDestroyed(this))
- .subscribe(data => {
- this.suggestedFileTreeNodes = data.fileNodes;
- });
- }
- }
-
- onFileTreeNodeSelected(node: DatasetFileNode) {
- this.modalRef.close(node);
- }
-
- get datasets(): ReadonlyArray<DashboardDataset> {
- return this._datasets;
- }
-}
diff --git a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.spec.ts b/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.spec.ts
deleted file mode 100644
index 690ad84999..0000000000
--- a/frontend/src/app/workspace/component/input-autocomplete/input-autocomplete.component.spec.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
-import { FormControl, ReactiveFormsModule } from "@angular/forms";
-import { InputAutoCompleteComponent } from "./input-autocomplete.component";
-import { HttpClientTestingModule } from "@angular/common/http/testing";
-import { NzModalService } from "ng-zorro-antd/modal";
-import { commonTestProviders } from "../../../common/testing/test-utils";
-
-describe("InputAutoCompleteComponent", () => {
- let component: InputAutoCompleteComponent;
- let fixture: ComponentFixture<InputAutoCompleteComponent>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [InputAutoCompleteComponent],
- imports: [ReactiveFormsModule, HttpClientTestingModule],
- providers: [NzModalService, ...commonTestProviders],
- }).compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(InputAutoCompleteComponent);
- component = fixture.componentInstance;
- component.field = { props: {}, formControl: new FormControl() };
- fixture.detectChanges();
- });
-
- it("should create", () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts b/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts
index 5d457e9050..0e1484f59c 100644
--- a/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts
+++ b/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts
@@ -449,10 +449,14 @@ export class OperatorPropertyEditFrameComponent implements OnInit, OnChanges, On
}
// if the title is fileName, then change it to custom autocomplete input template
- if (mappedField.key == "fileName") {
+ if (mappedField.key === "fileName") {
mappedField.type = "inputautocomplete";
}
+ if (mappedField.key === "datasetVersionPath") {
+ mappedField.type = "datasetversionselector";
+ }
+
// if the title is python script (for Python UDF), then make this field a custom template 'codearea'
if (mapSource?.description?.toLowerCase() === "input your code here") {
if (mappedField.type) {
diff --git a/frontend/src/assets/operator_images/FileLister.png b/frontend/src/assets/operator_images/FileLister.png
new file mode 100644
index 0000000000..c570e230ac
Binary files /dev/null and b/frontend/src/assets/operator_images/FileLister.png differ