Skip to content

Task 7#5

Open
YurikMurik wants to merge 1 commit intotask-5from
task-7
Open

Task 7#5
YurikMurik wants to merge 1 commit intotask-5from
task-7

Conversation

@YurikMurik
Copy link
Copy Markdown
Owner

  • Implements necessary routes, redirect, authguard
  • Added 404page component, breadcrumbs component
  • Added edit component and logic for it
  • Added another logic for components in according to requirements
  • Added pipe for transforming breadcrumb srting

</mat-card-header>
<mat-card-content>
<form class="add-course-form">
<table class="add-course-form-full-width" cellspacing="0">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please do not use the table for layout, it's 2020, choose different approach

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

okay, I changed this one

private homePageService: HomePageService
) { }

public cancelIsClicked(): void {
Copy link
Copy Markdown

@Yauhenia-Zhdanovich Yauhenia-Zhdanovich May 20, 2020

Choose a reason for hiding this comment

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

name of the method, please consider changing

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

changed

}];

this.homePageService.createCourse(sentDataCourse);
this.router.navigate(['/courses']);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can you assign value ['/courses'] to a variable?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

fixed

import { switchMap } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { Router } from '@angular/router';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please delete unused imports

Copy link
Copy Markdown
Owner Author

@YurikMurik YurikMurik May 20, 2020

Choose a reason for hiding this comment

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

I deleted it

public loginUser(): void {
const isLogged: boolean = this.authService.userLogin(this.username, this.password);
this.isAuthentificated = isLogged;
if (isLogged) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this check should be performed by a guard

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

fixed

) { }

public ngOnInit(): void {
this.isAuthentificated = this.authService.isAuthentificated();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this here?
if we are on the login page, shouldn't we be logged out by default?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

yes, sure. You're right, this piece of code is not important. I deleted it

- Implements necessary routes, redirect, authguard
- Added 404page component, breadcrumbs component
- Added edit component and logic for it
- Added another logic for components in according to requirements
- Added pipe for transforming breadcrumb srting
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.

2 participants