react instedof angular - #10
Closed
MohamedAzzam-CS wants to merge 2 commits into
Closed
MohamedAzzam-CS wants to merge 2 commits into
MohamedAzzam-CS wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Critical CI and deployment issues, plus routing and accessibility issues, remain.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR replaces the Angular frontend with a React/Vite/TypeScript application using React Router, reusable components, SCSS styling, and mock services.
Changes:
- Migrates Angular tooling, bootstrap, configuration, and dependencies to React/Vite.
- Adds routed home, catalog, search, login, profile, detail, and 404 pages.
- Adds shared UI components, models, services, styling, and updated documentation.
File summaries
| File | Summary |
|---|---|
frontend/vite.config.ts |
Adds Vite React configuration. Critical (2 votes): The /zemoLibrary/ deployment path is not configured, so production assets will 404. |
frontend/tsconfig.tsbuildinfo |
Adds TypeScript build metadata. |
frontend/tsconfig.spec.json |
Removes Angular test configuration. |
frontend/tsconfig.json |
Configures React/Vite TypeScript compilation. |
frontend/tsconfig.app.json |
Removes Angular app configuration. |
frontend/src/vite-env.d.ts |
Declares SCSS module types. |
frontend/src/styles/global.scss |
Adds global styles. |
frontend/src/styles.scss |
Removes the Angular stylesheet placeholder. |
frontend/src/services/searchService.ts |
Adds book search logic. |
frontend/src/services/cartService.ts |
Adds cart state management. |
frontend/src/services/bookService.ts |
Adds mock book data access. |
frontend/src/services/authService.ts |
Adds mock authentication state. |
frontend/src/pages/Search/Search.tsx |
Adds the search page. Moderate (2 votes): The search control lacks a persistent accessible name. |
frontend/src/pages/Search/Search.module.scss |
Styles the search page. |
frontend/src/pages/Profile/Profile.tsx |
Adds the profile page. |
frontend/src/pages/Profile/Profile.module.scss |
Styles the profile page. |
frontend/src/pages/NotFound/NotFound.tsx |
Adds the 404 page. |
frontend/src/pages/NotFound/NotFound.module.scss |
Styles the 404 page. |
frontend/src/pages/Login/Login.tsx |
Adds the login form. Moderate (2 votes): The email control relies only on its placeholder for an accessible name. |
frontend/src/pages/Login/Login.module.scss |
Styles the login form. |
frontend/src/pages/Home/Home.tsx |
Adds the home page. |
frontend/src/pages/Home/Home.module.scss |
Styles the home page. |
frontend/src/pages/Catalog/Catalog.tsx |
Adds catalog filtering and pagination. |
frontend/src/pages/Catalog/Catalog.module.scss |
Styles the catalog page. |
frontend/src/pages/BookDetail/BookDetail.tsx |
Adds the book-detail page. |
frontend/src/pages/BookDetail/BookDetail.module.scss |
Styles book details. |
frontend/src/models/User.ts |
Defines the user model. |
frontend/src/models/Book.ts |
Defines the book model. |
frontend/src/main.tsx |
Adds React application bootstrap. Critical (2 votes): BrowserRouter lacks deployment-compatible basename or fallback handling for /zemoLibrary/ and nested refreshes. |
frontend/src/main.ts |
Removes the Angular bootstrap. |
frontend/src/index.html |
Removes the Angular HTML entrypoint. |
frontend/src/components/Sidebar/Sidebar.tsx |
Adds the genre sidebar. |
frontend/src/components/Sidebar/Sidebar.module.scss |
Styles the sidebar. |
frontend/src/components/RatingStars/RatingStars.tsx |
Adds rating display. Moderate (2 votes): The generic div does not reliably expose the aggregate rating to assistive technology. |
frontend/src/components/RatingStars/RatingStars.module.scss |
Styles the rating display. |
frontend/src/components/Pagination/Pagination.tsx |
Adds pagination controls. |
frontend/src/components/Pagination/Pagination.module.scss |
Styles pagination. |
frontend/src/components/Navbar/Navbar.tsx |
Adds navigation links. Moderate (1 vote): The root NavLink lacks end, so Home appears active on descendant routes. |
frontend/src/components/Navbar/Navbar.module.scss |
Styles navigation. |
frontend/src/components/LoadingSpinner/LoadingSpinner.tsx |
Adds a loading indicator. |
frontend/src/components/LoadingSpinner/LoadingSpinner.module.scss |
Styles the loading indicator. |
frontend/src/components/Layout/Layout.tsx |
Adds the shared page layout. |
frontend/src/components/Layout/Layout.module.scss |
Styles the shared layout. |
frontend/src/components/Header/Header.tsx |
Adds the site header. |
frontend/src/components/Header/Header.module.scss |
Styles the site header. |
frontend/src/components/Footer/Footer.tsx |
Adds the site footer. |
frontend/src/components/Footer/Footer.module.scss |
Styles the site footer. |
frontend/src/components/BookCard/BookCard.tsx |
Adds the reusable book card. |
frontend/src/components/BookCard/BookCard.module.scss |
Styles book cards. |
frontend/src/app/app.ts |
Removes the Angular root component. |
frontend/src/app/app.spec.ts |
Removes the Angular root test. |
frontend/src/app/app.scss |
Removes the Angular root stylesheet. |
frontend/src/app/app.routes.ts |
Removes Angular routes. |
frontend/src/app/app.html |
Removes the Angular template. |
frontend/src/app/app.config.ts |
Removes Angular providers. |
frontend/src/App.tsx |
Defines React Router routes. |
frontend/README.md |
Documents the React/Vite setup. |
frontend/package.json |
Replaces Angular dependencies and scripts. Critical (3 votes): The workflow invokes undefined npm run test:ci. Critical (3 votes): The Pages workflow still uses Angular deployment arguments and artifact paths incompatible with Vite. Moderate (1 vote): The VS Code launch profile still invokes the removed npm: start task. |
frontend/index.html |
Adds the Vite HTML entrypoint. |
frontend/angular.json |
Removes Angular workspace configuration. |
Review details
Suppressed comments (2)
frontend/package.json:7
- The checked-in VS Code launch profile still runs the
npm: startpre-launch task, but this migration removes thestartscript. Using that profile now fails before Vite starts; retain astartalias or update the launch profile to use the new dev script.
"dev": "vite",
frontend/src/components/Navbar/Navbar.tsx:19
- The
NavLinkfor/is missingend, so React Router considers it active for every descendant path such as/catalogand/profile. The Home link will therefore appear active alongside the current route; setendfor the root link.
<NavLink
key={link.to}
to={link.to}
className={({ isActive }) => (isActive ? styles.active : styles.link)}
- Files reviewed: 58/62 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| ] | ||
| "dev": "vite", | ||
| "build": "tsc -b && vite build", |
| "dev": "vite", | ||
| "build": "tsc -b && vite build", | ||
| "preview": "vite preview", | ||
| "test": "vitest" |
|
|
||
| ReactDOM.createRoot(document.getElementById('root')!).render( | ||
| <React.StrictMode> | ||
| <BrowserRouter> |
Comment on lines
+4
to
+5
| export default defineConfig({ | ||
| plugins: [react()], |
| export default function RatingStars({ rating, max = 5 }: RatingStarsProps) { | ||
| const stars = Array.from({ length: max }, (_, i) => i < Math.round(rating)); | ||
| return ( | ||
| <div className={styles.stars} aria-label={`Rating: ${rating} out of ${max}`}> |
| return ( | ||
| <form className={styles.form} onSubmit={handleSubmit}> | ||
| <h1>Login</h1> | ||
| <input |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.