diff --git a/app/scripts/modules/core/src/artifact/react/ArtifactEditor.tsx b/app/scripts/modules/core/src/artifact/react/ArtifactEditor.tsx index 18cac462b67..6699721db94 100644 --- a/app/scripts/modules/core/src/artifact/react/ArtifactEditor.tsx +++ b/app/scripts/modules/core/src/artifact/react/ArtifactEditor.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { cloneDeep } from 'lodash'; +import { cloneDeep, head } from 'lodash'; import { IArtifactAccount } from 'core/account'; import { ArtifactAccountSelector } from 'core/artifact'; import { IArtifact, IPipeline } from 'core/domain'; @@ -35,7 +35,9 @@ export class ArtifactEditor extends React.Component { private defaultArtifactAccountIfNecessary(): void { const { artifact, artifactAccounts } = this.props; if (!artifact.artifactAccount && artifactAccounts.length > 0) { - this.onArtifactAccountChanged(artifactAccounts[0]); + this.onArtifactAccountChanged( + head(artifactAccounts.filter(a => a.types.includes(artifact.type))) || head(artifactAccounts), + ); } } diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/ExpectedArtifact.tsx b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/ExpectedArtifact.tsx index 6afbbb66984..6ae0fe260c4 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/ExpectedArtifact.tsx +++ b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/ExpectedArtifact.tsx @@ -44,14 +44,14 @@ export function ExpectedArtifact(props: IExpectedArtifactProps) { Match against -
+