Skip to content

Conversation

@aarya-16
Copy link

@aarya-16 aarya-16 commented Oct 10, 2025

Description

Overview

Replaced three duplicate empty state components (DestinationEmptyState, SourceEmptyState, JobEmptyState) with a single reusable EmptyState component, while preserving existing functionality and visual styling.

File Changes

New Files Added

ui/src/modules/common/components/EmptyState.tsx

  • Generic empty state component with configuration-driven rendering
  • Handles asset mapping, icon mapping, and HTML content support

ui/src/utils/emptyStateConfigs.ts

  • Configuration objects for destination, source, and job empty states
  • Contains styling, content, and asset paths for each variant

Files Modified

ui/src/types/commonTypes.ts

  • Added EmptyStateConfig and EmptyStateProps interfaces for TypeScript support

ui/src/modules/destinations/components/DestinationEmptyState.tsx

  • Now uses generic EmptyState component with destination configuration

ui/src/modules/sources/components/SourceEmptyState.tsx

  • Now uses generic EmptyState component with source configuration

ui/src/modules/jobs/components/JobEmptyState.tsx

  • Now uses generic EmptyState component with job configuration

fixes #220

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Ran pre-commit checks
  • Ensure UI remains consistent before and after refactoring and adding the changes

Related PR's (If Any):

@CLAassistant
Copy link

CLAassistant commented Oct 10, 2025

CLA assistant check
All committers have signed the CLA.

@aarya-16
Copy link
Author

@tarakaswathi-datazip please review this PR, and let me know if any changes are necessary.

@Akshay-datazip
Copy link
Collaborator

hey thanks a lot for your contribution @aarya-16 can you also go ahead and share the pr on our slack in contribute-to-olake channel?
Would help our devs to expedite
regards
https://join.slack.com/t/getolake/

@deepanshupal09-datazip
Copy link
Collaborator

deepanshupal09-datazip commented Oct 23, 2025

Hi @aarya-16, have you tested your changes? can you share screenshot of your changes made?
Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

The goal of this issue was to consolidate all Empty State components into a single shared one
Please remove this component and use the common EmptyState.tsx instead

Copy link
Collaborator

Choose a reason for hiding this comment

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

same for this

Copy link
Collaborator

Choose a reason for hiding this comment

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

and this too

Comment on lines 83 to 107
export interface EmptyStateConfig {
image: string
welcomeText: string
welcomeTextColor: string
heading: string
description: string
descriptionColor: string

button: {
text: string
icon: string
className: string
}

tutorial: {
link: string
image: string
altText: string
}
}

export interface EmptyStateProps {
config: EmptyStateConfig
onButtonClick: () => void
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don’t need to pass this much information into the EmptyState component. Instead, the props can be simplified to something like:

export interface EmptyStateProps {
  page: "job" | "sources" | "destinations";
  onButtonClick: () => void
}

The config logic can live inside the EmptyState component itself... since it’s only used there and not reused elsewhere. This way, we can conditionally render based on the page prop instead of passing the entire config through props.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As mentioned in the above comment, please remove this file from utils, and keep the config inside the EmptyState Component itself

@@ -0,0 +1,87 @@
import { Button } from "antd"
import { PlayCircle, Plus, GitCommit } from "@phosphor-icons/react"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change this to

Suggested change
import { PlayCircle, Plus, GitCommit } from "@phosphor-icons/react"
import { PlayCircleIcon, PlusIcon, GitCommitIcon } from "@phosphor-icons/react"

as these are depracted icon, and there is a separate PR to replace them everywhere, so let's keep it consistent here too

Comment on lines 5 to 22
image: "/src/assets/FirstDestination.svg",
welcomeText: "Welcome User !",
welcomeTextColor: "text-brand-blue",
heading: "Ready to create your first destination",
description:
"Get started and experience the speed of OLake by running jobs",
descriptionColor: "text-text-primary",
button: {
text: "New Destination",
icon: "Plus",
className:
"border-1 mb-12 border-[1px] border-[#D9D9D9] bg-white px-6 py-4 text-black",
},
tutorial: {
link: "https://youtu.be/Ub1pcLg0WsM?si=V2tEtXvx54wDoa8Y",
image: "/src/assets/DestinationTutorial.svg",
altText: "Destination Tutorial",
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, I don't think we need these many things in the config... some attributes here are common in all three configs(job, source, destination)

Please remove such attributes that are common, and try to keep the attributes here to minimum, things that are actually different in all three.

Comment on lines 83 to 103
export interface EmptyStateConfig {
image: string
welcomeText: string
welcomeTextColor: string
heading: string
description: string
descriptionColor: string

button: {
text: string
icon: string
className: string
}

tutorial: {
link: string
image: string
altText: string
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are moving the config to the component itself, also remove this interface from here

@deepanshupal09-datazip deepanshupal09-datazip added the hacktoberfest Issues open for Hacktoberfest contributors label Oct 28, 2025
@aarya-16
Copy link
Author

@deepanshupal09-datazip Here are the screenshots:

Jobs
image

Source
image

Destination
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest Issues open for Hacktoberfest contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants