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

T04 Code Review #1

Open
wants to merge 14 commits into
base: feedback
Choose a base branch
from
Open

T04 Code Review #1

wants to merge 14 commits into from

Commits on May 17, 2024

  1. chore: Install json-server for mock API development

    - Installed json-server as a development dependency.
    - Updated package.json and package-lock.json with json-server.
    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    0f612dc View commit details
    Browse the repository at this point in the history
  2. chore: Add db.json to data folder

    - Added db.json to the data folder with a list of 10 contacts
    - Each contact oncludes id, name, lastname, twitter_username, avatar_url, favorite status and a note
    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    830f5f1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c9cdb9 View commit details
    Browse the repository at this point in the history
  4. feat: Define routes

    - '': main route
    - contact/:id : subroute of main route
    - 404: error route
    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    82a5463 View commit details
    Browse the repository at this point in the history
  5. feat: Create first components

    - error404Component: show the error page
    - homeComponente: show tha main view
    -contactComponent: show details of a specific contact
    -buttonComponente: basic component
    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    14975e5 View commit details
    Browse the repository at this point in the history
  6. chore: remove unncesary code

    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    94e36b2 View commit details
    Browse the repository at this point in the history
  7. chore: Create a data backup

    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    54c076b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    76ee403 View commit details
    Browse the repository at this point in the history
  9. feat: Add contact interface

    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    7dba897 View commit details
    Browse the repository at this point in the history
  10. feat: Create contact service

    HLena committed May 17, 2024
    Configuration menu
    Copy the full SHA
    c03256f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    801fadb View commit details
    Browse the repository at this point in the history
  12. Initial commit

    HLena authored May 17, 2024
    Configuration menu
    Copy the full SHA
    92ea431 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0f552db View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. Develop (HLena#12)

    * style: Set global styles
    
    * chore: Update property name from 'contact' to 'contacts'
    
    * feat: Implement method to get all contacts
    
    * feat: Consume contactService and show a list of contacts
    
    * Added getContactById fn in ContactService
    
    * Added html structure in Contact component
    
    * Added styles for Contact component
    
    * Updated styles for Contact component
    
    * Added favorite function
    
    * Feat/search contact (HLena#2)
    
    * feat: Implement searchContactByName method
    
    * refactor: Moved search functionality to a new 'searchContact' component and integrated it into 'home' component
    
    * feat: Add search component to handle contact search functionality
    
    * chore: Change the icon before the heading 'h1' element
    
    * Add angular icon
    
    * feat: Implement search functionality with RxJS Observables and operators
    - Add BehaviorSubject to manage search term input.
    -Use debounceTime and distincyUntilChanged operators to optimize search input handling.
    - Implement switchMap to handle search requests and update the filtered contacts list
    
    * refactor: Replace FormControl with input event binding for search functionality
    
    * styles: update styles
    
    * Contact component with delete function (HLena#3)
    
    * Added updateContact fn in ContactService for update favorites with backend
    
    * Updated Json data
    
    * Added delete contact feature
    
    * feat: Implement update and delete functionalities for contacts (HLena#4)
    
    * Added updateContact fn in ContactService for update favorites with backend
    
    * Updated Json data
    
    * Added delete contact feature
    
    ---------
    
    Co-authored-by: Heberth López <[email protected]>
    
    * refactor: Update project structure
    This commit updates the project structure to improve organization and maintainability.
    
    **Changes:**
    - Moved `data-access` folder to a `home` directory
    - Relocated `contact` and `search-contact` components  to a `home/ui`` directory
    - Updated import paths in affected files
    
    * component: create edit compoenent
    
    * feat: edit functionality working
    
    * Added default avatar for contacts without imageUrl
    
    * Changes in Contact component
    
    * feat: create user done!
    
    * Updated getContactById fn for error handling
    
    * task: basic validations added
    
    * Updated HomeComponent with welcome message
    
    * Added Error404 page with styles
    
    * Update ContactPage when a contact is not found
    
    * chore: add data folder to gitignore file
    
    * chore: remove share contact service
    
    * chore: remove unnecessary imports
    
    * Updated Home Page
    
    * chore: disabled button when required
    
    * Refactor ContactService, SearchContactComponent, and ContactComponent (HLena#6)
    
    * feat: Add HttpClientModule import to enable HTTP requests in HomeComponent
    
    * feat: Persist selected contact in localStorage across page reloads
    
    * fix: Optimize contact data management with contact$ observable
    
    Refactor the contact management to utilize a contact$ observable in the ContactService. This change allows for more efficient and responsive updates when changes occur in the backend database (db.js)
    
    * fix: Centralize ContactService provider in AppComponent for shared state management
    - Removed individual ContactService providers from each component to address an issue where updates to contacts$ observable were not being detected across components.
    - Set ContactService as a provider in AppComponent to ensure a single, application-wide instance, allowing all components to share and reflect a consistent state.
    
    * feat: Add tap and map operators to update contacts$ observable with new data
    - Implement tap and map operators in ContactService to transform and update the contacts$ observable.
    - This change ensures that any updates to the contact data are reflected in the observable, improving data consistency across the application.
    
    * feat: Add tap and filter operators in deleteContact method to update contacts$ observable with new data
    - Implement tap and filter operators in deleteContact method to transform and update the contacts$ observable.
    - This change ensures that any updates to the contact data are reflected in the observable, improving data consistency across the application.
    
    * fear: Manage selected contact Id using BehaviorSubject instead of localStorage
    
    * refactor: Simplify ContactComponent by removing redundant error handling
    - Removed unnecessary catchError in ngOnInit.
    - Leveraged error handling from service methods.
    - Consolidated subscriptions for easier management and cleanup.
    
    * refactor: Add error handling in ContactService
    - Implemented catchError in all HTTP request methods.
    - Added handleError method to log errors and provide default values.
    
    * feat: Refactor SearchContactComponent to manage state with BehaviorSubject
    - Updated to use BehaviorSubject for managing selected contact ID.
    - Added setupSearchSubscription, setupContactsSubscription, and setupSelectedContactSubscription methods for better readability.
    - Subscribed to selectedContactId$ observable.
    - Removed localStorage usage for storing the selected contact ID.
    - Ensured proper cleanup of subscriptions in ngOnDestroy.
    
    * refactor: removed disabled on new button
    
    * chore: increase number of random characters in id generator
    
    * Update contact (HLena#9)
    
    * feat: Add HttpClientModule import to enable HTTP requests in HomeComponent
    
    * feat: Persist selected contact in localStorage across page reloads
    
    * fix: Optimize contact data management with contact$ observable
    
    Refactor the contact management to utilize a contact$ observable in the ContactService. This change allows for more efficient and responsive updates when changes occur in the backend database (db.js)
    
    * fix: Centralize ContactService provider in AppComponent for shared state management
    - Removed individual ContactService providers from each component to address an issue where updates to contacts$ observable were not being detected across components.
    - Set ContactService as a provider in AppComponent to ensure a single, application-wide instance, allowing all components to share and reflect a consistent state.
    
    * feat: Add tap and map operators to update contacts$ observable with new data
    - Implement tap and map operators in ContactService to transform and update the contacts$ observable.
    - This change ensures that any updates to the contact data are reflected in the observable, improving data consistency across the application.
    
    * feat: Add tap and filter operators in deleteContact method to update contacts$ observable with new data
    - Implement tap and filter operators in deleteContact method to transform and update the contacts$ observable.
    - This change ensures that any updates to the contact data are reflected in the observable, improving data consistency across the application.
    
    * fear: Manage selected contact Id using BehaviorSubject instead of localStorage
    
    * refactor: Simplify ContactComponent by removing redundant error handling
    - Removed unnecessary catchError in ngOnInit.
    - Leveraged error handling from service methods.
    - Consolidated subscriptions for easier management and cleanup.
    
    * refactor: Add error handling in ContactService
    - Implemented catchError in all HTTP request methods.
    - Added handleError method to log errors and provide default values.
    
    * feat: Refactor SearchContactComponent to manage state with BehaviorSubject
    - Updated to use BehaviorSubject for managing selected contact ID.
    - Added setupSearchSubscription, setupContactsSubscription, and setupSelectedContactSubscription methods for better readability.
    - Subscribed to selectedContactId$ observable.
    - Removed localStorage usage for storing the selected contact ID.
    - Ensured proper cleanup of subscriptions in ngOnDestroy.
    
    * fix: Updates the request url to get contacts sorted alphabetically
    
    * feat: Update contacts$ observable after create, edit or delete a contact
    
    * fix: removes contactService from providers
    
    * feat: implements scrollToContact to show always the selected contact in the list
    - Added scrollToContact method in SearchContactComponent to scroll to the selected contact.
    - Applied scroll-margin-top to contact items to ensure they are not too close to the top edge when scrolled into view.
    - Ensured new contact is visible in the contact list immediately.
    
    * refactor: submit button text depens on action to execute
    
    * Username Validations (HLena#11)
    
    * refactor: deletes consolo.log
    
    * feat: Add username validation using UsernameValidatorDirective in contact edit form
    - Implemented validateUsername function to validate usernames.
    - Created UsernameValidatorDirective to use custom username validation.
    
    * chore: Adds '@' before username in contact component
    
    ---------
    
    Co-authored-by: Heberth López <[email protected]>
    Co-authored-by: Heberth López <[email protected]>
    Co-authored-by: CrhistianT <[email protected]>
    Co-authored-by: Crhistian Turpo <[email protected]>
    5 people authored May 20, 2024
    Configuration menu
    Copy the full SHA
    55c55f7 View commit details
    Browse the repository at this point in the history