Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

refactor(select-union): extract to separate component #38

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tsvetkovv
Copy link
Contributor

@Max-Levitskiy Max-Levitskiy self-requested a review May 2, 2020 14:06
src/_services/authentication.service.ts Outdated Show resolved Hide resolved
src/_services/authentication.service.ts Outdated Show resolved Hide resolved
src/register/register.component.html Outdated Show resolved Hide resolved
src/register/register.component.html Show resolved Hide resolved
src/_services/authentication.service.ts Outdated Show resolved Hide resolved
src/_services/user.service.ts Outdated Show resolved Hide resolved
src/_services/authentication.service.ts Outdated Show resolved Hide resolved
src/login/login.component.ts Show resolved Hide resolved

this.tokenService.saveToken(token);
this.alertService.success('Logged in successfully');
if (!this.authenticationService.redirectToUnionIfNeeded(this.route.snapshot)) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we have something like this:

Suggested change
if (!this.authenticationService.redirectToUnionIfNeeded(this.route.snapshot)) {
this.authenticationService.redirectToUnionIfNeeded(this.route.snapshot))
.orElse(() -> this.router.navigate(['/select-union']))

Copy link
Member

Choose a reason for hiding this comment

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

Or with callback in parameter at least. :)

if (error.status === 400) {
this.alertService.error(error.error);
if (data === null) {
this.alertService.error('Registration unsuccessful');
Copy link
Member

Choose a reason for hiding this comment

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

Let's show server error always if it exists.
If no error message show status code description (if available somewhere).

@tsvetkovv tsvetkovv force-pushed the feature/union-refactoring branch from 0d55b01 to 5ac6dc1 Compare January 3, 2021 12:24
@tsvetkovv tsvetkovv force-pushed the feature/union-refactoring branch from 5ac6dc1 to 253126c Compare January 3, 2021 15:14
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 3, 2021

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants