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

chore(KFLUXUI-296): remove workspace dependency from Components #103

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

JoaoPedroPP
Copy link
Contributor

@JoaoPedroPP JoaoPedroPP commented Feb 4, 2025

Fixes

KFLUXUI-296

Description

WIP: Just replace workspace for namespace

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@JoaoPedroPP JoaoPedroPP force-pushed the KFLUXUI-296 branch 3 times, most recently from a183e08 to eb63f5f Compare February 6, 2025 13:59
const applicationBreadcrumbs = useApplicationBreadcrumbs();
const showModal = useModalLauncher();
const [component, loaded, componentError] = useComponent(namespace, workspace, componentName);
const [component, loaded, componentError] = useComponent(namespace, workspaceName, componentName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need to remove the usage of workspace. No need to get it from route params. that will be removed later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in new version.

const customizePipeline = () => {
track(TrackEvents.ButtonClicked, {
link_name: 'manage-build-pipeline',
link_location: 'component-list-label',
component_name: component.metadata.name,
app_name: component.spec.application,
workspace,
workspace: workspaceName,
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove workspace usage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced by namespace, is it correct?

const track = useTrackEvent();
const showModal = useModalLauncher();
const [component] = useComponent(namespace, workspace, componentName);
const [component] = useComponent(namespace, workspaceName, componentName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove workspaceName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in new version.

@@ -101,7 +104,11 @@ const ComponentLatestBuild: React.FC<React.PropsWithChildren<ComponentLatestBuil
{commit ? (
<>
<Link
to={`/workspaces/${workspace}/applications/${commit.application}/commit/${commit.sha}`}
to={COMMIT_DETAILS_PATH.createPath({
workspaceName,
Copy link
Collaborator

Choose a reason for hiding this comment

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

use namespace here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All occurrences of workspaceName in a createPath function are now workspaceName: namespace

@@ -8,6 +8,7 @@ export const RouterParams = {
taskRunName: 'taskRunName',
componentName: 'componentName',
commitName: 'commitName',
commitSha: 'commitSha',
Copy link
Collaborator

Choose a reason for hiding this comment

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

We use commitName as the commitSha

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Sahil! I deleted commitSha and replace its use by commitName

@JoaoPedroPP JoaoPedroPP requested a review from sahil143 February 10, 2025 22:22
@JoaoPedroPP
Copy link
Contributor Author

if these changes are correct then I will adjust the unit tests

@JoaoPedroPP JoaoPedroPP marked this pull request as ready for review February 12, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants