Skip to content

Commit

Permalink
#1422 Fix HDFS location validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zejnilovic committed Jul 8, 2020
1 parent 18cb47f commit dbb7693
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions menas/ui/components/dataset/addDataset.fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
value="{entity>/description}"/>
<core:Fragment type="XML" fragmentName="components.schema.selector.schemaSelector"/>
<Label text="HDFS raw data folder path"/>
<Input type="Text" id="selectedRawHDFSPathLabel"/>
<Input type="Text" id="selectedRawHDFSPathLabel" value="{entity>/hdfsPath}"/>
<Label text="HDFS conformed data publish folder path"/>
<Input type="Text" id="selectedPublishHDFSPathLabel"/>
<Input type="Text" id="selectedPublishHDFSPathLabel" value="{entity>/hdfsPublishPath}"/>
</form:content>
</form:SimpleForm>
</VBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
value="{entity>/description}"/>
<core:Fragment type="XML" fragmentName="components.schema.selector.schemaSelector"/>
<Label text="HDFS Path"/>
<Input type="Text" id="selectedHDFSPathLabel"/>
<Input type="Text" id="selectedHDFSPathLabel" value="{entity>/hdfsPath}"/>
</form:content>
</form:SimpleForm>
</VBox>
Expand Down
17 changes: 11 additions & 6 deletions menas/ui/service/EntityDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ class DatasetDialog extends EntityDialog {

this.oController.byId("schemaVersionSelect").setValueState(sap.ui.core.ValueState.None);
this.oController.byId("schemaVersionSelect").setValueStateText("");

this.oController.byId("selectedRawHDFSPathLabel").setValueState(sap.ui.core.ValueState.None);
this.oController.byId("selectedRawHDFSPathLabel").setValueStateText("");

this.oController.byId("selectedPublishHDFSPathLabel").setValueState(sap.ui.core.ValueState.None);
this.oController.byId("selectedPublishHDFSPathLabel").setValueStateText("");
}

isValid(oDataset) {
Expand All @@ -95,11 +101,8 @@ class DatasetDialog extends EntityDialog {
let hasValidPublishHDFSPath = EntityValidationService.hasValidHDFSPath(oDataset.hdfsPublishPath,
"Dataset publish HDFS path",
this.oController.byId("selectedPublishHDFSPathLabel"));
let hasExistingRawHDFSPath = hasValidRawHDFSPath ? this.oController.byId("newDatasetRawHDFSBrowser").validate() : false;
let hasExistingPublishHDFSPath = hasValidRawHDFSPath && hasValidPublishHDFSPath ?
this.oController.byId("newDatasetPublishHDFSBrowser").validate() : false;

return hasValidName && hasValidSchema && hasExistingRawHDFSPath && hasExistingPublishHDFSPath;
return hasValidName && hasValidSchema && hasValidRawHDFSPath && hasValidPublishHDFSPath;
}

onNameChange() {
Expand Down Expand Up @@ -246,6 +249,9 @@ class MappingTableDialog extends EntityDialog {

this.oController.byId("schemaVersionSelect").setValueState(sap.ui.core.ValueState.None);
this.oController.byId("schemaVersionSelect").setValueStateText("");

this.oController.byId("selectedHDFSPathLabel").setValueState(sap.ui.core.ValueState.None);
this.oController.byId("selectedHDFSPathLabel").setValueStateText("");
}

isValid(oMT) {
Expand All @@ -258,9 +264,8 @@ class MappingTableDialog extends EntityDialog {
let hasValidHDFSPath = EntityValidationService.hasValidHDFSPath(oMT.hdfsPath,
"Mapping Table HDFS path",
this.oController.byId("selectedHDFSPathLabel"));
let hasExistingHDFSPath = hasValidHDFSPath ? this.oController.byId("addMtHDFSBrowser").validate() : false;

return hasValidName && hasValidSchema && hasExistingHDFSPath;
return hasValidName && hasValidSchema && hasValidHDFSPath;
}

onNameChange() {
Expand Down

0 comments on commit dbb7693

Please sign in to comment.