fix: 🐛 actions not displaying for templates in grants editor (#3296)

* fix: 🐛 actions not displaying for templates in grants editor

* fix: 🐛 invalid ids check

* fix: 🐛 update check for ids type

* test: 💍 fix broken strings

* test: 💍 fix test case

* test: 💍 remove log
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2026-06-03 12:46:34 -07:00
1 parent 4a206c82dc
commit ecefa39b98
5 files changed
+76 -75

No files matched your search

+2 -8
View File
@@ -101,18 +101,12 @@ export const analyzeGrantString = (grantsSchema, grantString = '') => {
const hasSpecificIds = Boolean(idsValue) && !idsValue.includes('*');
const hasExplicitType = Boolean(typeValue) && typeValue !== '*';
const hasTemplateIds =
hasSpecificIds &&
parseIds(idsValue).some((id) => id.startsWith('{{') && id.endsWith('}}'));
const hasLiteralIds = hasSpecificIds && !hasTemplateIds;
const compatibleIdsResourceType = hasLiteralIds
const compatibleIdsResourceType = hasSpecificIds
? getCompatibleResourceTypeForIds(schema, idsValue)
: null;
const hasInvalidType = hasExplicitType && !schema.resourcesByType[typeValue];
const hasInvalidIds = hasLiteralIds && !compatibleIdsResourceType;
const hasInvalidIds = hasSpecificIds && !compatibleIdsResourceType;
const hasInvalidPinnedIdTypeCombination =
hasSpecificIds &&