Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion ui/src/components/header/DomainDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,23 @@ class DomainDetails extends React.Component {
);
}

getCurrentContacts() {
// Start with existing contacts to preserve any other contact types
const currentContacts = {
...(this.props.domainDetails.contacts || {}),
};

// Update with current local state values
if (this.state.poc && this.state.poc !== 'add') {
currentContacts['product-owner'] = this.state.poc;
}
if (this.state.securityPoc && this.state.securityPoc !== 'add') {
currentContacts['security-owner'] = this.state.securityPoc;
}

return currentContacts;
}

onEnvironmentUpdateSuccessCb(environmentName) {
this.setState({
showEnvironment: false,
Expand Down Expand Up @@ -420,7 +437,7 @@ class DomainDetails extends React.Component {
contactType={contactType}
onPocUpdateSuccessCb={this.onPocUpdateSuccessCb.bind(this)}
csrf={this.props._csrf}
contacts={this.props.domainDetails.contacts || {}}
contacts={this.getCurrentContacts()}
api={this.api}
/>
) : (
Expand Down
Loading