-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3489 from ita-social-projects/fix/#7836-admin-edi…
…t-all-comments [Fix] #7836 admin edit all types of order comments
- Loading branch information
Showing
22 changed files
with
488 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...p/ubs/ubs-admin/components/shared/components/comment-pop-up/comment-pop-up.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="wrapper"> | ||
<div class="set_comment_container"> | ||
<h3>{{ header }}</h3> | ||
<div class="set_comment"> | ||
<form [formGroup]="commentForm"> | ||
<textarea formControlName="comment" placeholder="{{ 'order-edit.comment.placeholder' | translate }}" cols="50" rows="6"></textarea> | ||
</form> | ||
</div> | ||
<div class="comment_btns"> | ||
<button class="cancel" [mat-dialog-close]="false">{{ 'order-edit.btn.cancel' | translate }}</button> | ||
<button (click)="onSubmit()" class="save">{{ 'order-edit.btn.save' | translate }}</button> | ||
</div> | ||
</div> | ||
</div> |
56 changes: 56 additions & 0 deletions
56
...p/ubs/ubs-admin/components/shared/components/comment-pop-up/comment-pop-up.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
* { | ||
font-family: var(--ubs-quaternary-font); | ||
} | ||
|
||
.wrapper { | ||
.set_comment_container { | ||
border-radius: 10px; | ||
font-size: 16px; | ||
|
||
h3 { | ||
font-size: 20px; | ||
font-weight: 600; | ||
} | ||
|
||
.comment_btns { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
} | ||
|
||
.set_comment { | ||
padding-block: 20px; | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
textarea { | ||
padding: 10px; | ||
border: 1px solid var(--ubs-tertiary-grey); | ||
border-radius: 5px; | ||
resize: none; | ||
outline: none; | ||
} | ||
|
||
textarea:focus { | ||
border: 1px solid var(--ubs-tertiary-grey); | ||
} | ||
} | ||
} | ||
|
||
.cancel { | ||
background: white; | ||
border-radius: 5px; | ||
border: none; | ||
color: var(--ubs-primary-black); | ||
font-weight: 600; | ||
} | ||
|
||
.save { | ||
height: 43px; | ||
background: var(--ubs-button-light-green); | ||
border-radius: 5px; | ||
border: 1px solid var(--ubs-button-light-green); | ||
padding: 0 30px; | ||
color: var(--ubs-tertiary-dark-grey); | ||
font-weight: 600; | ||
} |
30 changes: 30 additions & 0 deletions
30
...bs/ubs-admin/components/shared/components/comment-pop-up/comment-pop-up.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CommentPopUpComponent } from './comment-pop-up.component'; | ||
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
|
||
describe('CommentPopUpComponent', () => { | ||
let component: CommentPopUpComponent; | ||
let fixture: ComponentFixture<CommentPopUpComponent>; | ||
|
||
const MatDialogRefMock = { | ||
close: () => {} | ||
}; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [CommentPopUpComponent], | ||
imports: [MatDialogModule, ReactiveFormsModule, TranslateModule.forRoot()], | ||
providers: [{ provide: MatDialogRef, useValue: MatDialogRefMock }] | ||
}); | ||
fixture = TestBed.createComponent(CommentPopUpComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
...app/ubs/ubs-admin/components/shared/components/comment-pop-up/comment-pop-up.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | ||
import { MatDialogRef } from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-comment-pop-up', | ||
templateUrl: './comment-pop-up.component.html', | ||
styleUrls: ['./comment-pop-up.component.scss'] | ||
}) | ||
export class CommentPopUpComponent implements OnInit { | ||
@Input() header: string; | ||
@Input() comment: string; | ||
|
||
commentForm: FormGroup; | ||
|
||
constructor( | ||
public fb: FormBuilder, | ||
private dialogRef: MatDialogRef<CommentPopUpComponent> | ||
) {} | ||
|
||
ngOnInit(): void { | ||
this.initForm(); | ||
} | ||
|
||
initForm(): void { | ||
this.commentForm = this.fb.group({ | ||
comment: [this.comment, [Validators.maxLength(255)]] | ||
}); | ||
} | ||
|
||
onSubmit(): void { | ||
const data = this.commentForm.get('comment').value; | ||
this.dialogRef.close(data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ubs/ubs-admin/components/ubs-admin-table/table-cell-input/table-cell-input.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div | ||
class="comments" | ||
#tooltip="matTooltip" | ||
matTooltip="{{ data }}" | ||
(mouseenter)="onMouseEnter($event, tooltip)" | ||
(mouseleave)="tooltip.hide()" | ||
> | ||
<span>{{ data }}</span> | ||
<span *ngIf="!isEditable && !isBlocked && !isUneditableStatus" class="pointer" (keydown.enter)="edit()" (click)="edit()">✎</span> | ||
<mat-spinner class="spinner" *ngIf="isBlocked" strokeWidth="3" diameter="20"></mat-spinner> | ||
</div> |
26 changes: 26 additions & 0 deletions
26
...ubs/ubs-admin/components/ubs-admin-table/table-cell-input/table-cell-input.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.comments { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
padding: 0 10px; | ||
margin: 0 10px; | ||
cursor: default; | ||
position: relative; | ||
} | ||
|
||
.pointer { | ||
cursor: pointer; | ||
position: absolute; | ||
right: 0; | ||
} | ||
|
||
.spinner { | ||
position: absolute; | ||
right: 0; | ||
top: 20%; | ||
} | ||
|
||
div { | ||
width: 100%; | ||
height: 100%; | ||
} |
Oops, something went wrong.