Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit ecb3af7

Browse files
committed
feat(webhooks): display f next to the responder name if it is confugured with a script
1 parent bdb7b6c commit ecb3af7

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { icon as EuiIconExpandMini } from '@elastic/eui/es/components/icon/asset
3737
import { icon as EuiIconEyeClosed } from '@elastic/eui/es/components/icon/assets/eye_closed';
3838
import { icon as EuiIconFullScreen } from '@elastic/eui/es/components/icon/assets/full_screen';
3939
import { icon as EuiIconFullScreenExit } from '@elastic/eui/es/components/icon/assets/fullScreenExit';
40+
import { icon as EuiIconFunction } from '@elastic/eui/es/components/icon/assets/function';
4041
import { icon as EuiIconGear } from '@elastic/eui/es/components/icon/assets/gear';
4142
import { icon as EuiIconGlobe } from '@elastic/eui/es/components/icon/assets/globe';
4243
import { icon as EuiIconGrab } from '@elastic/eui/es/components/icon/assets/grab';
@@ -117,6 +118,7 @@ appendIconComponentCache({
117118
expandMini: EuiIconExpandMini,
118119
fullScreen: EuiIconFullScreen,
119120
fullScreenExit: EuiIconFullScreenExit,
121+
function: EuiIconFunction,
120122
gear: EuiIconGear,
121123
globe: EuiIconGlobe,
122124
grab: EuiIconGrab,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { EuiIcon, EuiText } from '@elastic/eui';
2+
3+
import type { Responder } from './responder';
4+
5+
export function ResponderName({ responder }: { responder: Responder }) {
6+
if (!responder.settings.script) {
7+
return responder.name;
8+
}
9+
10+
return (
11+
<EuiText size="s">
12+
{responder.name} {<EuiIcon type={'function'} size="s" title={'Responder generates responses dynamically'} />}
13+
</EuiText>
14+
);
15+
}

src/pages/workspace/utils/webhooks/responders.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { unix } from 'moment';
2323

2424
import type { Responder } from './responder';
2525
import { ResponderEditFlyout } from './responder_edit_flyout';
26+
import { ResponderName } from './responder_name';
2627
import { ResponderRequestsTable } from './responder_requests_table';
2728
import { PageErrorState, PageLoadingState } from '../../../../components';
2829
import { type AsyncData, getApiRequestConfig, getApiUrl, getErrorMessage } from '../../../../model';
@@ -236,7 +237,7 @@ export default function Responders() {
236237
field: 'name',
237238
sortable: true,
238239
textOnly: true,
239-
render: (_, responder: Responder) => responder.name,
240+
render: (_, responder: Responder) => <ResponderName responder={responder} />,
240241
},
241242
{
242243
name: 'Method',

0 commit comments

Comments
 (0)