mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 03:25:57 +00:00
fix(FilterBlocks): allow adding filter blocks in popup even without a… (#5502)
* fix(FilterBlocks): allow adding filter blocks in popup even without association fields * chore: make e2e more stable
This commit is contained in:
parent
f148536491
commit
4fcf7e3815
@ -32,7 +32,12 @@ test.describe('Input.Preview', () => {
|
|||||||
// 4. 切换图片大小到 Large,大小切换正常
|
// 4. 切换图片大小到 Large,大小切换正常
|
||||||
await page.getByLabel('block-item-CollectionField-').hover();
|
await page.getByLabel('block-item-CollectionField-').hover();
|
||||||
await page.getByLabel('designer-schema-settings-CollectionField-fieldSettings:FormItem-general-general').hover();
|
await page.getByLabel('designer-schema-settings-CollectionField-fieldSettings:FormItem-general-general').hover();
|
||||||
await page.getByRole('menuitem', { name: 'Size Small' }).click();
|
await page.getByRole('menuitem', { name: 'Size Small' }).click({
|
||||||
|
position: {
|
||||||
|
x: 160,
|
||||||
|
y: 10,
|
||||||
|
},
|
||||||
|
});
|
||||||
await page.getByRole('option', { name: 'Large' }).click();
|
await page.getByRole('option', { name: 'Large' }).click();
|
||||||
await expect(page.getByLabel('block-item-CollectionField-').getByRole('img').first()).toHaveJSProperty('width', 72);
|
await expect(page.getByLabel('block-item-CollectionField-').getByRole('img').first()).toHaveJSProperty('width', 72);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Schema } from '@formily/react';
|
import { Schema } from '@formily/react';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback } from 'react';
|
||||||
import {
|
import {
|
||||||
useActionAvailable,
|
useActionAvailable,
|
||||||
useCollection,
|
useCollection,
|
||||||
@ -283,16 +283,6 @@ const commonOptions = {
|
|||||||
name: 'filterBlocks',
|
name: 'filterBlocks',
|
||||||
title: '{{t("Filter blocks")}}',
|
title: '{{t("Filter blocks")}}',
|
||||||
type: 'itemGroup',
|
type: 'itemGroup',
|
||||||
useVisible() {
|
|
||||||
const collection = useCollection();
|
|
||||||
return useMemo(
|
|
||||||
() =>
|
|
||||||
collection.fields.some(
|
|
||||||
(field) => canMakeAssociationBlock(field) && ['hasMany', 'belongsToMany'].includes(field.type),
|
|
||||||
),
|
|
||||||
[collection.fields],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'filterForm',
|
name: 'filterForm',
|
||||||
|
Loading…
Reference in New Issue
Block a user