Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
5c1388d3
Commit
5c1388d3
authored
Jul 12, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add send confirmation modal
parent
a41c68bd
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
7 deletions
+110
-7
app.module.ts
Breeze.UI/src/app/app.module.ts
+3
-0
send-confirmation.component.css
...et/send/send-confirmation/send-confirmation.component.css
+0
-0
send-confirmation.component.html
...t/send/send-confirmation/send-confirmation.component.html
+43
-0
send-confirmation.component.spec.ts
...end/send-confirmation/send-confirmation.component.spec.ts
+25
-0
send-confirmation.component.ts
...let/send/send-confirmation/send-confirmation.component.ts
+24
-0
send.component.ts
Breeze.UI/src/app/wallet/send/send.component.ts
+15
-7
No files found.
Breeze.UI/src/app/app.module.ts
View file @
5c1388d3
...
...
@@ -17,6 +17,7 @@ import { ApiService } from './shared/services/api.service';
import
{
GlobalService
}
from
'./shared/services/global.service'
;
import
{
SendComponent
}
from
'./wallet/send/send.component'
;
import
{
SendConfirmationComponent
}
from
'./wallet/send/send-confirmation/send-confirmation.component'
;
import
{
ReceiveComponent
}
from
'./wallet/receive/receive.component'
;
import
{
TransactionDetailsComponent
}
from
'./wallet/transaction-details/transaction-details.component'
;
import
{
LogoutConfirmationComponent
}
from
'./wallet/logout-confirmation/logout-confirmation.component'
;
...
...
@@ -39,11 +40,13 @@ import { LogoutConfirmationComponent } from './wallet/logout-confirmation/logout
LoginComponent
,
LogoutConfirmationComponent
,
SendComponent
,
SendConfirmationComponent
,
ReceiveComponent
,
TransactionDetailsComponent
],
entryComponents
:
[
SendComponent
,
SendConfirmationComponent
,
ReceiveComponent
,
TransactionDetailsComponent
,
LogoutConfirmationComponent
...
...
Breeze.UI/src/app/wallet/send/send-confirmation/send-confirmation.component.css
0 → 100644
View file @
5c1388d3
Breeze.UI/src/app/wallet/send/send-confirmation/send-confirmation.component.html
0 → 100644
View file @
5c1388d3
<div
id=
"modalCheck"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"modal_check"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div>
<div
class=
"modal-body"
>
<svg
class=
"checkmark"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 52 52"
><circle
class=
"checkmark__circle"
cx=
"26"
cy=
"26"
r=
"25"
fill=
"none"
/><path
class=
"checkmark__check"
fill=
"none"
d=
"M14.1 27.2l7.1 7.2 16.7-16.8"
/></svg>
<p
class=
"lead text-success text-center"
>
<strong>
Your transaction has been sent with success !
</strong>
<small
class=
"text-center"
>
<a
class=
"btn btn-link"
(
click
)="
toggleDetails
()"
>
Show details
</a>
</small>
</p>
<div
*
ngIf=
"showDetails"
id=
"collapseExample"
>
<div
class=
"card card-block"
>
<ul
class=
"list-inline row"
>
<li
class=
"list-inline-item col blockLabel"
>
Type
</li>
<li
class=
"list-inline-item col-9 blockText"
>
Sent
</li>
</ul>
<ul
class=
"list-inline row"
>
<li
class=
"list-inline-item col blockLabel"
>
Amount
</li>
<li
class=
"list-inline-item col-9 blockText"
><strong
class=
"text-danger"
>
-{{ transaction.amount }}
</strong>
<small
class=
"text-uppercase ml-2"
>
BTC
</small></li>
</ul>
<ul
class=
"list-inline row"
>
<li
class=
"list-inline-item col blockLabel"
>
Destination
</li>
<li
class=
"list-inline-item col-9 blockText"
><code>
{{ transaction.destinationAddress }}
</code></li>
</ul>
<!-- <ul class="list-inline row">
<li class="list-inline-item col blockLabel">Date</li>
<li class="list-inline-item col-9 blockText"><small>{{ transaction.timestamp * 1000 | date:'medium' }}</small></li>
</ul>
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">transaction ID</li>
<li class="list-inline-item col-9 blockText blockID"><code>{{ transaction.id }}</code></li>
</ul> -->
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-lg btn-primary"
data-dismiss=
"modal"
aria-label=
"Close"
(
click
)="
activeModal
.
close
('
Close
click
')"
>
OK
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
Breeze.UI/src/app/wallet/send/send-confirmation/send-confirmation.component.spec.ts
0 → 100644
View file @
5c1388d3
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
SendConfirmationComponent
}
from
'./send-confirmation.component'
;
describe
(
'SendConfirmationComponent'
,
()
=>
{
let
component
:
SendConfirmationComponent
;
let
fixture
:
ComponentFixture
<
SendConfirmationComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
SendConfirmationComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
SendConfirmationComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should be created'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
Breeze.UI/src/app/wallet/send/send-confirmation/send-confirmation.component.ts
0 → 100644
View file @
5c1388d3
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
{
NgbModal
,
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
@
Component
({
selector
:
'app-send-confirmation'
,
templateUrl
:
'./send-confirmation.component.html'
,
styleUrls
:
[
'./send-confirmation.component.css'
]
})
export
class
SendConfirmationComponent
implements
OnInit
{
@
Input
()
transaction
:
any
;
constructor
(
public
activeModal
:
NgbActiveModal
)
{
}
private
showDetails
:
boolean
=
false
;
ngOnInit
()
{
console
.
log
(
this
.
transaction
);
}
toggleDetails
()
{
this
.
showDetails
=
!
this
.
showDetails
;
}
}
Breeze.UI/src/app/wallet/send/send.component.ts
View file @
5c1388d3
...
...
@@ -3,11 +3,13 @@ import { ApiService } from '../../shared/services/api.service';
import
{
GlobalService
}
from
'../../shared/services/global.service'
;
import
{
FormGroup
,
FormControl
,
Validators
,
FormBuilder
}
from
'@angular/forms'
;
import
{
NgbModal
,
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbModal
,
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
TransactionBuilding
}
from
'../../shared/classes/transaction-building'
;
import
{
TransactionSending
}
from
'../../shared/classes/transaction-sending'
;
import
{
SendConfirmationComponent
}
from
'./send-confirmation/send-confirmation.component'
;
@
Component
({
selector
:
'send-component'
,
templateUrl
:
'./send.component.html'
,
...
...
@@ -15,13 +17,14 @@ import { TransactionSending } from '../../shared/classes/transaction-sending';
})
export
class
SendComponent
{
constructor
(
private
apiService
:
ApiService
,
private
globalService
:
GlobalService
,
public
activeModal
:
NgbActiveModal
,
private
fb
:
FormBuilder
)
{
constructor
(
private
apiService
:
ApiService
,
private
globalService
:
GlobalService
,
p
rivate
modalService
:
NgbModal
,
p
ublic
activeModal
:
NgbActiveModal
,
private
fb
:
FormBuilder
)
{
this
.
buildSendForm
();
}
private
sendForm
:
FormGroup
;
private
responseMessage
:
any
;
private
errorMessage
:
string
;
private
transaction
:
TransactionBuilding
;
private
buildSendForm
():
void
{
this
.
sendForm
=
this
.
fb
.
group
({
...
...
@@ -76,8 +79,7 @@ export class SendComponent {
};
private
send
()
{
let
transaction
=
new
TransactionBuilding
(
this
.
transaction
=
new
TransactionBuilding
(
this
.
globalService
.
getWalletName
(),
this
.
globalService
.
getCoinType
(),
"account 0"
,
...
...
@@ -89,7 +91,7 @@ export class SendComponent {
);
this
.
apiService
.
buildTransaction
(
transaction
)
.
buildTransaction
(
t
his
.
t
ransaction
)
.
subscribe
(
response
=>
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
){
...
...
@@ -110,7 +112,7 @@ export class SendComponent {
}
}
},
()
=>
this
.
sendTransaction
(
"123"
)
()
=>
this
.
sendTransaction
(
this
.
responseMessage
.
hex
)
)
;
};
...
...
@@ -150,8 +152,14 @@ export class SendComponent {
alert
(
error
.
json
().
errors
[
0
].
message
);
}
}
}
},
()
=>
this
.
openConfirmationModal
()
)
;
}
private
openConfirmationModal
()
{
const
modalRef
=
this
.
modalService
.
open
(
SendConfirmationComponent
);
modalRef
.
componentInstance
.
transaction
=
this
.
transaction
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment