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