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:
1 parent
4a206c82dc
commit
ecefa39b98
5 files changed
+76
-75
No files matched your search
@@ -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 &&
|
||||
|
||||
Reference in new issue
Block a user