Skip to content

Commit

Permalink
[Search] Fix autogenerated connector names (elastic#197585)
Browse files Browse the repository at this point in the history
Improve the autogenerated connector names by

- Re-generating names when changing connector source
- Preventing editing of names after connector is created

(cherry picked from commit c05e1c5)
  • Loading branch information
navarone-feekery committed Oct 25, 2024
1 parent 670b108 commit 53e3a43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const StartStep: React.FC<StartStepProps> = ({
name="first"
value={rawName}
onChange={handleNameChange}
disabled={!!connector}
onBlur={() => {
if (selectedConnector) {
generateConnectorName({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ export const NewConnectorLogic = kea<MakeLogicType<NewConnectorValues, NewConnec
}
},
connectorNameGenerated: ({ connectorName }) => {
if (!values.rawName) {
actions.setRawName(connectorName);
}
actions.setRawName(connectorName);
},
createConnector: ({
isSelfManaged,
Expand Down Expand Up @@ -191,7 +189,6 @@ export const NewConnectorLogic = kea<MakeLogicType<NewConnectorValues, NewConnec
setSelectedConnector: ({ connector }) => {
if (connector) {
actions.generateConnectorName({
connectorName: values.rawName,
connectorType: connector.serviceType,
});
}
Expand Down

0 comments on commit 53e3a43

Please sign in to comment.