-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix(KFLUXUI-301): remove workspace dependency from Secrets #113
base: main
Are you sure you want to change the base?
Conversation
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.
Please remove the comments that were left behind. Beside that I left three questions why we use workspace dependency in some parts of the code.
This PR will probably be affected by #111 and the path for Namespace dependency will to update.
src/components/ComponentRelation/details-page/ComponentNudges.tsx
Outdated
Show resolved
Hide resolved
src/components/ComponentRelation/details-page/ComponentNudges.tsx
Outdated
Show resolved
Hide resolved
...omponents/ReleaseService/ReleasePlan/TriggerRelease/AddIssueSection/CVEComponentDropDown.tsx
Outdated
Show resolved
Hide resolved
src/components/SnapshotDetails/__tests__/EnvironmentProvisionErrorAlert.spec.tsx
Outdated
Show resolved
Hide resolved
@@ -63,7 +64,7 @@ const ComponentNudgesSVG: React.FC<ComponentNudgesSVGprops> = ({ | |||
{relatedComponents.map((comp, i) => ( | |||
<li key={i} data-test="nudges-connector"> | |||
<Link | |||
to={`/workspaces/${workspace}/applications/${comp.spec?.application}/components/${comp.metadata.name}`} | |||
to={`/workspaces/${namespace}/applications/${comp.spec?.application}/components/${comp.metadata.name}`} |
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.
Also should not be this like:
to={${APPLICATION_DETAILS_PATH.createPath({ workspaceName: namespace, applicationName: comp?.spec?.application, componentName: comp.metadata.name})}/
} or something similar @JoaoPedroPP @CryptoRodeo
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.
Nice catch!
Yeah, it should be the same
8cd65ce
to
f01a64c
Compare
@StanislavJochman , could you help to attach screenshots or recordings? For me, it seems the patch fixed more than its required. The screenshots or recordings are helpful for general review. |
jest.mock('../../../Workspace/useWorkspaceInfo', () => ({ | ||
useWorkspaceInfo: jest.fn(() => ({ namespace: 'test-ns', workspace: 'test-ws' })), | ||
})); |
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.
Can we remove this?
export const createUseNamespaceMock = (namespace: string = 'test-ns'): jest.Mock => { | ||
const mockFn = jest.fn().mockReturnValue(namespace); | ||
|
||
jest.spyOn(NameSpaceUtils, 'useNamespace').mockImplementation(mockFn); | ||
|
||
beforeEach(() => { | ||
mockFn.mockReturnValue(namespace); | ||
}); | ||
|
||
return mockFn; | ||
}; |
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 is a similar function in ./src/unit-test-utils/mock-namespace
, please use mockUseNamespaceHook
function.
@@ -60,7 +59,7 @@ const CustomizeAllPipelines: React.FC<React.PropsWithChildren<Props>> = ({ | |||
component={(props) => ( | |||
<Link | |||
{...props} | |||
to={`/workspaces/${workspace}/import?application=${applicationName}`} | |||
to={`${IMPORT_PATH.createPath({ workspaceName: namespace })}?application=${applicationName}`} |
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.
to={`${IMPORT_PATH.createPath({ workspaceName: namespace })}?application=${applicationName}`} | |
to={APPLICATION_DETAILS_PATH.createPath({ workspaceName: namespace, applicationName })} |
@@ -10,11 +10,11 @@ import { | |||
} from '@patternfly/react-core'; | |||
import { useComponents } from '../../hooks/useComponents'; | |||
import { ComponentModel } from '../../models'; | |||
import { IMPORT_PATH } from '../../routes/paths'; |
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 { IMPORT_PATH } from '../../routes/paths'; | |
import { APPLICATION_DETAILS_PATH } from '../../routes/paths'; |
Fixes
Description
Type of change
Screen shots / Gifs for design review
How to test or reproduce?
Browser conformance: