This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git

commit 7d36c275b353b719a2b43c8874d0bececfbd3eb2
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Thu Jan 12 19:02:18 2023 -0500

    Apply latest fixes to karavan-space
---
 .../src/designer/route/property/DslPropertyField.tsx    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/karavan-space/src/designer/route/property/DslPropertyField.tsx 
b/karavan-space/src/designer/route/property/DslPropertyField.tsx
index a05575f..8b9b57a 100644
--- a/karavan-space/src/designer/route/property/DslPropertyField.tsx
+++ b/karavan-space/src/designer/route/property/DslPropertyField.tsx
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import React from 'react';
+import React, {ReactElement} from 'react';
 import {
     FormGroup,
     TextInput,
@@ -410,10 +410,17 @@ export class DslPropertyField extends 
React.Component<Props, State> {
         )
     }
 
-    getMediaTypeSelectOptions(filter?: string) {
-        return filter
-            ? MediaTypes.filter(mt => mt.includes(filter)).map((value: string) 
=> <SelectOption key={value} value={value.trim()}/>)
-            : MediaTypes.map((value: string) => <SelectOption key={value} 
value={value.trim()}/>);
+    getMediaTypeSelectOptions(filter?: string): JSX.Element [] {
+        const options: JSX.Element [] = [
+            <SelectOption key={0} value="Select Media Type" isPlaceholder />
+        ];
+        const mediaTypes: JSX.Element[] =  filter
+            ? MediaTypes.filter(mt => mt.includes(filter)).map((value: string) 
=>
+                <SelectOption key={value} value={value.trim()}/>)
+            : MediaTypes.map((value: string) =>
+                <SelectOption key={value} value={value.trim()}/>);
+        options.push(...mediaTypes);
+        return options;
     }
 
     getMediaTypeSelect = (property: PropertyMeta, value: any) => {

Reply via email to