-
Notifications
You must be signed in to change notification settings - Fork 5
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
#791 #1027
Conversation
@@ -15,6 +15,8 @@ export class PaginatorComponent implements OnInit, OnChanges { | |||
|
|||
@Input() currentPage: PaginationElement; | |||
@Input() totalEntities: number; | |||
@Input() totalEntitiesDir: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the same input ad it was before totalEntities
there is no sense in the new one
src/app/shared/enum/provider.ts
Outdated
export enum createDirectionSteps { | ||
'direction', | ||
'department', | ||
'class' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we should keep this enum in provider.ts. move it to admin
createDirection(direction: Direction): Observable<Direction> { | ||
return this.http.post<Direction>('/api/v1/Direction/Create', direction); | ||
} | ||
createDepartment(department: Department): Observable<object> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add typo Observable
export class UpdateDirection { | ||
static readonly type = '[admin] update Direction'; | ||
constructor(public payload) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add typo for payload
src/app/shared/store/admin.state.ts
Outdated
iClass: IClass[]; | ||
classes: IClass[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we have two fields for classes? I think you can use just one of them and patch it
templateUrl: './directions.component.html', | ||
styleUrls: ['./directions.component.scss'] | ||
}) | ||
export class DirectionsComponent implements OnInit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add OnDestroy
this.searchValue.valueChanges | ||
.pipe(takeUntil(this.destroy$)) | ||
.subscribe((val: string) => { | ||
this.searchedText = val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing
this.store.dispatch([new FilterClear(), new GetFilteredDirections(), ]); | ||
|
||
this.searchValue.valueChanges | ||
.pipe(takeUntil(this.destroy$)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add additional operators such as debounce time and startWith(''), distinctUntilChanged(),
check it for the search-filed component/city filter, we have the same there
this.searchQuery$ | ||
.pipe(takeUntil(this.destroy$)) | ||
.subscribe((text: string) => this.searchValue.setValue(text, {emitEvent: false})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here I believe
} | ||
|
||
onSearch(): void { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line
src/app/shared/enum/no-results.ts
Outdated
@@ -1,7 +1,8 @@ | |||
export enum NoResultsTitle { | |||
noApplication = 'Заявок поки немає', | |||
noResultWorkshops = 'За результатами нічого не знайдено', | |||
noParentWorkshops = 'Тут буде відображатися інформація про гуртки, секцію або школу для навчання. Ще жодної заяви на гурток не подано.', | |||
noParentWorkshops = 'Тут буде відображатися інформація про гуртки, секцію фбо школу для навчання. Ще жодної заяви на гурток не подано.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistake
private getTotalPageAmount(): number { | ||
return Math.ceil(this.totalEntities / Constants.ITEMS_PER_PAGE); | ||
return Math.ceil(this.totalEntities / Constants.ITEMS_PER_PAGE) || Math.ceil(this.totalEntitiesDir / Constants.ITEMS_PER_PAGE_DIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just as an idea, maybe for getTotalPageAmount method will be good to receive from parent component flag like isDirections and then check and if yes use Constants.ITEMS_PER_PAGE_DIR
static readonly ITEMS_PER_PAGE_DIR =10; | ||
static readonly ITEMS_PER_PAGE = 2 * Math.floor(window.innerWidth / (332)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think is it make sense to use the same approach as with ITEMS_PER_PAGE constant? I mean "2 * Math.floor(window.innerWidth / (332))"
@@ -1,5 +1,7 @@ | |||
export enum ModalConfirmationType { | |||
delete = 'delete', | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line
this.id = id; | ||
this.title = info.title; | ||
this.description = info.title; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line
throwError(payload); | ||
dispatch(new ShowMessageBar({ message: 'На жаль виникла помилка', type: 'error' })); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add empty line between methods
src/app/shared/store/admin.state.ts
Outdated
return patchState({ selectedDirection: direction, isLoading: false }); | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tap((direction: Direction) => { | |
return patchState({ selectedDirection: direction, isLoading: false }); | |
})); | |
tap((direction: Direction) => patchState({ selectedDirection: direction, isLoading: false }))); |
@@ -11,9 +11,10 @@ import { SetDirections } from '../../store/filter.actions'; | |||
}) | |||
export class CategoryCardComponent implements OnInit { | |||
@Input() workshopsCount: number; | |||
@Input() isEditMode: boolean; | |||
@Input() isEditMode: true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true is not a typo of data:) if you want to set a default value then it should be @input() isEditMode = true;
if you want to say the data typo is boolean then you should remain the previous version
@@ -22,6 +23,10 @@ export class CategoryCardComponent implements OnInit { | |||
ngOnInit(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can delete it as well
dispatch(new ShowMessageBar({ message: 'Дитина успішно відредагована', type: 'success' })); | ||
this.router.navigate(['/admin-tools/platform/about']); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add empty line
this.router.navigate(['/admin-tools/platform/directions']); | ||
this.getFilteredDirections; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add empty line
}); | ||
dialogRef.afterClosed().subscribe((result: boolean) => { | ||
if (result) { | ||
const department = result && new Department(this.departmentFormGroup.value, this.direction.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don think that you should check for result one more time, because you handled it earlier
debounceTime(1000), | ||
distinctUntilChanged(), | ||
startWith(''), | ||
takeUntil(this.destroy$) | ||
).subscribe(() => this.store.dispatch(new GetFilteredDirections())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think you need startWith(''),
}); | ||
|
||
this.searchQuery$ | ||
.pipe(takeUntil(this.destroy$)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add operators
No description provided.