Skip to content

Commit

Permalink
ISPN-15257 Fixes initial values from string to String when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed Oct 23, 2023
1 parent e4e0b1a commit 212a881
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion src/app/Caches/Entries/CacheEntries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,30 @@ const CacheEntries = (props: { cacheName: string }) => {
});

useEffect(() => {
if (cacheEntries) setFilteredEntries(cacheEntries);
if (cache.encoding.key == EncodingType.Protobuf) {
setSelectSearchOption(ContentType.string);
setKeyContentTypeToEdit(ContentType.string);
} else if (cache.encoding.key == EncodingType.Java ||
cache.encoding.key == EncodingType.JBoss ||
cache.encoding.key == EncodingType.JavaSerialized) {
setSelectSearchOption(ContentType.StringContentType);
setKeyContentTypeToEdit(ContentType.StringContentType);
} else if (cache.encoding.key == EncodingType.XML){
setSelectSearchOption(ContentType.XML);
setKeyContentTypeToEdit(ContentType.XML);
} else if (cache.encoding.key == EncodingType.JSON) {
setSelectSearchOption(ContentType.JSON);
setSelectSearchOption(ContentType.JSON);
} else if (cache.encoding.key == EncodingType.Text) {
setSelectSearchOption(ContentType.StringContentType);
setSelectSearchOption(ContentType.StringContentType);
}
}, [cache]);

useEffect(() => {
if (cacheEntries) {
setFilteredEntries(cacheEntries);
}
}, [loadingEntries, errorEntries, cacheEntries]);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/Caches/Entries/CreateOrUpdateEntryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ const CreateOrUpdateEntryForm = (props: {
aria-describedby="key-entry-helper"
onChange={(_event, key) => onChangeKey(key)}
onBlur={onBlurKey}
disabled={isEdition}
isDisabled={isEdition}
/>
<FormHelperText>
<HelperText>
Expand Down

0 comments on commit 212a881

Please sign in to comment.