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

[WIP] Expose CreateProjectListPage and NamespacedPage components in internal SDK #11823

Closed

Conversation

mturley
Copy link

@mturley mturley commented Jul 12, 2022

Based on the usage here on the Add page and here on the Pipelines page, these two components allow a plugin to provide pages which require a namespace/project to be selected/created before reaching the page.

  • By rendering CreateProjectListPage instead of the page when there is no namespace present in the URL, the plugin can let the user create or select a project and then automatically proceed to the namespaced page in the same way that the above pages do (with a custom description at the top) without having to reimplement this selection page.
  • By wrapping the page in NamespacedPage, the plugin can provide the project switcher bar at the top even on pages which don't have /k8s in their URL (which is useful if a page doesn't strictly map to a k8s resource semantically). This is done above for both the /add/* and /dev-pipelines/* paths.

This PR moves the above two components from frontend/packages/dev-console/src/components into frontend/packages/console-shared/src/components, moves their prop types to frontend/packages/console-dynamic-plugin-sdk/src/api/internal-types.ts and exports them from frontend/packages/console-dynamic-plugin-sdk/src/api/internal-api.ts. This pattern is based on the last PR to expose something in this package (#11708).

  • Previously, dev-console/src/components/projects contained CreateProjectListPage and its internal ProjectListPage, and also a details subdirectory containing the ProjectDetailsPage component. This PR moves the former two components to a new directory at console-shared/src/components/projects, but leaves behind the ProjectDetailsPage in a new directory at dev-console/src/components/project-details because it is imported dynamically in the dev-console plugin's routes, so it didn't seem right to move it out of that package.
  • The NamespacedPage component wasn't in a subdirectory of dev-console/src/components, so it is now also at the top level of console-shared/src/components.
  • An index.ts file was added at console-shared/src/components/projects to match the pattern of other subdirectories there.
  • Imports have been adjusted to import each of these from @console/shared now that they are exported there.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 12, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added component/core Related to console core functionality component/dev-console Related to dev-console labels Jul 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 12, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mturley
To complete the pull request process, please assign jhadvig after the PR has been reviewed.
You can assign the PR to them by writing /assign @jhadvig 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 openshift-ci bot added component/helm Related to helm-plugin component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/pipelines Related to pipelines-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology labels Jul 12, 2022
@mturley
Copy link
Author

mturley commented Jul 12, 2022

/test all

@mturley
Copy link
Author

mturley commented Jul 12, 2022

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 12, 2022

@mturley: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/frontend e6673ba link true /test frontend
ci/prow/e2e-gcp-console e6673ba link true /test e2e-gcp-console
ci/prow/analyze e6673ba link true /test analyze
ci/prow/kubevirt-plugin e6673ba link true /test kubevirt-plugin

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@mturley
Copy link
Author

mturley commented Jul 13, 2022

Putting this on hold for now, it seems this belongs in the SDK proper.

@openshift-merge-robot
Copy link
Contributor

@mturley: PR needs rebase.

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-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 22, 2022
@mturley mturley closed this Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/core Related to console core functionality component/dev-console Related to dev-console component/helm Related to helm-plugin component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/pipelines Related to pipelines-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants