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

Bug 1827361: Show the project selection list when a pinned item is shown for all projects #5176

Merged

Conversation

jeff-phillips-18
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-3653

Analysis / Root cause:
Pinned items show the standard resources list page in the dev perspective

Solution Description:
Add a Page/Route plugin for resources in the dev perspective plugin to show the project select page when using all-namespaces.

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. bugzilla/unspecified labels Apr 23, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1827361, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1827361: Show the project selection list when a pinned item is shown for all projects

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 openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 23, 2020
@openshift-ci-robot openshift-ci-robot added the component/dev-console Related to dev-console label Apr 23, 2020
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

It's an elegantly simple solution. I worry about the connectToPlural right now though. Looking around to see if I can find an alternative.

kindForReference,
} from '@console/internal/module/k8s';
import { ErrorPage404 } from '@console/internal/components/error';
import { withStartGuide } from '../../../../public/components/start-guide';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { withStartGuide } from '../../../../public/components/start-guide';
import { withStartGuide } from '@console/internal/components/start-guide';

<title>{kindObj.labelPlural}</title>
</Helmet>
<ProjectListPage title={kindObj.labelPlural}>
{`Select a project to view the list of ${kindObj.labelPlural}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit

Suggested change
{`Select a project to view the list of ${kindObj.labelPlural}`}
Select a project to view the list of {kindObj.labelPlural}

);
};

export default connectToPlural(withStartGuide(ProjectSelectPage));
Copy link
Contributor

Choose a reason for hiding this comment

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

connectToPlural is deprecated. Let me see what an alternative would be.

Copy link
Contributor

Choose a reason for hiding this comment

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

The only alternative I can see is if you thread the model from getPinnedItems (in perspective-nav.tsx) and use React-Router-Dom to as an object and provide the state.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think its best to leave as is and someday when the connectToPlural is really removed it is replaced with a viable alternative

<Helmet>
<title>{kindObj.labelPlural}</title>
</Helmet>
<ProjectListPage title={kindObj.labelPlural}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to include the badge, if there is one.

Suggested change
<ProjectListPage title={kindObj.labelPlural}>
<ProjectListPage title={kindObj.labelPlural} badge={getBadgeFromType(kindObj.badge)}>

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

@christianvogt Would you be able to take a quick look here, I am still not super happy with the use of a deprecated function but the deprecation notice really should have listed an alternative.

I think Sam successfully fixed the issue where the conflict with Knative and the regular models occurred... so I suspect this will work fine.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 23, 2020
loader: async () =>
(
await import(
'./components/ProjectSelectPage' /* webpackChunkName: "dev-console-buildconfigs" */
Copy link
Contributor

Choose a reason for hiding this comment

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

update webpack chunk name.

Suggested change
'./components/ProjectSelectPage' /* webpackChunkName: "dev-console-buildconfigs" */
'./components/ProjectSelectPage' /* webpackChunkName: "dev-console-projectselectpage" */

Copy link
Contributor

@karthikjeeyar karthikjeeyar left a comment

Choose a reason for hiding this comment

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

Verified locally and works fine.
Waiting on a comment to #5176 (review) be resolved.

@christianvogt
Copy link
Contributor

@andrewballantyne i think connectToPlural was fixed sometime back. It looks like it breaks down the value into group version kind and does a look up.

@christianvogt
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, christianvogt, jeff-phillips-18

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

The pull request process is described 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-merge-robot openshift-merge-robot merged commit e9dcfdd into openshift:master Apr 27, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: All pull requests linked via external trackers have merged: openshift/console#5176. Bugzilla bug 1827361 has been moved to the MODIFIED state.

In response to this:

Bug 1827361: Show the project selection list when a pinned item is shown for all projects

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.

@spadgett spadgett added this to the v4.5 milestone Apr 28, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the pinned-resources branch December 2, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants