-
Notifications
You must be signed in to change notification settings - Fork 665
CONSOLE-4729,CONSOLE-4823: Enable OLMv1 Tech Preview #15715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
2f0fadc
d6cacd7
fa5028e
715ef94
bd2cf71
38058c6
2e7ab12
7b20a1d
0e7b174
e713ff3
37a7e13
bdb403e
7f7130e
2f550ee
aa6bf03
aae5133
5292d41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { SetFeatureFlag } from '@console/dynamic-plugin-sdk/src/extensions/feature-flags'; | ||
| import { FLAG_TECH_PREVIEW } from '../consts'; | ||
|
|
||
| type UseTechPreviewFlagProvider = (setFeatureFlag: SetFeatureFlag) => void; | ||
| const useTechPreviewFlagProvider: UseTechPreviewFlagProvider = (setFeatureFlag) => { | ||
| setFeatureFlag(FLAG_TECH_PREVIEW, !!window.SERVER_FLAGS.techPreview); | ||
| }; | ||
|
|
||
| export default useTechPreviewFlagProvider; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,7 +118,7 @@ const CatalogView: React.FC<CatalogViewProps> = ({ | |
| } | ||
| }, [catalogType, items.length]); | ||
|
|
||
| const handleCategoryChange = (categoryId) => { | ||
| const handleCategoryChange = (categoryId: string) => { | ||
| updateURLParams(CatalogQueryParams.CATEGORY, categoryId); | ||
| }; | ||
|
|
||
|
|
@@ -154,7 +154,7 @@ const CatalogView: React.FC<CatalogViewProps> = ({ | |
| const allCategory = { id: ALL_CATEGORY, label: t('console-shared~All items') }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. --> All Items (for consistent case?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jseseCCS PatternFly recommends sentence case so for any inconsistencies, I'd change the other items to sentence case https://www.patternfly.org/ux-writing/capitalization |
||
| const otherCategory = { id: OTHER_CATEGORY, label: t('console-shared~Other') }; | ||
| const sortedCategories = (categories ?? []) | ||
| .filter((cat) => cat.id !== ALL_CATEGORY && cat.id !== OTHER_CATEGORY) | ||
| .filter((cat) => cat && cat.id !== ALL_CATEGORY && cat.id !== OTHER_CATEGORY) | ||
| .sort((a, b) => a.label.localeCompare(b.label)); | ||
| return [allCategory, ...sortedCategories, otherCategory]; | ||
| }, [categories, t]); | ||
|
|
@@ -341,6 +341,7 @@ const CatalogView: React.FC<CatalogViewProps> = ({ | |
| sortOrder={sortOrder} | ||
| groupings={groupings} | ||
| activeGrouping={activeGrouping} | ||
| catalogType={catalogType} | ||
| onGroupingChange={handleGroupingChange} | ||
| onSortOrderChange={handleSortOrderChange} | ||
| onSearchKeywordChange={handleSearchKeywordChange} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # OLMv1 Package | ||
|
|
||
| This package provides components and utilities for OLMv1 (Operator Lifecycle Manager v1) catalog functionality. | ||
|
|
||
| ## Feature Flag | ||
|
|
||
| The package exports a `FLAG_OLMV1_ENABLED` feature flag that mirrors the user's OLMv1 toggle switch setting. | ||
|
|
||
| ### Usage Example | ||
|
|
||
| ```typescript | ||
| import { useFlag } from '@console/shared/src/hooks/flag'; | ||
| import { FLAG_OLMV1_ENABLED } from '@console/operator-lifecycle-manager-v1/src/const'; | ||
|
|
||
| const MyComponent = () => { | ||
| const olmv1Enabled = useFlag(FLAG_OLMV1_ENABLED); | ||
|
|
||
| return ( | ||
| <div> | ||
| {olmv1Enabled && <OLMv1SpecificFeature />} | ||
| </div> | ||
| ); | ||
| }; | ||
| ``` | ||
|
|
||
| ### In Console Extensions | ||
|
|
||
| You can also use the flag in `console-extensions.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "console.some-extension-type", | ||
| "properties": { | ||
| ... | ||
| }, | ||
| "flags": { | ||
| "required": ["OLMV1_ENABLED"] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| This flag is automatically synchronized with the user setting `console.olmv1.enabled` which can be controlled through: | ||
|
|
||
| 1. **User Preferences**: Navigate to User Preferences → Operators → Enable OLMv1 catalog | ||
| 2. **Catalog Toolbar Toggle**: Use the toggle switch in the Developer Catalog when viewing operators | ||
|
|
||
| Both controls are synchronized and modify the same user setting, ensuring a consistent experience across the console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate console.flag/hookProvider entry.
This
console.flag/hookProviderentry foruseTechPreviewFlagProviderappears to be duplicated—there's an identical entry earlier in the file around line 550-553. Duplicate extension entries may cause unexpected behavior or registration conflicts.Verify whether this is an intentional duplicate or a copy-paste error. If it's unintentional, remove one of the duplicate entries:
📝 Committable suggestion
🧰 Tools
🪛 Biome (2.1.2)
[error] 2533-2538: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 2538-2538: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
🤖 Prompt for AI Agents