diff --git a/frontend/public/components/operator-lifecycle-manager/subscription.tsx b/frontend/public/components/operator-lifecycle-manager/subscription.tsx index 8344511506b..e1eea83ad50 100644 --- a/frontend/public/components/operator-lifecycle-manager/subscription.tsx +++ b/frontend/public/components/operator-lifecycle-manager/subscription.tsx @@ -38,10 +38,14 @@ const menuActions = [ label: 'Remove Subscription...', callback: () => createDisableApplicationModal({k8sKill, k8sGet, k8sPatch, subscription: obj}), }), - (kind, obj) => ({ - label: `View ${ClusterServiceVersionModel.kind}...`, - href: `/k8s/ns/${obj.metadata.namespace}/${ClusterServiceVersionModel.plural}/${_.get(obj.status, 'installedCSV')}`, - }), + (kind, obj) => { + const installedCSV = _.get(obj, 'status.installedCSV'); + return { + label: `View ${ClusterServiceVersionModel.kind}...`, + href: `/k8s/ns/${obj.metadata.namespace}/${ClusterServiceVersionModel.plural}/${installedCSV}`, + hidden: !installedCSV, + }; + }, ]; export const SubscriptionRow: React.SFC = (props) => { @@ -62,7 +66,7 @@ export const SubscriptionRow: React.SFC = (props) => { {props.obj.spec.installPlanApproval || 'Automatic'}
- +
; }; diff --git a/frontend/public/components/utils/dropdown.jsx b/frontend/public/components/utils/dropdown.jsx index 7f97642ea1b..e3ce48dea1a 100644 --- a/frontend/public/components/utils/dropdown.jsx +++ b/frontend/public/components/utils/dropdown.jsx @@ -379,7 +379,7 @@ Dropdown.propTypes = { export const ActionsMenu = (props) => { const {actions, title = undefined, menuClassName = undefined, buttonClassName = undefined} = props; - const shownActions = _.reject(actions, o => _.get(o, 'hidden', false)); + const shownActions = _.reject(actions, 'hidden'); const items = _.fromPairs(_.map(shownActions, (v, k) => [k, v.label])); const btnTitle = title || Actions; const onChange = (key, e) => { diff --git a/frontend/public/components/utils/kebab.tsx b/frontend/public/components/utils/kebab.tsx index 7b8a719a23a..e1f6336dac8 100644 --- a/frontend/public/components/utils/kebab.tsx +++ b/frontend/public/components/utils/kebab.tsx @@ -95,8 +95,9 @@ export const ResourceKebab = connectToModel((props: ResourceKebabProps) => { if (!kindObj) { return null; } + const options = _.reject(actions.map(a => a(kindObj, resource)), 'hidden'); return a(kindObj, resource))} + options={options} key={resource.metadata.uid} isDisabled={isDisabled !== undefined ? isDisabled : _.get(resource.metadata, 'deletionTimestamp')} />;