Skip to content

Phase 6#2

Open
MohammadAminDadkhah wants to merge 41 commits into
mainfrom
phase-6
Open

Phase 6#2
MohammadAminDadkhah wants to merge 41 commits into
mainfrom
phase-6

Conversation

@MohammadAminDadkhah
Copy link
Copy Markdown
Collaborator

screencapture-localhost-4200-2025-07-30-10_50_26 screencapture-localhost-4200-admin-2025-07-30-10_50_12

MohammadAminDadkhah and others added 29 commits July 28, 2025 12:27
Comment thread phase-6/src/app/layouts/panel/add-book/add-book.component.ts Outdated
Comment thread phase-6/src/app/layouts/panel/add-book/add-book.component.html Outdated
Comment thread phase-6/src/app/layouts/main/footer/footer.component.html Outdated
@@ -0,0 +1,3 @@
main {
min-height: calc(100vh - 14rem);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

اگه سایز هدر یا فوتر تغییر کنه چی؟

path: '',
component: MainComponent,
children: [
{ path: 'home', redirectTo: '', pathMatch: 'full' },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

به نظرتون این اضافه کاری نیست که home رو بیایین ریدایرکت کنین به path خالی؟ اگه میخوایین وقتی مسیر اشتباهی وارد شد ریدایرکت بشه به home میتونین از wildcard استفاده کنین که اگه مسیر وارد شده با مسیر های تعریف شده شما match نشد به جایی که میخوایین کاربر رو هدایت کنید

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

نه این رو معمولا میزارن که اگه طرف یا لینکی به /home اومد اتفاقا به not found page نره و همون / که همون home page هست رو نشونش بده

Comment thread phase-6/src/app/layouts/main/main.routes.ts
Comment thread phase-6/src/app/layouts/panel/add-book/add-book.component.html
Comment thread phase-6/src/app/layouts/panel/panel.component.ts
providedIn: 'root',
})
export class BooksService {
private books = BOOKS;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

بهتر بود type مشخص کنید برای books

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

این کار رو به خاطر این انجام ندادیم چون initial value داشت ولی اگر مقدار اولیش خالی بود درست بود

Comment thread phase-6/src/app/services/books.service.ts Outdated
import { BooksService } from '../../../services/books.service';

@Component({
selector: 'app-top-bar',
Copy link
Copy Markdown

@amirbarari amirbarari Jul 31, 2025

Choose a reason for hiding this comment

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

بهتر بود اسم این کامبوننت رو top-bar نذارید. بر اساس کاری که داره انجام میده اسمش filter داشته باشه بهتره

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

اره ولی این پیش بینی شده شاید button های دیگه هم اضافه بشه برا همین کلی در نظر گرفتیم بر اساس موقعیت جای گیریش

this.books = this.booksService.getAllBooks;
}

ngDoCheck() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

به جای استفاده از ngDoCheck که بر اساس خیلی از رویداد هایی که توی صفحه و برنامه رخ میدن و به به سرچ مرتبط نیستن میتونستید یه event با هر تغییر input بدید و از اون استفاده کنید تا performance بهتری داشته باشید.

@amirbarari
Copy link
Copy Markdown

Screencast from 25-07-31 21:22:44.webm
دوتا مشکلی که هست اینه که وقتی یه چیزی سرچ میشه توی صفحه اصلی روی لیست نمایش داده شده صفحه ادمین هم تاثیر میذاره و این به نظرم خوب نیست و بر اساس \یاده سازی خودتون هم که اومدین دوتا ماژول برای صفحه اصلی که کاربر ارتباط داره و یکی دیگه برای ادمین بازهم منطقی نیست. وقتی دوباره به صفحه خانه برمیگردیم اون سرچ قبلی اعمال شده هست بدون اینکه input سرچ داخلش متن سرچی باشه. من بیشنهادم اینه که بیایید book-service رو در سطح دو تا ماژول provide کنید تا دوتا instance جدا از هم باشن. اینجوری اگه بعدا برای صفحه ادمین هم بخواین سرچ بیاده سازی کنید این دوتا باهم به تداخل نمیخورن. و اینکه بخش ذخیره سازی و سرچ هم میتونن توی دو تا سرویس جدا از book-service بیاده سازی بشن

@amirbarari
Copy link
Copy Markdown

در کل یه سری جاها کد های تکراری ای زدید که میتونن در قالب یه کابوننت در بیان و اینکه کابوننت هایی که تعریف شدن هم میشه reusable تر بیاده سازی بشن

display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 -0.2rem 0.8rem rgba(255, 255, 255, 0.35);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

توی box-shadow واقعا نیازه که از rem استفاده بشه؟

Comment on lines +1 to +10
export const HEADER_LINK = [
{
title: 'Home',
src: '',
},
{
title: 'Add book',
src: '/admin',
},
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

اسمش نباید با حرف بزرگ نوشته بشه و اینکه بجای _ باید از . استفاده بشه
header.links.ts

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