|
16 | 16 | * |
17 | 17 | */ |
18 | 18 |
|
19 | | -import React, { useState, useMemo } from 'react'; |
| 19 | +import { useState, useMemo } from 'react'; |
20 | 20 | import { Button, Intent } from '@blueprintjs/core'; |
21 | 21 |
|
22 | | -import { NoData } from '@/components'; |
| 22 | +import { Alert, NoData } from '@/components'; |
23 | 23 | import type { WebhookItemType } from '@/plugins/register/webook'; |
24 | 24 | import { WebhookCreateDialog, WebhookSelectorDialog, WebHookConnection } from '@/plugins/register/webook'; |
25 | 25 |
|
@@ -56,31 +56,44 @@ export const IncomingWebhooksPanel = ({ |
56 | 56 | setType(undefined); |
57 | 57 | }; |
58 | 58 |
|
59 | | - if (!webhookIds.length) { |
60 | | - return ( |
61 | | - <> |
62 | | - <NoData |
63 | | - text="Push `incidents` or `deployments` from your tools by incoming webhooks." |
64 | | - action={ |
65 | | - <> |
66 | | - <Button intent={Intent.PRIMARY} icon="plus" text="Add a Webhook" onClick={() => setType('create')} /> |
67 | | - <div style={{ margin: '8px 0' }}>or</div> |
68 | | - <Button |
69 | | - outlined |
70 | | - intent={Intent.PRIMARY} |
71 | | - text="Select Existing Webhooks" |
72 | | - onClick={() => setType('selectExist')} |
73 | | - /> |
74 | | - </> |
75 | | - } |
76 | | - /> |
77 | | - {type === 'create' && <WebhookCreateDialog isOpen onCancel={handleCancel} onSubmitAfter={onCreateWebhook} />} |
78 | | - {type === 'selectExist' && ( |
79 | | - <WebhookSelectorDialog isOpen saving={saving} onCancel={handleCancel} onSubmit={onSelectWebhook} /> |
80 | | - )} |
81 | | - </> |
82 | | - ); |
83 | | - } |
84 | | - |
85 | | - return <WebHookConnection filterIds={webhookIds} onCreateAfter={onCreateWebhook} onDeleteAfter={onDeleteWebhook} />; |
| 59 | + return ( |
| 60 | + <> |
| 61 | + <Alert style={{ marginBottom: 24, color: '#3C5088' }}> |
| 62 | + <div> |
| 63 | + The data pushed by Webhooks will only be calculated for DORA in the next run of the Blueprint of this project |
| 64 | + because DORA relies on the post-processing of "deployments," "incidents," and "pull requests" triggered by |
| 65 | + running the blueprint. |
| 66 | + </div> |
| 67 | + <div style={{ marginTop: 16 }}> |
| 68 | + To calculate DORA after receiving Webhook data immediately, you can visit the{' '} |
| 69 | + <b style={{ textDecoration: 'underline' }}>Status tab</b> of the Blueprint page and click on Run Now. |
| 70 | + </div> |
| 71 | + </Alert> |
| 72 | + {!webhookIds.length ? ( |
| 73 | + <> |
| 74 | + <NoData |
| 75 | + text="Push `incidents` or `deployments` from your tools by incoming webhooks." |
| 76 | + action={ |
| 77 | + <> |
| 78 | + <Button intent={Intent.PRIMARY} icon="plus" text="Add a Webhook" onClick={() => setType('create')} /> |
| 79 | + <div style={{ margin: '8px 0' }}>or</div> |
| 80 | + <Button |
| 81 | + outlined |
| 82 | + intent={Intent.PRIMARY} |
| 83 | + text="Select Existing Webhooks" |
| 84 | + onClick={() => setType('selectExist')} |
| 85 | + /> |
| 86 | + </> |
| 87 | + } |
| 88 | + /> |
| 89 | + {type === 'create' && <WebhookCreateDialog isOpen onCancel={handleCancel} onSubmitAfter={onCreateWebhook} />} |
| 90 | + {type === 'selectExist' && ( |
| 91 | + <WebhookSelectorDialog isOpen saving={saving} onCancel={handleCancel} onSubmit={onSelectWebhook} /> |
| 92 | + )} |
| 93 | + </> |
| 94 | + ) : ( |
| 95 | + <WebHookConnection filterIds={webhookIds} onCreateAfter={onCreateWebhook} onDeleteAfter={onDeleteWebhook} /> |
| 96 | + )} |
| 97 | + </> |
| 98 | + ); |
86 | 99 | }; |
0 commit comments