From 8d0a608f3fc4f6618dd8475003dca2ac0b428b10 Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 16 Aug 2023 09:38:48 +0700 Subject: [PATCH 001/184] [TamTM6] private name tag part 1 --- .../popup-name-tag.component.html | 136 +++++++++++++ .../popup-name-tag.component.scss | 64 ++++++ .../popup-name-tag.component.ts | 55 +++++ .../private-name-tag.component.html | 190 ++++++++++++++++++ .../private-name-tag.component.scss | 18 ++ .../private-name-tag.component.ts | 90 +++++++++ src/app/pages/profile/profile.component.html | 23 ++- src/app/pages/profile/profile.component.ts | 10 +- src/app/pages/profile/profile.module.ts | 10 +- 9 files changed, 584 insertions(+), 12 deletions(-) create mode 100644 src/app/pages/profile/popup-name-tag/popup-name-tag.component.html create mode 100644 src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss create mode 100644 src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts create mode 100644 src/app/pages/profile/private-name-tag/private-name-tag.component.html create mode 100644 src/app/pages/profile/private-name-tag/private-name-tag.component.scss create mode 100644 src/app/pages/profile/private-name-tag/private-name-tag.component.ts diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html new file mode 100644 index 000000000..8faba6e17 --- /dev/null +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -0,0 +1,136 @@ +
+
+
+
Create Private Name Tag
+ +
+
+
+
+
+ Set favorite in tag list + +
+
+ +
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ +
+
BingX
+
+ + +
+
+ +
+
+
+ +
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
+ Character limit: 0/35
+ Set private name tag to easily identify this address in Aurascan only from your view +
+ + +
+
+ +
+
+ + +
+
+
+ Character limit: 0/200
+ A personal note of this address. Kindly note that DO NOT input any passwords or private key here +
+ +
+
+ + +
+ + +
+
+
+
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss new file mode 100644 index 000000000..8be3dc39e --- /dev/null +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss @@ -0,0 +1,64 @@ +.card.card-private-name { + @media (min-width: 992px) { + width: 800px; + } + .card-header { + background-color: var(--aura-gray-9); + } + .card-body { + max-height: 85vh; + overflow-y: auto; + .box-content { + height: 530px; + overflow-y: auto; + padding: var(--spacer-6); + padding-right: 28px; + border-bottom: 1px solid var(--aura-gray-9); + } + } + .private-name-form { + .form-label { + font-size: 12px; + color: var(--aura-gray-3); + } + .input-group, + .text-area { + background-color: var(--aura-gray-10) !important; + } + .btn { + height: 40px; + padding: 0 24px; + } + .btn-create { + border: none; + &:disabled { + background: var(--aura-gray-8); + } + } + } + ::ng-deep { + .mat-slide-toggle-thumb { + width: 14px !important; + height: 14px !important; + } + .mat-slide-toggle.mat-checked .mat-slide-toggle-bar { + background-color: #2bbba3; + } + .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb { + background-color: var(--aura-white); + } + .mat-slide-toggle-bar { + height: 20px !important; + border-radius: 12px !important; + } + .mat-slide-toggle-thumb-container { + width: 14px !important; + height: 14px !important; + top: 3px !important; + transform: translate3d(4px, 0, 0) !important; + } + .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container { + transform: translate3d(18px, 0, 0) !important; + } + } +} diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts new file mode 100644 index 000000000..5f18a154f --- /dev/null +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -0,0 +1,55 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { FormBuilder, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { TranslateService } from '@ngx-translate/core'; +import { EnvironmentService } from 'src/app/core/data-services/environment.service'; + +@Component({ + selector: 'app-popup-name-tag', + templateUrl: './popup-name-tag.component.html', + styleUrls: ['./popup-name-tag.component.scss'], +}) +export class PopupNameTagComponent implements OnInit { + privateNameForm; + isSubmit = false; + errorSpendLimit = ''; + formValid = true; + isAccount = true; + + constructor( + @Inject(MAT_DIALOG_DATA) public data: { data: any }, + public dialogRef: MatDialogRef, + private fb: FormBuilder, + public environmentService: EnvironmentService, + public translate: TranslateService, + ) {} + + ngOnInit(): void { + this.formInit(); + } + + formInit() { + this.privateNameForm = this.fb.group({ + favorite: [''], + type: ['', [Validators.required]], + address: ['', [Validators.required]], + name: ['', [Validators.required, Validators.maxLength(200)]], + note: ['', [Validators.maxLength(200)]], + }); + } + + closeDialog(hash = null) { + this.dialogRef.close(hash); + } + + checkFormValid() {} + + async onSubmit() { + this.isSubmit = true; + console.log(this.privateNameForm.value); + } + + changeFavorite() { + this.privateNameForm.value.favorite = !this.privateNameForm.value.favorite; + } +} diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html new file mode 100644 index 000000000..986dcd3c1 --- /dev/null +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -0,0 +1,190 @@ +
+
Private name tag
+ +
+ +
+
+
Total 0/10 addresses tagged
+
+
+
+ + + +
+
+
+
+ +
+
+ + + + + + + + + + + + +
+
+
+ + + {{ template.matColumnDef | cutStringPipe : 8 : 8 }} + +
desc
+
+ + + + + {{ commonService.getDateValue(data['date_format'], false)[0] }} + + + + + + + + + {{ data[template.matColumnDef] }} + + + +
+ {{ 'NO DATA' | translate }} +
+
+ +
+ +
+
+
+ + + + + +
+ + + +
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss new file mode 100644 index 000000000..23fd2e449 --- /dev/null +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -0,0 +1,18 @@ +.txt-title { + font-size: 2.2rem; + font-weight: 700; + line-height: 2.8rem; + color: var(--aura-gray-4); + @media (min-width: 992px) { + line-height: 4rem; + font-size: 3.2rem; + } +} + +.search-form.private-search-form { + width: 100%; + + @media (min-width: 992px) { + width: 410px; + } +} diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts new file mode 100644 index 000000000..533552850 --- /dev/null +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { PageEvent } from '@angular/material/paginator'; +import { MatTableDataSource } from '@angular/material/table'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { Subject } from 'rxjs'; +import { debounceTime, takeUntil } from 'rxjs/operators'; +import { PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { TableTemplate } from 'src/app/core/models/common.model'; +import { CommonService } from 'src/app/core/services/common.service'; +import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; +import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; +import { ToastrService } from 'ngx-toastr'; +import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; + +@Component({ + selector: 'app-private-name-tag', + templateUrl: './private-name-tag.component.html', + styleUrls: ['./private-name-tag.component.scss'], +}) +export class PrivateNameTagComponent implements OnInit { + @ViewChild(PaginatorComponent) pageChange: PaginatorComponent; + + modalReference: any; + pageData: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: 10, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; + + templates: Array = [ + { matColumnDef: 'favorite', headerCellDef: 'Fav.', headerWidth: 8 }, + { matColumnDef: 'address', headerCellDef: 'Address', headerWidth: 12 }, + { matColumnDef: 'type', headerCellDef: 'Type', headerWidth: 6 }, + { matColumnDef: 'name', headerCellDef: 'Private Name Tag', headerWidth: 12 }, + { matColumnDef: 'add_time', headerCellDef: 'Added Time', headerWidth: 10 }, + { matColumnDef: 'update_time', headerCellDef: 'Updated Time', headerWidth: 10 }, + { matColumnDef: 'action', headerCellDef: '', headerWidth: 8 }, + ]; + displayedColumns: string[] = this.templates.map((dta) => dta.matColumnDef); + + textSearch = ''; + searchSubject = new Subject(); + destroy$ = new Subject(); + dataSource = new MatTableDataSource(); + + constructor( + public commonService: CommonService, + private modalService: NgbModal, + private dialog: MatDialog, + private toastr: NgxToastrService, + ) { + this.searchSubject + .asObservable() + .pipe(debounceTime(500), takeUntil(this.destroy$)) + .subscribe(() => { + this.pageChange.selectPage(0); + }); + } + + ngOnInit(): void {} + + onKeyUp() { + this.searchSubject.next(this.textSearch); + } + + resetFilterSearch() { + this.textSearch = ''; + this.onKeyUp(); + } + + pageEvent(pageIndex: number): void { + this.getListPrivateName(); + } + + getListPrivateName() {} + + openPopup() { + const dialogConfig = new MatDialogConfig(); + dialogConfig.panelClass = 'grant-overlay-panel'; + dialogConfig.disableClose = true; + let dialogRef = this.dialog.open(PopupNameTagComponent, dialogConfig); + + dialogRef.afterClosed().subscribe((result) => { + if (result) { + this.toastr.loading(result); + } + }); + } +} diff --git a/src/app/pages/profile/profile.component.html b/src/app/pages/profile/profile.component.html index 494b077d2..bff7f1891 100644 --- a/src/app/pages/profile/profile.component.html +++ b/src/app/pages/profile/profile.component.html @@ -7,17 +7,29 @@
Profile
Profile settings - + Private name tag + +
@@ -39,6 +51,7 @@
+ diff --git a/src/app/pages/profile/profile.component.ts b/src/app/pages/profile/profile.component.ts index eb7d2b2af..7f6b909e5 100644 --- a/src/app/pages/profile/profile.component.ts +++ b/src/app/pages/profile/profile.component.ts @@ -9,17 +9,17 @@ import { ProfileTab } from 'src/app/core/constants/profile.enum'; }) export class ProfileComponent implements OnInit { profileTab = ProfileTab; - currentTab = ProfileTab.Setting; + currentTab = ProfileTab.PrivateNameTag; activeTabID = 0; PROFILE_TAB = [ { key: ProfileTab.Setting, value: 'Profile settings' }, - // { - // key: ProfileTab.PrivateNameTag, - // value: 'Private name tag' - // }, + { + key: ProfileTab.PrivateNameTag, + value: 'Private name tag' + }, // { // key: ProfileTab.WatchList, // value: 'Watchlist' diff --git a/src/app/pages/profile/profile.module.ts b/src/app/pages/profile/profile.module.ts index f0e93c1b5..c6e7a841a 100644 --- a/src/app/pages/profile/profile.module.ts +++ b/src/app/pages/profile/profile.module.ts @@ -14,9 +14,13 @@ import { ProfileComponent } from './profile.component'; import { MatIconModule } from '@angular/material/icon'; import { UserService } from 'src/app/core/services/user.service'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { PrivateNameTagComponent } from './private-name-tag/private-name-tag.component'; +import { TableNoDataModule } from 'src/app/shared/components/table-no-data/table-no-data.module'; +import { APaginatorModule } from 'src/app/shared/components/a-paginator/a-paginator.module'; +import { PopupNameTagComponent } from './popup-name-tag/popup-name-tag.component'; @NgModule({ - declarations: [ProfileComponent, ProfileSettingsComponent], + declarations: [ProfileComponent, ProfileSettingsComponent, PrivateNameTagComponent, PopupNameTagComponent], imports: [ CommonModule, FormsModule, @@ -30,7 +34,9 @@ import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; ReactiveFormsModule, NameTagModule, MatIconModule, - NgbNavModule + NgbNavModule, + TableNoDataModule, + APaginatorModule, ], providers: [FormBuilder, UserService], }) From f1db465d96b1216b35fac4997299d1f2a6c6856f Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 16 Aug 2023 16:30:10 +0700 Subject: [PATCH 002/184] [TamTM6] update private name tag part 2 --- .../popup-name-tag.component.html | 86 +++++++++++-------- .../popup-name-tag.component.scss | 13 ++- .../popup-name-tag.component.ts | 57 +++++++++++- .../validators/validators.component.html | 3 +- src/assets/scss/aura-theme/form.scss | 2 +- 5 files changed, 115 insertions(+), 46 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 8faba6e17..5ada932be 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -19,8 +19,8 @@
Set favorite in tag list -
-
+
+
@@ -29,106 +29,118 @@ - + (change)="changeType(true)" /> +
- + (change)="changeType(false)" /> +
-
-
+
+
-
BingX
+
{{ publicNameTag }}
-
-
+
+
-
+
+
+ Invalid aura address format +
-
-
+
+
-
+
+ type="text" + class="col-12 mb-4 text--gray-1" + [maxlength]="maxLengthNameTag" + formControlName="name" + (keypress)="checkValidNameTag($event)" + placeholder="Enter private name tag" />
-
- Character limit: 0/35
- Set private name tag to easily identify this address in Aurascan only from your view +
+
+ Character limit: {{ privateNameForm.value.name?.length }}/{{ maxLengthNameTag }}
+ Set private name tag to easily identify this address in Aurascan only from your view +
-
-
+
+
-
+
-
-
- Character limit: 0/200
- A personal note of this address. Kindly note that DO NOT input any passwords or private key here +
+
+ Character limit: {{ privateNameForm.value.note?.length }}/{{ maxLengthNote }}
+ A personal note of this address. Kindly note that DO NOT input any passwords or private key here +
-
+
All fields are required except Personal Note
-
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss index 8be3dc39e..a62404c92 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss @@ -1,4 +1,5 @@ .card.card-private-name { + padding: var(--spacer-4); @media (min-width: 992px) { width: 800px; } @@ -9,7 +10,7 @@ max-height: 85vh; overflow-y: auto; .box-content { - height: 530px; + min-height: 536px; overflow-y: auto; padding: var(--spacer-6); padding-right: 28px; @@ -21,9 +22,17 @@ font-size: 12px; color: var(--aura-gray-3); } - .input-group, + .input-group { + background-color: var(--aura-gray-10) !important; + height: 40px; + input { + max-width: 95%; + } + } .text-area { background-color: var(--aura-gray-10) !important; + padding: var(--spacer-4); + border-radius: var(--spacer-2); } .btn { height: 40px; diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 5f18a154f..4e21aeb1a 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -2,7 +2,9 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; +import { LENGTH_CHARACTER } from 'src/app/core/constants/common.constant'; import { EnvironmentService } from 'src/app/core/data-services/environment.service'; +import { CommonService } from 'src/app/core/services/common.service'; @Component({ selector: 'app-popup-name-tag', @@ -15,6 +17,11 @@ export class PopupNameTagComponent implements OnInit { errorSpendLimit = ''; formValid = true; isAccount = true; + maxLengthNameTag = 35; + maxLengthNote = 200; + currentCodeID; + publicNameTag = '-'; + isValidAddress = false; constructor( @Inject(MAT_DIALOG_DATA) public data: { data: any }, @@ -22,18 +29,23 @@ export class PopupNameTagComponent implements OnInit { private fb: FormBuilder, public environmentService: EnvironmentService, public translate: TranslateService, + private commonService: CommonService, ) {} ngOnInit(): void { this.formInit(); } + get getAddress() { + return this.privateNameForm.get('address'); + } + formInit() { this.privateNameForm = this.fb.group({ favorite: [''], - type: ['', [Validators.required]], + isAccount: [true, [Validators.required]], address: ['', [Validators.required]], - name: ['', [Validators.required, Validators.maxLength(200)]], + name: ['', [Validators.required, Validators.maxLength(this.maxLengthNameTag)]], note: ['', [Validators.maxLength(200)]], }); } @@ -42,14 +54,51 @@ export class PopupNameTagComponent implements OnInit { this.dialogRef.close(hash); } - checkFormValid() {} + checkFormValid() { + this.isValidAddress = false; + if (this.getAddress.value?.length > 0 && this.getAddress?.value?.trim().startsWith('aura')) { + if ( + (this.getAddress.value?.length === LENGTH_CHARACTER.ADDRESS && this.isAccount) || + (this.getAddress.value?.length === LENGTH_CHARACTER.CONTRACT && !this.isAccount) + ) { + this.isValidAddress = true; + } + } + } async onSubmit() { this.isSubmit = true; - console.log(this.privateNameForm.value); + console.log(this.privateNameForm); } changeFavorite() { this.privateNameForm.value.favorite = !this.privateNameForm.value.favorite; } + + changeType(type) { + this.isAccount = type; + this.privateNameForm.value.isAccount = type; + this.checkFormValid(); + } + + checkValidNameTag(event) { + const regex = new RegExp('^[A-Za-z0-9._ -]+$'); + let key = String.fromCharCode(!event.charCode ? event.which : event.charCode); + if (!regex.test(key)) { + event.preventDefault(); + return; + } + this.privateNameForm.value.name = event.target.value; + } + + checkPublicNameTag() { + this.publicNameTag = '-'; + this.getAddress.value = this.getAddress.value.trim(); + if (this.getAddress.status === 'VALID') { + const temp = this.commonService.setNameTag(this.getAddress.value); + if (temp !== this.getAddress.value) { + this.publicNameTag = temp; + } + } + } } diff --git a/src/app/pages/validators/validators.component.html b/src/app/pages/validators/validators.component.html index 7fbd39b6a..acde5ee05 100644 --- a/src/app/pages/validators/validators.component.html +++ b/src/app/pages/validators/validators.component.html @@ -186,8 +186,7 @@

Validators

[votingPower]="true" [appBigNumber]="data[template.matColumnDef]" [decimal]="0"> - +
Date: Mon, 21 Aug 2023 16:42:06 +0700 Subject: [PATCH 003/184] [TamTM6] service name tag --- src/app/core/services/name-tag.service.ts | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/app/core/services/name-tag.service.ts diff --git a/src/app/core/services/name-tag.service.ts b/src/app/core/services/name-tag.service.ts new file mode 100644 index 000000000..8076d6577 --- /dev/null +++ b/src/app/core/services/name-tag.service.ts @@ -0,0 +1,29 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import * as _ from 'lodash'; +import { EnvironmentService } from '../data-services/environment.service'; +import { CommonService } from './common.service'; + +@Injectable() +export class NameTagService extends CommonService { + chainInfo = this.environmentService.configValue.chain_info; + + constructor(private http: HttpClient, private environmentService: EnvironmentService) { + super(http, environmentService); + } + + getListPrivateNameTag(payload) { + const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); + return this.http.get(`${this.apiUrl}/admin/private-name-tag`, { + params, + }); + } + + createPrivateName(payload) { + const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); + return this.http.post(`${this.apiUrl}/admin/private-name-tag`, { + params, + }); + } +} + From a0a67a1288b8772d053007975bc303f0b4ce34c4 Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 22 Aug 2023 08:49:59 +0700 Subject: [PATCH 004/184] [TamTM6] private name tag --- .../popup-name-tag.component.html | 2 +- .../popup-name-tag.component.scss | 2 +- .../popup-name-tag.component.ts | 41 ++++++++++++++++++- src/app/pages/profile/profile.module.ts | 3 +- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 5ada932be..80658572b 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -133,7 +133,7 @@
-
@@ -25,16 +22,13 @@ class="text--primary text-break d-flex" [ngClass]="[ isBox && !commonService.checkDisplayTooltip(paramUrl || value) ? 'box-name-tag' : '', - widthAuto ? 'w-auto' : '' + widthAuto ? 'w-auto' : '', + commonService.checkPrivate(paramUrl || value) ? 'private-name-tag' : '' ]" [class.aura-tooltip-object]="!commonService.checkDisplayTooltip(paramUrl || value)"> - +
@@ -45,7 +39,8 @@ class="text-break" [ngClass]="[ isBox && !commonService.checkDisplayTooltip(paramUrl || value) ? 'box-name-tag' : '', - widthAuto ? 'w-auto' : '' + widthAuto ? 'w-auto' : '', + commonService.checkPrivate(paramUrl || value) ? 'private-name-tag' : '' ]" [class.aura-tooltip-object]="!commonService.checkDisplayTooltip(paramUrl || value)"> @@ -65,11 +60,7 @@ - +
diff --git a/src/app/shared/components/name-tag/name-tag.component.ts b/src/app/shared/components/name-tag/name-tag.component.ts index bac362ac5..1978d1682 100644 --- a/src/app/shared/components/name-tag/name-tag.component.ts +++ b/src/app/shared/components/name-tag/name-tag.component.ts @@ -50,4 +50,9 @@ export class NameTagComponent implements OnInit { url = url.match(/^https?:/) ? url : '//' + url; return url; } + + displayContent(value) { + let result = value + '
' + 'Public name: ' + this.commonService.setNameTag(value, this.global.listNameTag); + return result; + } } From 6c90ec155e4123e030c092661bdb78da6b61abdf Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 22 Aug 2023 11:21:07 +0700 Subject: [PATCH 006/184] [TamTM6] private name tag api --- src/app/app.module.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2e6cfa748..b784da5a8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -58,6 +58,7 @@ import { Globals } from './global/global'; import { LayoutsModule } from './layouts/layouts.module'; import { SchemaViewerModule } from './pages/schema-viewer/schema-viewer.module'; import { MediaExpandModule } from './shared/components/media-expand/media-expand.module'; +import { NameTagService } from './core/services/name-tag.service'; export function createTranslateLoader(http: HttpClient): any { return new TranslateHttpLoader(http, 'assets/i18n/', '.json'); @@ -174,6 +175,7 @@ export class MaterialModule {} FeeGrantService, SoulboundService, MappingErrorService, + NameTagService, { provide: DateAdapter, useClass: MomentDateAdapter, From e3d3553fd5f36f256f3bd4c5b4e32dd638b78fb4 Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 23 Aug 2023 09:42:41 +0700 Subject: [PATCH 007/184] [TamTM6] private name tag api --- src/app/app.component.ts | 12 ++++++- src/app/core/pipes/common-pipe.module.ts | 10 ++++-- src/app/core/pipes/common.pipe.ts | 25 +++++++++++++ src/app/core/services/common.service.ts | 18 ++++++++-- src/app/core/services/name-tag.service.ts | 4 +-- .../account-detail.component.html | 36 ++++++++++++++----- .../account-detail.component.scss | 10 ++++++ .../account-detail.component.ts | 26 ++++++-------- .../contract-info-card.component.html | 22 +++++++++--- src/app/pages/login/login.component.ts | 8 +++++ .../popup-name-tag.component.ts | 10 ++++-- src/app/pages/profile/profile.component.ts | 13 ++++--- src/app/pages/profile/profile.module.ts | 16 ++++----- ...oulbound-account-token-list.component.html | 8 +++-- .../top-statistic-overview.component.html | 17 ++++++--- .../top-statistic-overview.component.scss | 5 ++- .../top-statistic-transaction.component.scss | 5 ++- .../validators-detail.component.html | 19 +++++++--- .../validators-detail.component.scss | 35 ++++++++++++++++++ .../validators-detail.component.ts | 11 ++++++ .../authenticate-mail.component.ts | 4 +++ .../components/name-tag/name-tag.component.ts | 11 ++++-- 22 files changed, 254 insertions(+), 71 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b6022dcc3..376a462a4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -77,6 +77,16 @@ export class AppComponent implements OnInit { keyword: null, }; + // get list name tag if not login email + const userEmail = localStorage.getItem('userEmail'); + if (!userEmail) { + this.commonService.getListNameTag(payload).subscribe((res) => { + this.globals.listNameTag = this.commonService.listNameTag = res.data?.nameTags; + }); + return; + } + + // get list name tag if login email forkJoin({ publicName: this.commonService.getListNameTag(payload), privateName: this.nameTagService.getListPrivateNameTag(payloadPrivate), @@ -102,10 +112,10 @@ export class AppComponent implements OnInit { const onlyInB = onlyInLeft(privateName?.data, listTemp, isSameUser); onlyInB.forEach((element) => { element['name_tag_private'] = element.name_tag; + element['name_tag'] = null; element['isPrivate'] = true; }); const result = [...listTemp, ...onlyInB]; - this.globals.listNameTag = this.commonService.listNameTag = result; }); } diff --git a/src/app/core/pipes/common-pipe.module.ts b/src/app/core/pipes/common-pipe.module.ts index 617dde07b..0f8d91b3d 100644 --- a/src/app/core/pipes/common-pipe.module.ts +++ b/src/app/core/pipes/common-pipe.module.ts @@ -12,6 +12,8 @@ import { convertLogAmount, decodeData, displayTypeToolTip, + displayNameTag, + checkIsPrivate, } from './common.pipe'; import { JsonPipe } from './json.pipe'; @@ -28,7 +30,9 @@ import { JsonPipe } from './json.pipe'; ConvertUauraToAura, convertLogAmount, decodeData, - displayTypeToolTip + displayTypeToolTip, + displayNameTag, + checkIsPrivate ], imports: [CommonModule], exports: [ @@ -43,7 +47,9 @@ import { JsonPipe } from './json.pipe'; ConvertUauraToAura, convertLogAmount, decodeData, - displayTypeToolTip + displayTypeToolTip, + displayNameTag, + checkIsPrivate ], }) export class CommonPipeModule {} diff --git a/src/app/core/pipes/common.pipe.ts b/src/app/core/pipes/common.pipe.ts index 2378a461a..fe952dc43 100644 --- a/src/app/core/pipes/common.pipe.ts +++ b/src/app/core/pipes/common.pipe.ts @@ -5,6 +5,7 @@ import { EnvironmentService } from '../data-services/environment.service'; import { CommonService } from '../services/common.service'; import { balanceOf } from '../utils/common/parsing'; import { MaskPipe } from 'ngx-mask'; +import { Globals } from 'src/app/global/global'; @Pipe({ name: 'calDate' }) export class pipeCalDate implements PipeTransform { @@ -141,3 +142,27 @@ export class displayTypeToolTip implements PipeTransform { return result; } } + +@Pipe({ name: 'displayNameTag' }) +export class displayNameTag implements PipeTransform { + constructor(private global: Globals) {} + transform(address: any): string { + const nameTag = this.global.listNameTag?.find((k) => k.address === address); + let result = nameTag?.name_tag_private || nameTag?.name_tag || address; + return result; + } +} + +@Pipe({ name: 'checkIsPrivate' }) +export class checkIsPrivate implements PipeTransform { + constructor(private global: Globals) {} + transform(address: any): boolean { + let result = false; + const nameTag = this.global.listNameTag?.find((k) => k.address === address && k.isPrivate); + if (nameTag?.name_tag_private) { + result = true; + } + return result; + } +} + diff --git a/src/app/core/services/common.service.ts b/src/app/core/services/common.service.ts index e3cefdc40..de80ea1a9 100644 --- a/src/app/core/services/common.service.ts +++ b/src/app/core/services/common.service.ts @@ -117,10 +117,14 @@ export class CommonService { }); } - setNameTag(address, listNameTag = []) { + setNameTag(address, listNameTag = [], getPrivate = true) { this.listNameTag = this.listNameTag?.length > 0 ? this.listNameTag : listNameTag; const nameTag = this.listNameTag?.find((k) => k.address === address); - return nameTag?.name_tag_private || nameTag?.name_tag || address; + let result = nameTag?.name_tag || address; + if (getPrivate) { + result = nameTag?.name_tag_private || result; + } + return result; } findNameTag(keySearch, listNameTag = []) { @@ -160,6 +164,16 @@ export class CommonService { return result; } + checkPublic(address, listNameTag = []): boolean { + this.listNameTag = this.listNameTag?.length > 0 ? this.listNameTag : listNameTag; + let result = false; + const nameTag = this.listNameTag?.find((k) => k.address === address && k.name_tag?.length > 0); + if (!nameTag || nameTag?.name_tag === address) { + result = true; + } + return result; + } + checkPrivate(address): boolean { let result = false; const nameTag = this.listNameTag?.find((k) => k.address === address && k.isPrivate); diff --git a/src/app/core/services/name-tag.service.ts b/src/app/core/services/name-tag.service.ts index 8076d6577..8b7665aea 100644 --- a/src/app/core/services/name-tag.service.ts +++ b/src/app/core/services/name-tag.service.ts @@ -14,14 +14,14 @@ export class NameTagService extends CommonService { getListPrivateNameTag(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.get(`${this.apiUrl}/admin/private-name-tag`, { + return this.http.get(`${this.apiUrl}/user/private-name-tag`, { params, }); } createPrivateName(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.post(`${this.apiUrl}/admin/private-name-tag`, { + return this.http.post(`${this.apiUrl}/user/private-name-tag`, { params, }); } diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 34218690c..7c2c184d9 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -31,13 +31,13 @@

Address

*ngIf="commonService.setNameTag(currentAddress) !== currentAddress" class="name-tag cursor-pointer mt-2 aura-tooltip-contain d-inline-flex">
- {{ commonService.setNameTag(currentAddress) || '-' }} + {{ commonService.setNameTag(currentAddress, null, false) || '-' }} - {{ (commonService.setNameTag(currentAddress) | cutStringPipe : 16) || '-' }} + {{ (commonService.setNameTag(currentAddress, null, false) | cutStringPipe : 16) || '-' }} - {{ (commonService.setNameTag(currentAddress) | cutStringPipe : 8 : 8) || '-' }} + {{ (commonService.setNameTag(currentAddress, null, false) | cutStringPipe : 8 : 8) || '-' }} Address
- + + +
+
+ {{ commonService.setNameTag(currentAddress) || '-' }} + + + {{ (commonService.setNameTag(currentAddress) | cutStringPipe : 16) || '-' }} + + + {{ (commonService.setNameTag(currentAddress) | cutStringPipe : 8 : 8) || '-' }} + + +
+ +
+

Total Value

@@ -151,4 +171,4 @@

Total Value

- \ No newline at end of file + diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index 5421fa1df..7f2dea976 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -118,6 +118,16 @@ section.account-detail { } } +.box-private { + .private-name-tag { + height: 24px; + padding: 0 var(--spacer-2); + background-color: unset; + border-radius: 16px; + border: 1px solid var(--aura-gray-8); + } +} + .btn-private { width: fit-content; } diff --git a/src/app/pages/account/account-detail/account-detail.component.ts b/src/app/pages/account/account-detail/account-detail.component.ts index f1296e535..2737ddc09 100644 --- a/src/app/pages/account/account-detail/account-detail.component.ts +++ b/src/app/pages/account/account-detail/account-detail.component.ts @@ -1,10 +1,8 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; -import { AfterViewInit, Component, HostListener, OnInit, ViewChild } from '@angular/core'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { Component, HostListener, OnInit, ViewChild } from '@angular/core'; import { MatSelect } from '@angular/material/select'; import { MatSort } from '@angular/material/sort'; -import { MatTableDataSource } from '@angular/material/table'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ChartComponent } from 'ng-apexcharts'; import { Subject, Subscription } from 'rxjs'; @@ -14,19 +12,11 @@ import { SoulboundService } from 'src/app/core/services/soulbound.service'; import { EnvironmentService } from '../../../../app/core/data-services/environment.service'; import { WalletService } from '../../../../app/core/services/wallet.service'; import { ACCOUNT_WALLET_COLOR, TABS_TITLE_ACCOUNT } from '../../../core/constants/account.constant'; -import { - ACCOUNT_WALLET_COLOR_ENUM, - PageEventType, - StakeModeAccount, - TabsAccount, - WalletAcount, -} from '../../../core/constants/account.enum'; -import { DATE_TIME_WITH_MILLISECOND, PAGE_EVENT } from '../../../core/constants/common.constant'; -import { TableTemplate } from '../../../core/models/common.model'; +import { ACCOUNT_WALLET_COLOR_ENUM, StakeModeAccount, WalletAcount } from '../../../core/constants/account.enum'; +import { DATE_TIME_WITH_MILLISECOND } from '../../../core/constants/common.constant'; import { AccountService } from '../../../core/services/account.service'; import { CommonService } from '../../../core/services/common.service'; -import { TransactionService } from '../../../core/services/transaction.service'; -import { Globals, convertDataTransaction } from '../../../global/global'; +import { Globals } from '../../../global/global'; import { CHART_OPTION, ChartOptions, chartCustomOptions } from './chart-options'; @Component({ @@ -78,7 +68,6 @@ export class AccountDetailComponent implements OnInit { isSent = true; constructor( - private transactionService: TransactionService, public commonService: CommonService, private route: ActivatedRoute, private accountService: AccountService, @@ -88,6 +77,7 @@ export class AccountDetailComponent implements OnInit { private modalService: NgbModal, private environmentService: EnvironmentService, private soulboundService: SoulboundService, + private router: Router, ) { this.chartOptions = CHART_OPTION(); } @@ -233,4 +223,8 @@ export class AccountDetailComponent implements OnInit { url = url.match(/^https?:/) ? url : '//' + url; return url; } + + editPrivateName() { + this.router.navigate(['/profile'], { queryParams: { tab: 'private' } }); + } } diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html index dd8e29c02..73cc49885 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html @@ -10,15 +10,23 @@ Public Name: + *ngIf=" + commonService.setNameTag(contractDetail?.address, null, false) !== contractDetail?.address; + else NoNameTag + ">
- {{ commonService.setNameTag(contractDetail?.address) || '-' }} + {{ + commonService.setNameTag(contractDetail?.address, null, false) || '-' + }} + {{ commonService.checkDisplayTooltip(contractDetail?.address) }} - {{ (commonService.setNameTag(contractDetail?.address) | cutStringPipe : 16) || '-' }} + {{ (commonService.setNameTag(contractDetail?.address, null, false) | cutStringPipe : 16) || '-' }} - {{ (commonService.setNameTag(contractDetail?.address) | cutStringPipe : 8 : 8) || '-' }} + {{ + (commonService.setNameTag(contractDetail?.address, null, false) | cutStringPipe : 8 : 8) || '-' + }} Private Name Tag: - + +
+ {{ (commonService.setNameTag(contractDetail?.address) | cutStringPipe : 16) || '' }} +
+ diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 370027485..90eba925d 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -142,6 +142,10 @@ export class LoginComponent implements OnInit { localStorage.setItem('userEmail', JSON.stringify(res.email)); localStorage.setItem('provider', JSON.stringify(res.provider || 'password')); this.route.navigate(['/profile']); + + setTimeout(() => { + location.reload(); + }, 500); } }, error: (error) => { @@ -238,6 +242,10 @@ export class LoginComponent implements OnInit { localStorage.setItem('userEmail', JSON.stringify(res.userEmail)); localStorage.setItem('provider', JSON.stringify(res.provider || 'password')); window.location.href = '/profile'; + + setTimeout(() => { + location.reload(); + }, 500); }, error: (error) => { this.addError(error?.details?.message); diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 9e9c3d34f..9e1ca4d0f 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -3,7 +3,6 @@ import { FormBuilder, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { LENGTH_CHARACTER } from 'src/app/core/constants/common.constant'; -import { MESSAGES_CODE } from 'src/app/core/constants/messages.constant'; import { EnvironmentService } from 'src/app/core/data-services/environment.service'; import { CommonService } from 'src/app/core/services/common.service'; import { NameTagService } from 'src/app/core/services/name-tag.service'; @@ -26,6 +25,11 @@ export class PopupNameTagComponent implements OnInit { publicNameTag = '-'; isValidAddress = false; + nameTagType = { + Account: 'account', + Contract: 'contract', + }; + constructor( @Inject(MAT_DIALOG_DATA) public data: { data: any }, public dialogRef: MatDialogRef, @@ -86,10 +90,10 @@ export class PopupNameTagComponent implements OnInit { const { isAccount, address, name, note } = this.privateNameForm.value; const payload = { - type: isAccount ? 'account' : 'contract', + type: isAccount ? this.nameTagType.Account : this.nameTagType.Contract, address: address, nameTag: name, - note: null, + note: note, }; this.nameTagService.createPrivateName(payload).subscribe({ diff --git a/src/app/pages/profile/profile.component.ts b/src/app/pages/profile/profile.component.ts index 7f6b909e5..bb3d67f67 100644 --- a/src/app/pages/profile/profile.component.ts +++ b/src/app/pages/profile/profile.component.ts @@ -9,24 +9,27 @@ import { ProfileTab } from 'src/app/core/constants/profile.enum'; }) export class ProfileComponent implements OnInit { profileTab = ProfileTab; - currentTab = ProfileTab.PrivateNameTag; + currentTab = ProfileTab.Setting; activeTabID = 0; PROFILE_TAB = [ { key: ProfileTab.Setting, - value: 'Profile settings' + value: 'Profile settings', }, { key: ProfileTab.PrivateNameTag, - value: 'Private name tag' + value: 'Private name tag', }, // { // key: ProfileTab.WatchList, // value: 'Watchlist' // } - ] + ]; - constructor(private route: ActivatedRoute, private router: Router) {} + constructor( + private route: ActivatedRoute, + private router: Router, + ) {} ngOnInit(): void { // check exit email diff --git a/src/app/pages/profile/profile.module.ts b/src/app/pages/profile/profile.module.ts index 9525a8418..3c162cd06 100644 --- a/src/app/pages/profile/profile.module.ts +++ b/src/app/pages/profile/profile.module.ts @@ -1,24 +1,24 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatIconModule } from '@angular/material/icon'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { NgxMaskModule } from 'ngx-mask'; +import { NameTagService } from 'src/app/core/services/name-tag.service'; +import { UserService } from 'src/app/core/services/user.service'; +import { APaginatorModule } from 'src/app/shared/components/a-paginator/a-paginator.module'; import { LoadingImageModule } from 'src/app/shared/components/loading-image/loading-image.module'; import { NameTagModule } from 'src/app/shared/components/name-tag/name-tag.module'; +import { TableNoDataModule } from 'src/app/shared/components/table-no-data/table-no-data.module'; import { MaterialModule } from '../../app.module'; import { CommonPipeModule } from '../../core/pipes/common-pipe.module'; import { SharedModule } from '../../shared/shared.module'; +import { PopupNameTagComponent } from './popup-name-tag/popup-name-tag.component'; +import { PrivateNameTagComponent } from './private-name-tag/private-name-tag.component'; import { ProfileRoutingModule } from './profile-routing.module'; import { ProfileSettingsComponent } from './profile-settings/profile-settings.component'; import { ProfileComponent } from './profile.component'; -import { MatIconModule } from '@angular/material/icon'; -import { UserService } from 'src/app/core/services/user.service'; -import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import { PrivateNameTagComponent } from './private-name-tag/private-name-tag.component'; -import { TableNoDataModule } from 'src/app/shared/components/table-no-data/table-no-data.module'; -import { APaginatorModule } from 'src/app/shared/components/a-paginator/a-paginator.module'; -import { PopupNameTagComponent } from './popup-name-tag/popup-name-tag.component'; -import { NameTagService } from 'src/app/core/services/name-tag.service'; @NgModule({ declarations: [ProfileComponent, ProfileSettingsComponent, PrivateNameTagComponent, PopupNameTagComponent], diff --git a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html index 79b830b7d..91265fe28 100644 --- a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html @@ -41,7 +41,7 @@ {{ (commonService.setNameTag(userAddress) | cutStringPipe : 8 : 8) || '-' }} - +
+ [content]="'Public name: ' + commonService.setNameTag(userAddress, null, false)">
@@ -75,7 +75,9 @@
-
+
- +
{{ @@ -48,7 +50,9 @@
- +
{{ @@ -68,7 +72,9 @@
- +
{{ (transactionsData.top_tx_sent[0]?.amount | number) ?? 0 }} @@ -84,7 +90,9 @@
- +
{{ (transactionsData.top_gas_used[0]?.amount | number) ?? 0 }} @@ -95,4 +103,3 @@
- \ No newline at end of file diff --git a/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss b/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss index f0bd3e385..6ad9516c6 100644 --- a/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss +++ b/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss @@ -12,9 +12,12 @@ } ::ng-deep { + .private-name-tag { + background-color: var(--aura-gray-10) !important; + } .box-name-tag { - background-color: var(--aura-gray-8) !important; &:not(.private-name-tag) { + background-color: var(--aura-gray-8) !important; &:after { border-right: 15px solid var(--aura-gray-9) !important; } diff --git a/src/app/pages/statistics/top-statistics/top-statistic-transaction/top-statistic-transaction.component.scss b/src/app/pages/statistics/top-statistics/top-statistic-transaction/top-statistic-transaction.component.scss index 57479ed85..974471b9a 100644 --- a/src/app/pages/statistics/top-statistics/top-statistic-transaction/top-statistic-transaction.component.scss +++ b/src/app/pages/statistics/top-statistics/top-statistic-transaction/top-statistic-transaction.component.scss @@ -26,13 +26,12 @@ .box-statistic { ::ng-deep { .box-name-tag { - background-color: var(--aura-gray-8) !important; - &:not(.private-name-tag) { + background-color: var(--aura-gray-8) !important; &:after { border-right: 15px solid var(--aura-gray-10) !important; } } } } -} \ No newline at end of file +} diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.html b/src/app/pages/validators/validators-detail/validators-detail.component.html index 249eb0f10..bdab469bf 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.html +++ b/src/app/pages/validators/validators-detail/validators-detail.component.html @@ -347,10 +347,21 @@

Delegators

- +
+
+ {{ data.delegator_address | displayNameTag }} +
+ + + +
{{ data[template.matColumnDef] | mask : 'separator.6' }} {{ denom }} diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.scss b/src/app/pages/validators/validators-detail/validators-detail.component.scss index bf74af7b5..4b8bb0d22 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.scss +++ b/src/app/pages/validators/validators-detail/validators-detail.component.scss @@ -150,3 +150,38 @@ form.search-form { } } } + +.box-name-tag { + height: 26px; + display: inline-flex; + align-items: center; + font-size: 1.2rem; + font-weight: 400; + line-height: 1.6rem; + word-break: break-word; + background-color: var(--aura-gray-9); + border-radius: 4px 0px 0px 4px; + padding-left: var(--spacer-2); + padding-right: var(--spacer-5); + &.private-name-tag { + padding: 0 var(--spacer-2); + background-color: unset; + border-radius: 16px; + border: 1px solid var(--aura-gray-8); + } + &:not(.private-name-tag) { + position: relative; + &:after { + content: ''; + position: absolute; + width: 0; + height: 0; + right: 0; + top: 0; + bottom: 0; + border-top: 13px solid transparent; + border-right: 15px solid #24262E; + border-bottom: 13px solid transparent; + } + } +} \ No newline at end of file diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.ts b/src/app/pages/validators/validators-detail/validators-detail.component.ts index 61b0be40a..bb19173d2 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.ts +++ b/src/app/pages/validators/validators-detail/validators-detail.component.ts @@ -447,4 +447,15 @@ export class ValidatorsDetailComponent implements OnInit { } }); } + + displayContent(value) { + let result = value; + if (!this.commonService.checkPublic(value, this.global.listNameTag)) { + result += '
' + 'Public name: ' + this.commonService.setNameTag(value, this.global.listNameTag, false); + } + if (this.commonService.checkPrivate(value)) { + result += '
' + 'Private name tag: ' + this.commonService.setNameTag(value, this.global.listNameTag); + } + return result; + } } diff --git a/src/app/shared/components/authenticate-mail/authenticate-mail.component.ts b/src/app/shared/components/authenticate-mail/authenticate-mail.component.ts index 0812db5b8..a638c904a 100644 --- a/src/app/shared/components/authenticate-mail/authenticate-mail.component.ts +++ b/src/app/shared/components/authenticate-mail/authenticate-mail.component.ts @@ -60,6 +60,10 @@ export class AuthenticateMailComponent implements OnDestroy { if (this.route.snapshot['_routerState']?.url === '/profile') { this.router.navigate(['/']); } + + setTimeout(() => { + location.reload(); + }, 500); } linkLogin() { diff --git a/src/app/shared/components/name-tag/name-tag.component.ts b/src/app/shared/components/name-tag/name-tag.component.ts index 1978d1682..03b23cd19 100644 --- a/src/app/shared/components/name-tag/name-tag.component.ts +++ b/src/app/shared/components/name-tag/name-tag.component.ts @@ -1,5 +1,4 @@ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; import { LENGTH_CHARACTER } from 'src/app/core/constants/common.constant'; import { CommonService } from 'src/app/core/services/common.service'; import { Globals } from 'src/app/global/global'; @@ -31,7 +30,7 @@ export class NameTagComponent implements OnInit { extendUrlLink = ''; - constructor(public commonService: CommonService, public global: Globals) {} + constructor(public commonService: CommonService, public global: Globals, ) {} ngOnInit(): void { if (this.extendUrl) { @@ -52,7 +51,13 @@ export class NameTagComponent implements OnInit { } displayContent(value) { - let result = value + '
' + 'Public name: ' + this.commonService.setNameTag(value, this.global.listNameTag); + let result = value; + if (!this.commonService.checkPublic(value)) { + result += '
' + 'Public name: ' + this.commonService.setNameTag(value, this.global.listNameTag, false); + } + if (this.commonService.checkPrivate(value)) { + result += '
' + 'Private name tag: ' + this.commonService.setNameTag(value, this.global.listNameTag); + } return result; } } From 001c075304baedef25c799afcdf8f2847071a7a4 Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 23 Aug 2023 11:18:45 +0700 Subject: [PATCH 008/184] [TamTM6] private name tag css, handle error --- src/app/app.component.ts | 5 ++- src/app/core/pipes/common-pipe.module.ts | 6 ---- src/app/core/pipes/common.pipe.ts | 24 ------------- src/app/core/services/name-tag.service.ts | 5 +-- .../account-detail.component.scss | 2 +- .../account-detail.component.ts | 7 +++- .../contract-info-card.component.scss | 2 +- .../popup-name-tag.component.html | 6 ++-- .../popup-name-tag.component.ts | 11 ++++-- .../top-statistic-overview.component.scss | 3 -- .../token-inventory-tab.component.html | 5 ++- .../token-inventory-tab.component.scss | 7 ++-- .../validators-detail.component.html | 23 ++++-------- .../validators-detail.component.scss | 35 ------------------- .../validators-detail.component.ts | 12 +------ .../name-tag/name-tag.component.scss | 2 +- src/assets/scss/custom.scss | 2 +- 17 files changed, 43 insertions(+), 114 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 376a462a4..7ec9b02e1 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,11 +33,14 @@ export class AppComponent implements OnInit { this.getPriceToken(); setInterval(() => { - this.getListNameTag(); this.getInfoCommon(); this.getPriceToken(); }, 60000); + setInterval(() => { + this.getListNameTag(); + }, 20000); + // if (this.isTestnet) { // let el = document.createElement('div'); // document.body.appendChild(el); diff --git a/src/app/core/pipes/common-pipe.module.ts b/src/app/core/pipes/common-pipe.module.ts index 0f8d91b3d..53186ee90 100644 --- a/src/app/core/pipes/common-pipe.module.ts +++ b/src/app/core/pipes/common-pipe.module.ts @@ -12,8 +12,6 @@ import { convertLogAmount, decodeData, displayTypeToolTip, - displayNameTag, - checkIsPrivate, } from './common.pipe'; import { JsonPipe } from './json.pipe'; @@ -31,8 +29,6 @@ import { JsonPipe } from './json.pipe'; convertLogAmount, decodeData, displayTypeToolTip, - displayNameTag, - checkIsPrivate ], imports: [CommonModule], exports: [ @@ -48,8 +44,6 @@ import { JsonPipe } from './json.pipe'; convertLogAmount, decodeData, displayTypeToolTip, - displayNameTag, - checkIsPrivate ], }) export class CommonPipeModule {} diff --git a/src/app/core/pipes/common.pipe.ts b/src/app/core/pipes/common.pipe.ts index fe952dc43..bd350a9aa 100644 --- a/src/app/core/pipes/common.pipe.ts +++ b/src/app/core/pipes/common.pipe.ts @@ -142,27 +142,3 @@ export class displayTypeToolTip implements PipeTransform { return result; } } - -@Pipe({ name: 'displayNameTag' }) -export class displayNameTag implements PipeTransform { - constructor(private global: Globals) {} - transform(address: any): string { - const nameTag = this.global.listNameTag?.find((k) => k.address === address); - let result = nameTag?.name_tag_private || nameTag?.name_tag || address; - return result; - } -} - -@Pipe({ name: 'checkIsPrivate' }) -export class checkIsPrivate implements PipeTransform { - constructor(private global: Globals) {} - transform(address: any): boolean { - let result = false; - const nameTag = this.global.listNameTag?.find((k) => k.address === address && k.isPrivate); - if (nameTag?.name_tag_private) { - result = true; - } - return result; - } -} - diff --git a/src/app/core/services/name-tag.service.ts b/src/app/core/services/name-tag.service.ts index 8b7665aea..610605507 100644 --- a/src/app/core/services/name-tag.service.ts +++ b/src/app/core/services/name-tag.service.ts @@ -21,9 +21,6 @@ export class NameTagService extends CommonService { createPrivateName(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.post(`${this.apiUrl}/user/private-name-tag`, { - params, - }); + return this.http.post(`${this.apiUrl}/user/private-name-tag`, params); } } - diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index 7f2dea976..10bcc771b 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -122,7 +122,7 @@ section.account-detail { .private-name-tag { height: 24px; padding: 0 var(--spacer-2); - background-color: unset; + background-color: var(--aura-gray-10); border-radius: 16px; border: 1px solid var(--aura-gray-8); } diff --git a/src/app/pages/account/account-detail/account-detail.component.ts b/src/app/pages/account/account-detail/account-detail.component.ts index 2737ddc09..a412c0341 100644 --- a/src/app/pages/account/account-detail/account-detail.component.ts +++ b/src/app/pages/account/account-detail/account-detail.component.ts @@ -225,6 +225,11 @@ export class AccountDetailComponent implements OnInit { } editPrivateName() { - this.router.navigate(['/profile'], { queryParams: { tab: 'private' } }); + const userEmail = localStorage.getItem('userEmail'); + if (userEmail) { + this.router.navigate(['/profile'], { queryParams: { tab: 'private' } }); + } else { + this.router.navigate(['/login']); + } } } diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss index 99b1f4126..cd58b04de 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss @@ -39,7 +39,7 @@ padding-right: var(--spacer-5); &.private-name-tag { padding: 0 var(--spacer-2); - background-color: unset; + background-color: var(--aura-gray-10); border-radius: 16px; border: 1px solid var(--aura-gray-8); } diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 80658572b..08d86f018 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -70,7 +70,7 @@ placeholder="aura..." class="input-address" (change)="checkPublicNameTag()" - (blur)="checkFormValid()" + (blur)="checkFormValid(); isError = false" autocomplete="off" />
@@ -115,6 +116,7 @@ rows="5" matInput formControlName="note" + (blur)="isError = false" [maxLength]="maxLengthNote" placeholder="Enter note" class="form-check-input col-12 text-area" @@ -139,7 +141,7 @@
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 9e1ca4d0f..5b2da19da 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -24,6 +24,7 @@ export class PopupNameTagComponent implements OnInit { currentCodeID; publicNameTag = '-'; isValidAddress = false; + isError = false; nameTagType = { Account: 'account', @@ -77,8 +78,8 @@ export class PopupNameTagComponent implements OnInit { if (this.getAddress.value?.length > 0 && this.getAddress?.value?.startsWith('aura')) { if ( - (this.getAddress.value?.length === LENGTH_CHARACTER.ADDRESS && this.isAccount) || - (this.getAddress.value?.length === LENGTH_CHARACTER.CONTRACT && !this.isAccount) + (this.getAddress.value.trim()?.length === LENGTH_CHARACTER.ADDRESS && this.isAccount) || + (this.getAddress.value.trim()?.length === LENGTH_CHARACTER.CONTRACT && !this.isAccount) ) { this.isValidAddress = true; } @@ -99,13 +100,16 @@ export class PopupNameTagComponent implements OnInit { this.nameTagService.createPrivateName(payload).subscribe({ next: (res) => { if (res.code && res.code !== 200) { + this.isError = true; this.toastr.error(res.message || 'Error'); return; } + this.closeDialog(); this.toastr.successWithTitle('Private name tag created!', 'Success'); }, error: (error) => { + this.isError = true; this.toastr.error(error?.details.message[0] || 'Error'); }, }); @@ -117,6 +121,7 @@ export class PopupNameTagComponent implements OnInit { changeType(type) { this.isAccount = type; + this.isError = false this.privateNameForm.value.isAccount = type; this.checkFormValid(); } @@ -135,7 +140,7 @@ export class PopupNameTagComponent implements OnInit { this.publicNameTag = '-'; this.getAddress.value = this.getAddress.value.trim(); if (this.getAddress.status === 'VALID') { - const temp = this.commonService.setNameTag(this.getAddress.value); + const temp = this.commonService.setNameTag(this.getAddress.value, null, false); if (temp !== this.getAddress.value) { this.publicNameTag = temp; } diff --git a/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss b/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss index 6ad9516c6..94e192903 100644 --- a/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss +++ b/src/app/pages/statistics/top-statistics/top-statistic-overview/top-statistic-overview.component.scss @@ -12,9 +12,6 @@ } ::ng-deep { - .private-name-tag { - background-color: var(--aura-gray-10) !important; - } .box-name-tag { &:not(.private-name-tag) { background-color: var(--aura-gray-8) !important; diff --git a/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.html b/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.html index 353862d64..a37d22848 100644 --- a/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.html +++ b/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.html @@ -31,10 +31,13 @@ {{ item.token_id | cutStringPipe : 5 : 5 }}
-
+
Owner: {{ commonService.setNameTag(item.owner) | cutStringPipe : 8 }} diff --git a/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.scss b/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.scss index f1903db87..a0e3aec76 100644 --- a/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.scss +++ b/src/app/pages/token/token-detail/token-content/token-content-tab/token-inventory-tab/token-inventory-tab.component.scss @@ -9,13 +9,14 @@ background-color: var(--aura-gray-8); border-radius: 4px 0px 0px 4px; padding-left: var(--spacer-1); - padding-right: var(--spacer-2); - min-width: 90px; + padding-right: var(--spacer-5); + // min-width: 90px; &.private-name-tag { padding: 0 var(--spacer-2); - background-color: unset; + background-color: var(--aura-gray-10); border-radius: 16px; border: 1px solid var(--aura-gray-8); + padding-right: var(--spacer-2); } &:not(.private-name-tag) { position: relative; diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.html b/src/app/pages/validators/validators-detail/validators-detail.component.html index bdab469bf..a898ccd27 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.html +++ b/src/app/pages/validators/validators-detail/validators-detail.component.html @@ -347,21 +347,10 @@

Delegators

-
-
- {{ data.delegator_address | displayNameTag }} -
- - - -
+
{{ data[template.matColumnDef] | mask : 'separator.6' }} {{ denom }} @@ -389,7 +378,9 @@

Delegators

{ label: '', class: !commonService.checkDisplayTooltip(data.delegator_address) - ? 'name-tag text--primary' + ? commonService.checkPrivate(data.delegator_address) + ? 'name-tag private-name-tag text--primary' + : 'name-tag text--primary' : 'text--primary', info: !commonService.checkDisplayTooltip(data.delegator_address) ? (commonService.setNameTag(data.delegator_address) | cutStringPipe : 16) diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.scss b/src/app/pages/validators/validators-detail/validators-detail.component.scss index 4b8bb0d22..a61fcd7e7 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.scss +++ b/src/app/pages/validators/validators-detail/validators-detail.component.scss @@ -149,39 +149,4 @@ form.search-form { color: var(--aura-primary) !important; } } -} - -.box-name-tag { - height: 26px; - display: inline-flex; - align-items: center; - font-size: 1.2rem; - font-weight: 400; - line-height: 1.6rem; - word-break: break-word; - background-color: var(--aura-gray-9); - border-radius: 4px 0px 0px 4px; - padding-left: var(--spacer-2); - padding-right: var(--spacer-5); - &.private-name-tag { - padding: 0 var(--spacer-2); - background-color: unset; - border-radius: 16px; - border: 1px solid var(--aura-gray-8); - } - &:not(.private-name-tag) { - position: relative; - &:after { - content: ''; - position: absolute; - width: 0; - height: 0; - right: 0; - top: 0; - bottom: 0; - border-top: 13px solid transparent; - border-right: 15px solid #24262E; - border-bottom: 13px solid transparent; - } - } } \ No newline at end of file diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.ts b/src/app/pages/validators/validators-detail/validators-detail.component.ts index bb19173d2..23d17fe96 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.ts +++ b/src/app/pages/validators/validators-detail/validators-detail.component.ts @@ -103,6 +103,7 @@ export class ValidatorsDetailComponent implements OnInit { ) {} ngOnInit(): void { + this.commonService['listNameTag'] = this.global?.listNameTag; this.currentAddress = this.route.snapshot.paramMap.get('id'); this.loadData(); this.getDetail(true); @@ -447,15 +448,4 @@ export class ValidatorsDetailComponent implements OnInit { } }); } - - displayContent(value) { - let result = value; - if (!this.commonService.checkPublic(value, this.global.listNameTag)) { - result += '
' + 'Public name: ' + this.commonService.setNameTag(value, this.global.listNameTag, false); - } - if (this.commonService.checkPrivate(value)) { - result += '
' + 'Private name tag: ' + this.commonService.setNameTag(value, this.global.listNameTag); - } - return result; - } } diff --git a/src/app/shared/components/name-tag/name-tag.component.scss b/src/app/shared/components/name-tag/name-tag.component.scss index 436b86d0e..bd5afe837 100644 --- a/src/app/shared/components/name-tag/name-tag.component.scss +++ b/src/app/shared/components/name-tag/name-tag.component.scss @@ -13,7 +13,7 @@ color: var(--aura-gray-2); &.private-name-tag { padding: 0 var(--spacer-2); - background-color: unset; + background-color: var(--aura-gray-10); border-radius: 16px; border: 1px solid var(--aura-gray-8); } diff --git a/src/assets/scss/custom.scss b/src/assets/scss/custom.scss index acb708d00..49c1948d8 100644 --- a/src/assets/scss/custom.scss +++ b/src/assets/scss/custom.scss @@ -681,7 +681,7 @@ body { color: var(--aura-gray-light); &.private-name-tag { padding: 0 var(--spacer-2); - background-color: unset; + background-color: var(--aura-gray-10); border-radius: 16px; border: 1px solid var(--aura-gray-8); } From ecd28b2896c6b26a38f4257304205de4942d2390 Mon Sep 17 00:00:00 2001 From: "FISAURA-PHUONGL\\quannn7" Date: Wed, 23 Aug 2023 15:15:43 +0700 Subject: [PATCH 009/184] private name tag table --- src/app/core/models/name-tag.model.ts | 6 ++ src/app/core/services/name-tag.service.ts | 4 +- .../private-name-tag.component.html | 74 +++++++------------ .../private-name-tag.component.ts | 30 ++++++-- .../token-cw20/token-cw20.component.ts | 1 + 5 files changed, 60 insertions(+), 55 deletions(-) create mode 100644 src/app/core/models/name-tag.model.ts diff --git a/src/app/core/models/name-tag.model.ts b/src/app/core/models/name-tag.model.ts new file mode 100644 index 000000000..170006b20 --- /dev/null +++ b/src/app/core/models/name-tag.model.ts @@ -0,0 +1,6 @@ +export class PrivateNameTagDto { + id: number; + address: string; + name_tag: string; + note: string; +} diff --git a/src/app/core/services/name-tag.service.ts b/src/app/core/services/name-tag.service.ts index 8076d6577..8b7665aea 100644 --- a/src/app/core/services/name-tag.service.ts +++ b/src/app/core/services/name-tag.service.ts @@ -14,14 +14,14 @@ export class NameTagService extends CommonService { getListPrivateNameTag(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.get(`${this.apiUrl}/admin/private-name-tag`, { + return this.http.get(`${this.apiUrl}/user/private-name-tag`, { params, }); } createPrivateName(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.post(`${this.apiUrl}/admin/private-name-tag`, { + return this.http.post(`${this.apiUrl}/user/private-name-tag`, { params, }); } diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 986dcd3c1..95a1c8ae1 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -10,7 +10,7 @@
-
Total 0/10 addresses tagged
+
Total 0/{{ pageData?.length }} addresses tagged
@@ -40,63 +40,41 @@
-
- +
+
- - - -
-
+
+
- - - {{ template.matColumnDef | cutStringPipe : 8 : 8 }} - -
desc
-
- - - - - {{ commonService.getDateValue(data['date_format'], false)[0] }} - - - - - - - - - {{ data[template.matColumnDef] }} - +
+ +
+ +
+ {{ data[template.matColumnDef].charAt(0).toUpperCase() + data[template.matColumnDef].slice(1) }} +
+ +
+ {{ commonService.getDateValue(data[template.matColumnDef])[0] }} +
+
+ {{ commonService.getDateValue(data[template.matColumnDef])[0] }} +
+
- +
- {{ 'NO DATA' | translate }} -
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index 533552850..bc867c40c 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -12,6 +12,8 @@ import { PaginatorComponent } from 'src/app/shared/components/paginator/paginato import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; import { ToastrService } from 'ngx-toastr'; import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; +import { NameTagService } from 'src/app/core/services/name-tag.service'; +import { PrivateNameTagDto } from 'src/app/core/models/name-tag.model'; @Component({ selector: 'app-private-name-tag', @@ -32,8 +34,8 @@ export class PrivateNameTagComponent implements OnInit { { matColumnDef: 'favorite', headerCellDef: 'Fav.', headerWidth: 8 }, { matColumnDef: 'address', headerCellDef: 'Address', headerWidth: 12 }, { matColumnDef: 'type', headerCellDef: 'Type', headerWidth: 6 }, - { matColumnDef: 'name', headerCellDef: 'Private Name Tag', headerWidth: 12 }, - { matColumnDef: 'add_time', headerCellDef: 'Added Time', headerWidth: 10 }, + { matColumnDef: 'name_tag', headerCellDef: 'Private Name Tag', headerWidth: 12 }, + { matColumnDef: 'created_at', headerCellDef: 'Added Time', headerWidth: 10 }, { matColumnDef: 'update_time', headerCellDef: 'Updated Time', headerWidth: 10 }, { matColumnDef: 'action', headerCellDef: '', headerWidth: 8 }, ]; @@ -42,10 +44,12 @@ export class PrivateNameTagComponent implements OnInit { textSearch = ''; searchSubject = new Subject(); destroy$ = new Subject(); - dataSource = new MatTableDataSource(); + dataSource: MatTableDataSource = new MatTableDataSource([]); + dataTable = []; constructor( public commonService: CommonService, + public nameTagService: NameTagService, private modalService: NgbModal, private dialog: MatDialog, private toastr: NgxToastrService, @@ -58,7 +62,10 @@ export class PrivateNameTagComponent implements OnInit { }); } - ngOnInit(): void {} + ngOnInit(): void { + console.log(this.dataSource); + this.getListPrivateName(); + } onKeyUp() { this.searchSubject.next(this.textSearch); @@ -73,7 +80,20 @@ export class PrivateNameTagComponent implements OnInit { this.getListPrivateName(); } - getListPrivateName() {} + getListPrivateName() { + this.textSearch = this.textSearch?.trim(); + const payload = { + limit: this.pageData.pageSize, + offset: this.pageData.pageSize * this.pageData.pageIndex, + keyword: this.textSearch, + }; + + this.nameTagService.getListPrivateNameTag(payload).subscribe((res) => { + console.log(res); + this.dataSource.data = res.data; + this.pageData.length = res?.meta?.count || 0; + }); + } openPopup() { const dialogConfig = new MatDialogConfig(); diff --git a/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts b/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts index 8f47a00e9..1322ecd3f 100644 --- a/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts +++ b/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts @@ -81,6 +81,7 @@ export class TokenCw20Component implements OnInit, OnDestroy { this.pageChange.selectPage(0); } }); + console.log(this.dataSource); } onKeyUp() { From 954ae77f072b25c46ff4eb4a46f68307aa6b5f20 Mon Sep 17 00:00:00 2001 From: mtam Date: Thu, 24 Aug 2023 11:08:53 +0700 Subject: [PATCH 010/184] [TamTM6] update name tag api, list --- src/app/core/services/name-tag.service.ts | 15 +- .../popup-name-tag.component.html | 13 +- .../popup-name-tag.component.ts | 61 ++++++-- .../private-name-tag.component.html | 135 ++++++------------ .../private-name-tag.component.scss | 8 ++ .../private-name-tag.component.ts | 81 +++++++++-- src/app/pages/profile/profile.module.ts | 14 +- .../token-cw20/token-cw20.component.ts | 1 - .../popup-common/popup-common.component.html | 38 +++++ .../popup-common/popup-common.component.scss | 16 +++ .../popup-common/popup-common.component.ts | 26 ++++ 11 files changed, 279 insertions(+), 129 deletions(-) create mode 100644 src/app/shared/components/popup-common/popup-common.component.html create mode 100644 src/app/shared/components/popup-common/popup-common.component.scss create mode 100644 src/app/shared/components/popup-common/popup-common.component.ts diff --git a/src/app/core/services/name-tag.service.ts b/src/app/core/services/name-tag.service.ts index bcb7981a7..1fb45b00d 100644 --- a/src/app/core/services/name-tag.service.ts +++ b/src/app/core/services/name-tag.service.ts @@ -21,8 +21,15 @@ export class NameTagService extends CommonService { createPrivateName(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.post(`${this.apiUrl}/user/private-name-tag`, { - params, - }); + return this.http.post(`${this.apiUrl}/user/private-name-tag`, params); + } + + deletePrivateNameTag(id) { + return this.http.delete(`${this.apiUrl}/user/private-name-tag/${id}`); + } + + updatePrivateNameTag(payload) { + const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); + return this.http.patch(`${this.apiUrl}/user/private-name-tag/${params.id}`, params); } -} \ No newline at end of file +} diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 08d86f018..c5d0fc13f 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -1,7 +1,7 @@
-
Create Private Name Tag
+
{{ data ? 'Edit' : 'Create' }} Private Name Tag
- Set favorite in tag list + Set favorite in tag list
@@ -140,9 +142,12 @@
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 5b2da19da..fe5ba2312 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -44,23 +44,22 @@ export class PopupNameTagComponent implements OnInit { ngOnInit(): void { this.formInit(); - const payload = { - limit: 20, - offset: 0, - keyword: null, - }; - this.nameTagService.getListPrivateNameTag(payload).subscribe((res) => { - console.log(res); - }); + if (this.data) { + this.setDataFrom(this.data); + } } get getAddress() { return this.privateNameForm.get('address'); } + get getFavorite() { + return this.privateNameForm.get('isFavorite'); + } + formInit() { this.privateNameForm = this.fb.group({ - favorite: [''], + isFavorite: [0], isAccount: [true, [Validators.required]], address: ['', [Validators.required]], name: ['', [Validators.required, Validators.maxLength(this.maxLengthNameTag)]], @@ -68,6 +67,14 @@ export class PopupNameTagComponent implements OnInit { }); } + setDataFrom(data) { + this.privateNameForm.controls['isFavorite'].setValue(data.isFavorite); + this.privateNameForm.controls['isAccount'].setValue(data.type === 'account' ? true : false); + this.privateNameForm.controls['address'].setValue(data.address); + this.privateNameForm.controls['name'].setValue(data.nameTag); + this.privateNameForm.controls['note'].setValue(data.note); + } + closeDialog(hash = null) { this.dialogRef.close(hash); } @@ -88,15 +95,24 @@ export class PopupNameTagComponent implements OnInit { async onSubmit() { this.isSubmit = true; - const { isAccount, address, name, note } = this.privateNameForm.value; + const { isFavorite, isAccount, address, name, note } = this.privateNameForm.value; const payload = { + isFavorite: isFavorite, type: isAccount ? this.nameTagType.Account : this.nameTagType.Contract, address: address, nameTag: name, note: note, }; + if (this.data) { + this.editPrivateName(payload); + } else { + this.createPrivateName(payload); + } + } + + createPrivateName(payload) { this.nameTagService.createPrivateName(payload).subscribe({ next: (res) => { if (res.code && res.code !== 200) { @@ -115,13 +131,34 @@ export class PopupNameTagComponent implements OnInit { }); } + editPrivateName(payload) { + this.nameTagService.updatePrivateNameTag(payload).subscribe({ + next: (res) => { + console.log(res); + + if (res.code && res.code !== 200) { + this.isError = true; + this.toastr.error(res.message || 'Error'); + return; + } + + // this.closeDialog(); + // this.toastr.successWithTitle('Private name tag created!', 'Success'); + }, + error: (error) => { + this.isError = true; + this.toastr.error(error?.details.message[0] || 'Error'); + }, + }); + } + changeFavorite() { - this.privateNameForm.value.favorite = !this.privateNameForm.value.favorite; + this.privateNameForm.value.isFavorite = !this.privateNameForm.value.isFavorite; } changeType(type) { this.isAccount = type; - this.isError = false + this.isError = false; this.privateNameForm.value.isAccount = type; this.checkFormValid(); } diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 95a1c8ae1..a59a44e9c 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -10,7 +10,7 @@
-
Total 0/{{ pageData?.length }} addresses tagged
+
Total {{ countFav }}/{{ pageData?.length }} addresses tagged
@@ -40,34 +40,61 @@
-
+
@@ -78,11 +105,13 @@
-
+
+ + + +
+
-
+
+ + +
{{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} - {{ data.note || '-' }} + {{ data.note || '-' }} +
+
+ {{ data[template.matColumnDef] }}
-
- {{ data[template.matColumnDef].charAt(0).toUpperCase() + data[template.matColumnDef].slice(1) }} +
+
- -
+
{{ commonService.getDateValue(data[template.matColumnDef])[0] }}
-
+
{{ commonService.getDateValue(data[template.matColumnDef])[0] }}
-
+
+
+ + +
+
+ + +
+
-
- + + [pageSize]="pageData.pageSize" + (paginator)="paginatorEmit($event)" + (pageEvent)="pageEvent($event)"> +
@@ -90,79 +119,3 @@ - -
- - - -
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss index 23fd2e449..65977a232 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -16,3 +16,11 @@ width: 410px; } } + +:ng-deep .box-name-tag { + height: 24px; + padding: 0 var(--spacer-2); + background-color: var(--aura-gray-10); + border-radius: 16px; + border: 1px solid var(--aura-gray-8); +} diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index bc867c40c..aa2959ef6 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -8,12 +8,11 @@ import { debounceTime, takeUntil } from 'rxjs/operators'; import { PAGE_EVENT } from 'src/app/core/constants/common.constant'; import { TableTemplate } from 'src/app/core/models/common.model'; import { CommonService } from 'src/app/core/services/common.service'; +import { NameTagService } from 'src/app/core/services/name-tag.service'; +import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; -import { ToastrService } from 'ngx-toastr'; -import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; -import { NameTagService } from 'src/app/core/services/name-tag.service'; -import { PrivateNameTagDto } from 'src/app/core/models/name-tag.model'; +import { PopupCommonComponent } from 'src/app/shared/components/popup-common/popup-common.component'; @Component({ selector: 'app-private-name-tag', @@ -23,20 +22,21 @@ import { PrivateNameTagDto } from 'src/app/core/models/name-tag.model'; export class PrivateNameTagComponent implements OnInit { @ViewChild(PaginatorComponent) pageChange: PaginatorComponent; + countFav = 0; modalReference: any; pageData: PageEvent = { length: PAGE_EVENT.LENGTH, - pageSize: 10, + pageSize: 5, pageIndex: PAGE_EVENT.PAGE_INDEX, }; templates: Array = [ - { matColumnDef: 'favorite', headerCellDef: 'Fav.', headerWidth: 8 }, + { matColumnDef: 'favorite', headerCellDef: 'Fav', headerWidth: 8 }, { matColumnDef: 'address', headerCellDef: 'Address', headerWidth: 12 }, { matColumnDef: 'type', headerCellDef: 'Type', headerWidth: 6 }, { matColumnDef: 'name_tag', headerCellDef: 'Private Name Tag', headerWidth: 12 }, - { matColumnDef: 'created_at', headerCellDef: 'Added Time', headerWidth: 10 }, - { matColumnDef: 'update_time', headerCellDef: 'Updated Time', headerWidth: 10 }, + { matColumnDef: 'createdAt', headerCellDef: 'Added Time', headerWidth: 10 }, + { matColumnDef: 'updatedAt', headerCellDef: 'Updated Time', headerWidth: 10 }, { matColumnDef: 'action', headerCellDef: '', headerWidth: 8 }, ]; displayedColumns: string[] = this.templates.map((dta) => dta.matColumnDef); @@ -63,7 +63,6 @@ export class PrivateNameTagComponent implements OnInit { } ngOnInit(): void { - console.log(this.dataSource); this.getListPrivateName(); } @@ -76,29 +75,32 @@ export class PrivateNameTagComponent implements OnInit { this.onKeyUp(); } - pageEvent(pageIndex: number): void { + pageEvent(e: PageEvent): void { + this.pageData.pageIndex = e.pageIndex; this.getListPrivateName(); } - getListPrivateName() { + getListPrivateName(nextKey = null) { this.textSearch = this.textSearch?.trim(); const payload = { - limit: this.pageData.pageSize, - offset: this.pageData.pageSize * this.pageData.pageIndex, + limit: 100, keyword: this.textSearch, }; this.nameTagService.getListPrivateNameTag(payload).subscribe((res) => { - console.log(res); + this.countFav = res.data?.filter((k) => k.isFavorite === 1)?.length || 0; this.dataSource.data = res.data; this.pageData.length = res?.meta?.count || 0; }); } - openPopup() { + openPopup(data = null) { const dialogConfig = new MatDialogConfig(); dialogConfig.panelClass = 'grant-overlay-panel'; dialogConfig.disableClose = true; + if (data) { + dialogConfig.data = data; + } let dialogRef = this.dialog.open(PopupNameTagComponent, dialogConfig); dialogRef.afterClosed().subscribe((result) => { @@ -107,4 +109,53 @@ export class PrivateNameTagComponent implements OnInit { } }); } + + openPopupDelete(data) { + let dialogRef = this.dialog.open(PopupCommonComponent, { + panelClass: 'sizeNormal', + data: { + title: 'Remove Private Name Tag', + content: 'Are you sure to remove private name tag for the address ' + data.address + ' ' + data.nameTag + ' ?', + }, + }); + + dialogRef.afterClosed().subscribe((result) => { + if (result !== 'canceled') { + this.deleteNameTag(data.id); + } + }); + } + + deleteNameTag(id) { + this.nameTagService.deletePrivateNameTag(id).subscribe((res) => { + if (res.code && res.code !== 200) { + this.toastr.error(res.message || 'Error'); + return; + } + + this.toastr.successWithTitle('Private name tag removed!', 'Success'); + setTimeout(() => { + this.getListPrivateName(); + }, 500); + }); + } + + editPrivateNameTag() {} + + updateFavorite(data) { + const payload = { + id: data.id, + isFavorite: !data.isFavorite, + }; + + this.nameTagService.updatePrivateNameTag(payload).subscribe((res) => { + setTimeout(() => { + this.getListPrivateName(); + }, 500); + }); + } + + paginatorEmit(event): void { + this.dataSource.paginator = event; + } } diff --git a/src/app/pages/profile/profile.module.ts b/src/app/pages/profile/profile.module.ts index 3c162cd06..f1607f3c7 100644 --- a/src/app/pages/profile/profile.module.ts +++ b/src/app/pages/profile/profile.module.ts @@ -19,9 +19,18 @@ import { PrivateNameTagComponent } from './private-name-tag/private-name-tag.com import { ProfileRoutingModule } from './profile-routing.module'; import { ProfileSettingsComponent } from './profile-settings/profile-settings.component'; import { ProfileComponent } from './profile.component'; +import { PopupCommonComponent } from 'src/app/shared/components/popup-common/popup-common.component'; +import { TooltipCustomizeModule } from 'src/app/shared/components/tooltip-customize/tooltip-customize.module'; +import { PaginatorModule } from 'src/app/shared/components/paginator/paginator.module'; @NgModule({ - declarations: [ProfileComponent, ProfileSettingsComponent, PrivateNameTagComponent, PopupNameTagComponent], + declarations: [ + ProfileComponent, + ProfileSettingsComponent, + PrivateNameTagComponent, + PopupNameTagComponent, + PopupCommonComponent, + ], imports: [ CommonModule, FormsModule, @@ -37,7 +46,8 @@ import { ProfileComponent } from './profile.component'; MatIconModule, NgbNavModule, TableNoDataModule, - APaginatorModule, + PaginatorModule, + TooltipCustomizeModule, ], providers: [FormBuilder, UserService, NameTagService], }) diff --git a/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts b/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts index 1322ecd3f..8f47a00e9 100644 --- a/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts +++ b/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts @@ -81,7 +81,6 @@ export class TokenCw20Component implements OnInit, OnDestroy { this.pageChange.selectPage(0); } }); - console.log(this.dataSource); } onKeyUp() { diff --git a/src/app/shared/components/popup-common/popup-common.component.html b/src/app/shared/components/popup-common/popup-common.component.html new file mode 100644 index 000000000..e5b60c187 --- /dev/null +++ b/src/app/shared/components/popup-common/popup-common.component.html @@ -0,0 +1,38 @@ + diff --git a/src/app/shared/components/popup-common/popup-common.component.scss b/src/app/shared/components/popup-common/popup-common.component.scss new file mode 100644 index 000000000..1778d6e2c --- /dev/null +++ b/src/app/shared/components/popup-common/popup-common.component.scss @@ -0,0 +1,16 @@ +::ng-deep { + .sizeNormal { + max-width: 500px !important; + } + + .mat-dialog-container { + background: transparent; + box-shadow: none; + padding: 0; + overflow: visible; + .card .popup-common { + max-width: 550px; + min-width: 300px; + } + } +} diff --git a/src/app/shared/components/popup-common/popup-common.component.ts b/src/app/shared/components/popup-common/popup-common.component.ts new file mode 100644 index 000000000..4c77d4e0b --- /dev/null +++ b/src/app/shared/components/popup-common/popup-common.component.ts @@ -0,0 +1,26 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; + +@Component({ + selector: 'app-popup-common', + templateUrl: './popup-common.component.html', + styleUrls: ['./popup-common.component.scss'], +}) +export class PopupCommonComponent implements OnInit { + isLoading; + constructor( + @Inject(MAT_DIALOG_DATA) public data: any, + public dialogRef: MatDialogRef, + ) {} + + ngOnInit(): void { + } + + submitAction(type) { + this.dialogRef.close(type); + } + + closeDialog() { + this.dialogRef.close('canceled'); + } +} From 45fd3b27f5803e262a648377e4f38d616233e88a Mon Sep 17 00:00:00 2001 From: mtam Date: Thu, 24 Aug 2023 16:14:17 +0700 Subject: [PATCH 011/184] [TamTM6] update layout private name tag --- .../popup-name-tag.component.html | 18 +-- .../popup-name-tag.component.scss | 34 ++++- .../popup-name-tag.component.ts | 4 +- .../private-name-tag.component.html | 144 +++++++++--------- .../private-name-tag.component.scss | 22 ++- .../private-name-tag.component.ts | 7 +- src/assets/scss/custom.scss | 6 + 7 files changed, 148 insertions(+), 87 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index c5d0fc13f..1cfb20421 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -2,11 +2,7 @@
{{ data ? 'Edit' : 'Create' }} Private Name Tag
- +
@@ -17,9 +13,9 @@ class="aura-form single-input-field private-name-form" autocomplete="off">
- Set favorite in tag list + + Set favorite in tag list +
@@ -56,7 +52,11 @@
-
{{ publicNameTag }}
+
+ {{ publicNameTag }} +
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss index a6d5bf546..7c00e7124 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss @@ -1,8 +1,10 @@ .card.card-private-name { - // padding: var(--spacer-4); @media (min-width: 992px) { width: 800px; } + @media (max-width: 414px) { + max-height: 80vh; + } .card-header { background-color: var(--aura-gray-9); } @@ -71,3 +73,33 @@ } } } + +.box-name-tag { + height: 26px; + display: inline-flex; + align-items: center; + font-size: 1.2rem; + font-weight: 400; + line-height: 1.6rem; + word-break: break-word; + background-color: var(--aura-gray-9); + border-radius: 4px 0px 0px 4px; + padding-left: var(--spacer-2); + padding-right: var(--spacer-5); + color: var(--aura-gray-light); + &:not(.private-name-tag) { + position: relative; + &:after { + content: ''; + position: absolute; + width: 0; + height: 0; + right: 0; + top: 0; + bottom: 0; + border-top: 13px solid transparent; + border-right: 15px solid #24262e; + border-bottom: 13px solid transparent; + } + } +} diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index fe5ba2312..0455d53d2 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -68,11 +68,13 @@ export class PopupNameTagComponent implements OnInit { } setDataFrom(data) { + this.isValidAddress = true; this.privateNameForm.controls['isFavorite'].setValue(data.isFavorite); this.privateNameForm.controls['isAccount'].setValue(data.type === 'account' ? true : false); this.privateNameForm.controls['address'].setValue(data.address); this.privateNameForm.controls['name'].setValue(data.nameTag); this.privateNameForm.controls['note'].setValue(data.note); + this.checkPublicNameTag(); } closeDialog(hash = null) { @@ -134,8 +136,6 @@ export class PopupNameTagComponent implements OnInit { editPrivateName(payload) { this.nameTagService.updatePrivateNameTag(payload).subscribe({ next: (res) => { - console.log(res); - if (res.code && res.code !== 200) { this.isError = true; this.toastr.error(res.message || 'Error'); diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index a59a44e9c..0d8215655 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -10,7 +10,7 @@
-
Total {{ countFav }}/{{ pageData?.length }} addresses tagged
+
Total {{ countFav }}/{{ pageData?.length }} addresses tagged
@@ -39,80 +39,82 @@
-
-
- - - - - + +
-
- - - -
-
-
-
- -
- - +
+ + + + + - + + + + - - -
+
+ + + +
+
+
+
+ +
+ + +
+ +
+ {{ data[template.matColumnDef] }} +
+
+
{{ data.nameTag | cutStringPipe : 25 }}
+
+
+ {{ commonService.getDateValue(data[template.matColumnDef])[0] }} +
+
+ {{ commonService.getDateValue(data[template.matColumnDef])[0] }} +
+
+
+ +
-
- - {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} - - {{ data.note || '-' }} +
+ +
-
- {{ data[template.matColumnDef] }} -
-
- -
-
- {{ commonService.getDateValue(data[template.matColumnDef])[0] }} -
-
- {{ commonService.getDateValue(data[template.matColumnDef])[0] }} -
-
-
- - -
-
- - -
-
- -
-
-
+ +
+
-
- - -
+
+ +
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss index 65977a232..b7c47b05e 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -17,8 +17,28 @@ } } -:ng-deep .box-name-tag { +.private-name-table { + th.mat-header-cell:nth-child(1) { + min-width: 60px; + } + th.mat-header-cell:nth-child(7) { + min-width: 80px; + } + th.mat-header-cell:nth-child(2), + th.mat-header-cell:nth-child(4), + th.mat-header-cell:nth-child(5), + th.mat-header-cell:nth-child(6) { + min-width: 150px; + } +} + +.txt-total-name { + color: #e6e7e8; +} + +.profile-private-name-tag { height: 24px; + width: fit-content; padding: 0 var(--spacer-2); background-color: var(--aura-gray-10); border-radius: 16px; diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index aa2959ef6..542b8c488 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { Subject } from 'rxjs'; import { debounceTime, takeUntil } from 'rxjs/operators'; import { PAGE_EVENT } from 'src/app/core/constants/common.constant'; @@ -10,9 +9,10 @@ import { TableTemplate } from 'src/app/core/models/common.model'; import { CommonService } from 'src/app/core/services/common.service'; import { NameTagService } from 'src/app/core/services/name-tag.service'; import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; +import { Globals } from 'src/app/global/global'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; -import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; import { PopupCommonComponent } from 'src/app/shared/components/popup-common/popup-common.component'; +import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; @Component({ selector: 'app-private-name-tag', @@ -50,9 +50,9 @@ export class PrivateNameTagComponent implements OnInit { constructor( public commonService: CommonService, public nameTagService: NameTagService, - private modalService: NgbModal, private dialog: MatDialog, private toastr: NgxToastrService, + private global: Globals, ) { this.searchSubject .asObservable() @@ -63,6 +63,7 @@ export class PrivateNameTagComponent implements OnInit { } ngOnInit(): void { + this.commonService.listNameTag = this.global.listNameTag; this.getListPrivateName(); } diff --git a/src/assets/scss/custom.scss b/src/assets/scss/custom.scss index 49c1948d8..4267a6ca6 100644 --- a/src/assets/scss/custom.scss +++ b/src/assets/scss/custom.scss @@ -761,3 +761,9 @@ body { background: url('../../assets/icons/icons-svg/white/error-notice.svg') center; background-size: cover; } + +.ellipsis-text { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} From bdb15093fc0fc19fbec28169bdfa5a130bd0d171 Mon Sep 17 00:00:00 2001 From: "FISAURA-PHUONGL\\quannn7" Date: Thu, 24 Aug 2023 17:29:23 +0700 Subject: [PATCH 012/184] fix edit name tag flow --- src/app/core/services/name-tag.service.ts | 2 +- .../profile/popup-name-tag/popup-name-tag.component.ts | 10 ++++++---- .../private-name-tag/private-name-tag.component.ts | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/core/services/name-tag.service.ts b/src/app/core/services/name-tag.service.ts index 1fb45b00d..5693937d1 100644 --- a/src/app/core/services/name-tag.service.ts +++ b/src/app/core/services/name-tag.service.ts @@ -30,6 +30,6 @@ export class NameTagService extends CommonService { updatePrivateNameTag(payload) { const params = _(payload).omitBy(_.isNull).omitBy(_.isUndefined).value(); - return this.http.patch(`${this.apiUrl}/user/private-name-tag/${params.id}`, params); + return this.http.patch(`${this.apiUrl}/user/private-name-tag/${payload.id}`, params); } } diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 0455d53d2..30729ca95 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -32,7 +32,7 @@ export class PopupNameTagComponent implements OnInit { }; constructor( - @Inject(MAT_DIALOG_DATA) public data: { data: any }, + @Inject(MAT_DIALOG_DATA) public data: any, public dialogRef: MatDialogRef, private fb: FormBuilder, public environmentService: EnvironmentService, @@ -95,7 +95,7 @@ export class PopupNameTagComponent implements OnInit { } } - async onSubmit() { + onSubmit() { this.isSubmit = true; const { isFavorite, isAccount, address, name, note } = this.privateNameForm.value; @@ -105,6 +105,7 @@ export class PopupNameTagComponent implements OnInit { address: address, nameTag: name, note: note, + id: this.data.id, }; if (this.data) { @@ -142,8 +143,9 @@ export class PopupNameTagComponent implements OnInit { return; } - // this.closeDialog(); - // this.toastr.successWithTitle('Private name tag created!', 'Success'); + this.closeDialog(true); + + this.toastr.successWithTitle('Private name tag created!', 'Success'); }, error: (error) => { this.isError = true; diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index 542b8c488..2191186d3 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -106,6 +106,9 @@ export class PrivateNameTagComponent implements OnInit { dialogRef.afterClosed().subscribe((result) => { if (result) { + setTimeout(() => { + this.getListPrivateName(); + }, 500); this.toastr.loading(result); } }); From 608980a5eb9419d88770fe7d9ce1f8a4c73e8d79 Mon Sep 17 00:00:00 2001 From: "FISAURA-PHUONGL\\quannn7" Date: Mon, 28 Aug 2023 16:15:50 +0700 Subject: [PATCH 013/184] fix small UI bug --- .../pages/profile/popup-name-tag/popup-name-tag.component.ts | 2 +- .../profile/private-name-tag/private-name-tag.component.scss | 3 +++ .../shared/components/popup-common/popup-common.component.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 30729ca95..e3fd5f535 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -145,7 +145,7 @@ export class PopupNameTagComponent implements OnInit { this.closeDialog(true); - this.toastr.successWithTitle('Private name tag created!', 'Success'); + this.toastr.successWithTitle('Private name tag edited!', 'Success'); }, error: (error) => { this.isError = true; diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss index b7c47b05e..7b3211f28 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -43,4 +43,7 @@ background-color: var(--aura-gray-10); border-radius: 16px; border: 1px solid var(--aura-gray-8); + color: var(--aura-primary); + display: flex; + align-items: center; } diff --git a/src/app/shared/components/popup-common/popup-common.component.html b/src/app/shared/components/popup-common/popup-common.component.html index e5b60c187..3038ebd0e 100644 --- a/src/app/shared/components/popup-common/popup-common.component.html +++ b/src/app/shared/components/popup-common/popup-common.component.html @@ -32,7 +32,7 @@ type="button" [disabled]="isLoading" (click)="submitAction(true)"> - Confirm + Remove
From 84deef17e536a225376612867d71066308860f7f Mon Sep 17 00:00:00 2001 From: "FISAURA-PHUONGL\\quannn7" Date: Mon, 28 Aug 2023 16:29:22 +0700 Subject: [PATCH 014/184] change added date format in private name tag table --- .../profile/private-name-tag/private-name-tag.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 0d8215655..bad567edb 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -81,7 +81,7 @@
{{ data.nameTag | cutStringPipe : 25 }}
- {{ commonService.getDateValue(data[template.matColumnDef])[0] }} + {{ data[template.matColumnDef] | customDate : 'yyyy-MM-dd' }}
{{ commonService.getDateValue(data[template.matColumnDef])[0] }} From 1c7f1cacaacc8b0ef50b83e01f81d06a019d27e6 Mon Sep 17 00:00:00 2001 From: "FISAURA-PHUONGL\\quannn7" Date: Mon, 28 Aug 2023 17:32:06 +0700 Subject: [PATCH 015/184] add note tooltip in private name tag table --- .../private-name-tag/private-name-tag.component.html | 8 ++++---- .../tooltip-customize/tooltip-customize.component.scss | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index bad567edb..5c60ea5a4 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -69,10 +69,10 @@ {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} -
-                      {{ data.note || '-' }}
-                    
+
+
{{ data.note || '-' }}
+ +
{{ data[template.matColumnDef] }} diff --git a/src/app/shared/components/tooltip-customize/tooltip-customize.component.scss b/src/app/shared/components/tooltip-customize/tooltip-customize.component.scss index 54a519f8c..34ec65d5c 100644 --- a/src/app/shared/components/tooltip-customize/tooltip-customize.component.scss +++ b/src/app/shared/components/tooltip-customize/tooltip-customize.component.scss @@ -7,6 +7,7 @@ position: relative; text-transform: initial; font-size: 1.2rem; + max-width: 600px; &:before { content: ''; position: absolute; From caf31f9c95f1e5f452c2cecf76a7c09dd123a27b Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Mon, 11 Sep 2023 16:22:24 +0700 Subject: [PATCH 016/184] add token transfer --- .../token-transfer.component.html | 172 ++++++++++++++++++ .../token-transfer.component.scss | 0 .../token-transfer.component.ts | 42 +++++ .../transaction-detail.component.html | 12 ++ .../pages/transaction/transaction.module.ts | 13 +- 5 files changed, 236 insertions(+), 3 deletions(-) create mode 100644 src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html create mode 100644 src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss create mode 100644 src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html new file mode 100644 index 000000000..047858257 --- /dev/null +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -0,0 +1,172 @@ +
+
+
+ +
+
Fungible Token (FT) Transfer
+
Non-Fungible Token (FT) Transfer
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + +
+
+ +
+ +
+
+ {{ element.name | stringEllipsis : 30 }} +
+
+
+ +
+ + +
+
+
+
+
+ {{ element.name | stringEllipsis : 19 }} +
+ +
+
+ +
+ + +
+
+ {{ element.symbol }} +
+
+
+
+ Contract + + - +
+
+
+ Price +
+ ${{ +element.price | mask : 'separator.6' }} + | +
+ {{ element.isValueUp ? '↑' : '↓' }}{{ element.change | number : global.formatNumber2Decimal }}% + +
+
+
+
+ Amount + +
+
+
+
+ <0,001 +
+ +
+
+
+
+ Value + + + ${{ element.price * element.balance | number : global.formatNumber2Decimal }} + +
+
+
+
+
+ +
+ +
+ + +
+
+
+
+
diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts new file mode 100644 index 000000000..49cdfb4c9 --- /dev/null +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts @@ -0,0 +1,42 @@ +import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; +import { PageEvent } from '@angular/material/paginator'; +import { Router } from '@angular/router'; +import { PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { pipeTypeData } from 'src/app/core/constants/transaction.enum'; +import { Globals } from 'src/app/global/global'; +import { MatTableDataSource } from '@angular/material/table'; +import { TableTemplate } from 'src/app/core/models/common.model'; + +@Component({ + selector: 'app-token-transfer', + templateUrl: './token-transfer.component.html', + styleUrls: ['./token-transfer.component.scss'], + encapsulation: ViewEncapsulation.None, +}) +export class TokenTransferComponent implements OnInit { + @Input() isNFT: boolean; + // @Input() value: any; + // @Input() dataLink: any; + // @Input() denom: any = { display: null, decimal: 6 }; + // @Input() pipeType: string = ''; + + pipeTypeData = pipeTypeData; + dataSource = new MatTableDataSource([]); + pageData: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: 10, + pageIndex: 1, + }; + templates: Array = [ + { matColumnDef: 'asset', headerCellDef: 'asset' }, + { matColumnDef: 'contractAddress', headerCellDef: 'contractAddress' }, + { matColumnDef: 'price', headerCellDef: 'price' }, + { matColumnDef: 'amount', headerCellDef: 'amount' }, + { matColumnDef: 'value', headerCellDef: 'value' }, + ]; + displayedColumns: string[] = this.templates.map((dta) => dta.matColumnDef); + + constructor(public global: Globals, public router: Router) {} + + ngOnInit(): void {} +} diff --git a/src/app/pages/transaction/transaction-detail/transaction-detail.component.html b/src/app/pages/transaction/transaction-detail/transaction-detail.component.html index 8c15818a7..ad062e790 100644 --- a/src/app/pages/transaction/transaction-detail/transaction-detail.component.html +++ b/src/app/pages/transaction/transaction-detail/transaction-detail.component.html @@ -110,6 +110,18 @@

+ +

Token Transfer

+
+
+ +
+
+ +
+
+
+

Messages

Date: Mon, 11 Sep 2023 16:56:10 +0700 Subject: [PATCH 017/184] add token transfer --- .../token-transfer/token-transfer.component.html | 4 ++-- .../token-transfer/token-transfer.component.ts | 15 ++++----------- .../transaction-detail.component.html | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index 047858257..2b18f15a8 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -147,8 +147,8 @@
- + +
+ + + + + + +
+
+
diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss index 99b1f4126..a0f374378 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss @@ -1,30 +1,15 @@ -.box-contract-info { - table.aura-basic-table { - min-height: 224px; - tr, - td { - color: var(--aura-gray-1); - height: 56px; - padding: 0px var(--spacer-4); - } - - tr:first-child td:first-child { - width: 40%; - color: var(--aura-white); - } - } - - @media (max-width: 992px) { - margin-bottom: 16px; +.box-contract-overview { + .card__header { + padding: var(--spacer-4); + padding-bottom: 0; } - - @media (max-width: 414px) { - tr td { - width: 40%; - } + .card__body { + padding: var(--spacer-4); + padding-top: 0; } } + .box-name-tag { height: 26px; display: inline-flex; @@ -37,6 +22,7 @@ border-radius: 4px 0px 0px 4px; padding-left: var(--spacer-2); padding-right: var(--spacer-5); + color: var(--aura-gray-2); &.private-name-tag { padding: 0 var(--spacer-2); background-color: unset; diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.ts b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.ts index d2aa10398..7aceee5be 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.ts +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.ts @@ -1,8 +1,6 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; -import { LENGTH_CHARACTER } from 'src/app/core/constants/common.constant'; -import { TYPE_CW4973 } from 'src/app/core/constants/contract.constant'; -import { ContractRegisterType } from 'src/app/core/constants/contract.enum'; import { CommonService } from 'src/app/core/services/common.service'; +import {LENGTH_CHARACTER} from "src/app/core/constants/common.constant"; @Component({ selector: 'app-contract-info-card', @@ -10,22 +8,15 @@ import { CommonService } from 'src/app/core/services/common.service'; styleUrls: ['./contract-info-card.component.scss'], }) export class ContractInfoCardComponent implements OnInit, OnChanges { + @Input() type: 'information' | 'moreInfo' = 'information'; @Input() contractDetail: any; - contractRegisterType = ContractRegisterType; - linkNft = 'token-nft'; lengthNormalAddress = LENGTH_CHARACTER.ADDRESS; constructor(public commonService: CommonService) {} ngOnInit(): void {} - ngOnChanges(changes: SimpleChanges): void { - setTimeout(() => { - if (changes?.contractDetail?.currentValue?.name === TYPE_CW4973) { - this.linkNft = 'token-abt'; - } - }, 500); - } + ngOnChanges(changes: SimpleChanges): void {} extendLink(url) { url = url.match(/^https?:/) ? url : '//' + url; diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html index 5e69421ab..685a9c2ff 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html @@ -26,14 +26,28 @@

Contract

-
- +
+
+ +
-
- +
+
+ +
+
+ +
+
+ +
diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss b/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss index 2073fb468..3fe254409 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss @@ -11,3 +11,8 @@ width: 15px; height: 15px; } +::ng-deep .contract__card-info .card { + @media (min-width: 991.98px) { + min-height: 237px; + } +} diff --git a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html index e62373779..4707bd2b3 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html @@ -1,68 +1,67 @@
-
- - - - - - - - - - - - - - - - - - - - - - - -
-
-
Contract Overview
-
-
-
-
-
Balance: - - {{ denom }} -
-
Contract Creator:
-
- - - - at txn - - {{ contractDetail?.tx_hash | cutStringPipe : 6 : 6 }} +
+
Contract Overview
+
+
+
+ +
+
Value
+
+ + + (${{ global.price.aura | mask : 'separator.6' }}/{{ denom | uppercase }}) + +
+
+
Contract Creator: - - - - at txn - - {{ contractDetail?.tx_hash | cutStringPipe : 8 : 8 }} + + {{ contractDetail?.cw721_contract?.name }} ({{ contractDetail?.cw721_contract?.symbol }}) -
Aura Value: - - - (${{ global.price.aura | mask : 'separator.6' }}/{{ denom | uppercase }}) - -
+ +
+
diff --git a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.scss b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.scss index a2a547e77..428c6bd39 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.scss +++ b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.scss @@ -1,65 +1,10 @@ .box-contract-overview { - table.aura-basic-table { - @media (min-width: 992px) { - min-height: 224px; - } - - tr, - td { - color: var(--aura-gray-1); - height: 56px; - padding: 0 var(--spacer-4); - } - - tr:first-child td:first-child { - width: 30%; - color: var(--aura-white); - } + .card__header { + padding: var(--spacer-4); + padding-bottom: 0; } - - .list-token .select-input-field { - background-color: var(--aura-bg-form); - width: 100%; - padding: 8px 16px; - height: 40px; - border: 1px solid var(--aura-dark-gray); - - @media (min-width: 992px) { - margin-right: 12px; - padding: 7px 22px 7px 24px; - } - - ::ng-deep mat-select-trigger { - display: inline-flex; - align-items: center; - } - } -} - -.selected-token__label { - margin-left: var(--spacer-2); - background: var(--aura-gradient-general); - color: var(--aura-black); - height: 20px; - font-size: 1.2rem; - line-height: 1.6rem; - display: inline-flex; - align-items: center; - justify-content: center; - border-radius: 4px; - padding: 0 var(--spacer-2); -} - -::ng-deep { - .aura-optional-panel.aura-optional-token-panel { - - .mat-option-text { - display: inline-flex; - align-items: center; - } - } - - .mat-select-value { - color: var(--aura-gray-1); + .card__body { + padding: var(--spacer-4); + padding-top: 0; } } diff --git a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.ts b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.ts index 22194d64a..32f11c623 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.ts +++ b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.ts @@ -5,6 +5,7 @@ import { ContractService } from 'src/app/core/services/contract.service'; import { TokenService } from 'src/app/core/services/token.service'; import { balanceOf } from 'src/app/core/utils/common/parsing'; import { Globals } from '../../../../global/global'; +import {ContractRegisterType} from "src/app/core/constants/contract.enum"; @Component({ selector: 'app-contracts-overview-card', @@ -16,7 +17,8 @@ export class ContractsOverviewCardComponent implements OnInit, OnChanges { contractBalance; contractPrice; priceToken = 0; - lengthNormalAddress = LENGTH_CHARACTER.ADDRESS; + contractRegisterType = ContractRegisterType; + linkNft = 'token-nft'; denom = this.environmentService.configValue.chain_info.currencies[0].coinDenom; constructor( diff --git a/src/app/pages/contracts/contracts-list/contracts-list.component.html b/src/app/pages/contracts/contracts-list/contracts-list.component.html index 2c6ece4d5..39dea5acc 100644 --- a/src/app/pages/contracts/contracts-list/contracts-list.component.html +++ b/src/app/pages/contracts/contracts-list/contracts-list.component.html @@ -149,11 +149,33 @@

Contracts

{{ (data[template.matColumnDef] | cutStringPipe : 16) || '-' }} + + +
+ {{ data['cw20_contract']?.name | stringEllipsis: 16}} + + + {{ data['cw721_contract']?.name | stringEllipsis: 16 }} + + + {{ data['cw721_contract']?.name | stringEllipsis: 16 }} + + - + diff --git a/src/app/pages/contracts/contracts-list/contracts-list.component.scss b/src/app/pages/contracts/contracts-list/contracts-list.component.scss index a94bc263f..433a01b56 100644 --- a/src/app/pages/contracts/contracts-list/contracts-list.component.scss +++ b/src/app/pages/contracts/contracts-list/contracts-list.component.scss @@ -22,17 +22,16 @@ text-overflow: ellipsis; } -.aura-table.contract-table th.mat-header-cell:nth-child(3) { - max-width: 130px; -} .aura-table.contract-table th.mat-header-cell:nth-child(1) { min-width: 220px; } - .aura-table.contract-table th.mat-header-cell:nth-child(5) { max-width: 150px; } +.aura-table.contract-table th.mat-header-cell:nth-child(7) { + max-width: 130px; +} .filter-group { overflow: auto; -ms-overflow-style: none; /* for Internet Explorer, Edge */ diff --git a/src/app/pages/contracts/contracts-list/contracts-list.component.ts b/src/app/pages/contracts/contracts-list/contracts-list.component.ts index d5bf4b8b3..8f485e0e3 100644 --- a/src/app/pages/contracts/contracts-list/contracts-list.component.ts +++ b/src/app/pages/contracts/contracts-list/contracts-list.component.ts @@ -20,15 +20,19 @@ import { CommonService } from 'src/app/core/services/common.service'; styleUrls: ['./contracts-list.component.scss'], }) export class ContractsListComponent implements OnInit, OnDestroy { + typeCW4973 = TYPE_CW4973; templates: Array = [ { matColumnDef: 'address', headerCellDef: 'Address', isUrl: '/contracts', isShort: true, isNameTag: true }, { matColumnDef: 'name', headerCellDef: 'Contract Name' }, - { matColumnDef: 'code_id', headerCellDef: 'Code ID' }, - { matColumnDef: 'type', headerCellDef: 'Type Contract' }, + { matColumnDef: 'label', headerCellDef: 'Label' }, { matColumnDef: 'compiler_version', headerCellDef: 'Version' }, - { matColumnDef: 'contract_verification', headerCellDef: 'Verified' }, + { matColumnDef: 'type', headerCellDef: 'Type' }, + { matColumnDef: 'token_tracker', headerCellDef: 'Token Tracker' }, + { matColumnDef: 'code_id', headerCellDef: 'Code ID' }, + // { matColumnDef: 'contract_verification', headerCellDef: 'Verified' }, { matColumnDef: 'creator', headerCellDef: 'Creator', isUrl: '/account', isShort: true, isNameTag: true }, ]; + contractRegisterType = ContractRegisterType; displayedColumns: string[] = this.templates.map((dta) => dta.matColumnDef); pageData: PageEvent = { length: PAGE_EVENT.LENGTH, diff --git a/src/app/shared/components/contract-table/contract-table.component.ts b/src/app/shared/components/contract-table/contract-table.component.ts index 6e196e239..89fecc294 100644 --- a/src/app/shared/components/contract-table/contract-table.component.ts +++ b/src/app/shared/components/contract-table/contract-table.component.ts @@ -24,7 +24,7 @@ export interface TableData { time: Date; from: string; to: string; - label: string; + // label: string; value: number; fee: number; gas_used: number; @@ -186,10 +186,10 @@ export class ContractTableComponent implements OnInit, OnChanges { break; } - const label = - contract.messages[0].sender === this.contractInfo?.contractsAddress - ? ContractTransactionType.OUT - : ContractTransactionType.IN; + // const label = + // contract.messages[0].sender === this.contractInfo?.contractsAddress + // ? ContractTransactionType.OUT + // : ContractTransactionType.IN; const tableDta: TableData = { txHash: contract.tx_hash, @@ -199,7 +199,7 @@ export class ContractTableComponent implements OnInit, OnChanges { blockId: contract.blockId, time: new Date(contract.timestamp), from, - label, + // label, to, value: balanceOf(value) || 0, fee: +contract.fee, From 58502affbfd77aaea76cd9ebf415432aa6b25e7f Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 12 Sep 2023 17:14:41 +0700 Subject: [PATCH 020/184] add token transfer --- src/app/core/services/transaction.service.ts | 44 +++ .../token-transfer.component.html | 301 +++++++++--------- .../token-transfer.component.scss | 15 + .../token-transfer.component.ts | 43 ++- .../transaction-detail.component.html | 9 +- .../transaction-detail.component.ts | 2 +- 6 files changed, 241 insertions(+), 173 deletions(-) diff --git a/src/app/core/services/transaction.service.ts b/src/app/core/services/transaction.service.ts index 503705ed0..634207c8a 100644 --- a/src/app/core/services/transaction.service.ts +++ b/src/app/core/services/transaction.service.ts @@ -189,4 +189,48 @@ export class TransactionService extends CommonService { }) .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); } + + getListTransferFromTx(height): Observable { + const operationsDoc = ` + query TxTransferDetail($height: Int) { + ${this.envDB} { + cw20_activity(where: {height: {_eq: $height}}) { + amount + from + to + cw20_contract { + smart_contract { + address + } + symbol + decimal + marketing_info + name + } + } + cw721_activity(where: {height: {_eq: $height}, cw721_contract: {smart_contract: {name: {_neq: "crates.io:cw4973"}}}}) { + from + to + cw721_token { + token_id + } + cw721_contract { + smart_contract { + address + } + } + } + } + } + `; + return this.http + .post(this.graphUrl, { + query: operationsDoc, + variables: { + height: height, + }, + operationName: 'TxTransferDetail', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + } } diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index 2b18f15a8..d0e17d997 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -1,172 +1,165 @@ -
-
-
- -
-
Fungible Token (FT) Transfer
-
Non-Fungible Token (FT) Transfer
-
- -
- - - - + + + + +
-
- +
+
+
+
+
+
+ Fungible Token (FT) Transfer +
+
+
+
+ + + + + + + - - - - + + + - + +
-
- Contract - - - -
+
+ {{ 'NO DATA' | translate }}
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+
+ Non-Fungible Token (NFT) Transfer +
+
+
+
+ + + + + - - - - - - - -
-
- <0,001 -
- -
-
- - + - - - - - - - - - - - -
+
+ +
+
+
+ Token ID + {{ data?.cw721_token?.token_id }} +
+
+ +
+
+
- - -
-
- Price -
- ${{ +element.price | mask : 'separator.6' }} - | -
- {{ element.isValueUp ? '↑' : '↓' }}{{ element.change | number : global.formatNumber2Decimal }}% - +
+
+ From + +
+
+ To + +
+
+
+ +
+
-
-
-
- Amount - -
+
-
- Value - - - ${{ element.price * element.balance | number : global.formatNumber2Decimal }} - -
-
-
-
+
+ {{ 'NO DATA' | translate }} +
+
- - - -
- - -
-
+ +
+ +
+
+
-
- + +
diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss index e69de29bb..debcaa8bf 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss @@ -0,0 +1,15 @@ +.transfer-card { + height: 372px; + .table-token { + ::ng-deep table thead { + display: none; + } + } + .transfer-token-info { + flex-direction: column; + } + + .transfer-address-label { + width: 30px; + } +} \ No newline at end of file diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts index 67904337a..335dd4613 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts @@ -1,35 +1,56 @@ -import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { Router } from '@angular/router'; import { PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { EnvironmentService } from 'src/app/core/data-services/environment.service'; import { TableTemplate } from 'src/app/core/models/common.model'; -import { Globals } from 'src/app/global/global'; +import { TransactionService } from 'src/app/core/services/transaction.service'; @Component({ selector: 'app-token-transfer', templateUrl: './token-transfer.component.html', styleUrls: ['./token-transfer.component.scss'], - encapsulation: ViewEncapsulation.None, }) export class TokenTransferComponent implements OnInit { - @Input() isNFT: boolean; - dataSource = new MatTableDataSource([]); + @Input() height: Number; + image_s3 = this.environmentService.configValue.image_s3; + defaultLogoToken = this.image_s3 + 'images/icons/token-logo.png'; + dataSourceFTs = new MatTableDataSource([]); + dataSourceNFTs = new MatTableDataSource([]); pageData: PageEvent = { length: PAGE_EVENT.LENGTH, pageSize: 10, pageIndex: 1, }; templatesFTs: Array = [ - { matColumnDef: 'asset', headerCellDef: 'asset' }, - { matColumnDef: 'contractAddress', headerCellDef: 'contractAddress' }, - { matColumnDef: 'price', headerCellDef: 'price' }, + { matColumnDef: 'assets', headerCellDef: 'assets' }, { matColumnDef: 'amount', headerCellDef: 'amount' }, - { matColumnDef: 'value', headerCellDef: 'value' }, + { matColumnDef: 'transfer', headerCellDef: 'transfer' }, + ]; + + templatesNFTs: Array = [ + { matColumnDef: 'nft', headerCellDef: 'nft' }, + { matColumnDef: 'transfer', headerCellDef: 'transfer' }, + { matColumnDef: 'action', headerCellDef: 'action' }, ]; displayedColumnsFTs: string[] = this.templatesFTs.map((dta) => dta.matColumnDef); + displayedColumnsNFTs: string[] = this.templatesNFTs.map((dta) => dta.matColumnDef); - constructor(public global: Globals, public router: Router) {} + constructor( + private environmentService: EnvironmentService, + public router: Router, + private transactionService: TransactionService, + ) {} - ngOnInit(): void {} + ngOnInit(): void { + this.transactionService.getListTransferFromTx(this.height).subscribe((res) => { + if (res?.cw721_activity.length > 0) { + this.dataSourceNFTs.data = res.cw721_activity; + } + if (res.cw20_activity.length > 0) { + this.dataSourceFTs.data = res.cw20_activity; + } + }); + } } diff --git a/src/app/pages/transaction/transaction-detail/transaction-detail.component.html b/src/app/pages/transaction/transaction-detail/transaction-detail.component.html index 7a87840cb..435a10c03 100644 --- a/src/app/pages/transaction/transaction-detail/transaction-detail.component.html +++ b/src/app/pages/transaction/transaction-detail/transaction-detail.component.html @@ -112,13 +112,8 @@

Token Transfer

-
-
- -
-
- -
+
+
diff --git a/src/app/pages/transaction/transaction-detail/transaction-detail.component.ts b/src/app/pages/transaction/transaction-detail/transaction-detail.component.ts index 04451e21c..bd428b08b 100644 --- a/src/app/pages/transaction/transaction-detail/transaction-detail.component.ts +++ b/src/app/pages/transaction/transaction-detail/transaction-detail.component.ts @@ -97,7 +97,7 @@ export class TransactionDetailComponent implements OnInit { setTimeout(() => { const lengthChar = document.getElementById('contentError')?.innerText?.length; const widthContent = document.getElementById('contentError')?.offsetWidth; - + // cal width text/content if (lengthChar * 7.1 > widthContent * 3) { this.isDisplayMore = true; From 719b056b48228f415507ae56163a2c5a350e555a Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Wed, 13 Sep 2023 11:10:34 +0700 Subject: [PATCH 021/184] update UI --- .../contracts-detail.component.html | 8 ++++---- .../contracts-detail.component.scss | 2 +- .../contracts-overview-card.component.html | 4 ++-- .../summary-info/summary-info.component.scss | 8 -------- src/assets/icons/icons-svg/white/Copy.svg | 4 ++++ src/assets/icons/icons-svg/white/QrCode.svg | 9 +++++++++ src/assets/scss/custom.scss | 18 ++++++++++++++++++ 7 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 src/assets/icons/icons-svg/white/Copy.svg create mode 100644 src/assets/icons/icons-svg/white/QrCode.svg diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html index 685a9c2ff..5733a8b8f 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html @@ -7,17 +7,17 @@

Contract

-

contractDetail?.cw721_contract?.name && contractDetail?.cw721_contract?.symbol " - class="text--primary break-word" + class="text--primary break-word v-ellipsis--des" [routerLink]="['/tokens/' + linkNft, contractDetail?.address]"> {{ contractDetail?.cw721_contract?.name }} ({{ contractDetail?.cw721_contract?.symbol }}) diff --git a/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.scss b/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.scss index 38bae38c7..29927804a 100644 --- a/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.scss +++ b/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.scss @@ -227,14 +227,6 @@ text-overflow: ellipsis; } } - -.v-ellipsis { - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; -} .nav-tabs-proposal.aura-nav-tabs.nav-tabs { .nav-item { flex-grow: 0; diff --git a/src/assets/icons/icons-svg/white/Copy.svg b/src/assets/icons/icons-svg/white/Copy.svg new file mode 100644 index 000000000..3c128ea94 --- /dev/null +++ b/src/assets/icons/icons-svg/white/Copy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/icons/icons-svg/white/QrCode.svg b/src/assets/icons/icons-svg/white/QrCode.svg new file mode 100644 index 000000000..0ed026e83 --- /dev/null +++ b/src/assets/icons/icons-svg/white/QrCode.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/scss/custom.scss b/src/assets/scss/custom.scss index acb708d00..79ddf9af1 100644 --- a/src/assets/scss/custom.scss +++ b/src/assets/scss/custom.scss @@ -761,3 +761,21 @@ body { background: url('../../assets/icons/icons-svg/white/error-notice.svg') center; background-size: cover; } + +.v-ellipsis { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.v-ellipsis--des { + @media (min-width: 991.98px) { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } +} From e6a1fa9559dc327967a7b0f87f9dd73e00fe3cfd Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Wed, 13 Sep 2023 11:57:31 +0700 Subject: [PATCH 022/184] add token transfer --- .../token-transfer.component.html | 155 +++++++++++------- .../token-transfer.component.scss | 36 ++-- .../token-transfer.component.ts | 10 +- 3 files changed, 131 insertions(+), 70 deletions(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index d0e17d997..42a00fc03 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -1,20 +1,25 @@ -
+
-
+
Fungible Token (FT) Transfer
-
-
- - - - - + + + + +
-
+
+
+ + + + + + + - - - - - - -
@@ -27,52 +32,65 @@
{{ data.cw20_contract.symbol }} - {{ data.cw20_contract.name | stringEllipsis : 16 }} - {{ data.cw20_contract.name }} + {{ data.cw20_contract.name | stringEllipsis : 16 }} + {{ data.cw20_contract.name }} +
+ +
+ Amount + +
+
-
- Amount - -
- -
-
+
+
From - +
-
+
To - +
-
-
- {{ 'NO DATA' | translate }} -
-
+
+ {{ 'NO DATA' | translate }} +
+
-
+
@@ -84,27 +102,44 @@
- -
-
+
+
Non-Fungible Token (NFT) Transfer
-
+
- +
- @@ -153,7 +190,7 @@
+
diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss index debcaa8bf..1749a0252 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss @@ -1,15 +1,31 @@ .transfer-card { - height: 372px; - .table-token { - ::ng-deep table thead { - display: none; - } - } - .transfer-token-info { - flex-direction: column; + + .card-nodata, + .table-token { + height: 321px; + margin-bottom: 0; + overflow-y: auto; + + ::ng-deep table thead { + display: none; + } + + .hide-td { + display: none; } - .transfer-address-label { - width: 30px; + @media (max-width: 992px) { + .nft-list .mat-cell { + padding-right: 0 !important; + } } + } + + .transfer-token-info { + flex-direction: column; + } + + .transfer-address-label { + width: 30px; + } } \ No newline at end of file diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts index 335dd4613..116c9263d 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts @@ -1,8 +1,9 @@ +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { Component, Input, OnInit } from '@angular/core'; import { PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { Router } from '@angular/router'; -import { PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { NULL_ADDRESS, PAGE_EVENT } from 'src/app/core/constants/common.constant'; import { EnvironmentService } from 'src/app/core/data-services/environment.service'; import { TableTemplate } from 'src/app/core/models/common.model'; import { TransactionService } from 'src/app/core/services/transaction.service'; @@ -16,6 +17,7 @@ export class TokenTransferComponent implements OnInit { @Input() height: Number; image_s3 = this.environmentService.configValue.image_s3; defaultLogoToken = this.image_s3 + 'images/icons/token-logo.png'; + nullAddress = NULL_ADDRESS; dataSourceFTs = new MatTableDataSource([]); dataSourceNFTs = new MatTableDataSource([]); pageData: PageEvent = { @@ -36,11 +38,13 @@ export class TokenTransferComponent implements OnInit { ]; displayedColumnsFTs: string[] = this.templatesFTs.map((dta) => dta.matColumnDef); displayedColumnsNFTs: string[] = this.templatesNFTs.map((dta) => dta.matColumnDef); + breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]); constructor( private environmentService: EnvironmentService, public router: Router, private transactionService: TransactionService, + private layout: BreakpointObserver, ) {} ngOnInit(): void { @@ -53,4 +57,8 @@ export class TokenTransferComponent implements OnInit { } }); } + + navigateToNFTDetail(address: string, tokenId: number): void { + this.router.navigate([`/tokens/token-nft/${address}/${tokenId}`]); + } } From f7866a514dac0f42f0e84f508579a3cfe75cf958 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Wed, 13 Sep 2023 14:42:20 +0700 Subject: [PATCH 023/184] label contract --- src/app/core/utils/common/validation.ts | 4 ++- .../account-detail.component.html | 11 +++--- .../account-detail.component.scss | 36 +++++++++++++++++++ .../account-detail.component.ts | 3 ++ 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/app/core/utils/common/validation.ts b/src/app/core/utils/common/validation.ts index b989b0c52..6be16e59d 100644 --- a/src/app/core/utils/common/validation.ts +++ b/src/app/core/utils/common/validation.ts @@ -1,3 +1,5 @@ +import { LENGTH_CHARACTER } from "../../constants/common.constant"; + const REGEX = { CONTRACT_ADDRESS: /aura([\w\d]+)/, }; @@ -6,7 +8,7 @@ export function isContract(adr: string): boolean { if (adr) { const regex = new RegExp(REGEX.CONTRACT_ADDRESS); - return regex.test(adr); + return (regex.test(adr) && adr.length === LENGTH_CHARACTER.CONTRACT); } return false; } diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index b07a6938f..10809307b 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -21,8 +21,8 @@
+
Contract
-
@@ -50,14 +50,13 @@

Account Info

target="_blank" [href]="extendLink(commonService.findUrlNameTag(currentAddress))" *ngIf="commonService.findUrlNameTag(currentAddress)"> - +
- +
diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index 6f18c7385..6e5cd37e3 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -137,11 +137,15 @@ section.account-detail { } } } + .contract-label { - height: 32px; + height: 20px; + @media (min-width: 991.98px) { + height: 32px; + } border-top-right-radius: 4px; border-bottom-right-radius: 4px; - display: flex; + display: inline-flex; align-items: center; justify-content: center; position: relative; @@ -154,12 +158,18 @@ section.account-detail { position: absolute; top: 0; bottom: 0; - left: -20px; + left: -10px; width: 0; height: 0; - border-top: 16px solid transparent; - border-bottom: 16px solid transparent; - border-right: 20px solid var(--aura-gray-9); + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + border-right: 10px solid var(--aura-gray-9); + @media (min-width: 991.98px) { + border-top: 16px solid transparent; + border-bottom: 16px solid transparent; + border-right: 20px solid var(--aura-gray-9); + left: -20px; + } } &::after { content: ''; @@ -168,8 +178,11 @@ section.account-detail { transform: translateY(-50%); width: 4px; height: 4px; - background-color: white; + background-color: var(--aura-gray-3); border-radius: 50%; - left: -6px; + left: 0px; + @media (min-width: 991.98px) { + left: -6px; + } } } \ No newline at end of file From df24ab9e8329234061e907f025cd49418b06abcf Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Wed, 13 Sep 2023 17:06:30 +0700 Subject: [PATCH 025/184] update UI (Mobile) --- .../contract-info-card.component.html | 40 +++++++++++++++---- .../contract-info-card.component.scss | 38 ++++++++++++++++-- .../contracts-detail.component.html | 6 +-- .../contracts-detail.component.scss | 3 ++ .../contracts-overview-card.component.html | 20 ++++++++-- .../contracts-overview-card.component.scss | 35 ++++++++++++++-- 6 files changed, 121 insertions(+), 21 deletions(-) diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html index f889a6a08..0ecad4445 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html @@ -1,10 +1,22 @@
-
-
+
+ -
-
+
+
Contract Name
{{ contractDetail.name }}
@@ -41,12 +53,24 @@
Information
-
-
+
+ -
-
+
+
Contract Type
{{ contractDetail.code?.type ?? '-' }}
diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss index a0f374378..f737c4a6c 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss @@ -1,11 +1,43 @@ .box-contract-overview { + border-radius: 0; + @media (min-width: 991.98px) { + border-radius: 12px; + } + &.moreInfo { + border-bottom-left-radius: var(--spacer-2); + border-bottom-right-radius: var(--spacer-2); + overflow: hidden; + } + .card__header { padding: var(--spacer-4); - padding-bottom: 0; + background-color: var(--aura-gray-9); + @media (min-width: 991.98px) { + padding-bottom: 0; + background-color: transparent; + } + &[aria-expanded='true'] { + img { + transform: rotate(180deg); + } + } } .card__body { - padding: var(--spacer-4); - padding-top: 0; + padding: 0 var(--spacer-4); + position: static !important; + background-color: var(--aura-gray-10) !important; + display: block !important; + border: none !important; + transition: all .35s ease-in-out; + overflow: hidden; + height: unset !important; + @media (max-width: 992px) { + max-height: 0; + &.show { + padding: var(--spacer-4); + max-height: 9999px; + } + } } } diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html index 5733a8b8f..8834cb85a 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html @@ -25,8 +25,8 @@

Contract

-
-
+
+
Contract
-
+
-
+
+
-
+
Token ID {{ data?.cw721_token?.token_id }}
+
+ {{ data?.cw721_token?.token_id }} +
+ +
+
@@ -116,26 +151,28 @@
From - +
To - +
-
- -
+ +
+ +
+
-
- +
+
@@ -76,7 +80,11 @@ style="max-width: 200px; width: fit-content" >{{ data.note || '-' }} - + +
@@ -98,7 +106,7 @@ (click)="openPopup(data)">
-
+
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss index 7b3211f28..9247448d8 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -47,3 +47,26 @@ display: flex; align-items: center; } + + +::ng-deep { + .txt-note { + pre { + max-width: 400px; + word-break: break-all; + white-space: pre-line; + color: white; + margin-bottom: 0; + } + &:before { + top: 100% !important; + transform: translate(-50%, 0) !important; + width: 0 !important; + height: 0 !important; + border-left: 8px solid transparent !important; + border-right: 8px solid transparent !important; + border-top: 10px solid var(--aura-gray-8) !important; + border-bottom: unset !important; + } + } +} \ No newline at end of file diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index 2191186d3..c0c2550d7 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -13,6 +13,7 @@ import { Globals } from 'src/app/global/global'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; import { PopupCommonComponent } from 'src/app/shared/components/popup-common/popup-common.component'; import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; +import { isContract } from 'src/app/core/utils/common/validation'; @Component({ selector: 'app-private-name-tag', @@ -46,6 +47,8 @@ export class PrivateNameTagComponent implements OnInit { destroy$ = new Subject(); dataSource: MatTableDataSource = new MatTableDataSource([]); dataTable = []; + nextKey = null; + currentKey = null; constructor( public commonService: CommonService, @@ -63,6 +66,13 @@ export class PrivateNameTagComponent implements OnInit { } ngOnInit(): void { + const dataNameTag = localStorage.getItem('setAddressNameTag'); + if (dataNameTag) { + const data = JSON.parse(dataNameTag); + this.openPopup(data); + localStorage.removeItem('setAddressNameTag'); + } + this.commonService.listNameTag = this.global.listNameTag; this.getListPrivateName(); } @@ -76,11 +86,6 @@ export class PrivateNameTagComponent implements OnInit { this.onKeyUp(); } - pageEvent(e: PageEvent): void { - this.pageData.pageIndex = e.pageIndex; - this.getListPrivateName(); - } - getListPrivateName(nextKey = null) { this.textSearch = this.textSearch?.trim(); const payload = { @@ -88,10 +93,16 @@ export class PrivateNameTagComponent implements OnInit { keyword: this.textSearch, }; - this.nameTagService.getListPrivateNameTag(payload).subscribe((res) => { - this.countFav = res.data?.filter((k) => k.isFavorite === 1)?.length || 0; - this.dataSource.data = res.data; - this.pageData.length = res?.meta?.count || 0; + this.nameTagService.getListPrivateNameTagNextKey(payload).subscribe((res) => { + if (res.data?.nameTags?.length >= 100) { + this.nextKey = res.data[res.data?.nameTags?.length - 1].id; + } + this.countFav = res.data?.nameTags?.filter((k) => k.isFavorite === 1)?.length || 0; + res.data?.nameTags.forEach((element) => { + element['type'] = isContract(element.address) ? 'contract' : 'account'; + }); + this.dataSource.data = res.data?.nameTags; + this.pageData.length = res?.data?.count || 0; }); } @@ -144,8 +155,6 @@ export class PrivateNameTagComponent implements OnInit { }); } - editPrivateNameTag() {} - updateFavorite(data) { const payload = { id: data.id, @@ -162,4 +171,15 @@ export class PrivateNameTagComponent implements OnInit { paginatorEmit(event): void { this.dataSource.paginator = event; } + + pageEvent(e: PageEvent): void { + const { length, pageIndex, pageSize } = e; + const next = length <= (pageIndex + 2) * pageSize; + this.pageData = e; + + if (next && this.nextKey && this.currentKey !== this.nextKey) { + this.getListPrivateName(this.nextKey); + this.currentKey = this.nextKey; + } + } } diff --git a/src/app/pages/profile/profile.component.html b/src/app/pages/profile/profile.component.html index bff7f1891..b0d58b163 100644 --- a/src/app/pages/profile/profile.component.html +++ b/src/app/pages/profile/profile.component.html @@ -4,7 +4,7 @@
-
Profile
+
Profile
Date: Thu, 14 Sep 2023 15:09:38 +0700 Subject: [PATCH 027/184] display set private name --- .../contract-info-card.component.html | 92 +++++++++---------- 1 file changed, 43 insertions(+), 49 deletions(-) diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html index 0ecad4445..0e524393c 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html @@ -1,93 +1,87 @@
-
-
-
+
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 1a90ba722..e8d02f1fe 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -30,6 +30,7 @@ id="account" class="radio-box radio-box--dark" [checked]="isAccount" + [disabled]="isEditMode" (change)="changeType(true)" /> @@ -40,6 +41,7 @@ id="contract" class="radio-box radio-box--dark" [checked]="!isAccount" + [disabled]="isEditMode" (change)="changeType(false)" /> @@ -65,9 +67,9 @@
-
+
+ {{ getAddress.value }}
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 0fdca33b0..2ee852325 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -115,7 +115,7 @@ export class PopupNameTagComponent implements OnInit { const { isFavorite, isAccount, address, name, note } = this.privateNameForm.value; let payload = { - isFavorite: isFavorite, + isFavorite: isFavorite == 1 ? true : false, type: isAccount ? this.nameTagType.Account : this.nameTagType.Contract, address: address, nameTag: name, diff --git a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html index 8a9f0538a..bba0485b8 100644 --- a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html @@ -83,7 +83,7 @@ [content]="'Private name: ' + commonService.setNameTag(userAddress)"> + (click)="editPrivateName()">
diff --git a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.ts b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.ts index 5bf715ec1..310c70dcb 100644 --- a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.ts +++ b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.ts @@ -113,7 +113,7 @@ export class SoulboundAccountTokenListComponent implements OnInit { return url; } - editPrivateName(nameTag = null) { + editPrivateName() { const userEmail = localStorage.getItem('userEmail'); const dataNameTag = this.global.listNameTag?.find((k) => k.address === this.userAddress); if (userEmail) { From 720c9666bd01213b7a30f2b4cc5269738e564ba9 Mon Sep 17 00:00:00 2001 From: mtam Date: Mon, 18 Sep 2023 13:29:59 +0700 Subject: [PATCH 032/184] [TamTM6] fix bug check is address (cherry picked from commit 5185f95d1fe97219af4b3a256aef46c654558dfb) --- src/app/core/utils/common/validation.ts | 7 +++++++ .../soulbound-token-create-popup.component.ts | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/core/utils/common/validation.ts b/src/app/core/utils/common/validation.ts index d4ddb23c5..4c356cbc3 100644 --- a/src/app/core/utils/common/validation.ts +++ b/src/app/core/utils/common/validation.ts @@ -10,3 +10,10 @@ export function isContract(adr: string): boolean { } return false; } + +export function isAddress(adr: string): boolean { + if (adr?.startsWith('aura') && adr?.length === LENGTH_CHARACTER.ADDRESS) { + return true; + } + return false; +} diff --git a/src/app/pages/soulbound-token/soulbound-token-create-popup/soulbound-token-create-popup.component.ts b/src/app/pages/soulbound-token/soulbound-token-create-popup/soulbound-token-create-popup.component.ts index 1c459d537..e6647217e 100644 --- a/src/app/pages/soulbound-token/soulbound-token-create-popup/soulbound-token-create-popup.component.ts +++ b/src/app/pages/soulbound-token/soulbound-token-create-popup/soulbound-token-create-popup.component.ts @@ -5,7 +5,7 @@ import { EnvironmentService } from 'src/app/core/data-services/environment.servi import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; import { SoulboundService } from 'src/app/core/services/soulbound.service'; import { WalletService } from 'src/app/core/services/wallet.service'; -import { isContract } from 'src/app/core/utils/common/validation'; +import { isAddress, isContract } from 'src/app/core/utils/common/validation'; @Component({ selector: 'app-soulbound-token-create-popup', @@ -55,7 +55,7 @@ export class SoulboundTokenCreatePopupComponent implements OnInit { soulboundTokenURI = soulboundTokenURI.trim(); receiverAddress = receiverAddress.trim(); - if (!isContract(receiverAddress)) { + if (!isAddress(receiverAddress)) { this.isAddressInvalid = true; return; } From 8b7a2f17097a5faa2191c4227cceb8c0158f6f4b Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Mon, 18 Sep 2023 15:32:11 +0700 Subject: [PATCH 033/184] update quota --- .../pages/profile/popup-name-tag/popup-name-tag.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 2ee852325..3e8287da0 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -46,8 +46,6 @@ export class PopupNameTagComponent implements OnInit { ) {} ngOnInit(): void { - //set temp quota = 100 - this.quota = 100; this.formInit(); if (this.data?.address) { this.setDataFrom(this.data); From e9151117cbbddef6466331461e52e4960d06c06b Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Mon, 18 Sep 2023 15:52:50 +0700 Subject: [PATCH 034/184] update code --- .../contracts-detail.component.html | 22 +++++++++---------- .../popup-common/popup-common.component.html | 7 ------ src/assets/icons/icons-svg/white/Copy.svg | 4 ---- src/assets/icons/icons-svg/white/QrCode.svg | 9 -------- 4 files changed, 10 insertions(+), 32 deletions(-) delete mode 100644 src/assets/icons/icons-svg/white/Copy.svg delete mode 100644 src/assets/icons/icons-svg/white/QrCode.svg diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html index 8834cb85a..fbadc8f80 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html @@ -11,16 +11,12 @@

Contract

#tooltip (click)="commonService.showToolTip(tooltip)" [cdkCopyToClipboard]="contractAddress"> - +
@@ -29,24 +25,26 @@

Contract

+ [contractDetail]="contractDetail" + *ngIf="contractDetail">
+ [type]="'information'" + [contractDetail]="contractDetail" + *ngIf="contractDetail">
+ [type]="'moreInfo'" + [contractDetail]="contractDetail" + *ngIf="contractDetail">
diff --git a/src/app/shared/components/popup-common/popup-common.component.html b/src/app/shared/components/popup-common/popup-common.component.html index 3038ebd0e..b18f549cb 100644 --- a/src/app/shared/components/popup-common/popup-common.component.html +++ b/src/app/shared/components/popup-common/popup-common.component.html @@ -1,7 +1,6 @@
- +
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index b54244451..bd50f7978 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -9,11 +9,11 @@ import { TableTemplate } from 'src/app/core/models/common.model'; import { CommonService } from 'src/app/core/services/common.service'; import { NameTagService } from 'src/app/core/services/name-tag.service'; import { NgxToastrService } from 'src/app/core/services/ngx-toastr.service'; +import { isContract } from 'src/app/core/utils/common/validation'; import { Globals } from 'src/app/global/global'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; import { PopupCommonComponent } from 'src/app/shared/components/popup-common/popup-common.component'; import { PopupNameTagComponent } from '../popup-name-tag/popup-name-tag.component'; -import { isContract } from 'src/app/core/utils/common/validation'; @Component({ selector: 'app-private-name-tag', @@ -130,7 +130,9 @@ export class PrivateNameTagComponent implements OnInit { panelClass: 'sizeNormal', data: { title: 'Remove Private Name Tag', - content: 'Are you sure to remove private name tag for the address ' + data.address + ' ' + data.nameTag + ' ?', + content: + 'Are you sure to remove private name tag for the address ' + data.address + ' (' + data.nameTag + ') ?', + class: 'text--gray-1', }, }); diff --git a/src/app/shared/components/popup-common/popup-common.component.html b/src/app/shared/components/popup-common/popup-common.component.html index b18f549cb..8dd09946e 100644 --- a/src/app/shared/components/popup-common/popup-common.component.html +++ b/src/app/shared/components/popup-common/popup-common.component.html @@ -11,7 +11,7 @@ class="cursor-pointer ml-10" (click)="closeDialog()" /> -
+
{{ data.content }}
From fa8be2d3766587004edce10bd1781e403dc7fc5c Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 09:34:31 +0700 Subject: [PATCH 038/184] update UI --- .../popup-name-tag.component.html | 2 +- .../private-name-tag.component.html | 10 ++-- .../private-name-tag.component.scss | 2 +- .../private-name-tag.component.ts | 57 ++++++++++++------- 4 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index e82dd7443..067f022d5 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -74,7 +74,7 @@ placeholder="aura..." class="input-address" (change)="checkPublicNameTag()" - (blur)="checkFormValid(); isError = false" + (input)="checkFormValid(); isError = false" autocomplete="off" />
{{ getAddress.value }} diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 9599b7dbe..7044355b4 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -19,7 +19,7 @@ class="form-control pl-0" placeholder="Search for Address or Name tag" [(ngModel)]="textSearch" - [maxLength]="35" + [maxLength]="maxLengthSearch" (keyup)="onKeyUp()" name="search" autocomplete="off" /> @@ -70,16 +70,16 @@ *ngIf="data.isFavorite" />
- + {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }}
{{ data.note || '-' }}
+ style="max-width: 200px; width: fit-content"> + {{ data.note || '-' }} +
= [ { matColumnDef: 'favorite', headerCellDef: 'Fav', headerWidth: 8 }, { matColumnDef: 'address', headerCellDef: 'Address', headerWidth: 12 }, @@ -41,7 +35,13 @@ export class PrivateNameTagComponent implements OnInit { { matColumnDef: 'action', headerCellDef: '', headerWidth: 8 }, ]; displayedColumns: string[] = this.templates.map((dta) => dta.matColumnDef); - + countFav = 0; + modalReference: any; + pageData: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: 5, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; textSearch = ''; searchSubject = new Subject(); destroy$ = new Subject(); @@ -49,6 +49,7 @@ export class PrivateNameTagComponent implements OnInit { dataTable = []; nextKey = null; currentKey = null; + maxLengthSearch = MAX_LENGTH_SEARCH_TOKEN; constructor( public commonService: CommonService, @@ -56,14 +57,8 @@ export class PrivateNameTagComponent implements OnInit { private dialog: MatDialog, private toastr: NgxToastrService, private global: Globals, - ) { - this.searchSubject - .asObservable() - .pipe(debounceTime(500), takeUntil(this.destroy$)) - .subscribe(() => { - this.pageChange.selectPage(0); - }); - } + private router: Router, + ) {} ngOnInit(): void { const dataNameTag = localStorage.getItem('setAddressNameTag'); @@ -75,6 +70,18 @@ export class PrivateNameTagComponent implements OnInit { this.commonService.listNameTag = this.global.listNameTag; this.getListPrivateName(); + this.searchSubject + .asObservable() + .pipe(debounceTime(500), takeUntil(this.destroy$)) + .subscribe(() => { + this.pageChange.selectPage(0); + }); + } + + ngOnDestroy(): void { + // throw new Error('Method not implemented.'); + this.destroy$.next(); + this.destroy$.complete(); } onKeyUp() { @@ -120,7 +127,7 @@ export class PrivateNameTagComponent implements OnInit { if (result) { setTimeout(() => { this.getListPrivateName(); - }, 1000); + }, 4000); } }); } @@ -182,6 +189,16 @@ export class PrivateNameTagComponent implements OnInit { if (next && this.nextKey && this.currentKey !== this.nextKey) { this.getListPrivateName(this.nextKey); this.currentKey = this.nextKey; + } else { + this.getListPrivateName(); + } + } + + navigateAddress(address): void { + if (isContract(address)) { + this.router.navigate(['/contracts', address]); + } else { + this.router.navigate(['/account', address]); } } } From 5187db2bed1d6617ec2e17c773b93fefe97127cc Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 10:14:59 +0700 Subject: [PATCH 039/184] fix UI --- .../contract-info-card.component.html | 12 +++--------- .../popup-name-tag/popup-name-tag.component.html | 2 +- .../private-name-tag/private-name-tag.component.html | 6 +++--- .../shared/components/name-tag/name-tag.component.ts | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html index f1f8f5827..c9a97e79c 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html @@ -57,8 +57,8 @@
Information
-
+ class="mt-2 d-inline-flex box-private align-items-center text--white"> +
{{ commonService.setNameTag(contractDetail?.address) || '-' }} @@ -69,13 +69,7 @@
Information
- - - +
diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 067f022d5..547b12d9f 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -79,7 +79,7 @@ {{ getAddress.value }}
Invalid aura address format
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 7044355b4..7c4ceb83c 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -2,7 +2,7 @@
Private name tag
@@ -47,7 +47,7 @@
+ [content]="'Click the star icon to mark your favorite address
on the top of the list'" [class]="'fw-normal'">
@@ -78,7 +78,7 @@ class="text--gray-5 ellipsis-text" [class.aura-tooltip-object]="data.note" style="max-width: 200px; width: fit-content"> - {{ data.note || '-' }} + {{ data.note || 'Note:-' }} Date: Tue, 19 Sep 2023 10:29:41 +0700 Subject: [PATCH 040/184] fix ui --- .../account-detail/account-detail.component.html | 14 ++++++-------- .../account-detail/account-detail.component.scss | 3 +++ .../popup-name-tag/popup-name-tag.component.scss | 3 +++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 02736d57a..1c743b3ed 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -29,13 +29,15 @@
- Contract +
+ Contract +
- {{ currentAddress }} + {{ currentAddress }}
@@ -99,12 +101,8 @@

Account Info

- + [content]="'Private name: ' + commonService.setNameTag(currentAddress)"> +
diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index 525fcb585..0a9d26431 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -182,4 +182,7 @@ section.account-detail { left: -6px; } } + a:hover { + color: var(--aura-primary) !important; + } } \ No newline at end of file diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss index b93ca588c..1ccfd07d9 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.scss @@ -35,6 +35,9 @@ background-color: var(--aura-gray-10) !important; padding: var(--spacer-4); border-radius: var(--spacer-2); + &::placeholder{ + color: var(--aura-gray-4); + } } .btn { height: 40px; From 8d9f7b510c39d76a43be96b80cb134888cbdafad Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 10:40:16 +0700 Subject: [PATCH 041/184] fix ui --- .../token-transfer/token-transfer.component.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss index 1749a0252..5fd2829bd 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss @@ -2,10 +2,16 @@ .card-nodata, .table-token { - height: 321px; + height: 192px; margin-bottom: 0; overflow-y: auto; + .aura-table { + tr.mat-row { + height: 64px; + } + } + ::ng-deep table thead { display: none; } From 50bed894c9e23651103b93dd2ed194a0268cc9b3 Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 19 Sep 2023 10:42:38 +0700 Subject: [PATCH 042/184] [TamTM6] update layout name tag --- .../account-detail.component.scss | 21 +++++++++++-------- .../private-name-tag.component.ts | 8 +++---- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index 525fcb585..c24909586 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -7,9 +7,12 @@ section.account-detail { .box-account-info { flex-grow: 1; min-height: 228px; - padding: 24px; + padding: 20px; @media (max-width: 1366px) { padding: 12px; + .private-name-tag { + font-size: 1.2rem; + } } @media (max-width: 992px) { padding: 16px; @@ -138,7 +141,7 @@ section.account-detail { .contract-label { height: 20px; @media (min-width: 991.98px) { - height: 32px; + height: 32px; } border-top-right-radius: 4px; border-bottom-right-radius: 4px; @@ -156,15 +159,15 @@ section.account-detail { top: 0; bottom: 0; left: -10px; - width: 0; - height: 0; + width: 0; + height: 0; border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - border-right: 10px solid var(--aura-gray-9); + border-bottom: 10px solid transparent; + border-right: 10px solid var(--aura-gray-9); @media (min-width: 991.98px) { border-top: 16px solid transparent; - border-bottom: 16px solid transparent; - border-right: 20px solid var(--aura-gray-9); + border-bottom: 16px solid transparent; + border-right: 20px solid var(--aura-gray-9); left: -20px; } } @@ -182,4 +185,4 @@ section.account-detail { left: -6px; } } -} \ No newline at end of file +} diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index b0a6bc81f..8ef9170a7 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -97,7 +97,7 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { this.textSearch = this.textSearch?.trim(); const payload = { limit: 100, - keyword: this.textSearch, + keyword: this.textSearch || '', }; this.nameTagService.getListPrivateNameTagNextKey(payload).subscribe((res) => { @@ -144,7 +144,7 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { }); dialogRef.afterClosed().subscribe((result) => { - if (result !== 'canceled') { + if (result && result !== 'canceled') { this.deleteNameTag(data.id); } }); @@ -160,7 +160,7 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { this.toastr.successWithTitle('Private name tag removed!', 'Success'); setTimeout(() => { this.getListPrivateName(); - }, 500); + }, 1000); }); } @@ -173,7 +173,7 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { this.nameTagService.updatePrivateNameTag(payload).subscribe((res) => { setTimeout(() => { this.getListPrivateName(); - }, 500); + }, 1000); }); } From 73fb1f696895d604981ba351466beef2a06e2d3a Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 11:03:42 +0700 Subject: [PATCH 043/184] update UI --- .../token-transfer/token-transfer.component.html | 3 ++- .../components/table-no-data/table-no-data.component.scss | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index 42a00fc03..1db6a1fd4 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -93,7 +93,8 @@
+ [img]="'assets/images/notFoundNFT.png'" + [class]="'img-height'">
diff --git a/src/app/shared/components/table-no-data/table-no-data.component.scss b/src/app/shared/components/table-no-data/table-no-data.component.scss index e69de29bb..57a7307f1 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.scss +++ b/src/app/shared/components/table-no-data/table-no-data.component.scss @@ -0,0 +1,3 @@ +.img-height { + height: 110px; +} \ No newline at end of file From 4e4e83922191bb304740079ba1fe4470c7b69e4b Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 11:19:38 +0700 Subject: [PATCH 044/184] update UI --- .../token-transfer/token-transfer.component.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index 1db6a1fd4..7ce61bdd5 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -194,7 +194,8 @@
+ [img]="'assets/images/notFoundNFT.png'" + [class]="'img-height'"> From cd813a5494f1fdab442a9523eae3e96025396b74 Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 19 Sep 2023 11:36:42 +0700 Subject: [PATCH 045/184] [TamTM6] update data close popup --- .../profile/popup-name-tag/popup-name-tag.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 3e8287da0..effd2a66c 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -87,8 +87,8 @@ export class PopupNameTagComponent implements OnInit { this.checkPublicNameTag(); } - closeDialog(hash = null) { - this.dialogRef.close(hash); + closeDialog(status = null) { + this.dialogRef.close(status); } checkFormValid() { @@ -143,7 +143,7 @@ export class PopupNameTagComponent implements OnInit { return; } - this.closeDialog(); + this.closeDialog(true); this.toastr.successWithTitle('Private name tag created!', 'Success'); }, error: (error) => { From f6059ab2684eb40c464ab68f9ffce9f864c49b6e Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 14:28:40 +0700 Subject: [PATCH 046/184] update UI --- .../account-detail.component.html | 2 +- .../account-detail.component.scss | 3 - .../contracts-overview-card.component.html | 77 +++++++++---------- .../contracts-overview-card.component.scss | 7 ++ .../contracts-overview-card.component.ts | 8 +- .../popup-name-tag.component.ts | 4 +- .../private-name-tag.component.ts | 2 +- .../token-transfer.component.html | 6 +- .../popup-common/popup-common.component.html | 6 +- .../table-no-data.component.html | 2 +- .../table-no-data/table-no-data.component.ts | 1 + src/assets/config/config.json | 3 +- 12 files changed, 64 insertions(+), 57 deletions(-) diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 1c743b3ed..716ca8d4d 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -30,7 +30,7 @@
diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index 8a7f6ec54..c24909586 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -186,6 +186,3 @@ section.account-detail { } } } -a:hover { - color: var(--aura-primary) !important; -} diff --git a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html index 7e069b10d..ebc52993f 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html @@ -1,17 +1,13 @@ -
+
{{ data.content }}
diff --git a/src/app/shared/components/table-no-data/table-no-data.component.html b/src/app/shared/components/table-no-data/table-no-data.component.html index 598752469..bf2112fcb 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.html +++ b/src/app/shared/components/table-no-data/table-no-data.component.html @@ -1,4 +1,4 @@ -
+
{{ textNull }}
diff --git a/src/app/shared/components/table-no-data/table-no-data.component.ts b/src/app/shared/components/table-no-data/table-no-data.component.ts index 8a9ad94c2..7034408a9 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.ts +++ b/src/app/shared/components/table-no-data/table-no-data.component.ts @@ -9,6 +9,7 @@ export class TableNoDataComponent implements OnInit { @Input() textNull: string = 'NO DATA'; @Input() img: string = 'assets/images/icons/noValues.svg'; @Input() class: string; + @Input() classText: string = 'body-01'; constructor() {} ngOnInit(): void {} diff --git a/src/assets/config/config.json b/src/assets/config/config.json index 63dc7e84a..4548ede29 100644 --- a/src/assets/config/config.json +++ b/src/assets/config/config.json @@ -60,5 +60,6 @@ "content": "Aurascan will be temporarily unavailable due to Xstaxy network upgrades on Jun 12th, 14:00 UTC", "url": "https://aurascan.io/votings/4" }, - "googleClientId": "3465782004-hp7u6vlitgs109rl0emrsf1oc7bjvu08.apps.googleusercontent.com" + "googleClientId": "3465782004-hp7u6vlitgs109rl0emrsf1oc7bjvu08.apps.googleusercontent.com", + "quotaSetPrivateName": 10 } From 9e4842b9d8300f3633e4729ee242873519b44dee Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 19 Sep 2023 14:35:25 +0700 Subject: [PATCH 047/184] update UI --- .../pages/account/account-detail/account-detail.component.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index c24909586..04ff9121c 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -17,6 +17,9 @@ section.account-detail { @media (max-width: 992px) { padding: 16px; } + .btn-private { + width: fit-content; + } } } From c71c4c12c00845e0c70f5692032708a43681a1d4 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Tue, 19 Sep 2023 16:40:01 +0700 Subject: [PATCH 048/184] update UI --- .../popup-name-tag.component.html | 2 +- .../popup-name-tag.component.ts | 24 ++++++++----------- src/app/pages/profile/profile.component.html | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index 547b12d9f..ee0f3b2d2 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -40,7 +40,7 @@ value="contract" id="contract" class="radio-box radio-box--dark" - [checked]="!isAccount" + [checked]="isContract" [disabled]="isEditMode" (change)="changeType(false)" /> diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts index 77b175a51..a9b361284 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.ts @@ -18,7 +18,8 @@ export class PopupNameTagComponent implements OnInit { isSubmit = false; errorSpendLimit = ''; formValid = true; - isAccount = true; + isAccount = false; + isContract = false; maxLengthNameTag = 35; maxLengthNote = 200; currentCodeID; @@ -63,7 +64,7 @@ export class PopupNameTagComponent implements OnInit { formInit() { this.privateNameForm = this.fb.group({ isFavorite: [0], - isAccount: [true, [Validators.required]], + isAccount: [false, [Validators.required]], address: ['', [Validators.required]], name: ['', [Validators.required, Validators.maxLength(this.maxLengthNameTag)]], note: ['', [Validators.maxLength(200)]], @@ -77,9 +78,11 @@ export class PopupNameTagComponent implements OnInit { this.idEdit = this.data.id || data.id; } - const isAccount = data.address?.length === LENGTH_CHARACTER.ADDRESS ? true : false; + const isAccount = data.address?.length === LENGTH_CHARACTER.ADDRESS; + this.privateNameForm.controls['isAccount'].setValue(isAccount); this.isAccount = isAccount; + this.isContract = !this.isAccount; this.privateNameForm.controls['isFavorite'].setValue(data.isFavorite || false); this.privateNameForm.controls['address'].setValue(data.address); this.privateNameForm.controls['name'].setValue(data.nameTag || data.name_tag_private); @@ -95,14 +98,8 @@ export class PopupNameTagComponent implements OnInit { this.getAddress['value'] = this.getAddress?.value.trim(); if (this.getAddress.value?.length > 0 && this.getAddress?.value?.startsWith('aura')) { - if ( - (this.getAddress.value.trim()?.length === LENGTH_CHARACTER.ADDRESS && this.isAccount) || - (this.getAddress.value.trim()?.length === LENGTH_CHARACTER.CONTRACT && !this.isAccount) - ) { - this.isValidAddress = true; - } else { - this.isValidAddress = false; - } + this.isValidAddress = (this.getAddress.value.trim()?.length === LENGTH_CHARACTER.ADDRESS && this.isAccount) || + (this.getAddress.value.trim()?.length === LENGTH_CHARACTER.CONTRACT && !this.isAccount); } else { this.isValidAddress = false; } @@ -111,16 +108,14 @@ export class PopupNameTagComponent implements OnInit { onSubmit() { this.isSubmit = true; const { isFavorite, isAccount, address, name, note } = this.privateNameForm.value; - let payload = { - isFavorite: isFavorite == 1 ? true : false, + isFavorite: isFavorite == 1, type: isAccount ? this.nameTagType.Account : this.nameTagType.Contract, address: address, nameTag: name, note: note, id: this.idEdit, }; - if (this.isEditMode) { this.editPrivateName(payload); } else { @@ -178,6 +173,7 @@ export class PopupNameTagComponent implements OnInit { changeType(type) { this.isAccount = type; + this.isContract = !this.isAccount; this.isValidAddress = false; this.isError = false; this.privateNameForm.value.isAccount = type; diff --git a/src/app/pages/profile/profile.component.html b/src/app/pages/profile/profile.component.html index b0d58b163..855a32446 100644 --- a/src/app/pages/profile/profile.component.html +++ b/src/app/pages/profile/profile.component.html @@ -38,7 +38,7 @@
- {{ nextKey ? 'More than >' : 'A total of' }} {{ pageData?.length }} transaction{{ + {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} found
- {{ nextKey ? 'More than >' : 'A total of' }} {{ pageData?.length }} transaction{{ + {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} found diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 43248e29b..1ea1e2ca0 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -149,7 +149,7 @@ export class AccountTransactionTableComponent { if (type === 'all') { if (event.target.checked) { this.checkAll = true; - this.listTypeSelectedTemp = this.tnxType; + this.listTypeSelectedTemp = this.tnxTypeOrigin; } else { this.listTypeSelectedTemp = []; this.checkAll = false; From 5e84744bf28269a1c40514dab4d6b76c77ba3218 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Tue, 19 Sep 2023 17:04:49 +0700 Subject: [PATCH 050/184] . --- .../account-transaction-table.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index c62ce377f..f20434c51 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -152,7 +152,7 @@
*ngIf="commonService.checkPrivate(currentAddress)" class="mt-2 aura-tooltip-contain d-inline-flex box-private align-items-center">
- {{ commonService.setNameTag(currentAddress) || '-' }} - - - {{ (commonService.setNameTag(currentAddress) | cutStringPipe : 16) || '-' }} - - - {{ (commonService.setNameTag(currentAddress) | cutStringPipe : 8 : 8) || '-' }} - - + {{ commonService.setNameTag(currentAddress) || '-' }}
@@ -59,15 +49,7 @@
Information
*ngIf="commonService.checkPrivate(contractDetail?.address)" class="mt-2 d-inline-flex box-private align-items-center text--white">
- {{ commonService.setNameTag(contractDetail?.address) || '-' }} - - - {{ (commonService.setNameTag(contractDetail?.address) | cutStringPipe : 16) || '-' }} - - - {{ (commonService.setNameTag(contractDetail?.address) | cutStringPipe : 8 : 8) || '-' }} - - + {{ commonService.setNameTag(contractDetail?.address) || '-' }}
diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss index 5470fd2ab..dca1f3a62 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.scss @@ -43,6 +43,7 @@ .box-name-tag { height: 26px; + max-width: 100%; display: inline-flex; align-items: center; font-size: 1.2rem; @@ -69,12 +70,30 @@ border-bottom: 13px solid transparent; } } + .line-claim { + display: inline-block; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } } -.private-name-tag { - height: 24px; - padding: 0 var(--spacer-2); - background-color: var(--aura-gray-10); - border-radius: 16px; - border: 1px solid var(--aura-gray-8); +.box-private{ + max-width: 100%; + .private-name-tag { + min-width: 0; + height: 24px; + padding: 0 var(--spacer-2); + background-color: var(--aura-gray-10); + border-radius: 16px; + border: 1px solid var(--aura-gray-8); + font-size: 1.2rem; + font-weight: 400; + .line-claim { + display: inline-block; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } + } } From 97bfa20a9a2934892cfea2a387b2faecdc14b502 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Wed, 20 Sep 2023 13:53:34 +0700 Subject: [PATCH 054/184] fix UI --- .../pages/contracts/contracts-list/contracts-list.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/contracts/contracts-list/contracts-list.component.ts b/src/app/pages/contracts/contracts-list/contracts-list.component.ts index e9ea647a0..465bc5505 100644 --- a/src/app/pages/contracts/contracts-list/contracts-list.component.ts +++ b/src/app/pages/contracts/contracts-list/contracts-list.component.ts @@ -25,7 +25,7 @@ export class ContractsListComponent implements OnInit, OnDestroy { { matColumnDef: 'address', headerCellDef: 'Address', isUrl: '/contracts', isShort: true, isNameTag: true }, { matColumnDef: 'name', headerCellDef: 'Contract Name' }, { matColumnDef: 'label', headerCellDef: 'Label' }, - { matColumnDef: 'compiler_version', headerCellDef: 'Version' }, + { matColumnDef: 'compiler_version', headerCellDef: 'Contract Ver' }, { matColumnDef: 'type', headerCellDef: 'Type' }, { matColumnDef: 'token_tracker', headerCellDef: 'Token Tracker' }, { matColumnDef: 'code_id', headerCellDef: 'Code ID' }, From 63e5fed1b20bc96a7ce4b4d89ea882012d42cfba Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Wed, 20 Sep 2023 15:02:18 +0700 Subject: [PATCH 055/184] update UI private name tag --- .../account-transaction-table.component.ts | 2 +- .../popup-name-tag.component.html | 2 +- .../private-name-tag.component.html | 83 +++++++++++++++++-- .../private-name-tag.component.scss | 32 +++++-- .../private-name-tag.component.ts | 18 +++- src/app/pages/profile/profile.component.scss | 4 +- .../popup-common/popup-common.component.scss | 5 +- .../white/DotsThreeOutlineVertical.svg | 3 + src/assets/scss/aura-theme/button.scss | 8 ++ src/assets/scss/aura-theme/form.scss | 6 +- src/assets/scss/aura-theme/popup.scss | 2 +- 11 files changed, 140 insertions(+), 25 deletions(-) create mode 100644 src/assets/icons/icons-svg/white/DotsThreeOutlineVertical.svg diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index ab927cf00..f4bb31bc4 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -57,7 +57,7 @@ export class AccountTransactionTableComponent { pageData: PageEvent = { length: PAGE_EVENT.LENGTH, - pageSize: 5, + pageSize: 10, pageIndex: PAGE_EVENT.PAGE_INDEX, }; nextKey = null; diff --git a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html index ee0f3b2d2..dec73bf66 100644 --- a/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html +++ b/src/app/pages/profile/popup-name-tag/popup-name-tag.component.html @@ -1,7 +1,7 @@
-
{{ isEditMode ? 'Edit' : 'Create' }} Private Name Tag
+
{{ isEditMode ? 'Edit' : 'Create' }} Private Name Tag
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 7c4ceb83c..4d4633801 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -1,8 +1,8 @@ -
+
Private name tag
@@ -11,8 +11,8 @@
Total {{ countFav }}/{{ pageData?.length }} addresses tagged
-
- +
+
- +
@@ -99,7 +99,7 @@
{{ commonService.getDateValue(data[template.matColumnDef])[0] }}
-
+
+
+
+
+
+ + {{ data.address | cutStringPipe : 8 : 8 }} + +
+ {{ data.note || 'Note:-' }} +
+
+
+
+ + +
+ +
+
+
+
+
+
Type
+
Contract
+
+
+
Private name tag
+
{{ data.nameTag }}
+
+
+
Added time
+
{{ data.createdAt | customDate : 'yyyy-MM-dd' }}
+
+
+
Updated time
+
{{commonService.getDateValue(data.updatedAt)[0]}}
+
+
+
+
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss index 6c2ce87de..d67b3eadf 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -19,16 +19,21 @@ .private-name-table { th.mat-header-cell:nth-child(1) { - min-width: 60px; + min-width: 80px; } th.mat-header-cell:nth-child(7) { - min-width: 80px; + min-width: 100px; + } + th.mat-header-cell:nth-child(4) { + min-width: 260px; } - th.mat-header-cell:nth-child(2), - th.mat-header-cell:nth-child(4), + th.mat-header-cell:nth-child(2) { + min-width: 190px; + } + th.mat-header-cell:nth-child(3), th.mat-header-cell:nth-child(5), th.mat-header-cell:nth-child(6) { - min-width: 150px; + min-width: 140px; } } @@ -67,4 +72,19 @@ border-bottom: unset !important; } } -} \ No newline at end of file +} +// Mobile card +.card-name-tag { + border: 1px solid var(--aura-gray-9); + border-radius: 8px; + padding: 12px; + &:not(:last-child) { + margin-bottom: var(--spacer-4); + } +} +.card__title { + max-width: calc(100% - 80px); +} +.label__content { + min-width: 120px; +} diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index 409d8bd31..6a4615cf4 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -39,13 +39,14 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { modalReference: any; pageData: PageEvent = { length: PAGE_EVENT.LENGTH, - pageSize: 5, + pageSize: 10, pageIndex: PAGE_EVENT.PAGE_INDEX, }; textSearch = ''; searchSubject = new Subject(); destroy$ = new Subject(); dataSource: MatTableDataSource = new MatTableDataSource([]); + dataSourceMobile = []; dataTable = []; nextKey = null; currentKey = null; @@ -110,6 +111,14 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { }); this.dataSource.data = res.data?.nameTags; this.pageData.length = res?.data?.count || 0; + + if (this.dataSource?.data) { + this.dataSourceMobile = this.dataSource.data?.slice( + this.pageData.pageIndex * this.pageData.pageSize, + this.pageData.pageIndex * this.pageData.pageSize + this.pageData.pageSize, + ); + } + }); } @@ -159,7 +168,9 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { this.toastr.successWithTitle('Private name tag removed!', 'Success'); setTimeout(() => { - this.getListPrivateName(); + this.pageData.length--; + this.pageData.pageIndex = 0; + this.pageEvent(this.pageData) }, 1000); }); } @@ -184,13 +195,12 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { pageEvent(e: PageEvent): void { const { length, pageIndex, pageSize } = e; const next = length <= (pageIndex + 2) * pageSize; + this.dataSourceMobile = this.dataSource.data.slice(pageIndex * pageSize, pageIndex * pageSize + pageSize); this.pageData = e; if (next && this.nextKey && this.currentKey !== this.nextKey) { this.getListPrivateName(this.nextKey); this.currentKey = this.nextKey; - } else { - this.getListPrivateName(); } } diff --git a/src/app/pages/profile/profile.component.scss b/src/app/pages/profile/profile.component.scss index 76fa96be3..03d07ab36 100644 --- a/src/app/pages/profile/profile.component.scss +++ b/src/app/pages/profile/profile.component.scss @@ -17,9 +17,9 @@ border-radius: 8px; } .profile-contain { - padding: var(--spacer-4); + padding: var(--spacer-4) var(--spacer-1); @media (min-width: 992px) { - padding: var(--spacer-6); + padding: var(--spacer-6) var(--spacer-4); } } .tab-profile { diff --git a/src/app/shared/components/popup-common/popup-common.component.scss b/src/app/shared/components/popup-common/popup-common.component.scss index 1778d6e2c..ae98ef4d2 100644 --- a/src/app/shared/components/popup-common/popup-common.component.scss +++ b/src/app/shared/components/popup-common/popup-common.component.scss @@ -1,6 +1,9 @@ ::ng-deep { .sizeNormal { - max-width: 500px !important; + max-width: 90vw !important; + @media (min-width: 991.98px) { + max-width: 500px !important; + } } .mat-dialog-container { diff --git a/src/assets/icons/icons-svg/white/DotsThreeOutlineVertical.svg b/src/assets/icons/icons-svg/white/DotsThreeOutlineVertical.svg new file mode 100644 index 000000000..d5f008354 --- /dev/null +++ b/src/assets/icons/icons-svg/white/DotsThreeOutlineVertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/scss/aura-theme/button.scss b/src/assets/scss/aura-theme/button.scss index 0c6f067e0..4654cdc9c 100644 --- a/src/assets/scss/aura-theme/button.scss +++ b/src/assets/scss/aura-theme/button.scss @@ -25,6 +25,10 @@ height: 34px; padding: 0 20px; } + &--ssm { + height: 32px; + padding: 0 16px; + } &--xs { height: 28px; padding: 0 16px; @@ -58,6 +62,10 @@ height: 32px; padding: 0 20px; } + &--ssm-mob { + height: 32px; + padding: 0 16px; + } &--xs-mob { height: 28px; padding: 0 16px; diff --git a/src/assets/scss/aura-theme/form.scss b/src/assets/scss/aura-theme/form.scss index c2d62fbbe..498735215 100644 --- a/src/assets/scss/aura-theme/form.scss +++ b/src/assets/scss/aura-theme/form.scss @@ -8,7 +8,7 @@ border-radius: 8px; justify-content: space-between; align-items: center; - height: 48px; + height: 40px; padding: 0 var(--spacer-4); &:focus { border-color: 1px solid var(--aura-white) !important; @@ -87,7 +87,7 @@ .input-group { display: flex; width: 100%; - height: 48px; + height: 40px; border: 1px solid #494C58; border-radius: 8px; padding: 0 var(--spacer-4); @@ -167,7 +167,7 @@ color: #E6E7E8; font-size: 1.4rem; font-weight: 400; - height: 48px; + height: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; diff --git a/src/assets/scss/aura-theme/popup.scss b/src/assets/scss/aura-theme/popup.scss index 3a2154780..5f3d928b2 100644 --- a/src/assets/scss/aura-theme/popup.scss +++ b/src/assets/scss/aura-theme/popup.scss @@ -34,7 +34,7 @@ } .grant-overlay-panel { @media (max-width: 567px) { - max-width: 100vw !important; + max-width: 95vw !important; } .mat-dialog-container { background: none; From 997aea67acf8b9e1fe80930d8b412648222cb1e7 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Wed, 20 Sep 2023 15:07:02 +0700 Subject: [PATCH 056/184] update UI private name tag --- .../profile/private-name-tag/private-name-tag.component.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts index 6a4615cf4..f735e458a 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.ts +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.ts @@ -201,6 +201,8 @@ export class PrivateNameTagComponent implements OnInit, OnDestroy { if (next && this.nextKey && this.currentKey !== this.nextKey) { this.getListPrivateName(this.nextKey); this.currentKey = this.nextKey; + } else { + this.getListPrivateName(); } } From 1d72d07284c2a1de9bc8709697f9f6008a0f14e1 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Wed, 20 Sep 2023 15:43:43 +0700 Subject: [PATCH 057/184] fix ui --- .../contract-info-card.component.html | 4 +- .../contracts-detail.component.html | 12 +++-- .../contracts-detail.component.scss | 9 ++++ .../contracts-overview-card.component.html | 2 +- .../contracts-list.component.html | 47 +++++++++++++------ .../token-transfer.component.html | 41 ++++++++++++---- .../table-no-data.component.scss | 3 ++ 7 files changed, 87 insertions(+), 31 deletions(-) diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html index bdb8abcce..8091366db 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html @@ -6,7 +6,7 @@ data-bs-target="#title2" aria-controls="title2" aria-expanded="false"> -
Information
+
Information
@@ -63,7 +63,7 @@
Information
data-bs-target="#title3" aria-controls="title3" aria-expanded="false"> -
More Info
+
More Info
diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html index fbadc8f80..9ceecea21 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.html @@ -5,9 +5,9 @@

Contract

{{ contractAddress }}
-
+
- +
+ +
diff --git a/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss b/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss index 21f793ac0..3817a70c1 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss +++ b/src/app/pages/contracts/contracts-detail/contracts-detail.component.scss @@ -11,11 +11,20 @@ width: 15px; height: 15px; } + ::ng-deep .contract__card-info .card { @media (min-width: 991.98px) { min-height: 247px; } } + .mb-haft { margin-bottom: 1.5px; } + +@media (max-width: 414px) { + .btn-mobile { + border: 1px solid #717582; + border-radius: 8px; + } +} \ No newline at end of file diff --git a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html index ebc52993f..23dd2d299 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-overview-card/contracts-overview-card.component.html @@ -5,7 +5,7 @@ data-bs-target="#title1" aria-controls="title1" aria-expanded="false"> -
Contract Overview
+
Contract Overview
diff --git a/src/app/pages/contracts/contracts-list/contracts-list.component.html b/src/app/pages/contracts/contracts-list/contracts-list.component.html index 5617ebd76..e21f5c790 100644 --- a/src/app/pages/contracts/contracts-list/contracts-list.component.html +++ b/src/app/pages/contracts/contracts-list/contracts-list.component.html @@ -115,6 +115,7 @@

Contracts

@@ -151,24 +152,40 @@

Contracts

- - {{ data['cw20_contract']?.name | stringEllipsis: 16}} + + {{ data['cw20_contract']?.name | stringEllipsis : 16 }} - - {{ data['cw721_contract']?.name | stringEllipsis: 16 }} + + {{ data['cw721_contract']?.name | stringEllipsis : 16 }} - - {{ data['cw721_contract']?.name | stringEllipsis: 16 }} + + {{ data['cw721_contract']?.name | stringEllipsis : 16 }} - - + + - +
- {{ + {{ data.cw20_contract.symbol }}
- Amount + Amount
-
- +
+ +
+
+
-
+
From - + +
-
+
To - + +
diff --git a/src/app/shared/components/table-no-data/table-no-data.component.scss b/src/app/shared/components/table-no-data/table-no-data.component.scss index 57a7307f1..b499edf57 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.scss +++ b/src/app/shared/components/table-no-data/table-no-data.component.scss @@ -1,3 +1,6 @@ .img-height { height: 110px; + @media (max-width: 414px) { + height: 95px; + } } \ No newline at end of file From 6b8df134b82132ab1cb362ba10cc1d8ad1280bdc Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 21 Sep 2023 09:26:06 +0700 Subject: [PATCH 058/184] fix bug search box --- .../token-transfers-tab/token-transfers-tab.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts b/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts index 56858d83f..18ab428f7 100644 --- a/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts +++ b/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts @@ -202,10 +202,10 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit { if (this.keyWord?.length === LENGTH_CHARACTER.TRANSACTION && this.keyWord == this?.keyWord.toUpperCase()) { payload['txHash'] = this.keyWord; } else { - if (this.keyWord?.length >= LENGTH_CHARACTER.ADDRESS && this.keyWord?.startsWith(this.prefixAdd)) { - payload['sender'] = this.keyWord; - payload['receiver'] = this.keyWord; - } + // if (this.keyWord?.length >= LENGTH_CHARACTER.ADDRESS && this.keyWord?.startsWith(this.prefixAdd)) { + payload['sender'] = this.keyWord; + payload['receiver'] = this.keyWord; + // } } } From bef3e8c9eeddd51144775739b85e552bdc568f87 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 21 Sep 2023 11:41:49 +0700 Subject: [PATCH 059/184] fix UI transaction detail (cherry picked from commit da356b4549194ac2e7de97272236e2f24e9f75ba) # Conflicts: # src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html # src/app/shared/components/table-no-data/table-no-data.component.scss --- .../token-transfer.component.html | 39 ++++++++++++------- .../token-transfer.component.scss | 5 ++- .../token-transfer.component.ts | 9 ++++- .../table-no-data.component.html | 2 +- .../table-no-data.component.scss | 6 +++ 5 files changed, 44 insertions(+), 17 deletions(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index 5afdad2e1..1ba6c5ed6 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -3,11 +3,11 @@
-
+
Fungible Token (FT) Transfer
-
+
@@ -61,17 +61,23 @@
-
+
From - +
-
+
To - +
@@ -105,11 +111,11 @@
-
+
Non-Fungible Token (NFT) Transfer
-
+
@@ -143,14 +149,15 @@
- +
+ [url]="isContractAddress(data.to) ? 'contracts' : 'account'">
@@ -162,14 +169,16 @@
+ [url]="isContractAddress(data.from) ? 'contracts' : 'account'"> + [url]="isContractAddress(data.from) ? 'contracts' : 'account'">
+ [url]="isContractAddress(data.to) ? 'contracts' : 'account'"> + [url]="isContractAddress(data.to) ? 'contracts' : 'account'">
diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss index 5fd2829bd..46675b7a5 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss @@ -2,7 +2,7 @@ .card-nodata, .table-token { - height: 192px; + height: 193px; margin-bottom: 0; overflow-y: auto; @@ -10,6 +10,9 @@ tr.mat-row { height: 64px; } + td.mat-cell:first-of-type { + padding-left: 14px; + } } ::ng-deep table thead { diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts index 116c9263d..e5498718f 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.ts @@ -3,7 +3,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { Router } from '@angular/router'; -import { NULL_ADDRESS, PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { LENGTH_CHARACTER, NULL_ADDRESS, PAGE_EVENT } from 'src/app/core/constants/common.constant'; import { EnvironmentService } from 'src/app/core/data-services/environment.service'; import { TableTemplate } from 'src/app/core/models/common.model'; import { TransactionService } from 'src/app/core/services/transaction.service'; @@ -61,4 +61,11 @@ export class TokenTransferComponent implements OnInit { navigateToNFTDetail(address: string, tokenId: number): void { this.router.navigate([`/tokens/token-nft/${address}/${tokenId}`]); } + + isContractAddress(address) { + if (address?.startsWith('aura') && address?.length === LENGTH_CHARACTER.CONTRACT) { + return true; + } + return false; + } } diff --git a/src/app/shared/components/table-no-data/table-no-data.component.html b/src/app/shared/components/table-no-data/table-no-data.component.html index bf2112fcb..51b2f4e1a 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.html +++ b/src/app/shared/components/table-no-data/table-no-data.component.html @@ -1,4 +1,4 @@ -
+
{{ textNull }}
diff --git a/src/app/shared/components/table-no-data/table-no-data.component.scss b/src/app/shared/components/table-no-data/table-no-data.component.scss index b499edf57..65f500d6b 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.scss +++ b/src/app/shared/components/table-no-data/table-no-data.component.scss @@ -3,4 +3,10 @@ @media (max-width: 414px) { height: 95px; } +} + +@media (max-width: 992px) { + .clear-margin { + margin: 12px !important; + } } \ No newline at end of file From d9497a218d4e5ef7d18f6eed60bf1e8c72457ed6 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 21 Sep 2023 13:49:59 +0700 Subject: [PATCH 060/184] fix UI transaction detail (cherry picked from commit da356b4549194ac2e7de97272236e2f24e9f75ba) # Conflicts: # src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html # src/app/shared/components/table-no-data/table-no-data.component.scss --- .../token-transfer.component.html | 41 +++++++++++++------ .../token-transfer.component.scss | 9 +++- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html index 1ba6c5ed6..572870be9 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.html @@ -3,9 +3,7 @@
-
- Fungible Token (FT) Transfer -
+
Fungible Token (FT) Transfer
@@ -16,7 +14,7 @@
@@ -60,24 +58,38 @@
-
-
+
+
From +
-
+
To +
@@ -124,7 +136,7 @@
@@ -149,15 +161,20 @@
- +
+ [url]="'contracts'">
diff --git a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss index 46675b7a5..927326397 100644 --- a/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss +++ b/src/app/pages/transaction/transaction-detail/token-transfer/token-transfer.component.scss @@ -2,7 +2,7 @@ .card-nodata, .table-token { - height: 193px; + height: 194px; margin-bottom: 0; overflow-y: auto; @@ -37,4 +37,11 @@ .transfer-address-label { width: 30px; } + + .transfer-address { + min-width: 180px; + @media (max-width: 992px) { + min-width: 150px; + } + } } \ No newline at end of file From d17c7df3d889e8ceef6c723aeeaf02acdfd1d0a7 Mon Sep 17 00:00:00 2001 From: nttnguyen136 Date: Thu, 21 Sep 2023 09:59:58 +0700 Subject: [PATCH 061/184] Merge pull request #2357 from aura-nw/baseline/serenity_20230921 Baseline/serenity 20230921 (cherry picked from commit 1fc73c08a4a17ff010593f6147e7a25a37b52710) --- .../account-transaction-table.component.html | 46 +++++++++----- .../account-transaction-table.component.scss | 63 ++++++++++++++----- .../account-transaction-table.component.ts | 10 +++ .../account-transaction.component.scss | 2 + 4 files changed, 90 insertions(+), 31 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index a59979b81..0b4ee0ddd 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -90,9 +90,9 @@ -
- {{ transactionFilter.typeTransfer }} - -
+
+ {{ transactionFilter.typeTransfer }} + +
@@ -126,8 +127,8 @@ #tnxTypeMenuBtn [matMenuTriggerFor]="tnxTypeMenu" class="input-group align-items-center d-flex justify-content-between text--white cursor-pointer btn-mess" - type="button" - *ngIf="!transactionFilter.type"> + [class.menu-hidden]="transactionFilter.type" + type="button"> Message type
@@ -135,8 +136,9 @@
{{ checkAll ? 'All' : transactionFilter.type?.length + (isSearchOther ? 1 : 0) || 1 }} Msg Types selected @@ -145,7 +147,9 @@ #tnxTypeMenu="matMenu" class="aura-menu-panel tnx-type-panel text--white mt-2 p-2" [yPosition]="'above'"> -
+
+
+ Selected Items ... +
+ {{ type.value }} + +
+
+ class="form-group d-flex align-items-center tnx-filter-item mx-2">
-
+
@@ -217,7 +233,7 @@ class="button button--xlg button-outline button-outline__in-card button-pill ml-4" type="button" [disabled]="listTypeSelectedTemp?.length === 0" - (click)="$event.stopPropagation(); executeFilterType()"> + (click)="executeFilterType(); tnxTypeMenuBtn.click()"> Select
diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index 638c30323..fe86430cc 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -25,24 +25,13 @@ .input-group { height: 33px; background-color: transparent; - border: 1px solid var(--aura-gray-8) !important; + border: 1px solid var(--aura-gray-8); padding: 0 16px; border-radius: 8px; } @media (max-width: 376px) { width: calc(100vw - 68px); } - .filter-result { - white-space: nowrap; - padding: 0 var(--spacer-4); - color: var(--aura-blue-3link); - border: 1px solid var(--aura-blue-4); - background: #222f3d; - border-radius: 8px; - height: 33px; - display: flex; - align-items: center; - } .mat-date-range-input { width: 100%; } @@ -52,13 +41,13 @@ } .tnx-filter-box { - max-height: 356px; + max-height: 220px; overflow-y: auto; @media (max-width: 1366px) { - max-height: 280px; + max-height: 150px; } @media (max-width: 414px) { - max-height: 210px; + max-height: 130px; } ::ng-deep { .form-group label { @@ -220,7 +209,7 @@ align-items: center; justify-content: end; background-color: var(--aura-gray-9); - margin: 0 -4px -12px -4px; + margin: 0 -8px -16px -8px; } mat-date-range-input { @@ -295,3 +284,45 @@ mat-date-range-input { margin-top: 0; } } +.filter-result { + white-space: nowrap; + padding: 0 var(--spacer-4); + color: var(--aura-blue-3link); + border: 1px solid var(--aura-blue-4); + background: #222f3d; + border-radius: 8px; + height: 33px; + display: flex; + align-items: center; +} +.menu-hidden { + height: 0 !important; + width: 0 !important; + min-width: 0 !important; + overflow: hidden !important; + border: none !important; +} +.tag-filter-box { + min-height: 40px; + border: 1px solid var(--aura-gray-9); + border-radius: 8px; + color: var(--aura-gray-5); + display: flex; + align-items: center; + padding: 0 14px; + max-height: 100px; + overflow-y: auto; + &.has-result { + padding: 4px; + padding-right: 14px; + flex-wrap: wrap; + } + .filter-result { + height: 24px; + padding: 0 var(--spacer-2); + margin-bottom: var(--spacer-1); + &:not(:last-child) { + margin-right: var(--spacer-1); + } + } +} diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index f4bb31bc4..248a6a043 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -167,6 +167,12 @@ export class AccountTransactionTableComponent { } } + removeFilterType(type: any) { + this.listTypeSelectedTemp?.forEach((element, index) => { + if (element.label === type.label) this.listTypeSelectedTemp?.splice(index, 1); + }); + } + searchTransactionType() { if (this.transactionTypeKeyWord?.toLowerCase().length === 0 || this.transactionTypeKeyWord?.toLowerCase() === '') { this.tnxType = this.tnxTypeOrigin; @@ -531,4 +537,8 @@ export class AccountTransactionTableComponent { resetMsgTypeCheckbox() { this.listTypeSelectedTemp = []; } + + initTnxFilterPanel() { + this.listTypeSelectedTemp = this.tnxTypeOrigin.filter(type => this.transactionFilter.type.includes(type.label)); + } } diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss index 196629326..9c5389a30 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -2,6 +2,8 @@ width: 420px; } ::ng-deep .mat-menu-panel.tnx-type-panel { + padding: 0 !important; + overflow: hidden; width: 355px; max-width: unset; @media (max-width: 414px) { From b6c9d77fecaeb5cdb6498cd26ac3a7f56fc83a4f Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Thu, 21 Sep 2023 14:22:33 +0700 Subject: [PATCH 062/184] fixbug UI private-name-tag --- .../private-name-tag.component.html | 26 +++++++++---------- .../private-name-tag.component.scss | 13 +++++++--- .../token-cw20/token-cw20.component.ts | 2 +- .../popup-common/popup-common.component.html | 2 +- src/assets/scss/aura-theme/form.scss | 13 +++++++++- 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.html b/src/app/pages/profile/private-name-tag/private-name-tag.component.html index 4d4633801..2ebd6f992 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.html +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.html @@ -124,7 +124,7 @@
-
+
@@ -172,19 +172,19 @@
-
Type
+
Type
Contract
-
Private name tag
+
Private name tag
{{ data.nameTag }}
-
Added time
+
Added time
{{ data.createdAt | customDate : 'yyyy-MM-dd' }}
-
Updated time
+
Updated time
{{commonService.getDateValue(data.updatedAt)[0]}}
diff --git a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss index d67b3eadf..b49b2b75e 100644 --- a/src/app/pages/profile/private-name-tag/private-name-tag.component.scss +++ b/src/app/pages/profile/private-name-tag/private-name-tag.component.scss @@ -30,10 +30,14 @@ th.mat-header-cell:nth-child(2) { min-width: 190px; } - th.mat-header-cell:nth-child(3), - th.mat-header-cell:nth-child(5), + th.mat-header-cell:nth-child(3) { + min-width: 120px; + } + th.mat-header-cell:nth-child(5) { + min-width: 140px; + } th.mat-header-cell:nth-child(6) { - min-width: 140px; + min-width: 160px; } } @@ -88,3 +92,6 @@ .label__content { min-width: 120px; } +.action-mob { + height: 44px; +} diff --git a/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts b/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts index 8f47a00e9..2418dff42 100644 --- a/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts +++ b/src/app/pages/token/token-list/token-cw20/token-cw20.component.ts @@ -216,7 +216,7 @@ export class TokenCw20Component implements OnInit, OnDestroy { sortData(sort: Sort) { this.dataSource.data.forEach((data) => { data.circulating_market_cap = +data.circulating_market_cap; - data.volume = +data.volume_24h; + data.volume = +data.volume; data.price = +data.price; data.holders = +data.holders; }); diff --git a/src/app/shared/components/popup-common/popup-common.component.html b/src/app/shared/components/popup-common/popup-common.component.html index c96e1aac4..3fbaf8e39 100644 --- a/src/app/shared/components/popup-common/popup-common.component.html +++ b/src/app/shared/components/popup-common/popup-common.component.html @@ -1,6 +1,6 @@