Skip to content

Commit ef1c0b5

Browse files
authored
Merge pull request #77 from hypersign-protocol/bugfix-kycwebpageGenrator
Bugfix kycwebpage genrator
2 parents 28c9fc5 + 7fba27d commit ef1c0b5

File tree

1 file changed

+118
-8
lines changed

1 file changed

+118
-8
lines changed

src/views/playground/KYCWebpageGenerator.vue

Lines changed: 118 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,46 @@
4141
border: 1px solid #ffeaa7;
4242
}
4343
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+
4484
/* Link Display Styles */
4585
.link-display {
4686
display: flex;
@@ -753,9 +793,10 @@ textarea.form-control {
753793
754794
.url-section {
755795
display: flex;
756-
align-items: center;
796+
flex-direction: column;
797+
align-items: flex-end;
757798
justify-content: flex-end;
758-
gap: 10px;
799+
gap: 6px;
759800
}
760801
761802
.url-section h6 {
@@ -765,6 +806,11 @@ textarea.form-control {
765806
color: #2c3e50;
766807
}
767808
809+
.url-section .status-badge {
810+
align-self: flex-end;
811+
margin-top: 4px;
812+
}
813+
768814
/* Two Column Layout */
769815
.form-layout {
770816
display: flex;
@@ -1011,8 +1057,12 @@ textarea.form-control {
10111057
<v-col>
10121058
<HfButtons name="Save Configuration" @executeAction="saveConfiguration()" v-if="!this.kycWebpageConfigTemp._id"
10131059
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>
10161066
</v-col>
10171067
</v-row>
10181068

@@ -1027,9 +1077,6 @@ textarea.form-control {
10271077
<i class="fa fa-building"></i>
10281078
</div>
10291079
</div>
1030-
<span class="status-badge" :class="getStatusClass()">
1031-
{{ getStatusText() }}
1032-
</span>
10331080
<div class="company-info">
10341081
<h4>{{ getSelectedService ? getSelectedService.appName : 'Your Business Name' }}</h4>
10351082
<p>{{ kycWebpageConfigTemp.pageTitle || 'KYC Verification' }}</p>
@@ -1047,10 +1094,47 @@ textarea.form-control {
10471094
<div class="link-display" v-else>
10481095
<span class="link-text">URL will be generated after saving</span>
10491096
</div>
1097+
<span class="status-badge" :class="getStatusClass()">
1098+
{{ getStatusText() }}
1099+
</span>
10501100
</div>
10511101
</div>
10521102
</div>
10531103

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+
10541138
<!-- Expiry Warning -->
10551139
<div v-if="showExpiryWarning" class="warning-alert">
10561140
<i class="fa fa-exclamation-triangle"></i>
@@ -1177,7 +1261,7 @@ textarea.form-control {
11771261
</div>
11781262
<div>
11791263
<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>
11811265
</div>
11821266
</div>
11831267

@@ -1277,6 +1361,7 @@ export default {
12771361
fullPage: true,
12781362
isLoading: false,
12791363
previewMode: "desktop",
1364+
showDeleteModal: false,
12801365
kycWebpageConfigTemp: {
12811366
pageTitle: "KYC Verification",
12821367
pageDescription: "",
@@ -1303,6 +1388,14 @@ export default {
13031388
this.kycWebpageConfigTemp.selectedTheme = theme;
13041389
},
13051390
1391+
openDeleteModal() {
1392+
this.showDeleteModal = true;
1393+
},
1394+
1395+
async confirmDelete() {
1396+
await this.deleteConfiguration();
1397+
},
1398+
13061399
generateUniqueId() {
13071400
return 'kyc_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);
13081401
},
@@ -1423,6 +1516,23 @@ export default {
14231516
this.isLoading = false;
14241517
this.notifyErr(e);
14251518
}
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+
}
14261536
}
14271537
},
14281538

0 commit comments

Comments
 (0)