Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/app/auth/auth.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@
*ngIf="formSignUp.controls['userNewPassword'].errors?.['pattern']
&& formSignUp.controls['userNewPassword'].touched"
>
Your password isn't strong enough
Your password isn't strong enough! You should have one upper letter, one lower letter, one number, one
special symbol (?, !, @, #, $, %, ^, &, *, -) and length more 8 symbols.
</div>
</label>
<button class="login-button" nzType="primary" nz-button>Sign up</button>
Expand Down
3 changes: 2 additions & 1 deletion src/app/auth/auth.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

.login-wrapper {
padding: 20px;
width: 265px;
max-width: 500px;
width: 100%;

display: flex;
flex-direction: column;
Expand Down
16 changes: 12 additions & 4 deletions src/app/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export class AuthService {

isLoading = false;

loading() {
this.isLoading = true;
}

loaded() {
this.isLoading = false;
}

loginHandle(value: string) {
this.login = value;
}
Expand Down Expand Up @@ -68,9 +76,9 @@ export class AuthService {

comeIn() {
if (this.login && this.password) {
this.isLoading = true;
this.loading();
this.authAPIService.signIn({ login: this.login, password: this.password }).subscribe((response) => {
this.isLoading = false;
this.loaded();
if (response) {
window.localStorage.setItem('userLogin', this.login);
window.localStorage.setItem('userTokenMid', response.token);
Expand All @@ -85,11 +93,11 @@ export class AuthService {

signUpNewUser() {
if (this.signUpName && this.signUpLogin && this.signUpPassword) {
this.isLoading = true;
this.loading();
this.authAPIService
.signUp({ name: this.signUpName, login: this.signUpLogin, password: this.signUpPassword })
.subscribe((response) => {
this.isLoading = false;
this.loaded();
if (response) {
this.message.create(
Message.SUCCESS,
Expand Down
4 changes: 4 additions & 0 deletions src/app/board/board-item/board-item.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
margin-bottom: 0.5rem;

.mt-1 {
max-width: 120px;
margin-top: 0.25rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/board/board.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { HeaderComponent } from './header/header.component';
import { SpaceModule } from '../space/space.module';
import { ConfirmModule } from '../confirm/confirm.module';
import { EditColumnTitleComponent } from './edit-column-title/edit-column-title.component';
import { LoaderModule } from '../loader/loader.module';

@NgModule({
declarations: [
Expand All @@ -36,6 +37,7 @@ import { EditColumnTitleComponent } from './edit-column-title/edit-column-title.
NzButtonModule,
ConfirmModule,
NzToolTipModule,
LoaderModule,
],
exports: [BoardComponent, BoardItemComponent],
})
Expand Down
8 changes: 7 additions & 1 deletion src/app/board/board/board.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<div class="space">
<space-left-aside pageName="Board Page"></space-left-aside>
<div class="space__main">
<div
class="space__main"
[class]="{
disabled: boardService.isLoadingDesk
}"
>
<board-header [title]="boardService.titleBoard"></board-header>
<div
cdkDropList
Expand Down Expand Up @@ -53,5 +58,6 @@
</div>
</div>
</div>
<app-loader *ngIf="boardService.isLoadingDesk" [isForBlock]="true"></app-loader>
</div>
</div>
6 changes: 6 additions & 0 deletions src/app/board/board/board.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@
min-height: 100%;
background-color: $main-color;
display: flex;

&__main {
width: 100%;
min-height: 100%;
background-color: $main-color;
position: relative;

&.disabled {
pointer-events: none;
}
}
}
2 changes: 1 addition & 1 deletion src/app/board/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>
<div>
<app-dialog (emitText)="addColumn($event)" question="Add new column">
<button nz-button nzType="primary">New Column</button>
<button nz-button nzType="primary" [disabled]="boardService.isLoadingDesk">New Column</button>
</app-dialog>
</div>
</div>
2 changes: 1 addition & 1 deletion src/app/confirm/confirm-body/confirm-body.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h3>{{ data.question }}</h3>
<div>Confirmation modal</div>
</form>
</div>
<div>
<div class="gap-10">
<button nz-button nzType="primary" [mat-dialog-close]="true">Confirm</button>
<button nz-button nzType="default" (click)="onNoClick()">Cancel</button>
</div>
10 changes: 10 additions & 0 deletions src/app/confirm/confirm-body/confirm-body.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.w-100 {
margin-bottom: 16px;
}

.gap-10 {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 10px;
}
2 changes: 1 addition & 1 deletion src/app/dialog/dialog-body/dialog-body.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3>{{ data.question }}</h3>
</span>
</form>
</div>
<div>
<div class="gap-10">
<button nz-button nzType="primary" [mat-dialog-close]="data.text">Confirm</button>
<button nz-button nzType="default" (click)="onNoClick()">Cancel</button>
</div>
10 changes: 10 additions & 0 deletions src/app/dialog/dialog-body/dialog-body.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.w-100 {
margin-bottom: 16px;
}

.gap-10 {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 10px;
}
12 changes: 10 additions & 2 deletions src/app/loader/loader.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<div class="loader">
<nz-spin nzSimple nzSize="large"></nz-spin>
<div
class="loader"
[class]="{
block: isForBlock
}"
[style]="{
left: left
}"
>
<nz-spin nzSimple [nzSize]="nzSize"></nz-spin>
</div>
7 changes: 7 additions & 0 deletions src/app/loader/loader.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
background-color: $bg-loader;
width: 100%;
height: 100%;

&.block {
position: absolute;
width: auto;
height: auto;
background-color: transparent;
}
}
10 changes: 8 additions & 2 deletions src/app/loader/loader.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';

@Component({
selector: 'app-loader',
templateUrl: './loader.component.html',
styleUrls: ['./loader.component.scss'],
})
export class LoaderComponent {}
export class LoaderComponent {
@Input() isForBlock: boolean = false;

@Input() left: string | undefined;

@Input() nzSize: 'large' | 'small' | 'default' = 'large';
}
28 changes: 24 additions & 4 deletions src/app/profile/profile.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<div class="profile-page">
<div class="profile-wrapper">
<div
class="profile-wrapper"
[class]="{
disabled: profileService.isLoadingBlock
}"
>
<div>
<h2 class="profile-title">Profile</h2>
<small>Please fill all fields</small>
Expand Down Expand Up @@ -50,7 +55,7 @@ <h2 class="profile-title">Profile</h2>
<label class="label">
Password:
<input
type="password"
[type]="showPass ? 'text' : 'password'"
placeholder="your new password"
#mySPassword
[value]="profileService.password"
Expand All @@ -63,6 +68,12 @@ <h2 class="profile-title">Profile</h2>
&& form.controls['userNewPassword'].touched
}"
/>
<div class="input-eye" *ngIf="!showPass" (click)="showPassHandle()">
<i nz-icon nzType="eye-invisible" nzTheme="outline"></i>
</div>
<div class="input-eye" *ngIf="showPass" (click)="showPassHandle()">
<i nz-icon nzType="eye" nzTheme="outline"></i>
</div>
<div
class="alert alert-danger"
*ngIf="form.controls['userNewPassword'].errors?.['required']
Expand All @@ -75,7 +86,8 @@ <h2 class="profile-title">Profile</h2>
*ngIf="form.controls['userNewPassword'].errors?.['pattern']
&& form.controls['userNewPassword'].touched"
>
Your password isn't strong enough
Your password isn't strong enough! You should have one upper letter, one lower letter, one number, one special
symbol (?, !, @, #, $, %, ^, &, *, -) and length more 8 symbols.
</div>
</label>
<button class="login-button" nzType="primary" nz-button>Save</button>
Expand All @@ -86,8 +98,16 @@ <h2 class="profile-title">Profile</h2>
(click)="$event.stopPropagation()"
(emitConfirm)="onUserDelete($event)"
>
<button class="button button__icon" nz-icon nzType="delete" nzTheme="outline"></button>
<button
class="button button__icon"
nz-icon
nzType="delete"
nzTheme="outline"
[disabled]="profileService.isLoadingBlock"
></button>
</app-confirm>
</div>
<app-loader *ngIf="profileService.isLoadingBlock" [isForBlock]="true"></app-loader>
</div>
<app-loader *ngIf="profileService.isLoading"></app-loader>
</div>
17 changes: 16 additions & 1 deletion src/app/profile/profile.component.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
@import '../../styles/variables';

.profile-page {
position: relative;
padding: 50px 10px;
display: flex;
justify-content: center;

.profile-wrapper {
padding: 20px;
width: 265px;
max-width: 500px;
width: 100%;
position: relative;

display: flex;
Expand Down Expand Up @@ -39,14 +41,23 @@
flex-direction: column;
gap: 6px;
font-size: 14px;
position: relative;

.input {
color: $first-color;
max-width: 173px;

&.error {
border: 1px solid $error-color;
background-color: $fourth-color;
}

&-eye {
position: absolute;
top: 35px;
left: 180px;
cursor: pointer;
}
}
}

Expand All @@ -55,6 +66,10 @@
top: 25px;
right: 27px;
}

&.disabled {
pointer-events: none;
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/app/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ import { regexpPassword } from '../../constants/constants';
export class ProfileComponent implements OnInit {
form: FormGroup;

showPass = false;

constructor(public profileService: ProfileService) {
this.form = this.initForm('', '');
}

ngOnInit() {
this.profileService.loading();
this.profileService.getUserData().subscribe((response) => {
this.profileService.nameHandle(response.name);
this.profileService.loginHandle(response.login);
this.form = this.initForm(response.name, response.login);
this.profileService.loaded();
});
}

Expand All @@ -42,4 +46,8 @@ export class ProfileComponent implements OnInit {
this.profileService.removeUser();
}
}

showPassHandle() {
this.showPass = !this.showPass;
}
}
Loading