Skip to content

Commit 67b0f12

Browse files
ref(automations): Hide plugin action type from action picker (#117479)
1 parent 4250651 commit 67b0f12

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

static/app/views/automations/components/actionNodeList.spec.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,35 @@ describe('ActionNodeList', () => {
103103
expect(screen.getByRole('menuitemradio', {name: 'Jira'})).toBeInTheDocument();
104104
});
105105

106+
it('does not show plugin actions in the dropdown', async () => {
107+
MockApiClient.addMockResponse({
108+
url: `/organizations/${organization.slug}/available-actions/`,
109+
body: [
110+
...actionHandlers,
111+
ActionHandlerFixture({
112+
type: ActionType.PLUGIN,
113+
handlerGroup: ActionGroup.OTHER,
114+
integrations: undefined,
115+
}),
116+
],
117+
});
118+
119+
render(
120+
<AutomationBuilderErrorContext.Provider value={defaultErrorContextProps}>
121+
<ActionNodeList {...defaultProps} />
122+
</AutomationBuilderErrorContext.Provider>,
123+
{
124+
organization,
125+
}
126+
);
127+
await userEvent.click(screen.getByRole('textbox', {name: 'Add action'}));
128+
129+
expect(screen.getAllByRole('menuitemradio')).toHaveLength(5);
130+
expect(
131+
screen.queryByRole('menuitemradio', {name: 'Legacy integrations'})
132+
).not.toBeInTheDocument();
133+
});
134+
106135
it('adds actions', async () => {
107136
render(
108137
<AutomationBuilderErrorContext.Provider value={defaultErrorContextProps}>

static/app/views/automations/components/actionNodeList.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export function ActionNodeList({
7979
const otherActions: Option[] = [];
8080

8181
availableActions.forEach(action => {
82+
if (action.type === ActionType.PLUGIN) {
83+
return;
84+
}
8285
const label =
8386
actionNodesMap.get(action.type)?.label || action.sentryApp?.name || action.type;
8487
const newAction = {

static/app/views/automations/new.spec.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,10 @@ describe('AutomationNewSettings', () => {
390390
await addAction('Jira');
391391
await addAction('Jira Server');
392392
await addAction('Azure DevOps');
393-
await addAction('Legacy integrations');
394393

395394
await userEvent.click(screen.getByRole('button', {name: 'Create Alert'}));
396395

397-
const EXPECTED_ACTION_PAYLOADS: Record<ActionType, any> = {
396+
const EXPECTED_ACTION_PAYLOADS: Partial<Record<ActionType, any>> = {
398397
slack: {
399398
type: 'slack',
400399
integrationId: 'slack-1',
@@ -512,14 +511,6 @@ describe('AutomationNewSettings', () => {
512511
targetDisplay: null,
513512
},
514513
},
515-
plugin: {
516-
type: 'plugin',
517-
config: {
518-
targetType: null,
519-
targetIdentifier: '',
520-
targetDisplay: null,
521-
},
522-
},
523514
slack_staging: {
524515
type: 'slack_staging',
525516
integrationId: 'slack-staging-1',

0 commit comments

Comments
 (0)