Skip to content

Conversation

@yashin4112
Copy link
Contributor

PR request to merge Execution Log Screen.

- Implemented ExecutionLogs component to display migration logs with filtering options.
- Created FilterModal for selecting log levels (info, error).
- Integrated API call to fetch migration logs with pagination and filtering.
- Updated Settings component to include Execution Logs section.
- Added styles for ExecutionLogs and FilterModal components.
- Defined TypeScript interfaces for log entries and filter options.
- Enhanced user experience with loading states and no data messages.
…te to the previous migration step.

- Updated ExecutionLogs component to improve error handling and user feedback with custom empty states.
- Refactored filter modal styles .
@yashin4112 yashin4112 requested a review from a team as a code owner May 12, 2025 09:25
const testStacks = useSelector(
(state: RootState) => state?.migration?.newMigrationData?.testStacks
);
console.info(testStacks.length)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove console

const [selectedStack, setSelectedStack] = useState<DropdownOption>(
{
label: stackIds[stackIds.length - 1]?.label ?? '' ,
value: stackIds[stackIds.length - 1]?.value ?? ''
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be stackIds[stackIds?.length - 1]

try {
let filterValueCopy: FilterOption[] = [...filterOption];

if (!filterValueCopy.length && isChecked) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be filterValueCopy?.length

} else if (isChecked) {
// Remove the old value and keep updated one in case old value exists
const updatedFilter = filterValueCopy.filter((v) => v.value !== value.value);
filterValueCopy = [...updatedFilter, value];
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be
const updatedFilter = filterValueCopy?.filter((v) => v?.value !== value?.value);

filterValueCopy = [...updatedFilter, value];
} else if (!isChecked) {
filterValueCopy = filterValueCopy.filter((v) => v.value !== value.value);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ?.

// Method to handle Apply
const onApply = () => {
try {
if (!filterOption.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ?.

return;
}

const usersQueryArray = filterOption.map((item) => item.value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ?.

Copy link
Contributor

Choose a reason for hiding this comment

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

filterOption?.map?((item) => item?.value);

updateValue({ value: item, isChecked: e.target.checked })
}
version="v2"
label={item.label}
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be item?.label. Please check whole file and added null checks

<div className="tableFilterModalStories__suggestion-item">
<Checkbox
checked={selectedLevels.some((v) => v.value === item.value)}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ?.

Copy link
Contributor

@umeshmore45 umeshmore45 left a comment

Choose a reason for hiding this comment

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


try {
const logsDir = path.join(process.cwd(), 'logs');
const mainPath = process.cwd()?.split("migration-v2")?.[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

const mainPath = process?.cwd?.()?.split?.("migration-v2")?.[0];

})
.filter((entry) => entry !== null);
return logEntries;
?.filter((entry) => entry !== null);
Copy link
Contributor

Choose a reason for hiding this comment

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

filter?.(

return { logs: [], total: 0 };
}

logEntries = logEntries?.slice(1, logEntries.length - 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

?.(

if (searchText !== "null") {
logEntries = logEntries?.filter((log) => {
return (
log?.level?.toLowerCase()?.includes(searchText?.toLowerCase() ?? '') ||
Copy link
Contributor

Choose a reason for hiding this comment

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

lets create genric func for this

params?.projectId ?? ''
);

if (status === 200) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s create constant for 200

isRowSelect={false}
columnSelector={false}
canSearch={true}
searchPlaceholder={'Search Execution Logs'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Constant

customEmptyState={
<EmptyState
forPage="list"
heading={searchText === '' ? 'No Logs' : 'No matching results found!'}
Copy link
Contributor

Choose a reason for hiding this comment

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

constant

searchText === ''
? 'Try Executing the Migration.'
: 'Try changing the search query to find what you are looking for.'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

constant

if (error instanceof Error) {
throw new Error(`Error in userSession: ${error.message}`);
} else {
throw new Error('Unknown error in userSession');
Copy link
Contributor

Choose a reason for hiding this comment

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

constant

Copy link
Contributor

Choose a reason for hiding this comment

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

Don’t push thios file

@sayalijoshi27 sayalijoshi27 merged commit fb8485c into dev May 19, 2025
4 checks passed
umeshmore45 pushed a commit that referenced this pull request Jun 11, 2025
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.

4 participants