-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-14098 JIRA Review configuration in JSON, XML and YAML #401
added contentType to convertConfigFormat, so that we can convert from any format instead of using json added contentType state to help conersion from any config type added feature to review configuration in JSON XML and YAML format Toggle Radios for JSON XML and YAML configurations added contentType for format conversion api call
- Loading branch information
Himanshu Verma
committed
Oct 8, 2023
1 parent
5dc4e2d
commit 5864cc3
Showing
8 changed files
with
406 additions
and
308 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { useState } from 'react'; | ||
import { FormGroup, Radio } from '@patternfly/react-core'; | ||
import { ConfigDownloadType } from '@services/infinispanRefData'; | ||
import { useTranslation } from 'react-i18next'; | ||
const LanguageToggleRadios = (props: { | ||
language: ConfigDownloadType; | ||
setLanguage: (ConfigDownloadType) => void; | ||
setContentType: (string) => void; | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<FormGroup hasNoPaddingTop isInline label="Code language" fieldId="code-language-radio-field"> | ||
<Radio | ||
name="language-radio" | ||
id="JSON" | ||
onChange={() => { | ||
props.setLanguage(ConfigDownloadType.JSON); | ||
props.setContentType(ConfigDownloadType.JSON.toLowerCase()); | ||
}} | ||
isChecked={(props.language as ConfigDownloadType) == ConfigDownloadType.JSON} | ||
label={t('caches.create.review.json')} | ||
/> | ||
<Radio | ||
name="language-radio" | ||
id="XML" | ||
onChange={() => { | ||
props.setLanguage(ConfigDownloadType.XML); | ||
props.setContentType(ConfigDownloadType.XML.toLowerCase()); | ||
}} | ||
isChecked={(props.language as ConfigDownloadType) == ConfigDownloadType.XML} | ||
label={t('caches.create.review.xml')} | ||
/> | ||
<Radio | ||
name="language-radio" | ||
id="YAML" | ||
onChange={() => { | ||
props.setLanguage(ConfigDownloadType.YAML); | ||
props.setContentType(ConfigDownloadType.YAML.toLowerCase()); | ||
}} | ||
isChecked={(props.language as ConfigDownloadType) == ConfigDownloadType.YAML} | ||
label={t('caches.create.review.yaml')} | ||
/> | ||
</FormGroup> | ||
); | ||
}; | ||
|
||
export default LanguageToggleRadios; |
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
Oops, something went wrong.