console
console copied to clipboard
[WIP] Expose `CreateProjectListPage` and `NamespacedPage` components in internal SDK
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
CreateProjectListPageinstead 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/k8sin 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 (https://github.com/openshift/console/pull/11708).
- Previously,
dev-console/src/components/projectscontainedCreateProjectListPageand its internalProjectListPage, and also adetailssubdirectory containing theProjectDetailsPagecomponent. This PR moves the former two components to a new directory atconsole-shared/src/components/projects, but leaves behind theProjectDetailsPagein a new directory atdev-console/src/components/project-detailsbecause 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
NamespacedPagecomponent wasn't in a subdirectory ofdev-console/src/components, so it is now also at the top level ofconsole-shared/src/components. - An
index.tsfile was added atconsole-shared/src/components/projectsto match the pattern of other subdirectories there. - Imports have been adjusted to import each of these from
@console/sharednow that they are exported there.
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
[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.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/test all
/retest
@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 | e6673baf13f5382fa765bc1cd0b54da6acb75460 | link | true | /test frontend |
| ci/prow/e2e-gcp-console | e6673baf13f5382fa765bc1cd0b54da6acb75460 | link | true | /test e2e-gcp-console |
| ci/prow/analyze | e6673baf13f5382fa765bc1cd0b54da6acb75460 | link | true | /test analyze |
| ci/prow/kubevirt-plugin | e6673baf13f5382fa765bc1cd0b54da6acb75460 | 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.
Putting this on hold for now, it seems this belongs in the SDK proper.
@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.
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