File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 63
63
font-size : 2.2em ;
64
64
font-family : 'Engagement' , cursive;
65
65
padding-right : 3% ;
66
+ }
67
+
68
+ # new-reg-message {
69
+ margin-top : 2% ;
66
70
}
Original file line number Diff line number Diff line change @@ -51,9 +51,16 @@ <h5 class="card-title"><em class="fa fa-angle-right"></em> <em>{{url.orig
51
51
< div class ="input-group ">
52
52
< button type ="submit " class ="btn btn-primary "> Submit</ button >
53
53
</ div >
54
- < p id ="new-reg-message " class ="text-danger "> </ p >
54
+ <!-- < p id="new-reg-message" class="text-danger"></p> -- >
55
55
</ div >
56
56
</ form >
57
+ < div id ="new-reg-message " class ="card " hidden >
58
+ < h5 id ="new-reg-title " class ="card-header "> </ h5 >
59
+ < div class ="card-body ">
60
+ < h5 class ="card-title "> < em class ="fa fa-link "> </ em > < span id ="new-short-uri "> </ span > </ h5 >
61
+ < p class ="card-text "> < em class ="fa fa-angle-right "> </ em > < span id ="new-original-uri "> </ span > </ p >
62
+ </ div >
63
+ </ div >
57
64
</ div >
58
65
< div class ="col-sm-2 col-md-3 col-lg-4 "> </ div >
59
66
</ div >
Original file line number Diff line number Diff line change @@ -78,11 +78,16 @@ export class DashboardComponent implements OnInit {
78
78
const newuri = this . registerationForm . get ( 'newurl' ) . value ;
79
79
this . uriService . newUri ( { uri : newuri } ) . subscribe ( ( data ) => {
80
80
if ( data [ 'status' ] === 200 ) {
81
- document . getElementById ( 'new-reg-message' ) . innerText =
82
- 'Registered new URL\nOrignial URL: ' + data [ 'originalUri' ] + '\nShort URL: ' + data [ 'shortUri' ] ;
81
+ document . getElementById ( 'new-reg-title' ) . innerText = data [ 'message' ] ;
82
+ document . getElementById ( 'new-short-uri' ) . innerText = data [ 'shortUri' ] ;
83
+ document . getElementById ( 'new-original-uri' ) . innerText = data [ 'originalUri' ] ;
84
+ document . getElementById ( 'new-reg-message' ) . hidden = false ;
83
85
this . fetchAll ( ) ;
84
86
} else if ( data [ 'status' ] === 201 ) {
85
- document . getElementById ( 'new-reg-message' ) . innerText = 'URI already shortened\nShort URL: ' + data [ 'shortUri' ] ;
87
+ document . getElementById ( 'new-reg-title' ) . innerText = data [ 'message' ] ;
88
+ document . getElementById ( 'new-short-uri' ) . innerText = data [ 'shortUri' ] ;
89
+ document . getElementById ( 'new-original-uri' ) . innerText = data [ 'originalUri' ] ;
90
+ document . getElementById ( 'new-reg-message' ) . hidden = false ;
86
91
} else if ( data [ 'status' ] === 203 ) {
87
92
document . getElementById ( 'new-reg-message' ) . innerText = 'INVALID URL ERROR: Enter a valid URL' ;
88
93
} else {
You can’t perform that action at this time.
0 commit comments