@nocobase/client-v2 2.1.22 → 2.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,11 +135,15 @@ describe('linkageRulesRefresh action', () => {
135
135
  expect(handler).toHaveBeenCalledWith(ctx, { value: ['master-mounted'] });
136
136
  });
137
137
 
138
- it('runs linkage action on master model when forks exist in design mode', async () => {
138
+ it('skips master model when forks can handle flow in design mode', async () => {
139
139
  const handler = vi.fn(async () => {});
140
140
  const model: any = {
141
141
  isFork: false,
142
- forks: new Set([{}]),
142
+ forks: new Set([
143
+ {
144
+ getFlow: vi.fn(() => ({})),
145
+ },
146
+ ]),
143
147
  getFlow: vi.fn(() => ({})),
144
148
  getStepParams: vi.fn(() => ({ value: ['master'] })),
145
149
  context: {
@@ -157,7 +161,7 @@ describe('linkageRulesRefresh action', () => {
157
161
  flowKey: 'buttonSettings',
158
162
  });
159
163
 
160
- expect(handler).toHaveBeenCalledWith(ctx, { value: ['master'] });
164
+ expect(handler).not.toHaveBeenCalled();
161
165
  });
162
166
 
163
167
  it('runs linkage action on fork model and resolves params', async () => {
@@ -35,12 +35,8 @@ export const linkageRulesRefresh = defineAction({
35
35
  // Prefer running on the current model; fallback to blockModel when the current model doesn't own the flow.
36
36
  if (!hasFlow) return;
37
37
 
38
- // In runtime, only skip master when there are mounted forks that can handle the same flow.
38
+ // Skip master when unmounted forks can handle the same flow.
39
39
  // Otherwise master is likely the rendered model and still needs refresh.
40
- // In design mode, always refresh master so the currently edited model state stays in sync.
41
- const flowSettingsEnabled = Boolean(
42
- (ctx as any)?.flowSettingsEnabled || (model as any)?.context?.flowSettingsEnabled,
43
- );
44
40
  const hasForkWithFlow =
45
41
  !model?.isFork &&
46
42
  !!model?.forks?.size &&
@@ -49,7 +45,7 @@ export const linkageRulesRefresh = defineAction({
49
45
  return !!fork?.getFlow?.(flowKey);
50
46
  });
51
47
  const isMasterMounted = Boolean((model as any)?.context?.ref?.current);
52
- if (hasForkWithFlow && !isMasterMounted && !flowSettingsEnabled) {
48
+ if (hasForkWithFlow && !isMasterMounted) {
53
49
  return;
54
50
  }
55
51
 
@@ -121,10 +121,11 @@ const Columns = observer<any>(({ record, model, index }) => {
121
121
  fork.context.defineProperty('recordIndex', {
122
122
  get: () => index,
123
123
  });
124
+ const rendererKey = `${fork.uid}:${fork.forkId}`;
124
125
  const renderer = (
125
126
  <FlowModelRenderer
126
127
  showFlowSettings={{ showBorder: false, toolbarPosition: 'above' }}
127
- key={fork.uid}
128
+ key={rendererKey}
128
129
  model={fork}
129
130
  inputArgs={record}
130
131
  fallback={<Skeleton.Button size="small" />}
@@ -300,7 +300,7 @@ export class TableBlockModel extends CollectionBlockModel<TableBlockModelStructu
300
300
  transform: translateY(-50%);
301
301
  }
302
302
  &:hover {
303
- background: rgba(24, 144, 255, 0.1) !important;
303
+ box-shadow: inset 0 0 0 9999px rgba(24, 144, 255, 0.1);
304
304
  }
305
305
  &:hover .edit-icon {
306
306
  display: inline-flex;
@@ -102,7 +102,7 @@ const RenderCell = observer<any>((props) => {
102
102
  transform: translateY(-50%);
103
103
  }
104
104
  &:hover {
105
- background: rgba(24, 144, 255, 0.1) !important;
105
+ box-shadow: inset 0 0 0 9999px rgba(24, 144, 255, 0.1);
106
106
  }
107
107
  &:hover .edit-icon {
108
108
  display: inline-flex;
@@ -231,7 +231,7 @@ export const FIELDS_VALIDATION_OPTIONS = {
231
231
  },
232
232
  {
233
233
  key: 'multiple',
234
- label: 'Multiple',
234
+ label: 'Multiple of',
235
235
  hasValue: true,
236
236
  params: [{ key: 'base', label: 'Base', componentType: 'inputNumber', required: true }],
237
237
  },