diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Modals/AddServiceModal/AddServiceModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Modals/AddServiceModal/AddServiceModal.tsx index 0233297092a..9e749e58101 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Modals/AddServiceModal/AddServiceModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Modals/AddServiceModal/AddServiceModal.tsx @@ -24,6 +24,7 @@ import { import { DatabaseService } from '../../../generated/entity/services/databaseService'; import { MessagingService } from '../../../generated/entity/services/messagingService'; import { PipelineService } from '../../../generated/entity/services/pipelineService'; +import { errorMsg } from '../../../utils/CommonUtils'; // import { fromISOString } from '../../../utils/ServiceUtils'; import { Button } from '../../buttons/Button/Button'; import MarkdownWithPreview from '../../common/editor/MarkdownWithPreview'; @@ -161,14 +162,6 @@ const seprateUrl = (url?: string) => { return {}; }; -const errorMsg = (value: string) => { - return ( -
- {value} -
- ); -}; - export const AddServiceModal: FunctionComponent = ({ header, serviceName, @@ -338,7 +331,7 @@ export const AddServiceModal: FunctionComponent = ({ const handleSave = () => { let setMsg: ErrorMsg = { selectService: !selectService, - name: !name, + name: !name.trim(), }; switch (serviceName) { case ServiceCategory.DATABASE_SERVICES: diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Modals/FormModal/index.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Modals/FormModal/index.tsx index 05892f570b2..39583bc436f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Modals/FormModal/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Modals/FormModal/index.tsx @@ -11,27 +11,31 @@ * limitations under the License. */ -import { Team } from 'Models'; +import { FormErrorData, Team } from 'Models'; import React, { useRef, useState } from 'react'; import { TagsCategory } from '../../../pages/tags/tagsTypes'; import { Button } from '../../buttons/Button/Button'; type FormData = TagsCategory | Team; type FormModalProp = { onCancel: () => void; - onSave: (data: TagsCategory) => void; + onChange?: (data: TagsCategory | Team) => void; + onSave: (data: TagsCategory | Team) => void; form: React.ElementType; header: string; initialData: FormData; + errorData?: FormErrorData; }; type FormRef = { fetchMarkDownData: () => string; }; const FormModal = ({ onCancel, + onChange, onSave, form: Form, header, initialData, + errorData, }: FormModalProp) => { const formRef = useRef(); const [data, setData] = useState(initialData); @@ -57,7 +61,15 @@ const FormModal = ({

-
+ { + setData(data); + onChange && onChange(data); + }} + />