mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
allow query preview when query editor is closed
This commit is contained in:
@@ -62,10 +62,6 @@ const PlaylistQueryEditor = ({
|
||||
const { t } = useTranslation();
|
||||
|
||||
const openPreviewModal = useCallback(() => {
|
||||
if (!isQueryBuilderExpanded) {
|
||||
return;
|
||||
}
|
||||
|
||||
const filters = queryBuilderRef.current?.getFilters();
|
||||
|
||||
if (!filters) {
|
||||
@@ -86,7 +82,7 @@ const PlaylistQueryEditor = ({
|
||||
size: 'xl',
|
||||
title: t('common.preview', { postProcess: 'titleCase' }),
|
||||
});
|
||||
}, [isQueryBuilderExpanded, queryBuilderRef, t]);
|
||||
}, [queryBuilderRef, t]);
|
||||
|
||||
const openSaveAndReplaceModal = useCallback(() => {
|
||||
if (!isQueryBuilderExpanded) {
|
||||
@@ -170,7 +166,8 @@ const PlaylistQueryEditor = ({
|
||||
/>
|
||||
}
|
||||
onClick={onToggleExpand}
|
||||
size="compact-md"
|
||||
size="sm"
|
||||
variant="subtle"
|
||||
>
|
||||
{t('form.queryEditor.title', {
|
||||
postProcess: 'titleCase',
|
||||
|
||||
@@ -9,7 +9,7 @@ interface JsonPreviewProps {
|
||||
export const JsonPreview = ({ value }: JsonPreviewProps) => {
|
||||
return (
|
||||
<Code block className={styles.preview} lang="json" p="md">
|
||||
{JSON.stringify(value, null, 4)}
|
||||
{JSON.stringify(value, null, 2)}
|
||||
</Code>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user