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

CONSOLE-3792: Add extension point to enable customized create project modal for dynamic plugins #13825

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sg00dwin
Copy link
Member

@sg00dwin sg00dwin commented May 6, 2024

@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 May 6, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2024
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/sdk Related to console-plugin-sdk kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels May 6, 2024
@TheRealJon
Copy link
Member

I just realized that we probably need to change the existing createNamespaceModal, createProjectModal, and createNamespaceOrProjectModal functions to use the useModal hook from the dynamic plugin SDK. The createModalLauncher function, part of our internal app, passes a different set of props than the launcher returned by useModal. We will want the new extension point to use props from the stable SDK API, not from our internal app.

@TheRealJon
Copy link
Member

I just realized that we probably need to change the existing createNamespaceModal, createProjectModal, and createNamespaceOrProjectModal functions to use the useModal hook from the dynamic plugin SDK. The createModalLauncher function, part of our internal app, passes a different set of props than the launcher returned by useModal. We will want the new extension point to use props from the stable SDK API, not from our internal app.

This also means that these functions will need to be migrated to hooks

@sg00dwin sg00dwin force-pushed the create-project-extension-CONSOLE-3792 branch from 773aa8f to 5842dcb Compare May 22, 2024 19:55
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 22, 2024
@openshift-ci openshift-ci bot added component/dev-console Related to dev-console component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared labels May 22, 2024
@sg00dwin sg00dwin force-pushed the create-project-extension-CONSOLE-3792 branch from 5842dcb to 01ed48b Compare May 24, 2024 18:01
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 24, 2024
@sg00dwin sg00dwin force-pushed the create-project-extension-CONSOLE-3792 branch 3 times, most recently from c849918 to fbabf3e Compare May 29, 2024 22:47
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2024
@sg00dwin sg00dwin changed the title [WIP] Add extension point to enable customized create project modal for dynamic plugins Add extension point to enable customized create project modal for dynamic plugins May 30, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 30, 2024
@sg00dwin sg00dwin force-pushed the create-project-extension-CONSOLE-3792 branch from fbabf3e to 89a0cf6 Compare May 30, 2024 15:31
Copy link
Contributor

openshift-ci bot commented May 30, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sg00dwin
Once this PR has been reviewed and has the lgtm label, please ask for approval from jhadvig. For more information see the Kubernetes Code Review Process.

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

@sg00dwin
Copy link
Member Author

/retest-required

@jhadvig jhadvig changed the title Add extension point to enable customized create project modal for dynamic plugins CONSOLE-3792: Add extension point to enable customized create project modal for dynamic plugins May 31, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 31, 2024

@sg00dwin: This pull request references CONSOLE-3792 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 31, 2024
Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

Thanks for this change @sg00dwin 👍
Adding couple of smaller comments.
Also it looks you need to regenerate the i18n.

@@ -71,7 +71,8 @@
"projectOverviewInventory": "./components/ProjectOverview/Inventory",
"projectOverview": "./utils/project-overview",
"modalPage": "./components/Modals/ModalPage",
"sampleErrorBoundaryPage": "./components/ErrorBoundary/SampleErrorBoundaryPage"
"sampleErrorBoundaryPage": "./components/ErrorBoundary/SampleErrorBoundaryPage",
"CreateProjectModal": "./components/Modals/CreateProjectModal"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"CreateProjectModal": "./components/Modals/CreateProjectModal"
"createProjectModal": "./components/Modals/CreateProjectModal"

Copy link
Member Author

Choose a reason for hiding this comment

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

updated


const CreateProjectModal: React.FC<{ closeModal: () => void }> = ({ closeModal }) => {
const { t } = useTranslation('plugin__console-plugin-template');
const [name, setName] = React.useState('');
Copy link
Member

Choose a reason for hiding this comment

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

Lets type these.

}) => {
const navigate = useNavigate();
const dispatch = useDispatch();
const [inProgress, setInProgress] = React.useState(false);
Copy link
Member

Choose a reason for hiding this comment

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

Lets type these as well

@sg00dwin sg00dwin force-pushed the create-project-extension-CONSOLE-3792 branch from 89a0cf6 to 89e00ff Compare June 3, 2024 16:39
@sg00dwin
Copy link
Member Author

sg00dwin commented Jun 4, 2024

/retest-required

Copy link
Contributor

openshift-ci bot commented Jun 4, 2024

@sg00dwin: 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/e2e-gcp-console 89e00ff link true /test e2e-gcp-console
ci/prow/frontend 89e00ff link true /test frontend

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

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/kubevirt Related to kubevirt-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants