Xetera 4 лет назад
Родитель
Сommit
453fc56ee9

+ 3 - 2
dashboard/src/components/values-form/KeyValueArray.tsx

@@ -155,8 +155,9 @@ export default class KeyValueArray extends Component<PropsType, StateType> {
             clusterId={this.props.externalValues?.clusterId}
             clusterId={this.props.externalValues?.clusterId}
             closeModal={() => this.setState({ showEnvModal: false })}
             closeModal={() => this.setState({ showEnvModal: false })}
             setValues={(values) => {
             setValues={(values) => {
-              this.props.setValues(values);
-              this.setState({ values: this.objectToValues(values) });
+              const newValues = { ...this.props.values, ...values };
+              this.props.setValues(newValues);
+              this.setState({ values: this.objectToValues(newValues) });
             }}
             }}
           />
           />
         </Modal>
         </Modal>

+ 11 - 6
dashboard/src/main/home/modals/LoadEnvGroupModal.tsx

@@ -100,8 +100,8 @@ export default class LoadEnvGroupModal extends Component<PropsType, StateType> {
   };
   };
 
 
   potentiallyOverriddenKeys(incoming: Record<string, string>): KeyValue[] {
   potentiallyOverriddenKeys(incoming: Record<string, string>): KeyValue[] {
-    return Object.entries(this.props.existingValues)
-      .filter(([key]) => incoming[key])
+    return Object.entries(incoming)
+      .filter(([key]) => this.props.existingValues[key])
       .map(([key, value]) => ({ key, value }));
       .map(([key, value]) => ({ key, value }));
   }
   }
 
 
@@ -128,11 +128,11 @@ export default class LoadEnvGroupModal extends Component<PropsType, StateType> {
             </ClashingKeyTitle>
             </ClashingKeyTitle>
             <ClashingKeyDefinitions>
             <ClashingKeyDefinitions>
               <ClashingKeyLabel>Defined as</ClashingKeyLabel>
               <ClashingKeyLabel>Defined as</ClashingKeyLabel>
-              <ClashingKeyLabel>
-                {this.state.selectedEnvGroup.data[key] || emptyValue}
-              </ClashingKeyLabel>
+              <ClashingKeyValue>
+                {this.props.existingValues[key] || emptyValue}
+              </ClashingKeyValue>
               <ClashingKeyLabel>Replaced by</ClashingKeyLabel>
               <ClashingKeyLabel>Replaced by</ClashingKeyLabel>
-              <ClashingKeyLabel>{value || emptyValue}</ClashingKeyLabel>
+              <ClashingKeyValue>{value || emptyValue}</ClashingKeyValue>
             </ClashingKeyDefinitions>
             </ClashingKeyDefinitions>
             {i !== clashingKeys.length - 1 && <ClashingKeyRowDivider />}
             {i !== clashingKeys.length - 1 && <ClashingKeyRowDivider />}
           </ClashingKeyRow>
           </ClashingKeyRow>
@@ -287,6 +287,11 @@ const ClashingKeyLabel = styled.p`
   white-space: nowrap;
   white-space: nowrap;
 `;
 `;
 
 
+const ClashingKeyValue = styled.p`
+  margin: 0px;
+  word-break: break-word;
+`;
+
 const EnvGroupList = styled.div`
 const EnvGroupList = styled.div`
   width: 100%;
   width: 100%;
   border-radius: 3px;
   border-radius: 3px;