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
Fixes #24480 - fix org switching on subs page #7605
Conversation
Issues: #24480 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, thanks @amirfefer!
Can you add a test for the new functionality please?
} | ||
static getDerivedStateFromProps(newProps) { | ||
const uiOrgName = document.getElementById('organization-dropdown').children[0].text.trim(); | ||
if (uiOrgName === 'Any Organization' && !newProps.location.state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little fragile, can we just check for the lack of an org id?
c4fad7f
to
097fc5e
Compare
@waldenraines I've added some tests |
@amirfefer this works well and thanks for adding tests but this now needs a rebase. |
path: 'redhat_repositories', | ||
component: WithOrganization(Repos, '/redhat_repositories'), | ||
component: WithOrganization( | ||
withHeader(Repos, { title: __('RH Repos') }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HOC's order is importent - affects on the entire component's lifecycle
|
||
export default () => ( | ||
<div> | ||
{links.map(({ path, component, text }) => { | ||
const Page = component; | ||
const withHeader = () => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on every route change withHeader
will recreate, it should exist as a separate component.
@waldenraines I've rebased and fix some issues, would you mind to have a quick look? |
package.json
Outdated
"enzyme": "^3.2.0", | ||
"enzyme-adapter-react-16": "^1.1.0", | ||
"enzyme": "^3.4.0", | ||
"enzyme-adapter-react-16.3": "^1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes required for this? If so we need to add a request to update these packages downstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works locally without these.
361b971
to
8e43408
Compare
@amirfefer sorry, I created some more conflicts for you here by merging #7630 |
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
Dang, I was hoping I could fix these conflicts for you and merge but apparently not. At any rate they are very minor. |
@waldenraines - rebased :) |
[test katello] |
Certain flows will allow the user to see subs across any organization.
This PR fixes it - when clicking on the
Any Organization
, a select organization page should appear.