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

Improve nav item extensions #1584

Merged

Conversation

vojtechszocs
Copy link
Contributor

@vojtechszocs vojtechszocs commented May 17, 2019

Follow-up to PR #1528.

From plugin perspective:

  • nav item extension's section now links to all known sections
  • nav item extension's componentProps now links to corresponding React component props
  • add ResourceClusterNavItem extension

From Console perspective:

  • refactor public/components/nav/index.jsx into smaller parts that use TypeScript
  • add __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ to global Window declaration

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 17, 2019
@vojtechszocs
Copy link
Contributor Author


const plugin: Plugin<ConsumedExtensions> = [
{
type: 'FeatureFlag/Model',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for moving this extension up in the list is to highlight that each plugin should start with adding its own feature flag(s).

Other extensions like nav items should be gated by those feature flags.

componentProps: {
name: 'Test ResourceCluster Link',
resource: 'projects',
required: [FLAGS.OPENSHIFT, 'TEST_MODEL_FLAG'],
Copy link
Contributor Author

@vojtechszocs vojtechszocs May 17, 2019

Choose a reason for hiding this comment

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

This link is equivalent to

<ResourceClusterLink
  resource="projects"
  name="Test ResourceCluster Link"
  required={[FLAGS.OPENSHIFT, 'TEST_MODEL_FLAG']}
/>

@vojtechszocs
Copy link
Contributor Author

@jtomasek This addresses the issue of adding nav items to all known sections.

@vojtechszocs
Copy link
Contributor Author

This PR is based on #1528 (not merged yet) so the first commit isn't related to this PR.

@vojtechszocs
Copy link
Contributor Author

/retest

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

lgtm, we should rebase now that #1528 merged

}
}

export class ResourceNSLink extends NavLink<ResourceNSLinkProps> {
Copy link
Member

Choose a reason for hiding this comment

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

Not new, but I'd like to get away from using inheritance in the nav components. Not necessary for this PR, just an observation.

https://reactjs.org/docs/composition-vs-inheritance.html

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2019
@vojtechszocs
Copy link
Contributor Author

lgtm, we should rebase now that #1528 merged

I'm on it.

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 20, 2019
@vojtechszocs
Copy link
Contributor Author

Clean rebase, no conflicts.

@spadgett
Copy link
Member

https://openshift-gce-devel.appspot.com/build/origin-ci-test/pr-logs/pull/openshift_console/1584/pull-ci-openshift-console-master-e2e-aws-console-olm/1205

NoSuchElementError: No element found using locator: By(css selector, input[data-test=providerType-community])

Weird, there's no community type in the error screenshot. @alecmerdler fyi

@spadgett
Copy link
Member

/retest

@spadgett
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 20, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spadgett, vojtechszocs

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 c78f6d9 into openshift:master May 20, 2019
@vojtechszocs vojtechszocs deleted the improve-nav-extension branch May 20, 2019 16:57
@mareklibra mareklibra mentioned this pull request May 21, 2019
3 tasks
@spadgett spadgett added this to the v4.2 milestone May 21, 2019
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. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants