Skip to content
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

Removing all the internal API Cards from Overview page #3844

Closed
wants to merge 1 commit into from

Conversation

aruniiird
Copy link
Contributor

A minimal change to remove all the internal API cards from 'Installed
Operator' -> Overview page

Signed-off-by: Arun Kumar Mohan arun.iiird@gmail.com

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 31, 2019
@openshift-ci-robot
Copy link
Contributor

Hi @aruniiird. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aruniiird
To complete the pull request process, please assign jeff-phillips-18
You can assign the PR to them by writing /assign @jeff-phillips-18 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the component/olm Related to OLM label Dec 31, 2019
@aruniiird
Copy link
Contributor Author

Before

withInternalCards

After

withPublicAPICards

@afreen23 , @bipuladh
Please note there are some unwanted blank cards being displayed.
Some help to fix that is much appreciated.

@bipuladh
Copy link
Contributor

bipuladh commented Jan 2, 2020

@aruniiird I don't think this we should be showing empty tiles. @shirimordechay wdyt?

return (
<Card></Card>
)
}
Copy link
Contributor

@afreen23 afreen23 Jan 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess all cards will be showing since the PF Card component has some custom css being applied on it that applies width to it.
https://github.com/openshift/console/blob/master/frontend/packages/operator-lifecycle-manager/src/style.scss#L89-L93
You can either return empty fragments to avoid this or return null.
Returning null would be good as its is suggested in react docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @afreen23 , returning a null fixed the blank tiles (from showing up)

Copy link
Contributor

@afreen23 afreen23 Jan 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aruniiird need to modify the filtering logic now as per the below comment.

@@ -570,6 +570,11 @@ export const CRDCard: React.SFC<CRDCardProps> = (props) => {
`/k8s/ns/${csv.metadata.namespace}/${ClusterServiceVersionModel.plural}/${
csv.metadata.name
}/${reference}/~new`;
if (crd.displayName.startsWith("[Internal]")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we can't use the operators.operatorframework.io/internal-objects annotation instead of trying to key on the name? See #3518

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this approach but is not working for me. Is there any documentation that clearly explains how to achieve this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keying on name should be removed ?

@aruniiird aruniiird force-pushed the displayOnlyPublicCards branch from bd546a7 to b713b72 Compare January 4, 2020 06:51
A minimal change to remove all the internal API cards from 'Installed
Operator' -> Overview page

Signed-off-by: Arun Kumar Mohan <arun.iiird@gmail.com>
@aruniiird aruniiird force-pushed the displayOnlyPublicCards branch from b713b72 to d920f88 Compare January 4, 2020 06:59
@@ -616,7 +620,7 @@ export const CRDCardRow = connect(crdCardRowStateToProps)((props: CRDCardRowProp
{_.isEmpty(props.crdDescs) ? (
<span className="text-muted">No Kubernetes APIs are being provided by this Operator.</span>
) : (
props.crdDescs.map((desc) => (
props.crdDescs.filter((crd) => !isInternal(crd)).map((desc) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this function is expecting csv object passed with crd name.
In order to reuse need to pass a custom object with csv and crdDesc

@aruniiird
Copy link
Contributor Author

Bipul has a better PR (#3877) to do the same ... Closing this PR

@aruniiird aruniiird closed this Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/olm Related to OLM needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants