Skip to content

Commit 879da8f

Browse files
committed
refactor(studio): key the list's mark callback on its two config values
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
1 parent 52eb6b1 commit 879da8f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,21 +576,22 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
576576
);
577577

578578
// The customization mark of each row, from the base's served read only.
579+
const markPrimaryKey = config.primaryKey ?? 'name';
580+
const markMemberField = config.bundleMemberField;
579581
const markOf = React.useCallback(
580582
(row: ItemRow): CustomizationMarkKind | null => {
581583
if (customizations.status !== 'read') return null;
582-
const pk = config.primaryKey ?? 'name';
583584
return customizationMarkOf(
584585
{
585586
type,
586-
name: String(row.item[pk] ?? ''),
587-
member: bundleMemberOf(row.item, config.bundleMemberField),
587+
name: String(row.item[markPrimaryKey] ?? ''),
588+
member: bundleMemberOf(row.item, markMemberField),
588589
packageId: (row.item as { _packageId?: string })._packageId,
589590
},
590591
customizations.index,
591592
);
592593
},
593-
[customizations, config.primaryKey, config.bundleMemberField, type],
594+
[customizations, markPrimaryKey, markMemberField, type],
594595
);
595596
const markedCount = React.useMemo(
596597
() => scopedItems.filter((row) => markOf(row) !== null).length,

0 commit comments

Comments
 (0)