-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cdevents-notification): CDEvents notification to produce CDEvents (
#9997) * feat(cdevents-notification): CDEvents notification to produce CDEvents * fix: linter issue Sort the import statements * fix: cdevents files formatting * adding validations for URL and cdevents type * fix prettier formatting issue * update regex for URL validation * review comments on placeholder/regex configurable * lint issue with order import * lint issue Prettier
- Loading branch information
Showing
9 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/core/src/notification/selector/types/cdevents/CDEventsNotificationType.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
|
||
import type { INotificationTypeCustomConfig } from '../../../../domain'; | ||
import { FormikFormField, TextInput, Validators } from '../../../../presentation'; | ||
|
||
export class CDEventsNotificationType extends React.Component<INotificationTypeCustomConfig> { | ||
public render() { | ||
const { fieldName } = this.props; | ||
return ( | ||
<> | ||
<FormikFormField | ||
label="Events Broker URL" | ||
name={fieldName ? `${fieldName}.address` : 'address'} | ||
validate={Validators.skipIfSpel(Validators.urlValue('Please enter a valid URL'))} | ||
input={(props) => ( | ||
<TextInput | ||
inputClassName={'form-control input-sm'} | ||
{...props} | ||
placeholder="Enter an events message broker URL" | ||
/> | ||
)} | ||
required={true} | ||
/> | ||
<FormikFormField | ||
label="CDEvents Type" | ||
name={fieldName ? `${fieldName}.cdEventsType` : 'cdEventsType'} | ||
validate={Validators.skipIfSpel(Validators.cdeventsTypeValue('Please enter a valid CDEvents Type'))} | ||
input={(props) => ( | ||
<TextInput inputClassName={'form-control input-sm'} {...props} placeholder="Enter a CDEvents type" /> | ||
)} | ||
required={true} | ||
/> | ||
</> | ||
); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/core/src/notification/selector/types/cdevents/cdevents.notification.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { CDEventsNotificationType } from './CDEventsNotificationType'; | ||
import type { INotificationTypeConfig } from '../../../../domain'; | ||
|
||
export const cdEventsNotification: INotificationTypeConfig = { | ||
component: CDEventsNotificationType, | ||
key: 'cdevents', | ||
label: 'CDEvents', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters