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
Move topology from dev-console to its own monorepo #7254
Move topology from dev-console to its own monorepo #7254
Conversation
6198600
to
25ea9e5
Compare
/test analyze |
/retest |
45d6d82
to
478ec68
Compare
@@ -1,7 +1,7 @@ | |||
import * as React from 'react'; | |||
import * as cx from 'classnames'; | |||
import { NamespaceBar } from '@console/internal/components/namespace'; | |||
import ApplicationSelector from './dropdown/ApplicationSelector'; | |||
import { NamespaceBarApplicationSelector } from '@console/topology/src'; |
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.
Nit:
import { NamespaceBarApplicationSelector } from '@console/topology/src'; | |
import { NamespaceBarApplicationSelector } from '@console/topology'; |
{!hideApplications && <ApplicationSelector disabled={disabled} />} | ||
{!hideApplications && <NamespaceBarApplicationSelector disabled={disabled} />} |
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.
🤔 Is this PR not just a refactor... why the change in component usage?
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.
There were two different ApplicationSelector components, one in shared one in dev-console. Both are now in topology (since the use the topology data retrieval) and this one was renamed.
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.
Gotcha. Thanks for the clarification!
@@ -1,6 +1,6 @@ | |||
import { K8sResourceKind } from '@console/internal/module/k8s'; | |||
import { ServiceModel } from '@console/knative-plugin'; | |||
import { UNASSIGNED_KEY } from '../../../const'; | |||
import { UNASSIGNED_KEY } from '@console/topology/src/const'; |
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.
Nit:
import { UNASSIGNED_KEY } from '@console/topology/src/const'; | |
import { UNASSIGNED_KEY } from '@console/topology'; |
@@ -10,7 +10,7 @@ import { DeploymentConfigModel, DeploymentModel } from '@console/internal/models | |||
import { hasIcon } from '@console/internal/components/catalog/catalog-item-icon'; | |||
import { ServiceModel } from '@console/knative-plugin'; | |||
import { Pipeline } from '@console/pipelines-plugin/src/utils/pipeline-augment'; | |||
import { UNASSIGNED_KEY } from '../../const'; | |||
import { UNASSIGNED_KEY } from '@console/topology/src/const'; |
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.
Nit:
import { UNASSIGNED_KEY } from '@console/topology/src/const'; | |
import { UNASSIGNED_KEY } from '@console/topology'; |
@@ -16,5 +16,3 @@ const CheIcon: React.FC<React.HTMLProps<SVGElement>> = ({ style }): React.ReactE | |||
</svg> | |||
); | |||
}; | |||
|
|||
export default CheIcon; |
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.
Sole component file should have a default export... why the change?
Recommend you undo.
@@ -111,5 +111,3 @@ const SvgBoxedText: React.FC<SvgBoxedTextProps> = ({ | |||
</g> | |||
); | |||
}; | |||
|
|||
export default SvgBoxedText; |
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.
Same here
@@ -1,4 +1,6 @@ | |||
import { STORAGE_PREFIX } from '@console/shared'; | |||
import { STORAGE_PREFIX } from '@console/shared/src/constants/common'; |
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.
import { STORAGE_PREFIX } from '@console/shared/src/constants/common'; | |
import { STORAGE_PREFIX } from '@console/shared'; |
@@ -29,5 +29,3 @@ const DataModelProvider: React.FC<DataModelProviderProps> = ({ namespace, childr | |||
</ModelContext.Provider> | |||
); | |||
}; | |||
|
|||
export default DataModelProvider; |
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.
Default export
const ModelContext = createContext<ExtensibleModel>(null); | ||
|
||
export default ModelContext; | ||
export const ModelContext = createContext<ExtensibleModel>(null); |
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.
I would think this should still be a default export but it's odd it was put into a variable first.
default export createContext<ExtensibleModel>(null);
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.
There are multiple exports.
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.
😕 Sure, but in these 3 lines, it didn't need to create a variable to do a default export
-- but I think you handled this in your last change, so it's moot now.
import { TopologyViewType } from '@console/dev-console/src/components/topology/topology-types'; | ||
import { STORAGE_PREFIX } from '@console/shared'; | ||
import { TopologyPage } from '@console/topology'; | ||
import { TopologyViewType } from '@console/topology/src/topology-types'; |
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.
import { TopologyViewType } from '@console/topology/src/topology-types'; | |
import { TopologyViewType } from '@console/topology'; |
478ec68
to
59dad45
Compare
59dad45
to
c6fb7a2
Compare
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.
frontend/packages/topology/src/index.ts
is an empty file. Perhaps delete?
import { InputField } from '@console/shared'; | ||
import { useTranslation } from 'react-i18next'; | ||
import ApplicationSelector from '@console/topology/src/components/dropdowns/ApplicationSelector'; | ||
import FormSection from '@console/dev-console/src/components/import/section/FormSection'; |
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.
Nit: move these back up to where the other calls were.
|
||
describe('TopologySideBar:', () => { | ||
const props: TopologySideBarProps = { |
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.
hmmm... this could be to our loss if the type changes shape.
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.
we'd get compile errors or test failures. A lot of tests don't use prop types.
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.
Ah okay, no worries.
import { useExtensions } from '@console/plugin-sdk/src'; | ||
import { isTopologyDataModelFactory, TopologyDataModelFactory } from '../../extensions'; | ||
import { WatchK8sResources } from '@console/internal/components/utils/k8s-watch-hook'; | ||
import { getBaseWatchedResources } from '../../data-transforms/transform-utils'; |
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.
Nit: sort.
/lgtm Tested various things on Topology (adding items and seeing if sidebars loaded and pods spooled up and all the normal touch points I could think of) looks like the refactor didn't cause any issues as far as I can tell. Nits are nice to haves, but I don't think they change the merge-ability of this PR. |
/approve |
c6fb7a2
to
6062e7e
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, christianvogt, jeff-phillips-18 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 |
Fixes:
https://issues.redhat.com/browse/ODC-5037
Solution Description:
Created a new
topology
package, moved code from dev-console package there.Non-functional change.
Browser conformance:
/kind cleanup