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

Unit dates selector Component review #573

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

Conversation

XinHuang1112
Copy link

@XinHuang1112 XinHuang1112 commented Dec 23, 2024

Ontrack Component Review

Team Member Name

Xin Huang | 218161625

Component Name

unit-dates-selector Component

Files in this Component

  • unit-dates-selector.coffee
  • unit-dates-selector.tpl.html

Component Purpose

The unit-dates-selector component is a date selection tool for editing a unit's key details during the rollover process. It enables users to configure teaching periods, select start and end dates, and save the updated information for the unit.
Screenshots:
Original : unit-date-selector

Component Functions

The unit-dates-selector component allows users to:

  • View and select teaching periods: Dynamically load available teaching periods and display them in a dropdown list.
  • Pick start and end dates:Use interactive date pickers for precise selection of custom dates.
  • Save updated unit details:Submit teaching period or date information to the backend for processing.
  • Receive feedback:Display success or error messages after saving data.

Interaction with Other Components/Services

  • newTeachingPeriodService
    Output:

    • Loads and caches available teaching periods.
    • Filters and formats data for display in the dropdown.
  • alertService
    Outputs:

    • Displays success or error notifications to users.
  • $state
    Redirects users to the updated unit admin page after successful save.

  • Date Pickers
    Outputs:

    • Manages the state of two date pickers for startDate and endDate.

Migration Steps

I will be following the
doubtfire-web's Migration Guide

  1. Analyze Existing Component:

    • Review the AngularJS implementation.
    • Identify key functions, filters, and service dependencies.
  2. Setup Angular Environment:

    • Ensure Angular 17 project setup is ready.
    • Install required dependencies (e.g., Angular Material, ngx-pagination).
  3. Create Angular Component:

    • Generate a new Angular component unit-dates-selector.
    • Transfer HTML template and styles to Angular.
  4. Rewrite Core Logic:

    • Migrate key functions (e.g., filtering, pagination, sorting, and CSV export) into TypeScript.
    • Replace AngularJS $scope with reactive properties using Angular's @Input and @Output.
  5. Integrate Services:

    • Migrate services (newTeachingPeriodService, alertService) to Angular’s DI system.
    • Use Angular Router for navigation instead of $state.
  6. Replace Date Picker:

    • Integrate Angular Material date pickers.
    • Replace $scope.calOptions with reactive form controls.
  7. Testing:
    Validate all functionalities:

    • Teaching period dropdown.
    • Date pickers’ open/close behavior.
    • Successful save and error handling.
    • Navigation to the updated unit admin page.
  8. Downgrade Component (if needed):

    • Use UpgradeModule to allow Angular and AngularJS components to coexist.

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Safari
  • Tested in latest Firefox

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

@XinHuang1112 XinHuang1112 changed the title Unit dates selector Unit dates selector Component review Dec 23, 2024
Copy link

@nodogx nodogx left a comment

Choose a reason for hiding this comment

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

The documentations seems to make sense and match the Unit dates selector components. I have ran the git for the unit dates selector works as intended, with no error in the functionality. I approve these documentations.

Copy link

@aditya993388 aditya993388 left a comment

Choose a reason for hiding this comment

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

I have reviewed the documentation, and it’s really well done. You’ve clearly explained the purpose, functions, and migration steps of the unit-dates-selector component.

Since I’ve already reviewed the implementation of the unit-dates-selector, I can confidently say this is the right and accurate documentation for it.

Hence, I am approving it.

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