changes to show/hide of option 'remove aggregation' for model program aggregation files
@@ -333,7 +333,7 @@ function updateSelectionMenuContext() {
// ------------- The item selected is a file -------------
else {
const logicalFileType = $(selected).find(".fb-logical-file-type").attr("data-logical-file-type").trim();
-
+ const fileHasModelProgramAggrFolder = $(selected).attr("data-has-model-program-aggr-folder").trim();
// Disable add metadata to folder
uiActionStates.setFileSetFileType.disabled = true;
uiActionStates.setFileSetFileType.fileMenu.hidden = true;
@@ -408,15 +408,24 @@ function updateSelectionMenuContext() {
}
else {
// The selected file is part of a logical file type
- if (logicalFileType !== 'RefTimeseriesLogicalFile' && logicalFileType !== "GenericLogicalFile") {
+ if (logicalFileType !== 'RefTimeseriesLogicalFile' && logicalFileType !== "GenericLogicalFile"
+ && logicalFileType !== "ModelProgramLogicalFile") {
// if the selected file is not part of the RefTimeseriesLogical or GenericLogicalFile file (aggregation)
- // dont't show the Remove Aggregation option
+ // or ModelProgramLogicalFile dont't show the Remove Aggregation option
+ uiActionStates.removeAggregation.disabled = true;
+ uiActionStates.removeAggregation.fileMenu.hidden = true;
+ }
+ else {
+ if (logicalFileType === "ModelProgramLogicalFile" && fileHasModelProgramAggrFolder === "true") {
+ // don't show option to remove aggregation for a file that's part of a model program aggregation
+ // created based on a folder
uiActionStates.removeAggregation.disabled = true;
uiActionStates.removeAggregation.fileMenu.hidden = true;
}
}
}
}
+ }
else {
// ------------- No files selected -------------
uiActionStates.cut.disabled = true;
@@ -832,6 +841,13 @@ function showFileTypeMetadata(file_type_time_series, url){
updateSelectionMenuContext();
return;
}
+ else if (logical_type === "ModelProgramLogicalFile") {
+ if (selectedItem.attr('data-has-model-program-aggr-folder') === 'true') {
+ $("#fileTypeMetaData").html(no_metadata_alert);
+ $("#btnSideAddMetadata").addClass("disabled");
+ return;
+ }
+ }
}
var resource_mode = RESOURCE_MODE;
if (!resource_mode) {
