Fix: #3305 and added webhook icon (#3345)

This commit is contained in:
darth-coder00 2022-03-10 11:50:43 +05:30 committed by GitHub
parent cff4ea2dfd
commit e03b16f023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 147 additions and 8 deletions

View File

@ -0,0 +1,38 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#6B7280" stroke="none">
<path d="M2469 4514 c-231 -41 -452 -178 -596 -368 -63 -83 -137 -242 -165
-351 -31 -125 -31 -353 0 -467 47 -174 127 -323 239 -447 l49 -54 -242 -396
-243 -396 -78 -1 c-97 -1 -167 -23 -234 -74 -202 -152 -223 -437 -45 -616 234
-233 616 -110 677 218 14 78 3 150 -36 235 -19 43 -22 59 -14 74 6 11 152 250
325 531 173 281 314 511 314 513 0 1 -33 22 -72 46 -87 51 -200 162 -247 242
-78 132 -111 289 -91 435 21 155 73 265 179 375 229 238 584 260 858 53 116
-88 214 -241 249 -391 26 -112 16 -277 -24 -382 l-30 -83 56 -33 c128 -77 204
-119 208 -115 13 13 67 149 84 210 65 241 42 477 -70 703 -195 396 -625 617
-1051 539z"/>
<path d="M2540 3946 c-114 -31 -229 -125 -271 -223 -109 -252 62 -539 332
-560 l74 -6 270 -499 c149 -275 273 -504 276 -509 3 -6 46 11 100 40 187 99
367 114 561 47 100 -35 171 -81 254 -163 159 -157 224 -385 172 -603 -39 -168
-180 -341 -338 -419 -113 -55 -194 -74 -310 -74 -216 1 -410 92 -539 254 l-45
56 -120 -70 c-67 -38 -125 -73 -130 -78 -11 -10 9 -42 82 -132 113 -140 295
-257 487 -313 112 -32 312 -44 432 -24 530 85 899 592 808 1111 -28 164 -85
295 -185 427 -132 176 -321 300 -545 358 -158 41 -355 37 -530 -11 -17 -4 -45
41 -220 367 l-201 373 34 55 c48 81 66 150 59 236 -18 244 -273 424 -507 360z"/>
<path d="M1277 2594 c-207 -37 -386 -133 -533 -285 -384 -398 -372 -1032 27
-1402 138 -129 324 -219 509 -248 104 -16 285 -7 390 21 209 54 410 186 536
353 63 84 149 264 172 362 l19 80 435 3 435 2 19 -42 c10 -24 41 -67 69 -97
192 -205 525 -151 652 107 36 73 38 80 38 176 0 93 -3 107 -32 168 -122 258
-456 312 -649 106 -27 -29 -56 -64 -65 -78 l-16 -25 -594 -5 -594 -5 -6 -145
c-5 -113 -11 -158 -27 -204 -38 -103 -93 -188 -172 -267 -63 -63 -94 -85 -171
-122 -122 -58 -181 -72 -309 -71 -87 1 -119 6 -185 28 -199 68 -346 216 -408
411 -18 59 -22 93 -22 210 0 126 3 147 27 213 40 110 84 178 174 269 67 67 98
89 175 127 60 29 120 50 167 58 l72 12 0 122 c0 67 -3 136 -6 153 -7 36 -10
36 -127 15z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,38 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#7147E8" stroke="none">
<path d="M2469 4514 c-231 -41 -452 -178 -596 -368 -63 -83 -137 -242 -165
-351 -31 -125 -31 -353 0 -467 47 -174 127 -323 239 -447 l49 -54 -242 -396
-243 -396 -78 -1 c-97 -1 -167 -23 -234 -74 -202 -152 -223 -437 -45 -616 234
-233 616 -110 677 218 14 78 3 150 -36 235 -19 43 -22 59 -14 74 6 11 152 250
325 531 173 281 314 511 314 513 0 1 -33 22 -72 46 -87 51 -200 162 -247 242
-78 132 -111 289 -91 435 21 155 73 265 179 375 229 238 584 260 858 53 116
-88 214 -241 249 -391 26 -112 16 -277 -24 -382 l-30 -83 56 -33 c128 -77 204
-119 208 -115 13 13 67 149 84 210 65 241 42 477 -70 703 -195 396 -625 617
-1051 539z"/>
<path d="M2540 3946 c-114 -31 -229 -125 -271 -223 -109 -252 62 -539 332
-560 l74 -6 270 -499 c149 -275 273 -504 276 -509 3 -6 46 11 100 40 187 99
367 114 561 47 100 -35 171 -81 254 -163 159 -157 224 -385 172 -603 -39 -168
-180 -341 -338 -419 -113 -55 -194 -74 -310 -74 -216 1 -410 92 -539 254 l-45
56 -120 -70 c-67 -38 -125 -73 -130 -78 -11 -10 9 -42 82 -132 113 -140 295
-257 487 -313 112 -32 312 -44 432 -24 530 85 899 592 808 1111 -28 164 -85
295 -185 427 -132 176 -321 300 -545 358 -158 41 -355 37 -530 -11 -17 -4 -45
41 -220 367 l-201 373 34 55 c48 81 66 150 59 236 -18 244 -273 424 -507 360z"/>
<path d="M1277 2594 c-207 -37 -386 -133 -533 -285 -384 -398 -372 -1032 27
-1402 138 -129 324 -219 509 -248 104 -16 285 -7 390 21 209 54 410 186 536
353 63 84 149 264 172 362 l19 80 435 3 435 2 19 -42 c10 -24 41 -67 69 -97
192 -205 525 -151 652 107 36 73 38 80 38 176 0 93 -3 107 -32 168 -122 258
-456 312 -649 106 -27 -29 -56 -64 -65 -78 l-16 -25 -594 -5 -594 -5 -6 -145
c-5 -113 -11 -158 -27 -204 -38 -103 -93 -188 -172 -267 -63 -63 -94 -85 -171
-122 -122 -58 -181 -72 -309 -71 -87 1 -119 6 -185 28 -199 68 -346 216 -408
411 -18 59 -22 93 -22 210 0 126 3 147 27 213 40 110 84 178 174 269 67 67 98
89 175 127 60 29 120 50 167 58 l72 12 0 122 c0 67 -3 136 -6 153 -7 36 -10
36 -127 15z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,38 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#37352f" stroke="none">
<path d="M2469 4514 c-231 -41 -452 -178 -596 -368 -63 -83 -137 -242 -165
-351 -31 -125 -31 -353 0 -467 47 -174 127 -323 239 -447 l49 -54 -242 -396
-243 -396 -78 -1 c-97 -1 -167 -23 -234 -74 -202 -152 -223 -437 -45 -616 234
-233 616 -110 677 218 14 78 3 150 -36 235 -19 43 -22 59 -14 74 6 11 152 250
325 531 173 281 314 511 314 513 0 1 -33 22 -72 46 -87 51 -200 162 -247 242
-78 132 -111 289 -91 435 21 155 73 265 179 375 229 238 584 260 858 53 116
-88 214 -241 249 -391 26 -112 16 -277 -24 -382 l-30 -83 56 -33 c128 -77 204
-119 208 -115 13 13 67 149 84 210 65 241 42 477 -70 703 -195 396 -625 617
-1051 539z"/>
<path d="M2540 3946 c-114 -31 -229 -125 -271 -223 -109 -252 62 -539 332
-560 l74 -6 270 -499 c149 -275 273 -504 276 -509 3 -6 46 11 100 40 187 99
367 114 561 47 100 -35 171 -81 254 -163 159 -157 224 -385 172 -603 -39 -168
-180 -341 -338 -419 -113 -55 -194 -74 -310 -74 -216 1 -410 92 -539 254 l-45
56 -120 -70 c-67 -38 -125 -73 -130 -78 -11 -10 9 -42 82 -132 113 -140 295
-257 487 -313 112 -32 312 -44 432 -24 530 85 899 592 808 1111 -28 164 -85
295 -185 427 -132 176 -321 300 -545 358 -158 41 -355 37 -530 -11 -17 -4 -45
41 -220 367 l-201 373 34 55 c48 81 66 150 59 236 -18 244 -273 424 -507 360z"/>
<path d="M1277 2594 c-207 -37 -386 -133 -533 -285 -384 -398 -372 -1032 27
-1402 138 -129 324 -219 509 -248 104 -16 285 -7 390 21 209 54 410 186 536
353 63 84 149 264 172 362 l19 80 435 3 435 2 19 -42 c10 -24 41 -67 69 -97
192 -205 525 -151 652 107 36 73 38 80 38 176 0 93 -3 107 -32 168 -122 258
-456 312 -649 106 -27 -29 -56 -64 -65 -78 l-16 -25 -594 -5 -594 -5 -6 -145
c-5 -113 -11 -158 -27 -204 -38 -103 -93 -188 -172 -267 -63 -63 -94 -85 -171
-122 -122 -58 -181 -72 -309 -71 -87 1 -119 6 -185 28 -199 68 -346 216 -408
411 -18 59 -22 93 -22 210 0 126 3 147 27 213 40 110 84 178 174 269 67 67 98
89 175 127 60 29 120 50 167 58 l72 12 0 122 c0 67 -3 136 -6 153 -7 36 -10
36 -127 15z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -321,18 +321,23 @@ const AddWebhook: FunctionComponent<AddWebhookProps> = ({
};
const validateEventFilters = () => {
let isValid = false;
const isValid = [];
if (!isEmpty(createEvents)) {
isValid = Boolean(createEvents.entities?.length);
isValid.push(Boolean(createEvents.entities?.length));
}
if (!isEmpty(updateEvents)) {
isValid = Boolean(updateEvents.entities?.length);
isValid.push(Boolean(updateEvents.entities?.length));
}
if (!isEmpty(deleteEvents) && deleteEvents.entities?.length) {
isValid = Boolean(deleteEvents.entities?.length);
if (!isEmpty(deleteEvents)) {
isValid.push(Boolean(deleteEvents.entities?.length));
}
return isValid;
return (
isValid.length > 0 &&
isValid.reduce((prev, curr) => {
return prev && curr;
}, isValid[0])
);
};
const validateForm = () => {

View File

@ -14,6 +14,7 @@
import React, { FunctionComponent } from 'react';
import { Status } from '../../../generated/entity/events/webhook';
import { stringToHTML } from '../../../utils/StringsUtils';
import SVGIcons, { Icons } from '../../../utils/SvgUtils';
import WebhookDataCardBody from './WebhookDataCardBody';
type Props = {
@ -41,7 +42,8 @@ const WebhookDataCard: FunctionComponent<Props> = ({
data-testid="webhook-data-card">
<div>
<div className="tw-flex tw-items-center">
<h6 className="tw-flex tw-items-center tw-m-0 tw-heading">
<SVGIcons alt="webhook" icon={Icons.WEBHOOK} width="16" />
<h6 className="tw-flex tw-items-center tw-m-0 tw-heading tw-pl-1">
<button
className="tw-text-grey-body tw-font-medium"
data-testid="webhook-link"

View File

@ -33,7 +33,7 @@ const WebhookDataCardBody: FunctionComponent<Props> = ({
<span className="tw-flex tw-items-center">
<div
className={classNames(
'tw-w-3 tw-h-3 tw-rounded-full',
'tw-w-3 tw-h-3 tw-rounded-full tw-mx-0.5',
`tw-bg-${status}`
)}
/>

View File

@ -128,6 +128,9 @@ import IconVersionBlack from '../assets/svg/version-black.svg';
import IconVersionWhite from '../assets/svg/version-white.svg';
import IconVersion from '../assets/svg/version.svg';
import IconWarning from '../assets/svg/warning.svg';
import IconWebhookGrey from '../assets/svg/webhook-grey.svg';
import IconWebhookPrimary from '../assets/svg/webhook-primary.svg';
import IconWebhook from '../assets/svg/webhook.svg';
import IconWhatsNew from '../assets/svg/whatsNew.svg';
type Props = {
@ -255,6 +258,9 @@ export const Icons = {
PAPER_PLANE_PRIMARY: 'icon-paper-plane-primary',
COMMENT: 'icon-comment',
COMMENT_PLUS: 'icon-comment-plus',
WEBHOOK: 'icon-webhook',
WEBHOOK_GREY: 'icon-webhook-grey',
WEBHOOK_PRIMARY: 'icon-webhook-primary',
};
const SVGIcons: FunctionComponent<Props> = ({
@ -738,6 +744,18 @@ const SVGIcons: FunctionComponent<Props> = ({
case Icons.COMMENT_PLUS:
IconComponent = IconCommentPlus;
break;
case Icons.WEBHOOK:
IconComponent = IconWebhook;
break;
case Icons.WEBHOOK_GREY:
IconComponent = IconWebhookGrey;
break;
case Icons.WEBHOOK_PRIMARY:
IconComponent = IconWebhookPrimary;
break;
default: