Skip to content

Commit

Permalink
feat(webhooks): display f next to the responder name if it is confu…
Browse files Browse the repository at this point in the history
…gured with a script
  • Loading branch information
azasypkin committed Jan 7, 2024
1 parent bdb7b6c commit ecb3af7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { icon as EuiIconExpandMini } from '@elastic/eui/es/components/icon/asset
import { icon as EuiIconEyeClosed } from '@elastic/eui/es/components/icon/assets/eye_closed';
import { icon as EuiIconFullScreen } from '@elastic/eui/es/components/icon/assets/full_screen';
import { icon as EuiIconFullScreenExit } from '@elastic/eui/es/components/icon/assets/fullScreenExit';
import { icon as EuiIconFunction } from '@elastic/eui/es/components/icon/assets/function';
import { icon as EuiIconGear } from '@elastic/eui/es/components/icon/assets/gear';
import { icon as EuiIconGlobe } from '@elastic/eui/es/components/icon/assets/globe';
import { icon as EuiIconGrab } from '@elastic/eui/es/components/icon/assets/grab';
Expand Down Expand Up @@ -117,6 +118,7 @@ appendIconComponentCache({
expandMini: EuiIconExpandMini,
fullScreen: EuiIconFullScreen,
fullScreenExit: EuiIconFullScreenExit,
function: EuiIconFunction,
gear: EuiIconGear,
globe: EuiIconGlobe,
grab: EuiIconGrab,
Expand Down
15 changes: 15 additions & 0 deletions src/pages/workspace/utils/webhooks/responder_name.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { EuiIcon, EuiText } from '@elastic/eui';

import type { Responder } from './responder';

export function ResponderName({ responder }: { responder: Responder }) {
if (!responder.settings.script) {
return responder.name;
}

return (
<EuiText size="s">
{responder.name} {<EuiIcon type={'function'} size="s" title={'Responder generates responses dynamically'} />}
</EuiText>
);
}
3 changes: 2 additions & 1 deletion src/pages/workspace/utils/webhooks/responders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { unix } from 'moment';

import type { Responder } from './responder';
import { ResponderEditFlyout } from './responder_edit_flyout';
import { ResponderName } from './responder_name';
import { ResponderRequestsTable } from './responder_requests_table';
import { PageErrorState, PageLoadingState } from '../../../../components';
import { type AsyncData, getApiRequestConfig, getApiUrl, getErrorMessage } from '../../../../model';
Expand Down Expand Up @@ -236,7 +237,7 @@ export default function Responders() {
field: 'name',
sortable: true,
textOnly: true,
render: (_, responder: Responder) => responder.name,
render: (_, responder: Responder) => <ResponderName responder={responder} />,
},
{
name: 'Method',
Expand Down

0 comments on commit ecb3af7

Please sign in to comment.