41
41
border : 1px solid #ffeaa7 ;
42
42
}
43
43
44
+ /* Modal styles */
45
+ .hf-modal .modal-content.hf-modal-content {
46
+ border-radius : 12px ;
47
+ border : 1px solid #e9ecef ;
48
+ }
49
+ .hf-modal-header {
50
+ border-bottom : 1px solid #f1f3f4 ;
51
+ }
52
+ .hf-modal-title {
53
+ display : flex ;
54
+ align-items : center ;
55
+ font-weight : 600 ;
56
+ font-size : 16px ;
57
+ }
58
+ .confirm-body {
59
+ padding : 8px 6px 0 6px ;
60
+ }
61
+ .confirm-url {
62
+ display : grid ;
63
+ grid-template-columns : 60px 1fr ;
64
+ align-items : center ;
65
+ gap : 8px ;
66
+ background : #f8f9fa ;
67
+ border : 1px solid #e9ecef ;
68
+ border-radius : 6px ;
69
+ padding : 8px 10px ;
70
+ }
71
+ .confirm-url code {
72
+ white-space : nowrap ;
73
+ overflow : hidden ;
74
+ text-overflow : ellipsis ;
75
+ font-size : 12px ;
76
+ }
77
+ .modal-actions {
78
+ display : flex ;
79
+ justify-content : flex-end ;
80
+ gap : 10px ;
81
+ margin-top : 16px ;
82
+ }
83
+
44
84
/* Link Display Styles */
45
85
.link-display {
46
86
display : flex ;
@@ -753,9 +793,10 @@ textarea.form-control {
753
793
754
794
.url-section {
755
795
display : flex ;
756
- align-items : center ;
796
+ flex-direction : column ;
797
+ align-items : flex-end ;
757
798
justify-content : flex-end ;
758
- gap : 10 px ;
799
+ gap : 6 px ;
759
800
}
760
801
761
802
.url-section h6 {
@@ -765,6 +806,11 @@ textarea.form-control {
765
806
color : #2c3e50 ;
766
807
}
767
808
809
+ .url-section .status-badge {
810
+ align-self : flex-end ;
811
+ margin-top : 4px ;
812
+ }
813
+
768
814
/* Two Column Layout */
769
815
.form-layout {
770
816
display : flex ;
@@ -1011,8 +1057,12 @@ textarea.form-control {
1011
1057
<v-col >
1012
1058
<HfButtons name =" Save Configuration" @executeAction =" saveConfiguration()" v-if =" !this.kycWebpageConfigTemp._id"
1013
1059
style =" float :right " ></HfButtons >
1014
- <HfButtons name =" Update Configuration" @executeAction =" updateConfiguration()" style =" float :right " v-else >
1015
- </HfButtons >
1060
+ <div v-else >
1061
+ <b-button variant =" link" class =" danger" @click =" openDeleteModal()" style =" float :right ;"
1062
+ title =" Delete Configuration" ><i class =" fa fa-trash" ></i ></b-button >
1063
+ <HfButtons name =" Update Configuration" @executeAction =" updateConfiguration()" style =" float :right " class =" mx-1" >
1064
+ </HfButtons >
1065
+ </div >
1016
1066
</v-col >
1017
1067
</v-row >
1018
1068
@@ -1027,9 +1077,6 @@ textarea.form-control {
1027
1077
<i class =" fa fa-building" ></i >
1028
1078
</div >
1029
1079
</div >
1030
- <span class =" status-badge" :class =" getStatusClass()" >
1031
- {{ getStatusText() }}
1032
- </span >
1033
1080
<div class =" company-info" >
1034
1081
<h4 >{{ getSelectedService ? getSelectedService.appName : 'Your Business Name' }}</h4 >
1035
1082
<p >{{ kycWebpageConfigTemp.pageTitle || 'KYC Verification' }}</p >
@@ -1047,10 +1094,47 @@ textarea.form-control {
1047
1094
<div class =" link-display" v-else >
1048
1095
<span class =" link-text" >URL will be generated after saving</span >
1049
1096
</div >
1097
+ <span class =" status-badge" :class =" getStatusClass()" >
1098
+ {{ getStatusText() }}
1099
+ </span >
1050
1100
</div >
1051
1101
</div >
1052
1102
</div >
1053
1103
1104
+ <!-- Delete confirmation modal -->
1105
+ <b-modal
1106
+ v-model =" showDeleteModal"
1107
+ hide-footer
1108
+ centered
1109
+ size =" md"
1110
+ dialog-class =" hf-modal"
1111
+ content-class =" hf-modal-content"
1112
+ header-class =" hf-modal-header"
1113
+ >
1114
+ <template #modal-title >
1115
+ <div class =" hf-modal-title" >
1116
+ <i class =" fa fa-exclamation-triangle" style =" color :#dc3545 ;margin-right :8px ;" ></i >
1117
+ Delete KYC Page?
1118
+ </div >
1119
+ </template >
1120
+ <div class =" confirm-body" >
1121
+ <p class =" mb-2" >You're about to remove this KYC page configuration.</p >
1122
+ <div class =" confirm-url" v-if =" kycWebpageConfigTemp.generatedUrl" >
1123
+ <span >URL</span >
1124
+ <code >{{ kycWebpageConfigTemp.generatedUrl }}</code >
1125
+ </div >
1126
+ <div class =" confirm-url" v-else >
1127
+ <span >URL</span >
1128
+ <code >Not generated yet</code >
1129
+ </div >
1130
+ <p class =" mt-2" style =" color :#6b7280 ;" >This action cannot be undone.</p >
1131
+ </div >
1132
+ <div class =" modal-actions" >
1133
+ <b-button variant =" outline-secondary" @click =" showDeleteModal=false" >Cancel</b-button >
1134
+ <b-button variant =" danger" @click =" confirmDelete" ><i class =" fa fa-trash mr-1" ></i >Delete</b-button >
1135
+ </div >
1136
+ </b-modal >
1137
+
1054
1138
<!-- Expiry Warning -->
1055
1139
<div v-if =" showExpiryWarning" class =" warning-alert" >
1056
1140
<i class =" fa fa-exclamation-triangle" ></i >
@@ -1177,7 +1261,7 @@ textarea.form-control {
1177
1261
</div >
1178
1262
<div >
1179
1263
<h3 class =" brand-name" >{{ getSelectedService ? getSelectedService.appName : 'Your Business Name' }}</h3 >
1180
- <div class =" brand-subtitle" >Identity Verification Platform</div >
1264
+ <div class =" brand-subtitle" >{{ kycWebpageConfigTemp.pageTitle || ' Identity Verification Platform' }} </div >
1181
1265
</div >
1182
1266
</div >
1183
1267
@@ -1277,6 +1361,7 @@ export default {
1277
1361
fullPage: true ,
1278
1362
isLoading: false ,
1279
1363
previewMode: " desktop" ,
1364
+ showDeleteModal: false ,
1280
1365
kycWebpageConfigTemp: {
1281
1366
pageTitle: " KYC Verification" ,
1282
1367
pageDescription: " " ,
@@ -1303,6 +1388,14 @@ export default {
1303
1388
this .kycWebpageConfigTemp .selectedTheme = theme;
1304
1389
},
1305
1390
1391
+ openDeleteModal () {
1392
+ this .showDeleteModal = true ;
1393
+ },
1394
+
1395
+ async confirmDelete () {
1396
+ await this .deleteConfiguration ();
1397
+ },
1398
+
1306
1399
generateUniqueId () {
1307
1400
return ' kyc_' + Date .now () + ' _' + Math .random ().toString (36 ).substr (2 , 9 );
1308
1401
},
@@ -1423,6 +1516,23 @@ export default {
1423
1516
this .isLoading = false ;
1424
1517
this .notifyErr (e);
1425
1518
}
1519
+ },
1520
+
1521
+ async deleteConfiguration () {
1522
+ try {
1523
+ if (! this .kycWebpageConfigTemp || ! this .kycWebpageConfigTemp ._id ) {
1524
+ return this .notifyErr (' No configuration to delete' );
1525
+ }
1526
+ this .isLoading = true ;
1527
+ await this .deleteKYCWebpageConfig ({ _id: this .kycWebpageConfigTemp ._id });
1528
+ this .showDeleteModal = false ;
1529
+ this .notifySuccess (' KYC webpage configuration deleted successfully!' );
1530
+ await this .fetchKYCWebpageConfig ();
1531
+ this .isLoading = false ;
1532
+ } catch (e) {
1533
+ this .isLoading = false ;
1534
+ this .notifyErr (e);
1535
+ }
1426
1536
}
1427
1537
},
1428
1538
0 commit comments