Skip to content

Claudio/comp 106 add implementation widget#467

Merged
claudfuen merged 2 commits intomainfrom
claudio/comp-106-add-implementation-widget
Apr 29, 2025
Merged

Claudio/comp 106 add implementation widget#467
claudfuen merged 2 commits intomainfrom
claudio/comp-106-add-implementation-widget

Conversation

@claudfuen
Copy link
Copy Markdown
Contributor

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes COMP-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

- Added FloatingOnboardingChecklist component to display onboarding progress.
- Introduced getOnboardingStatus action to fetch onboarding status from the database.
- Created generateChecklistItems function to generate checklist items based on onboarding data.
- Updated Layout and Page components to integrate onboarding status handling and error management.
- Refactored Checklist component to use ChecklistItemProps for better type safety.
Copilot AI review requested due to automatic review settings April 29, 2025 16:12
@linear
Copy link
Copy Markdown

linear bot commented Apr 29, 2025

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ❌ Failed (Inspect) Apr 29, 2025 4:15pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
comp-portal ⬜️ Skipped (Inspect) Apr 29, 2025 4:15pm

@vercel vercel bot temporarily deployed to Preview – comp-portal April 29, 2025 16:12 Inactive
@claudfuen claudfuen merged commit 78a5081 into main Apr 29, 2025
6 checks passed
@claudfuen claudfuen deleted the claudio/comp-106-add-implementation-widget branch April 29, 2025 16:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the routing paths by replacing "/employees" with "/people" and integrates an onboarding checklist widget via new actions and UI components. Key changes include:

  • Updating revalidation paths across multiple action files and components.
  • Introducing a new onboarding checklist with corresponding types, pages, and actions.
  • Removing obsolete "employees/all" pages and components.

Reviewed Changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/[employeeId]/actions/update-employee.ts Updated revalidation paths from "/employees" to "/people".
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/[employeeId]/actions/update-employee-status.ts Updated revalidation paths to reflect new routing.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/[employeeId]/actions/update-employee-details.ts Revalidation paths updated to "/people".
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/[employeeId]/actions/update-department.ts Revalidation paths updated to "/people".
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/layout.tsx Added onboarding checklist logic with error logging for fetching onboarding status.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/implementation/types.ts Updated the ChecklistItemProps by making description required.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/implementation/page.tsx Updated onboarding status retrieval and enhanced error messaging in the UI.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/implementation/components/Checklist.tsx Modified type import and key usage for Checklist items.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/implementation/checklist-items.tsx New file generating checklist items with updated routing.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/implementation/actions.ts New file that consolidates onboarding status logic.
apps/app/src/actions/organization/remove-employee.ts and invite-employee.ts Updated revalidation paths to remove "/employees/all" references.
Other employees/all pages/components Removed obsolete files related to the "employees/all" route.
Comments suppressed due to low confidence (1)

apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/implementation/components/Checklist.tsx:10

  • [nitpick] Using 'dbColumn' as a React key might lead to duplicate keys if its values are not guaranteed to be unique; consider using a more unique identifier if available.
<ChecklistItem key={item.dbColumn} {...item} />

if ("error" in onboardingStatus) {
// Decide how to handle the error - maybe log it or show a generic error message
// For now, we'll proceed without the checklist
console.error("Error fetching onboarding status:", onboardingStatus.error);
Copy link

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

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

[nitpick] While console.error is useful for debugging during development, integrating a structured error tracking or user feedback mechanism may improve error handling in production.

Copilot uses AI. Check for mistakes.
const completedItems = checklistItems.filter((item) => item.completed).length;
const totalItems = checklistItems.length;

return { checklistItems, completedItems, totalItems };
Copy link

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The getOnboardingStatus function returns an error object on failure and a status object on success; standardizing error handling (e.g., by throwing exceptions) could avoid ambiguity in downstream consumers.

Copilot uses AI. Check for mistakes.
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