diff --git a/frontend/src/framework/internal/components/SelectEnsemblesDialog/selectEnsemblesDialog.tsx b/frontend/src/framework/internal/components/SelectEnsemblesDialog/selectEnsemblesDialog.tsx index d9dec6203..dd43e7b33 100644 --- a/frontend/src/framework/internal/components/SelectEnsemblesDialog/selectEnsemblesDialog.tsx +++ b/frontend/src/framework/internal/components/SelectEnsemblesDialog/selectEnsemblesDialog.tsx @@ -657,227 +657,240 @@ export const SelectEnsemblesDialog: React.FC = (prop
-
Selected Ensembles
-
- - - - - - - - - - - - {newlySelectedEnsembles.map((item) => ( - - - - - - +
+
Selected Ensembles
+
+
ColorCustom nameCaseEnsembleActions
- - handleColorChange(item.caseUuid, item.ensembleName, value) - } - /> - - ) => - handleEnsembleCustomNameChange( - item.caseUuid, - item.ensembleName, - e.target.value - ) - } - /> - -
- {item.caseName} -
-
-
- {item.ensembleName} -
-
- - handleRemoveEnsemble(item.caseUuid, item.ensembleName) - } - color="danger" - title="Remove ensemble from selection" - > - - {" "} -
+ + + + + + + - ))} - -
ColorCustom nameCaseEnsembleActions
-
-
- -
Delta Ensembles
- - - -
-
- - - - - - - - - - - - {deltaEnsembles.map((elm) => { - const isDeltaEnsembleValid = - elm.compareEnsemble !== null && elm.referenceEnsemble !== null; - const isDuplicateDeltaEnsemble = - deltaEnsembles.filter( - (e) => - e.compareEnsemble?.caseUuid === elm.compareEnsemble?.caseUuid && - e.compareEnsemble?.ensembleName === - elm.compareEnsemble?.ensembleName && - e.referenceEnsemble?.caseUuid === elm.referenceEnsemble?.caseUuid && - e.referenceEnsemble?.ensembleName === - elm.referenceEnsemble?.ensembleName - ).length > 1; - return ( + + + {newlySelectedEnsembles.map((item) => ( - ); - })} - -
ColorCustom nameCompare EnsembleReference EnsembleActions
- handleDeltaEnsembleColorChange(elm.uuid, value) + handleColorChange(item.caseUuid, item.ensembleName, value) } /> ) => - handleDeltaEnsembleCustomNameChange( - elm.uuid, + handleEnsembleCustomNameChange( + item.caseUuid, + item.ensembleName, e.target.value ) } /> - { - return { - value: createCaseUuidAndEnsembleNameString( - elm.caseUuid, - elm.ensembleName - ), - label: - elm.customName ?? - `${elm.ensembleName} (${elm.caseName})`, - }; - })} - value={ - elm.compareEnsemble - ? createCaseUuidAndEnsembleNameString( - elm.compareEnsemble.caseUuid, - elm.compareEnsemble.ensembleName - ) - : undefined - } - onChange={(newCaseUuidAndEnsembleNameString) => { - handleDeltaEnsembleCompareEnsembleChange( - elm.uuid, - newCaseUuidAndEnsembleNameString - ); - }} - /> +
+ {item.caseName} +
- { - return { - value: createCaseUuidAndEnsembleNameString( - elm.caseUuid, - elm.ensembleName - ), - label: - elm.customName ?? - `${elm.ensembleName} (${elm.caseName})`, - }; - })} - value={ - elm.referenceEnsemble - ? createCaseUuidAndEnsembleNameString( - elm.referenceEnsemble.caseUuid, - elm.referenceEnsemble.ensembleName - ) - : undefined - } - onChange={(value) => { - handleDeltaEnsembleReferenceEnsembleChange(elm.uuid, value); - }} - /> +
+ {item.ensembleName} +
handleRemoveDeltaEnsemble(elm.uuid)} + onClick={() => + handleRemoveEnsemble(item.caseUuid, item.ensembleName) + } color="danger" - title="Remove delta ensemble from selection" + title="Remove ensemble from selection" > {" "}
+ ))} + + +
+ {newlySelectedEnsembles.length === 0 && ( +
No ensembles selected.
+ )} +
+
+
+ +
Delta Ensembles
+ + + +
+
+ + + + + + + + + + + + {deltaEnsembles.map((elm) => { + const isDeltaEnsembleValid = + elm.compareEnsemble !== null && elm.referenceEnsemble !== null; + const isDuplicateDeltaEnsemble = + deltaEnsembles.filter( + (e) => + e.compareEnsemble?.caseUuid === elm.compareEnsemble?.caseUuid && + e.compareEnsemble?.ensembleName === + elm.compareEnsemble?.ensembleName && + e.referenceEnsemble?.caseUuid === + elm.referenceEnsemble?.caseUuid && + e.referenceEnsemble?.ensembleName === + elm.referenceEnsemble?.ensembleName + ).length > 1; + return ( + + + + + + + + ); + })} + +
ColorCustom nameCompare EnsembleReference EnsembleActions
+ + handleDeltaEnsembleColorChange(elm.uuid, value) + } + /> + + ) => + handleDeltaEnsembleCustomNameChange( + elm.uuid, + e.target.value + ) + } + /> + + { + return { + value: createCaseUuidAndEnsembleNameString( + elm.caseUuid, + elm.ensembleName + ), + label: + elm.customName ?? + `${elm.ensembleName} (${elm.caseName})`, + }; + })} + value={ + elm.compareEnsemble + ? createCaseUuidAndEnsembleNameString( + elm.compareEnsemble.caseUuid, + elm.compareEnsemble.ensembleName + ) + : undefined + } + onChange={(newCaseUuidAndEnsembleNameString) => { + handleDeltaEnsembleCompareEnsembleChange( + elm.uuid, + newCaseUuidAndEnsembleNameString + ); + }} + /> + + { + return { + value: createCaseUuidAndEnsembleNameString( + elm.caseUuid, + elm.ensembleName + ), + label: + elm.customName ?? + `${elm.ensembleName} (${elm.caseName})`, + }; + })} + value={ + elm.referenceEnsemble + ? createCaseUuidAndEnsembleNameString( + elm.referenceEnsemble.caseUuid, + elm.referenceEnsemble.ensembleName + ) + : undefined + } + onChange={(value) => { + handleDeltaEnsembleReferenceEnsembleChange( + elm.uuid, + value + ); + }} + /> + + handleRemoveDeltaEnsemble(elm.uuid)} + color="danger" + title="Remove delta ensemble from selection" + > + + {" "} +
+
+ {deltaEnsembles.length === 0 && ( +
No delta ensembles created.
+ )}
- {newlySelectedEnsembles.length === 0 &&
No ensembles selected.
} {isLoadingEnsembles && }