@openshift-console/dynamic-plugin-sdk
Advanced tools
Comparing version 0.0.0-alpha12 to 0.0.0-alpha13
# OpenShift Console Extension Types | ||
1. [`console.alert-action`](#console.alert-action) | ||
2. [`console.catalog/item-filter`](#console.catalog/item-filter) | ||
3. [`console.catalog/item-provider`](#console.catalog/item-provider) | ||
4. [`console.catalog/item-type`](#console.catalog/item-type) | ||
5. [`console.context-provider`](#console.context-provider) | ||
6. [`console.file-upload`](#console.file-upload) | ||
7. [`console.flag`](#console.flag) | ||
8. [`console.flag/model`](#console.flag/model) | ||
9. [`console.global-config`](#console.global-config) | ||
10. [`console.navigation/href`](#console.navigation/href) | ||
11. [`console.navigation/resource-cluster`](#console.navigation/resource-cluster) | ||
12. [`console.navigation/resource-ns`](#console.navigation/resource-ns) | ||
13. [`console.navigation/section`](#console.navigation/section) | ||
14. [`console.navigation/separator`](#console.navigation/separator) | ||
15. [`console.page/route/standalone`](#console.page/route/standalone) | ||
16. [`console.pvc/alert`](#console.pvc/alert) | ||
17. [`console.pvc/create-prop`](#console.pvc/create-prop) | ||
18. [`console.pvc/delete`](#console.pvc/delete) | ||
19. [`console.pvc/status`](#console.pvc/status) | ||
20. [`console.redux-reducer`](#console.redux-reducer) | ||
21. [`console.resource-metadata`](#console.resource-metadata) | ||
22. [`console.storage-provider`](#console.storage-provider) | ||
23. [`console.yaml-template`](#console.yaml-template) | ||
24. [`dev-console.add/action`](#dev-console.add/action) | ||
1. [`console.action/filter`](#console.action/filter) | ||
2. [`console.action/group`](#console.action/group) | ||
3. [`console.action/provider`](#console.action/provider) | ||
4. [`console.action/resource-provider`](#console.action/resource-provider) | ||
5. [`console.alert-action`](#console.alert-action) | ||
6. [`console.catalog/item-filter`](#console.catalog/item-filter) | ||
7. [`console.catalog/item-provider`](#console.catalog/item-provider) | ||
8. [`console.catalog/item-type`](#console.catalog/item-type) | ||
9. [`console.context-provider`](#console.context-provider) | ||
10. [`console.dashboards/card`](#console.dashboards/card) | ||
11. [`console.dashboards/inventory/item`](#console.dashboards/inventory/item) | ||
12. [`console.dashboards/inventory/item/group`](#console.dashboards/inventory/item/group) | ||
13. [`console.dashboards/overview/activity/resource`](#console.dashboards/overview/activity/resource) | ||
14. [`console.dashboards/overview/health/operator`](#console.dashboards/overview/health/operator) | ||
15. [`console.dashboards/overview/health/prometheus`](#console.dashboards/overview/health/prometheus) | ||
16. [`console.dashboards/overview/health/resource`](#console.dashboards/overview/health/resource) | ||
17. [`console.dashboards/overview/health/url`](#console.dashboards/overview/health/url) | ||
18. [`console.dashboards/tab`](#console.dashboards/tab) | ||
19. [`console.file-upload`](#console.file-upload) | ||
20. [`console.flag`](#console.flag) | ||
21. [`console.flag/model`](#console.flag/model) | ||
22. [`console.global-config`](#console.global-config) | ||
23. [`console.navigation/href`](#console.navigation/href) | ||
24. [`console.navigation/resource-cluster`](#console.navigation/resource-cluster) | ||
25. [`console.navigation/resource-ns`](#console.navigation/resource-ns) | ||
26. [`console.navigation/section`](#console.navigation/section) | ||
27. [`console.navigation/separator`](#console.navigation/separator) | ||
28. [`console.page/resource/details`](#console.page/resource/details) | ||
29. [`console.page/resource/list`](#console.page/resource/list) | ||
30. [`console.page/resource/tab`](#console.page/resource/tab) | ||
31. [`console.page/route`](#console.page/route) | ||
32. [`console.page/route/standalone`](#console.page/route/standalone) | ||
33. [`console.pvc/alert`](#console.pvc/alert) | ||
34. [`console.pvc/create-prop`](#console.pvc/create-prop) | ||
35. [`console.pvc/delete`](#console.pvc/delete) | ||
36. [`console.pvc/status`](#console.pvc/status) | ||
37. [`console.redux-reducer`](#console.redux-reducer) | ||
38. [`console.resource-metadata`](#console.resource-metadata) | ||
39. [`console.storage-provider`](#console.storage-provider) | ||
40. [`console.telemetry/listener`](#console.telemetry/listener) | ||
41. [`console.yaml-template`](#console.yaml-template) | ||
42. [`dev-console.add/action`](#dev-console.add/action) | ||
43. [`topology.details/resource-alert`](#topology.details/resource-alert) | ||
44. [`topology.details/resource-link`](#topology.details/resource-link) | ||
45. [`topology.details/tab`](#topology.details/tab) | ||
46. [`topology.details/tab-section`](#topology.details/tab-section) | ||
--- | ||
## `console.action/filter` | ||
### Summary | ||
ActionFilter can be used to filter an action | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `contextId` | `string` | no | The context ID helps to narrow the scope of contributed actions to a particular area of the application. Ex - topology, helm | | ||
| `filter` | `CodeRef<(scope: any, action: Action) => boolean>` | no | A function which will filter actions based on some conditions.<br/>scope: The scope in which actions should be provided for.<br/>Note: hook may be required if we want to remove the ModifyCount action from a deployment with HPA | | ||
--- | ||
## `console.action/group` | ||
### Summary | ||
ActionGroup contributes an action group that can also be a submenu | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `id` | `string` | no | ID used to identify the action section. | | ||
| `label` | `string` | yes | The label to display in the UI.<br/>Required for submenus. | | ||
| `submenu` | `boolean` | yes | Whether this group should be displayed as submenu | | ||
| `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here.<br/>For arrays, the first one found in order is used. | | ||
| `insertAfter` | `string \| string[]` | yes | Insert this item after the item referenced here.<br/>For arrays, the first one found in order is used.<br/>insertBefore takes precedence. | | ||
--- | ||
## `console.action/provider` | ||
### Summary | ||
ActionProvider contributes a hook that returns list of actions for specific context | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `contextId` | `string` | no | The context ID helps to narrow the scope of contributed actions to a particular area of the application. Ex - topology, helm | | ||
| `provider` | `CodeRef<ExtensionHook<Action[], any>>` | no | A react hook which returns actions for the given scope.<br/>If contextId = `resource` then the scope will always be a K8s resource object | | ||
--- | ||
## `console.action/resource-provider` | ||
### Summary | ||
ResourceActionProvider contributes a hook that returns list of actions for specific resource model | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `ExtensionK8sGroupModel` | no | The model for which this provider provides actions for. | | ||
| `provider` | `CodeRef<ExtensionHook<Action[], any>>` | no | A react hook which returns actions for the given resource model | | ||
--- | ||
## `console.alert-action` | ||
@@ -113,2 +198,156 @@ | ||
## `console.dashboards/card` | ||
### Summary | ||
Adds a new dashboard card. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `tab` | `string` | no | The id of the dashboard tab to which the card will be added. | | ||
| `position` | `'LEFT' \| 'RIGHT' \| 'MAIN'` | no | The grid position of the card on the dashboard. | | ||
| `loader` | `CodeRef<React.ComponentType<{}>>` | no | Dashboard card component. | | ||
| `span` | `DashboardCardSpan` | yes | Card's vertical span in the column. Ignored for small screens, defaults to 12. | | ||
--- | ||
## `console.dashboards/inventory/item` | ||
### Summary | ||
Adds a resource tile to the overview inventory card. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `CodeRef<T>` | no | The model for `resource` which will be fetched. Used to get the model's `label` or `abbr`. | | ||
| `mapper` | `CodeRef<StatusGroupMapper<T, R>>` | yes | Function which maps various statuses to groups. | | ||
| `additionalResources` | `CodeRef<WatchK8sResources<R>>` | yes | Additional resources which will be fetched and passed to the `mapper` function. | | ||
--- | ||
## `console.dashboards/inventory/item/group` | ||
### Summary | ||
Adds an inventory status group. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `id` | `string` | no | The id of the status group. | | ||
| `icon` | `CodeRef<React.ReactElement<any, string \| React.JSXElementConstructor<any>>>` | no | React component representing the status group icon. | | ||
--- | ||
## `console.dashboards/overview/activity/resource` | ||
### Summary | ||
Adds an activity to the Activity Card of Overview Dashboard where the triggering of activity is based on watching a K8s resource. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `k8sResource` | `CodeRef<FirehoseResource & { isList: true; }>` | no | The utilization item to be replaced. | | ||
| `loader` | `CodeRef<React.ComponentType<K8sActivityProps<T>>>` | no | Loader for the corresponding action component. | | ||
| `isActivity` | `CodeRef<(resource: T) => boolean>` | yes | Function which determines if the given resource represents the action. If not defined, every resource represents activity. | | ||
| `getTimestamp` | `CodeRef<(resource: T) => Date>` | yes | Timestamp for the given action, which will be used for ordering. | | ||
--- | ||
## `console.dashboards/overview/health/operator` | ||
### Summary | ||
Adds a health subsystem to the status card of Overview dashboard where the source of status is a K8s REST API. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `title` | `string` | no | Title of operators section in the popup. | | ||
| `resources` | `CodeRef<FirehoseResource[]>` | no | Kubernetes resources which will be fetched and passed to `healthHandler`. | | ||
| `getOperatorsWithStatuses` | `CodeRef<GetOperatorsWithStatuses<T>>` | yes | Resolves status for the operators. | | ||
| `operatorRowLoader` | `CodeRef<React.ComponentType<OperatorRowProps<T>>>` | yes | Loader for popup row component. | | ||
| `viewAllLink` | `string` | yes | Links to all resources page. If not provided then a list page of the first resource from resources prop is used. | | ||
--- | ||
## `console.dashboards/overview/health/prometheus` | ||
### Summary | ||
Adds a health subsystem to the status card of Overview dashboard where the source of status is Prometheus. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `title` | `string` | no | The display name of the subsystem. | | ||
| `healthHandler` | `CodeRef<PrometheusHealthHandler>` | no | Resolve the subsystem's health. | | ||
| `additionalResource` | `CodeRef<FirehoseResource>` | yes | Additional resource which will be fetched and passed to `healthHandler`. | | ||
| `popupComponent` | `CodeRef<React.ComponentType<PrometheusHealthPopupProps>>` | yes | Loader for popup content. If defined, a health item will be represented as a link which opens popup with given content. | | ||
| `popupTitle` | `string` | yes | The title of the popover. | | ||
| `disallowedProviders` | `string[]` | yes | Cloud providers which for which the subsystem should be hidden. | | ||
--- | ||
## `console.dashboards/overview/health/resource` | ||
### Summary | ||
Adds a health subsystem to the status card of Overview dashboard where the source of status is a K8s Resource. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `title` | `string` | no | The display name of the subsystem. | | ||
| `resources` | `CodeRef<WatchK8sResources<T>>` | no | Kubernetes resources which will be fetched and passed to `healthHandler`. | | ||
| `healthHandler` | `CodeRef<ResourceHealthHandler<T>>` | no | Resolve the subsystem's health. | | ||
| `popupComponent` | `CodeRef<WatchK8sResults<T>>` | yes | Loader for popup content. If defined, a health item will be represented as a link which opens popup with given content. | | ||
| `popupTitle` | `string` | yes | The title of the popover. | | ||
--- | ||
## `console.dashboards/overview/health/url` | ||
### Summary | ||
Adds a health subsystem to the status card of Overview dashboard where the source of status is a K8s REST API. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `title` | `string` | no | The display name of the subsystem. | | ||
| `url` | `string` | no | The URL to fetch data from. It will be prefixed with base k8s URL. | | ||
| `healthHandler` | `CodeRef<URLHealthHandler<T, K8sResourceCommon \| K8sResourceCommon[]>>` | no | Resolve the subsystem's health. | | ||
| `additionalResource` | `CodeRef<FirehoseResource>` | yes | Additional resource which will be fetched and passed to `healthHandler`. | | ||
| `popupComponent` | `CodeRef<React.ComponentType<{ healthResult?: T; healthResultError?: any; k8sResult?: FirehoseResult<R>; }>>` | yes | Loader for popup content. If defined, a health item will be represented as a link which opens popup with given content. | | ||
| `popupTitle` | `string` | yes | The title of the popover. | | ||
--- | ||
## `console.dashboards/tab` | ||
### Summary | ||
Adds a new dashboard tab, placed after the Overview tab. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `id` | `string` | no | A unique tab identifier, used as tab link `href` and when adding cards to this tab. | | ||
| `title` | `string` | no | The title of the tab. | | ||
--- | ||
## `console.file-upload` | ||
@@ -154,3 +393,3 @@ | ||
| `flag` | `string` | no | The name of the flag to set once the CRD is detected. | | ||
| `model` | `{ group: string; version: string; kind: string; }` | no | The model which refers to a `CustomResourceDefinition`. | | ||
| `model` | `ExtensionK8sModel` | no | The model which refers to a `CustomResourceDefinition`. | | ||
@@ -171,3 +410,3 @@ --- | ||
| `name` | `string` | no | The name of the cluster config resource instance. | | ||
| `model` | `{ group: string; version: string; kind: string; }` | no | The model which refers to a cluster config resource. | | ||
| `model` | `ExtensionK8sModel` | no | The model which refers to a cluster config resource. | | ||
| `namespace` | `string` | no | The namespace of the cluster config resource instance. | | ||
@@ -192,6 +431,8 @@ | ||
| `section` | `string` | yes | Navigation section to which this item belongs to. If not specified, render this item as a top level link. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds `data-` attributes to the DOM. Each key will receive the `data-` prefix. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds data attributes to the DOM. | | ||
| `startsWith` | `string[]` | yes | Mark this item as active when the URL starts with one of these paths. | | ||
| `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here. For arrays, the first one found in order is used. | | ||
| `insertAfter` | `string \| string[]` | yes | Insert this item after the item referenced here. For arrays, the first one found in order is used. `insertBefore` takes precedence. | | ||
| `namespaced` | `boolean` | yes | if true, adds /ns/active-namespace to the end | | ||
| `prefixNamespaced` | `boolean` | yes | if true, adds /k8s/ns/active-namespace to the begining | | ||
@@ -211,6 +452,6 @@ --- | ||
| `id` | `string` | no | A unique identifier for this item. | | ||
| `model` | `{ group: string; version: string; kind: string; }` | no | The model for which this nav item links to. | | ||
| `model` | `ExtensionK8sModel` | no | The model for which this nav item links to. | | ||
| `perspective` | `string` | yes | The perspective ID to which this item belongs to. If not specified, contributes to the default perspective. | | ||
| `section` | `string` | yes | Navigation section to which this item belongs to. If not specified, render this item as a top level link. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds `data-` attributes to the DOM. Each key will receive the `data-` prefix. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds data attributes to the DOM. | | ||
| `startsWith` | `string[]` | yes | Mark this item as active when the URL starts with one of these paths. | | ||
@@ -234,6 +475,6 @@ | `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here. For arrays, the first one found in order is used. | | ||
| `id` | `string` | no | A unique identifier for this item. | | ||
| `model` | `{ group: string; version: string; kind: string; }` | no | The model for which this nav item links to. | | ||
| `model` | `ExtensionK8sModel` | no | The model for which this nav item links to. | | ||
| `perspective` | `string` | yes | The perspective ID to which this item belongs to. If not specified, contributes to the default perspective. | | ||
| `section` | `string` | yes | Navigation section to which this item belongs to. If not specified, render this item as a top level link. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds `data-` attributes to the DOM. Each key will receive the `data-` prefix. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds data attributes to the DOM. | | ||
| `startsWith` | `string[]` | yes | Mark this item as active when the URL starts with one of these paths. | | ||
@@ -258,3 +499,3 @@ | `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here. For arrays, the first one found in order is used. | | ||
| `perspective` | `string` | yes | The perspective ID to which this item belongs to. If not specified, contributes to the default perspective. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds `data-` attributes to the DOM. Each key will receive the `data-` prefix. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds data attributes to the DOM. | | ||
| `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here. For arrays, the first one found in order is used. | | ||
@@ -279,3 +520,3 @@ | `insertAfter` | `string \| string[]` | yes | Insert this item after the item referenced here. For arrays, the first one found in order is used. `insertBefore` takes precedence. | | ||
| `section` | `string` | yes | Navigation section to which this item belongs to. If not specified, render this item as a top level link. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds `data-` attributes to the DOM. Each key will receive the `data-` prefix. | | ||
| `dataAttributes` | `{ [key: string]: string; }` | yes | Adds data attributes to the DOM. | | ||
| `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here. For arrays, the first one found in order is used. | | ||
@@ -286,2 +527,67 @@ | `insertAfter` | `string \| string[]` | yes | Insert this item after the item referenced here. For arrays, the first one found in order is used. `insertBefore` takes precedence. | | ||
## `console.page/resource/details` | ||
### Summary | ||
Adds new resource details page to Console router. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `ExtensionK8sModel` | no | The model for which this resource page links to. | | ||
| `component` | `CodeRef<React.ComponentType<{ match: match<{}>; namespace: string; model: ExtensionK8sModel; }>>` | no | | | ||
--- | ||
## `console.page/resource/list` | ||
### Summary | ||
Adds new resource list page to Console router. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `ExtensionK8sModel` | no | The model for which this resource page links to. | | ||
| `component` | `CodeRef<React.ComponentType<{ match: match<{}>; namespace: string; model: ExtensionK8sModel; }>>` | no | | | ||
--- | ||
## `console.page/resource/tab` | ||
### Summary | ||
Adds new resource tab page to Console router. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `ExtensionK8sModel` | no | The model for which this resource page links to. | | ||
| `component` | `CodeRef<React.ComponentType<RouteComponentProps<{}, StaticContext, any>>>` | no | The component to be rendered when the route matches. | | ||
| `name` | `string` | no | The name of the tab. | | ||
| `href` | `string` | yes | The optional href for the tab link. If not provided, the first `path` is used. | | ||
| `exact` | `boolean` | yes | When true, will only match if the path matches the `location.pathname` exactly. | | ||
--- | ||
## `console.page/route` | ||
### Summary | ||
Adds new page to Console router. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `component` | `CodeRef<React.ComponentType<RouteComponentProps<{}, StaticContext, any>>>` | no | The component to be rendered when the route matches. | | ||
| `path` | `string \| string[]` | no | Valid URL path or array of paths that `path-to-regexp@^1.7.0` understands. | | ||
| `perspective` | `string` | yes | The perspective to which this page belongs to. If not specified, contributes to all perspectives. | | ||
| `exact` | `boolean` | yes | When true, will only match if the path matches the `location.pathname` exactly. | | ||
--- | ||
## `console.page/route/standalone` | ||
@@ -297,3 +603,3 @@ | ||
| ---- | ---------- | -------- | ----------- | | ||
| `component` | `CodeRef<React.FC<RouteComponentProps<{}, StaticContext, any>>>` | no | The component to be rendered when the route matches. | | ||
| `component` | `CodeRef<React.ComponentType<RouteComponentProps<{}, StaticContext, any>>>` | no | The component to be rendered when the route matches. | | ||
| `path` | `string \| string[]` | no | Valid URL path or array of paths that `path-to-regexp@^1.7.0` understands. | | ||
@@ -390,3 +696,3 @@ | `exact` | `boolean` | yes | When true, will only match if the path matches the `location.pathname` exactly. | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `{ group: string; version?: string; kind?: string; }` | no | The model to customize. May specify only a group, or optional version and kind. | | ||
| `model` | `ExtensionK8sGroupModel` | no | The model to customize. May specify only a group, or optional version and kind. | | ||
| `badge` | `'tech' \| 'dev'` | yes | Whether to consider this model reference as tech preview or dev preview. | | ||
@@ -415,2 +721,16 @@ | `color` | `string` | yes | The color to associate to this model. | | ||
## `console.telemetry/listener` | ||
### Summary | ||
(not available) | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `listener` | `CodeRef<TelemetryEventListener>` | no | Listen for telemetry events | | ||
--- | ||
## `console.yaml-template` | ||
@@ -426,3 +746,3 @@ | ||
| ---- | ---------- | -------- | ----------- | | ||
| `model` | `{ group: string; version: string; kind: string; }` | no | Model associated with the template. | | ||
| `model` | `ExtensionK8sModel` | no | Model associated with the template. | | ||
| `template` | `string` | no | The YAML template. | | ||
@@ -450,1 +770,68 @@ | `name` | `string` | no | The name of the template. Use the name `default` to mark this as the default template. | | ||
--- | ||
## `topology.details/resource-alert` | ||
### Summary | ||
DetailsResourceAlert contributes an alert for specific topology context or graph element. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `id` | `string` | no | The ID of this alert. Used to save state if the alert should be shown after dismissed. | | ||
| `title` | `string` | no | The title of the alert | | ||
| `contentProvider` | `CodeRef<(element: GraphElement) => DetailsResourceAlertContent>` | no | Hook to return the contents of the Alert. | | ||
| `dismissible` | `boolean` | yes | Whether to show a dismiss button. false by default | | ||
--- | ||
## `topology.details/resource-link` | ||
### Summary | ||
DetailsResourceLink contributes a link for specific topology context or graph element. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `link` | `CodeRef<(element: GraphElement) => React.Component \| undefined>` | no | Return the resource link if provided, otherwise undefined.<br/>Use ResourceIcon and ResourceLink for styles. | | ||
| `priority` | `number` | yes | A higher priority factory will get the first chance to create the link. | | ||
--- | ||
## `topology.details/tab` | ||
### Summary | ||
DetailsTab contributes a tab for the topology details panel. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `id` | `string` | no | A unique identifier for this details tab. | | ||
| `label` | `string` | no | The tab label to display in the UI. | | ||
| `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here.<br/>For arrays, the first one found in order is used. | | ||
| `insertAfter` | `string \| string[]` | yes | Insert this item after the item referenced here.<br/>For arrays, the first one found in order is used.<br/>insertBefore takes precedence. | | ||
--- | ||
## `topology.details/tab-section` | ||
### Summary | ||
DetailsTabSection contributes a section for a specific tab in topology details panel. | ||
### Properties | ||
| Name | Value Type | Optional | Description | | ||
| ---- | ---------- | -------- | ----------- | | ||
| `id` | `string` | no | A unique identifier for this details tab section. | | ||
| `tab` | `string` | no | The parent tab ID that this section should contribute to. | | ||
| `section` | `CodeRef<(element: GraphElement) => React.Component \| undefined>` | no | Returns a section for the graph element or undefined if not provided.<br/>SDK component: <Section title={<optional>}>... padded area </Section> | | ||
| `insertBefore` | `string \| string[]` | yes | Insert this item before the item referenced here.<br/>For arrays, the first one found in order is used. | | ||
| `insertAfter` | `string \| string[]` | yes | Insert this item after the item referenced here.<br/>For arrays, the first one found in order is used.<br/>insertBefore takes precedence. | | ||
export { ResolvedExtension } from '../types'; | ||
export declare type ExtensionHook<T, R = any> = (options: R) => ExtensionHookResult<T>; | ||
export declare type ExtensionHookResult<T> = [T, boolean, any]; | ||
export declare type ExtensionK8sModel = { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
export declare type ExtensionK8sGroupModel = { | ||
group: string; | ||
version?: string; | ||
kind?: string; | ||
}; |
@@ -37,2 +37,3 @@ import * as React from 'react'; | ||
}>; | ||
export declare type SupportedCatalogExtensions = CatalogItemType | CatalogItemProvider | CatalogItemFilter; | ||
export declare const isCatalogItemType: (e: Extension<any>) => e is ExtensionDeclaration<"console.catalog/item-type", { | ||
@@ -78,2 +79,6 @@ /** Type for the catalog item. */ | ||
name: string; | ||
/** Optional title to render a custom title using ReactNode. | ||
* Rendered in catalog tile and side panel | ||
* */ | ||
title?: React.ReactNode; | ||
provider?: string; | ||
@@ -80,0 +85,0 @@ description?: string | React.ReactNode; |
@@ -0,1 +1,2 @@ | ||
import { ExtensionK8sModel } from '../api/common-types'; | ||
import { Extension, ExtensionDeclaration } from '../types'; | ||
@@ -8,7 +9,3 @@ export declare type ClusterGlobalConfig = ExtensionDeclaration<'console.global-config', { | ||
/** The model which refers to a cluster config resource. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
/** The namespace of the cluster config resource instance. */ | ||
@@ -23,9 +20,5 @@ namespace: string; | ||
/** The model which refers to a cluster config resource. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
/** The namespace of the cluster config resource instance. */ | ||
namespace: string; | ||
}>; |
@@ -77,1 +77,98 @@ export declare type OwnerReference = { | ||
export declare type K8sResourceKindReference = GroupVersionKind | string; | ||
declare enum InventoryStatusGroup { | ||
WARN = "WARN", | ||
ERROR = "ERROR", | ||
PROGRESS = "PROGRESS", | ||
NOT_MAPPED = "NOT_MAPPED", | ||
UNKNOWN = "UNKNOWN" | ||
} | ||
declare type StatusGroup = { | ||
[key in InventoryStatusGroup | string]: { | ||
filterType?: string; | ||
statusIDs: string[]; | ||
count: number; | ||
}; | ||
}; | ||
export declare type StatusGroupMapper<T extends K8sResourceCommon = K8sResourceCommon, R extends { | ||
[key: string]: K8sResourceCommon[]; | ||
} = { | ||
[key: string]: K8sResourceCommon[]; | ||
}> = (resources: T[], additionalResources?: R) => StatusGroup; | ||
export declare enum HealthState { | ||
OK = "OK", | ||
ERROR = "ERROR", | ||
WARNING = "WARNING", | ||
LOADING = "LOADING", | ||
UNKNOWN = "UNKNOWN", | ||
UPDATING = "UPDATING", | ||
PROGRESS = "PROGRESS", | ||
NOT_AVAILABLE = "NOT_AVAILABLE" | ||
} | ||
export declare type PrometheusLabels = { | ||
[key: string]: string; | ||
}; | ||
export declare type PrometheusValue = [number, string]; | ||
export declare type PrometheusResult = { | ||
metric: PrometheusLabels; | ||
values?: PrometheusValue[]; | ||
value?: PrometheusValue; | ||
}; | ||
export declare type PrometheusData = { | ||
resultType: 'matrix' | 'vector' | 'scalar' | 'string'; | ||
result: PrometheusResult[]; | ||
}; | ||
export declare type PrometheusResponse = { | ||
status: string; | ||
data: PrometheusData; | ||
errorType?: string; | ||
error?: string; | ||
warnings?: string[]; | ||
}; | ||
export declare type WatchK8sResource = { | ||
kind: K8sResourceKindReference; | ||
name?: string; | ||
namespace?: string; | ||
isList?: boolean; | ||
selector?: Selector; | ||
namespaced?: boolean; | ||
limit?: number; | ||
fieldSelector?: string; | ||
optional?: boolean; | ||
}; | ||
export declare type ResourcesObject = { | ||
[key: string]: K8sResourceCommon | K8sResourceCommon[]; | ||
}; | ||
export declare type WatchK8sResultsObject<R extends K8sResourceCommon | K8sResourceCommon[]> = { | ||
data: R; | ||
loaded: boolean; | ||
loadError: any; | ||
}; | ||
export declare type WatchK8sResults<R extends ResourcesObject> = { | ||
[k in keyof R]: WatchK8sResultsObject<R[k]>; | ||
}; | ||
export declare type WatchK8sResources<R extends ResourcesObject> = { | ||
[k in keyof R]: WatchK8sResource; | ||
}; | ||
export declare type FirehoseResource = { | ||
kind: K8sResourceKindReference; | ||
name?: string; | ||
namespace?: string; | ||
isList?: boolean; | ||
selector?: Selector; | ||
prop: string; | ||
namespaced?: boolean; | ||
optional?: boolean; | ||
limit?: number; | ||
fieldSelector?: string; | ||
}; | ||
export declare type FirehoseResult<R extends K8sResourceCommon | K8sResourceCommon[] = K8sResourceCommon[]> = { | ||
loaded: boolean; | ||
loadError: string; | ||
optional?: boolean; | ||
data: R; | ||
kind?: string; | ||
}; | ||
export declare type FirehoseResourcesResult = { | ||
[key: string]: FirehoseResult<K8sResourceCommon | K8sResourceCommon[]>; | ||
}; | ||
export {}; |
@@ -0,1 +1,20 @@ | ||
var InventoryStatusGroup; | ||
(function (InventoryStatusGroup) { | ||
InventoryStatusGroup["WARN"] = "WARN"; | ||
InventoryStatusGroup["ERROR"] = "ERROR"; | ||
InventoryStatusGroup["PROGRESS"] = "PROGRESS"; | ||
InventoryStatusGroup["NOT_MAPPED"] = "NOT_MAPPED"; | ||
InventoryStatusGroup["UNKNOWN"] = "UNKNOWN"; | ||
})(InventoryStatusGroup || (InventoryStatusGroup = {})); | ||
export var HealthState; | ||
(function (HealthState) { | ||
HealthState["OK"] = "OK"; | ||
HealthState["ERROR"] = "ERROR"; | ||
HealthState["WARNING"] = "WARNING"; | ||
HealthState["LOADING"] = "LOADING"; | ||
HealthState["UNKNOWN"] = "UNKNOWN"; | ||
HealthState["UPDATING"] = "UPDATING"; | ||
HealthState["PROGRESS"] = "PROGRESS"; | ||
HealthState["NOT_AVAILABLE"] = "NOT_AVAILABLE"; | ||
})(HealthState || (HealthState = {})); | ||
//# sourceMappingURL=console-types.js.map |
@@ -0,1 +1,2 @@ | ||
import { ExtensionK8sModel } from '../api/common-types'; | ||
import { Extension, ExtensionDeclaration, CodeRef } from '../types'; | ||
@@ -12,7 +13,3 @@ /** Gives full control over Console feature flags. */ | ||
/** The model which refers to a `CustomResourceDefinition`. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
}>; | ||
@@ -27,8 +24,4 @@ export declare const isFeatureFlag: (e: Extension<any>) => e is ExtensionDeclaration<"console.flag", { | ||
/** The model which refers to a `CustomResourceDefinition`. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
}>; | ||
export declare type SetFeatureFlag = (flag: string, enabled: boolean) => void; |
@@ -12,2 +12,3 @@ export * from './add-actions'; | ||
export * from './resource-metadata'; | ||
export * from './telemetry'; | ||
export * from './yaml-templates'; | ||
@@ -17,1 +18,3 @@ export * from './notification-alert'; | ||
export * from './storage-provider'; | ||
export * from './actions'; | ||
export * from './topology-details'; |
@@ -12,5 +12,9 @@ export * from './add-actions'; | ||
export * from './resource-metadata'; | ||
export * from './telemetry'; | ||
export * from './yaml-templates'; | ||
export * from './notification-alert'; | ||
export * from './console-types'; | ||
export * from './storage-provider'; | ||
export * from './actions'; | ||
export * from './topology-details'; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,2 @@ | ||
import { ExtensionK8sModel } from '../api/common-types'; | ||
import { Extension, ExtensionDeclaration } from '../types'; | ||
@@ -9,3 +10,3 @@ declare type NavItemProperties = { | ||
section?: string; | ||
/** Adds `data-` attributes to the DOM. Each key will receive the `data-` prefix. */ | ||
/** Adds data attributes to the DOM. */ | ||
dataAttributes?: { | ||
@@ -21,2 +22,5 @@ [key: string]: string; | ||
}; | ||
export declare type NavItem = ExtensionDeclaration<'console.navigation/href', NavItemProperties & { | ||
name: string; | ||
}>; | ||
export declare type HrefNavItem = ExtensionDeclaration<'console.navigation/href', NavItemProperties & { | ||
@@ -27,2 +31,6 @@ /** The name of this item. */ | ||
href: string; | ||
/** if true, adds /ns/active-namespace to the end */ | ||
namespaced?: boolean; | ||
/** if true, adds /k8s/ns/active-namespace to the begining */ | ||
prefixNamespaced?: boolean; | ||
}>; | ||
@@ -33,7 +41,3 @@ export declare type ResourceNSNavItem = ExtensionDeclaration<'console.navigation/resource-ns', NavItemProperties & { | ||
/** The model for which this nav item links to. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
}>; | ||
@@ -44,7 +48,3 @@ export declare type ResourceClusterNavItem = ExtensionDeclaration<'console.navigation/resource-cluster', NavItemProperties & { | ||
/** The model for which this nav item links to. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
}>; | ||
@@ -61,2 +61,6 @@ export declare type Separator = ExtensionDeclaration<'console.navigation/separator', Omit<NavItemProperties, 'startsWith'>>; | ||
href: string; | ||
/** if true, adds /ns/active-namespace to the end */ | ||
namespaced?: boolean; | ||
/** if true, adds /k8s/ns/active-namespace to the begining */ | ||
prefixNamespaced?: boolean; | ||
}>; | ||
@@ -67,7 +71,3 @@ export declare const isResourceNSNavItem: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/resource-ns", NavItemProperties & { | ||
/** The model for which this nav item links to. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
}>; | ||
@@ -78,13 +78,12 @@ export declare const isResourceClusterNavItem: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/resource-cluster", NavItemProperties & { | ||
/** The model for which this nav item links to. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
}>; | ||
export declare const isSeparator: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/separator", Pick<NavItemProperties, "id" | "perspective" | "section" | "dataAttributes" | "insertBefore" | "insertAfter">>; | ||
export declare const isNavSection: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/section", Pick<NavItemProperties, "id" | "perspective" | "dataAttributes" | "insertBefore" | "insertAfter"> & { | ||
export declare const isSeparator: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/separator", Pick<NavItemProperties, "perspective" | "id" | "section" | "dataAttributes" | "insertBefore" | "insertAfter">>; | ||
export declare const isNavSection: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/section", Pick<NavItemProperties, "perspective" | "id" | "dataAttributes" | "insertBefore" | "insertAfter"> & { | ||
/** Name of this section. If not supplied, only a separator will be shown above the section. */ | ||
name?: string; | ||
}>; | ||
export declare const isNavItem: (e: Extension<any>) => e is ExtensionDeclaration<"console.navigation/href", NavItemProperties & { | ||
name: string; | ||
}>; | ||
export {}; |
@@ -7,2 +7,5 @@ // Type guards | ||
export const isNavSection = (e) => e.type === 'console.navigation/section'; | ||
export const isNavItem = (e) => { | ||
return isHrefNavItem(e) || isResourceNSNavItem(e) || isResourceClusterNavItem(e); | ||
}; | ||
//# sourceMappingURL=navigation.js.map |
/// <reference types="react" /> | ||
import { RouteComponentProps } from 'react-router'; | ||
import { ExtensionK8sModel } from '../api/common-types'; | ||
import { Extension, ExtensionDeclaration, CodeRef } from '../types'; | ||
/** Adds new standalone page (rendered outside the common page layout) to Console router. */ | ||
export declare type StandaloneRoutePage = ExtensionDeclaration<'console.page/route/standalone', { | ||
declare type ResourcePageProperties = { | ||
/** The model for which this resource page links to. */ | ||
model: ExtensionK8sModel; | ||
component: CodeRef<React.ComponentType<{ | ||
match: RouteComponentProps['match']; | ||
/** The namespace for which this resource page links to. */ | ||
namespace: string; | ||
/** The model for which this resource page links to. */ | ||
model: ExtensionK8sModel; | ||
}>>; | ||
}; | ||
declare type RoutePageProperties = { | ||
/** The perspective to which this page belongs to. If not specified, contributes to all perspectives. */ | ||
perspective?: string; | ||
/** The component to be rendered when the route matches. */ | ||
component: CodeRef<React.FC<RouteComponentProps>>; | ||
component: CodeRef<React.ComponentType<RouteComponentProps>>; | ||
/** Valid URL path or array of paths that `path-to-regexp@^1.7.0` understands. */ | ||
@@ -12,10 +25,36 @@ path: string | string[]; | ||
exact?: boolean; | ||
}; | ||
/** Adds new page to Console router. */ | ||
export declare type RoutePage = ExtensionDeclaration<'console.page/route', RoutePageProperties>; | ||
/** Adds new resource list page to Console router. */ | ||
export declare type ResourceListPage = ExtensionDeclaration<'console.page/resource/list', ResourcePageProperties & {}>; | ||
/** Adds new resource details page to Console router. */ | ||
export declare type ResourceDetailsPage = ExtensionDeclaration<'console.page/resource/details', ResourcePageProperties & {}>; | ||
/** Adds new resource tab page to Console router. */ | ||
export declare type ResourceTabPage = ExtensionDeclaration<'console.page/resource/tab', Omit<ResourcePageProperties, 'component'> & { | ||
/** The component to be rendered when the route matches. */ | ||
component: CodeRef<React.ComponentType<RouteComponentProps>>; | ||
/** The name of the tab. */ | ||
name: string; | ||
/** The optional href for the tab link. If not provided, the first `path` is used. */ | ||
href?: string; | ||
/** When true, will only match if the path matches the `location.pathname` exactly. */ | ||
exact?: boolean; | ||
}>; | ||
export declare const isStandaloneRoutePage: (e: Extension<any>) => e is ExtensionDeclaration<"console.page/route/standalone", { | ||
/** Adds new standalone page (rendered outside the common page layout) to Console router. */ | ||
export declare type StandaloneRoutePage = ExtensionDeclaration<'console.page/route/standalone', Omit<RoutePageProperties, 'perspective'>>; | ||
export declare const isRoutePage: (e: Extension<any>) => e is ExtensionDeclaration<"console.page/route", RoutePageProperties>; | ||
export declare const isStandaloneRoutePage: (e: Extension<any>) => e is ExtensionDeclaration<"console.page/route/standalone", Pick<RoutePageProperties, "component" | "path" | "exact">>; | ||
export declare const isResourceListPage: (e: Extension<any>) => e is ExtensionDeclaration<"console.page/resource/list", ResourcePageProperties>; | ||
export declare const isResourceDetailsPage: (e: Extension<any>) => e is ExtensionDeclaration<"console.page/resource/details", ResourcePageProperties>; | ||
export declare const isResourceTabPage: (e: Extension<any>) => e is ExtensionDeclaration<"console.page/resource/tab", Pick<ResourcePageProperties, "model"> & { | ||
/** The component to be rendered when the route matches. */ | ||
component: CodeRef<import("react").FC<RouteComponentProps<{}, import("react-router").StaticContext, any>>>; | ||
/** Valid URL path or array of paths that `path-to-regexp@^1.7.0` understands. */ | ||
path: string | string[]; | ||
component: CodeRef<import("react").ComponentType<RouteComponentProps<{}, import("react-router").StaticContext, any>>>; | ||
/** The name of the tab. */ | ||
name: string; | ||
/** The optional href for the tab link. If not provided, the first `path` is used. */ | ||
href?: string; | ||
/** When true, will only match if the path matches the `location.pathname` exactly. */ | ||
exact?: boolean; | ||
}>; | ||
export {}; |
// Type guards | ||
export const isRoutePage = (e) => e.type === 'console.page/route'; | ||
export const isStandaloneRoutePage = (e) => e.type === 'console.page/route/standalone'; | ||
export const isResourceListPage = (e) => e.type === 'console.page/resource/list'; | ||
export const isResourceDetailsPage = (e) => e.type === 'console.page/resource/details'; | ||
export const isResourceTabPage = (e) => e.type === 'console.page/resource/tab'; | ||
//# sourceMappingURL=pages.js.map |
@@ -0,1 +1,2 @@ | ||
import { ExtensionK8sGroupModel } from '../api/common-types'; | ||
import { Extension, ExtensionDeclaration } from '../types'; | ||
@@ -5,7 +6,3 @@ /** Customize the display of models by overriding values retrieved and generated through API discovery. */ | ||
/** The model to customize. May specify only a group, or optional version and kind. */ | ||
model: { | ||
group: string; | ||
version?: string; | ||
kind?: string; | ||
}; | ||
model: ExtensionK8sGroupModel; | ||
/** Whether to consider this model reference as tech preview or dev preview. */ | ||
@@ -24,7 +21,3 @@ badge?: 'tech' | 'dev'; | ||
/** The model to customize. May specify only a group, or optional version and kind. */ | ||
model: { | ||
group: string; | ||
version?: string; | ||
kind?: string; | ||
}; | ||
model: ExtensionK8sGroupModel; | ||
/** Whether to consider this model reference as tech preview or dev preview. */ | ||
@@ -31,0 +24,0 @@ badge?: "tech" | "dev"; |
@@ -0,9 +1,6 @@ | ||
import { ExtensionK8sModel } from '../api/common-types'; | ||
import { Extension, ExtensionDeclaration } from '../types'; | ||
export declare type YAMLTemplate = ExtensionDeclaration<'console.yaml-template', { | ||
/** Model associated with the template. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
/** The YAML template. */ | ||
@@ -16,7 +13,3 @@ template: string; | ||
/** Model associated with the template. */ | ||
model: { | ||
group: string; | ||
version: string; | ||
kind: string; | ||
}; | ||
model: ExtensionK8sModel; | ||
/** The YAML template. */ | ||
@@ -23,0 +16,0 @@ template: string; |
import { FeatureFlag, ModelFeatureFlag } from '../extensions/feature-flags'; | ||
import { ReduxReducer } from '../extensions/redux'; | ||
import { ContextProvider } from '../extensions/context-providers'; | ||
import { StandaloneRoutePage } from '../extensions/pages'; | ||
import { StandaloneRoutePage, RoutePage, ResourceDetailsPage, ResourceListPage, ResourceTabPage } from '../extensions/pages'; | ||
import { YAMLTemplate } from '../extensions/yaml-templates'; | ||
@@ -9,3 +9,3 @@ import { AddAction } from '../extensions/add-actions'; | ||
import { HrefNavItem, ResourceNSNavItem, ResourceClusterNavItem, Separator, NavSection } from '../extensions/navigation'; | ||
import { CatalogItemType, CatalogItemProvider, CatalogItemFilter } from '../extensions/catalog'; | ||
import { SupportedCatalogExtensions } from '../extensions/catalog'; | ||
import { FileUpload } from '../extensions/file-upload'; | ||
@@ -16,3 +16,7 @@ import { ModelMetadata } from '../extensions/resource-metadata'; | ||
import { StorageProvider } from '../extensions/storage-provider'; | ||
export declare type SupportedExtension = FeatureFlag | ModelFeatureFlag | ReduxReducer | ContextProvider | StandaloneRoutePage | PVCCreateProp | PVCStatus | PVCAlert | PVCDelete | YAMLTemplate | AddAction | ClusterGlobalConfig | HrefNavItem | ResourceNSNavItem | ResourceClusterNavItem | Separator | NavSection | CatalogItemType | CatalogItemProvider | CatalogItemFilter | FileUpload | ModelMetadata | AlertAction | StorageProvider; | ||
import { TelemetryListener } from '../extensions/telemetry'; | ||
import { SupportedActionExtensions } from '../extensions/actions'; | ||
import { SupportedTopologyDetailsExtensions } from '../extensions/topology-details'; | ||
import { DashboardsTab, DashboardsCard, DashboardsOverviewHealthPrometheusSubsystem, DashboardsOverviewURLSubsystem, DashboardsOverviewHealthResourceSubsystem, DashboardsOverviewHealthOperator, DashboardsInventoryItemGroup, DashboardsOverviewInventoryItem, DashboardsOverviewResourceActivity } from '../extensions/dashboards'; | ||
export declare type SupportedExtension = FeatureFlag | ModelFeatureFlag | ReduxReducer | ContextProvider | StandaloneRoutePage | PVCCreateProp | PVCStatus | PVCAlert | PVCDelete | YAMLTemplate | AddAction | ClusterGlobalConfig | HrefNavItem | ResourceNSNavItem | ResourceClusterNavItem | Separator | NavSection | FileUpload | ModelMetadata | AlertAction | StorageProvider | TelemetryListener | SupportedCatalogExtensions | SupportedActionExtensions | SupportedTopologyDetailsExtensions | RoutePage | ResourceListPage | ResourceTabPage | ResourceDetailsPage | DashboardsTab | DashboardsCard | DashboardsOverviewHealthPrometheusSubsystem | DashboardsOverviewURLSubsystem | DashboardsOverviewHealthResourceSubsystem | DashboardsOverviewHealthOperator | DashboardsInventoryItemGroup | DashboardsOverviewInventoryItem | DashboardsOverviewResourceActivity; | ||
/** | ||
@@ -19,0 +23,0 @@ * Schema of Console plugin's `console-extensions.json` file. |
@@ -21,4 +21,4 @@ import * as webpack from 'webpack'; | ||
constructor(description: string); | ||
validate(compilation: webpack.Compilation, extensions: SupportedExtension[], exposedModules: ExposedPluginModules, dataVar?: string, extensionDataVar?: string): ValidationResult; | ||
validate(compilation: webpack.Compilation, extensions: SupportedExtension[], exposedModules: ExposedPluginModules, dataVar?: string): ValidationResult; | ||
} | ||
export {}; |
@@ -14,3 +14,6 @@ import * as _ from 'lodash'; | ||
return Object.keys(exposedModules).reduce((acc, moduleName) => { | ||
acc[moduleName] = webpackModules.find((m) => { var _a; return ((_a = m) === null || _a === void 0 ? void 0 : _a.rawRequest) === exposedModules[moduleName]; }); | ||
acc[moduleName] = webpackModules.find((m) => { | ||
const rawRequest = _.get(m, 'rawRequest') || _.get(m, 'rootModule.rawRequest'); | ||
return exposedModules[moduleName] === rawRequest; | ||
}); | ||
return acc; | ||
@@ -23,3 +26,3 @@ }, {}); | ||
} | ||
validate(compilation, extensions, exposedModules, dataVar = 'obj', extensionDataVar = 'data') { | ||
validate(compilation, extensions, exposedModules, dataVar = 'extensions') { | ||
const codeRefs = collectCodeRefData(extensions); | ||
@@ -41,3 +44,3 @@ const webpackModules = findWebpackModules(compilation, exposedModules); | ||
const [moduleName, exportName] = parseEncodedCodeRefValue(codeRefValue); | ||
const errorTrace = `in ${dataVar}.${extensionDataVar}[${data.index}] property '${propName}'`; | ||
const errorTrace = `in ${dataVar}[${data.index}] property '${propName}'`; | ||
if (!moduleName || !exportName) { | ||
@@ -44,0 +47,0 @@ this.result.addError(`Invalid code reference '${codeRefValue}' ${errorTrace}`); |
{ | ||
"name": "@openshift-console/dynamic-plugin-sdk", | ||
"version": "0.0.0-alpha12", | ||
"version": "0.0.0-alpha13", | ||
"description": "Tools and APIs for building OpenShift Console dynamic plugins", | ||
@@ -5,0 +5,0 @@ "main": "lib/extensions/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
478883
124
12355