Skip to content

Commit a254312

Browse files
committed
Merge branch 'revert-27be7059' into 'develop'
Revert "Merge branch 'feature/custom-models-region-visibility' into 'develop'" See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!616
2 parents de4c4f1 + 93c8b76 commit a254312

3 files changed

Lines changed: 6 additions & 24 deletions

File tree

docs/custom-model-finetuning.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Custom Model Fine-tuning is available to **Admin** and **Author** roles. The Gra
3838
3939
## Prerequisites
4040

41-
- **Deployed in `us-east-1` region**: Custom Model Fine-Tuning is only available when the IDP Accelerator is deployed to the `us-east-1` AWS region. The Custom Models navigation link is automatically hidden in deployments to other regions.
4241
- An existing Test Set with:
4342
- At least 10 documents
4443
- At least 2 document classes

docs/nova-finetuning.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ This guide provides comprehensive step-by-step instructions for fine-tuning Amaz
2424

2525
## Prerequisites
2626

27-
> **Region Availability**: Nova fine-tuning is only available in the `us-east-1` AWS region. Ensure your IDP Accelerator stack is deployed to `us-east-1` to use this feature. The Custom Models UI is automatically hidden in deployments to other regions.
28-
2927
### AWS Setup
3028
Set up AWS CLI and credentials:
3129
```bash

src/ui/src/components/genaiidp-layout/navigation.tsx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ const Navigation = ({
187187
return viewerNavItems;
188188
}, [items, isAdmin, isAuthor, isViewerOnly, isReviewerOnly]);
189189

190-
// Filter out navigation items based on deployment context:
191-
// - Capacity Planning: hidden if pattern is not Pattern-2 or Unified
192-
// - Custom Models: hidden if deployed region is not us-east-1
190+
// Filter out Capacity Planning link if pattern is not Pattern-2
193191
const filteredItems = useMemo(() => {
194192
const pattern = (settings?.IDPPattern as string | undefined)?.toLowerCase();
195193

@@ -203,42 +201,29 @@ const Navigation = ({
203201
pattern.includes('unified') ||
204202
/pattern[\s\-_]?2/.test(pattern); // Regex: "pattern" followed by optional separator, then "2"
205203

206-
// Custom Models is only available in us-east-1 (Nova fine-tuning region requirement)
207-
const deployedRegion = import.meta.env.VITE_AWS_REGION as string | undefined;
208-
const isCustomModelsSupported = deployedRegion === 'us-east-1';
209-
210204
// Debug logging (remove after testing)
211205
if (pattern) {
212206
console.log('[Navigation] IDPPattern detected:', settings.IDPPattern, '| Capacity Planning supported:', isCapacityPlanningSupported);
213207
}
214-
console.log('[Navigation] Region:', deployedRegion, '| Custom Models supported:', isCustomModelsSupported);
215-
216-
// Build list of items to hide from the Configuration section
217-
const hiddenConfigItems = new Set<string>();
218-
if (!isCapacityPlanningSupported) {
219-
hiddenConfigItems.add('Capacity Planning');
220-
}
221-
if (!isCustomModelsSupported) {
222-
hiddenConfigItems.add('Custom Models');
223-
}
224208

225-
if (hiddenConfigItems.size === 0) {
209+
if (isCapacityPlanningSupported) {
210+
// Show Capacity Planning for Pattern-2, Unified, or if pattern is unknown
226211
return baseItems;
227212
}
228213

229-
// Filter out hidden items from Configuration section and top-level
214+
// Filter out Capacity Planning for Pattern 1 and Pattern 3
230215
return baseItems
231216
.map((item) => {
232217
if (item.type === 'section' && item.text === 'Configuration') {
233218
const section = item as SideNavigationProps.Section;
234219
return {
235220
...item,
236-
items: section.items.filter((subItem) => !hiddenConfigItems.has((subItem as { text?: string }).text ?? '')),
221+
items: section.items.filter((subItem) => (subItem as { text?: string }).text !== 'Capacity Planning'),
237222
};
238223
}
239224
return item;
240225
})
241-
.filter((item) => !hiddenConfigItems.has((item as { text?: string }).text ?? ''));
226+
.filter((item) => (item as { text?: string }).text !== 'Capacity Planning'); // Also filter top-level if it exists
242227
}, [baseItems, settings?.IDPPattern]);
243228

244229
// Determine active link based on current path

0 commit comments

Comments
 (0)