Sai Sudheer 2 lat temu
rodzic
commit
f46290abf6

+ 14
- 8
assets/js/base.js Wyświetl plik

@@ -1,7 +1,13 @@
1
-const serverUrl = 'http://localhost:1188/';
2
-let _baseUserInfo = atob(document.cookie.split('=')[1]);
3
-let baseUserInfo = 'JSON.parse(_baseUserInfo).result';
4
-let baseSessionId = 'baseUserInfo.sessionId';
1
+import {
2
+    decrypt
3
+} from "./cookiehelper.js";
4
+import {
5
+    _serverUrl
6
+} from "./setting.js";
7
+
8
+let serverUrl = _serverUrl();
9
+let baseUserInfo = decrypt(document.cookie.split('=')[1]);
10
+let baseSessionId = baseUserInfo.sessionId;
5 11
 
6 12
 export function getData(url) {
7 13
     var datastr = null;
@@ -16,9 +22,9 @@ export function getData(url) {
16 22
         cache: true,
17 23
         jsonp: false,
18 24
         data: datastr,
19
-        beforeSend: function (xhr) {
25
+        beforeSend: function(xhr) {
20 26
             if (baseUserInfo != undefined && baseUserInfo != null) {
21
-                xhr.setRequestHeader("Authorization", "Basic " + baseSessionId);
27
+                xhr.setRequestHeader("Authorization", "Basic " + JSON.parse(baseUserInfo).sessionId);
22 28
                 xhr.setRequestHeader('geoposition', 0 + ':' + 0);
23 29
             }
24 30
         }
@@ -36,9 +42,9 @@ export function getDataObj(url, data, async, type) { //url, data, true, "POST"
36 42
         traditional: true,
37 43
         crossDomain: true,
38 44
         async: async,
39
-        beforeSend: function (xhr) {
45
+        beforeSend: function(xhr) {
40 46
             if (baseUserInfo != undefined && baseUserInfo != null) {
41
-                xhr.setRequestHeader('Authorization', 'Basic ' + baseSessionId);
47
+                xhr.setRequestHeader('Authorization', 'Basic ' + JSON.parse(baseUserInfo).sessionId);
42 48
                 xhr.setRequestHeader('geoposition', 0 + ':' + 0);
43 49
             }
44 50
         }

+ 116
- 121
assets/js/forgotpassword.js Wyświetl plik

@@ -1,147 +1,142 @@
1
-const serverUrl = 'http://localhost:3088/';
1
+const serverUrl = 'http://localhost:3086/';
2 2
 let otpid;
3 3
 let sendotp;
4 4
 let unibaseid;
5 5
 async function showOtpBox() {
6 6
     let inputdetails = document.getElementById('txt_PhoneorMail').value;
7
-  
8
-      let sendnumber  = await fetch(serverUrl + 'account/getuserbyphoneormail/'+inputdetails+'/'+inputdetails)
9
-        let textdata = await sendnumber.json();
10
-        if(textdata.result != null){
11
-         unibaseid = textdata.result.unibaseId;
12
-    var myHeaders = new Headers();
13
-    myHeaders.append("Content-Type", "application/json");
14
-    
15
-    var raw = JSON.stringify({
16
-      "FirstName": "",
17
-      "LastName": "",
18
-      "ContactNumber": "",
19
-      "Email": "",
20
-      "TenantName": "",
21
-      "ContactOrEmail": inputdetails,
22
-      "IsSignup": false,
23
-      "IsRegisterUser": false,
24
-      "IsForgotPswd": true,
25
-      "UnibaseId": unibaseid,
26
-      "OtpId": 0,
27
-      "UserOtp": ""
28
-    });
29
-    
30
-    var requestOptions = {
31
-      method: 'POST',
32
-      headers: myHeaders,
33
-      body: raw,
34
-      redirect: 'follow'
35
-    };
36
-    
37
-    fetch(serverUrl + 'account/sendotp', requestOptions)
38
-      .then(response => response.text())
39
-      .then(function(result){
40
-        optid = result;
41
-        document.getElementById('div_ForgotPswd').style.display = 'none';
42
-        document.getElementById('modal_Otp').style.display = 'block';
7
+
8
+    let sendnumber = await fetch(serverUrl + 'account/getuserbyphoneormail/' + inputdetails + '/' + inputdetails)
9
+    let textdata = await sendnumber.json();
10
+    if (textdata.result != null) {
11
+        unibaseid = textdata.result.unibaseId;
12
+        var myHeaders = new Headers();
13
+        myHeaders.append("Content-Type", "application/json");
14
+
15
+        var raw = JSON.stringify({
16
+            "FirstName": "",
17
+            "LastName": "",
18
+            "ContactNumber": "",
19
+            "Email": "",
20
+            "TenantName": "",
21
+            "ContactOrEmail": inputdetails,
22
+            "IsSignup": false,
23
+            "IsRegisterUser": false,
24
+            "IsForgotPswd": true,
25
+            "UnibaseId": unibaseid,
26
+            "OtpId": 0,
27
+            "UserOtp": ""
28
+        });
29
+
30
+        var requestOptions = {
31
+            method: 'POST',
32
+            headers: myHeaders,
33
+            body: raw,
34
+            redirect: 'follow'
35
+        };
36
+
37
+        fetch(serverUrl + 'account/sendotp', requestOptions)
38
+            .then(response => response.text())
39
+            .then(function(result) {
40
+                optid = result;
41
+                document.getElementById('div_ForgotPswd').style.display = 'none';
42
+                document.getElementById('modal_Otp').style.display = 'block';
43
+                document.getElementById('div_ValidationSummary').innerHTML = "";
44
+            })
45
+            .catch(error => console.log('error', error));
46
+    } else {
47
+        let html = '<div class="p-2"><span class="error-warning">Error !</span> Email/Phonenumber does not exist</div>';
43 48
         document.getElementById('div_ValidationSummary').innerHTML = "";
44
-      })
45
-      .catch(error => console.log('error', error));
46
-    }
47
-    else{
48
-        let html = '<div class="p-2"><span class="error-warning">Error !</span> Email/Phonenumber does not exist</div>' ;
49
-    document.getElementById('div_ValidationSummary').innerHTML = "";
50
-    let error = document.getElementById('div_ValidationSummary');
51
-    error.insertAdjacentHTML('beforeend',html); 
49
+        let error = document.getElementById('div_ValidationSummary');
50
+        error.insertAdjacentHTML('beforeend', html);
52 51
     }
53 52
 }
54 53
 
55 54
 /*verify otp*/
56
-      async function showPasswordBox() {
57
-       let inputdetails = document.getElementById('txt_Code').value;
58
-       if(inputdetails.length > 0){
55
+async function showPasswordBox() {
56
+    let inputdetails = document.getElementById('txt_Code').value;
57
+    if (inputdetails.length > 0) {
59 58
         var myHeaders = new Headers();
60 59
         myHeaders.append("Content-Type", "application/json");
61 60
         var raw = JSON.stringify({
62
-          "FirstName": "",
63
-          "LastName": "",
64
-          "ContactNumber": "",
65
-          "Email": "",
66
-          "TenantName": "",
67
-          "ContactOrEmail": "",
68
-          "IsForgotPswd": false,
69
-          "IsRegisterUser": false,
70
-          "IsSignup": true,
71
-          "UnibaseId": "",
72
-          "OtpId": optid,
73
-          "UserOtp": inputdetails
61
+            "FirstName": "",
62
+            "LastName": "",
63
+            "ContactNumber": "",
64
+            "Email": "",
65
+            "TenantName": "",
66
+            "ContactOrEmail": "",
67
+            "IsForgotPswd": false,
68
+            "IsRegisterUser": false,
69
+            "IsSignup": true,
70
+            "UnibaseId": "",
71
+            "OtpId": optid,
72
+            "UserOtp": inputdetails
74 73
         });
75
-        
74
+
76 75
         var requestOptions = {
77
-          method: 'POST',
78
-          headers: myHeaders,
79
-          body: raw,
80
-          redirect: 'follow'
76
+            method: 'POST',
77
+            headers: myHeaders,
78
+            body: raw,
79
+            redirect: 'follow'
81 80
         };
82
-        
81
+
83 82
         fetch(serverUrl + 'account/verifyotp', requestOptions)
84
-          .then(response => response.text())
85
-          .then(function(result){
86
-            let data = JSON.parse(result);
87
-            if(data.result.contactConfirmed == true){
88
-                document.getElementById('modal_Otp').style.display = 'none';
89
-                document.getElementById('div_ResetPswd').style.display = 'block';
90
-                document.getElementById('div_ValidationSummary').innerHTML = "";
91
-            }else{
92
-               let html = '<div class="p-2" ><span class="error-warning">Error !</span> Enter Valid OTP</div>' ;
93
-               document.getElementById('div_ValidationSummary').innerHTML = "";
94
-               let error = document.getElementById('div_ValidationSummary');
95
-               error.insertAdjacentHTML('beforeend',html);
96
-            }
97
-          })
98
-          .catch(error => console.log('error', error));
99
-    }else{
83
+            .then(response => response.text())
84
+            .then(function(result) {
85
+                let data = JSON.parse(result);
86
+                if (data.result.contactConfirmed == true) {
87
+                    document.getElementById('modal_Otp').style.display = 'none';
88
+                    document.getElementById('div_ResetPswd').style.display = 'block';
89
+                    document.getElementById('div_ValidationSummary').innerHTML = "";
90
+                } else {
91
+                    let html = '<div class="p-2" ><span class="error-warning">Error !</span> Enter Valid OTP</div>';
92
+                    document.getElementById('div_ValidationSummary').innerHTML = "";
93
+                    let error = document.getElementById('div_ValidationSummary');
94
+                    error.insertAdjacentHTML('beforeend', html);
95
+                }
96
+            })
97
+            .catch(error => console.log('error', error));
98
+    } else {
100 99
 
101 100
     }
102
-   
101
+
103 102
 
104 103
 
105 104
 }
105
+
106 106
 function showSuccessBox() {
107
-  let txt_NewPassword  =  document.getElementById('txt_NewPassword').value;
108
-  let txt_ConfirmPassword = document.getElementById('txt_ConfirmPassword').value;
109
-  if(txt_NewPassword == txt_ConfirmPassword){
110
-    var myHeaders = new Headers();
111
-myHeaders.append("Content-Type", "application/json");
112
-var raw = JSON.stringify({
113
-  "Password": txt_NewPassword,
114
-  "UserName": unibaseid
115
-});
116
-var requestOptions = {
117
-  method: 'POST',
118
-  headers: myHeaders,
119
-  body: raw,
120
-  redirect: 'follow'
121
-};
122
-fetch(serverUrl + 'account/updatepassword', requestOptions)
123
-  .then(response => response.text())
124
-  .then(function(result){
125
-    let updatepassword = JSON.parse(result);
126
-    let message  = updatepassword.message;
127
-    if(message == 'Password Updated Successfully'){
107
+    let txt_NewPassword = document.getElementById('txt_NewPassword').value;
108
+    let txt_ConfirmPassword = document.getElementById('txt_ConfirmPassword').value;
109
+    if (txt_NewPassword == txt_ConfirmPassword) {
110
+        var myHeaders = new Headers();
111
+        myHeaders.append("Content-Type", "application/json");
112
+        var raw = JSON.stringify({
113
+            "Password": txt_NewPassword,
114
+            "UserName": unibaseid
115
+        });
116
+        var requestOptions = {
117
+            method: 'POST',
118
+            headers: myHeaders,
119
+            body: raw,
120
+            redirect: 'follow'
121
+        };
122
+        fetch(serverUrl + 'account/updatepassword', requestOptions)
123
+            .then(response => response.text())
124
+            .then(function(result) {
125
+                let updatepassword = JSON.parse(result);
126
+                let message = updatepassword.message;
127
+                if (message == 'Password Updated Successfully') {
128
+                    document.getElementById('div_ValidationSummary').innerHTML = "";
129
+                    document.getElementById('div_ResetPswd').style.display = 'none';
130
+                    document.getElementById('div_SuccessMsg').style.display = 'block';
131
+                }
132
+            })
133
+            .catch(error => console.log('error', error));
134
+
135
+    } else {
136
+        let html = '<div class="p-2"> <span class="error-warning">Error !</span> Password Does not Match</div>';
128 137
         document.getElementById('div_ValidationSummary').innerHTML = "";
129
-        document.getElementById('div_ResetPswd').style.display = 'none';
130
-        document.getElementById('div_SuccessMsg').style.display = 'block';
138
+        let error = document.getElementById('div_ValidationSummary');
139
+        error.insertAdjacentHTML('beforeend', html);
131 140
     }
132
-  }
133
-  )
134
-  .catch(error => console.log('error', error));
135
- 
136
-  }else{
137
-    let html = '<div class="p-2"> <span class="error-warning">Error !</span> Password Does not Match</div>' ;
138
-    document.getElementById('div_ValidationSummary').innerHTML = "";
139
-    let error = document.getElementById('div_ValidationSummary');
140
-    error.insertAdjacentHTML('beforeend',html);
141
-  }
142
-   
143
-}
144
-
145
-
146
-
147 141
 
142
+}

+ 6
- 19
assets/js/home.js Wyświetl plik

@@ -1,22 +1,9 @@
1
-import { getCookie } from "./cookiehelper.js";
2
-import { initListIndex } from "./list.index.js";
1
+import {
2
+    getCookie
3
+} from "./cookiehelper.js";
4
+import {
5
+    initListIndex
6
+} from "./list.index.js";
3 7
 
4 8
 initListIndex();
5 9
 
6
-$('#detailBtn').click(function () {
7
-    $('.bdy-ul').addClass('d-none');
8
-    // Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(105013010001972,105010260000090,'Details','null',6,0,null)
9
-    const cookie = getCookie('_idty');
10
-    if (cookie) {
11
-        const {
12
-            unibaseId,
13
-            tenantId,
14
-            userId
15
-        } = JSON.parse(cookie);
16
-        debugger;
17
-        $('#detailIframe').html(
18
-            `<iframe width="100%" style="min-height:746px"  name="srcframe" id="srcframe" class="srcframe" src="http://localhost:1188/#/${unibaseId}/${tenantId}/${userId}/106457720000011/100010270000325/loadDetail"></iframe>`
19
-        );
20
-    }
21
-
22
-});

+ 137
- 52
assets/js/list.index.js Wyświetl plik

@@ -1,53 +1,94 @@
1 1
 /*Data  loading  start here*/
2
+import {
3
+    getCookie
4
+} from "./cookiehelper.js";
2 5
 
3
-import { getData, getDataObj } from "./base.js";
4
-
5
-
6
+import {
7
+    getData,
8
+    getDataObj
9
+} from "./base.js";
6 10
 
7 11
 function loadData() {
8
-    getData('apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20').then(function (result) {
12
+    getData(
13
+        "apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20"
14
+    ).then(function(result) {
9 15
         let response = JSON.parse(result.result);
10
-        if (response.length != 0) { // Notifcations
16
+        if (response.length != 0) {
17
+            // Notifcations
11 18
             let bdyUI = '<div class="accordion" id="notifi-list">';
12 19
             for (var i = 0; i < response.length; i++) {
13
-                bdyUI += `<li class="item-li" id="${response[i].ReminderId}" data-ref="${response[i].RedirectOptions.RefId}" data-installedAppId="${response[i].RedirectOptions.InstalledAppId}" data-formId="${response[i].RedirectOptions.CreateFormId}">
14
-                            <div class="accordion-header" id="accHeader-${response[i].ReminderId}">
15
-                                <div class="notifiListItms accordion-button collapsed" data-bs-toggle="collapse"  data-bs-target="#collapse-${response[i].ReminderId}" aria-expanded="false" aria-controls="collapseOne">
20
+                bdyUI += `<li class="item-li" id="${
21
+          response[i].ReminderId
22
+        }" data-ref="${
23
+          response[i].RedirectOptions.RefId
24
+        }" data-installedAppId="${
25
+          response[i].RedirectOptions.InstalledAppId
26
+        }" data-formId="${response[i].RedirectOptions.CreateFormId}">
27
+                            <div class="accordion-header" id="accHeader-${
28
+                              response[i].ReminderId
29
+                            }">
30
+                                <div class="notifiListItms accordion-button collapsed" data-bs-toggle="collapse"  data-bs-target="#collapse-${
31
+                                  response[i].ReminderId
32
+                                }" aria-expanded="false" aria-controls="collapseOne">
16 33
                                     <div class="row m-0 w-100 p-0 ">
17 34
                                         <div class="col-1 ">
18 35
                                             <input class="form-check-input mx-1" type="checkbox" value="" id="flexCheckDefault">
19 36
                                         </div>
20 37
                                         <div class="col-4 text-truncate">
21
-                                            <span class="mx-1">${response[i].Subject}</span>
38
+                                            <span class="mx-1">${
39
+                                              response[i].Subject
40
+                                            }</span>
22 41
                                         </div>
23 42
                                         <div class="col-5 text-truncate">
24
-                                            <span class="mx-1">${response[i].Message}</span>
43
+                                            <span class="mx-1">${
44
+                                              response[i].Message
45
+                                            }</span>
25 46
                                         </div>
26 47
                                         <div class="col-2 text-truncate">
27
-                                            <span class="mx-1">${formatLocal(response[i].ReminderDate)}</span>
48
+                                            <span class="mx-1">22 minutes ago</span>
28 49
                                         </div>
29 50
                                     </div>    
30 51
                                 </div>
31
-                                <div id="collapse-${response[i].ReminderId}"  class="accordion-collapse collapse" aria-labelledby="accHeader-${response[i].ReminderId}" data-bs-parent="#notifi-list">
32
-                                    <div class="accordion-body" id="accBody${response[i].ReminderId}">
52
+                                <div id="collapse-${
53
+                                  response[i].ReminderId
54
+                                }"  class="accordion-collapse collapse" aria-labelledby="accHeader-${
55
+          response[i].ReminderId
56
+        }" data-bs-parent="#notifi-list">
57
+                                    <div class="accordion-body" id="accBody${
58
+                                      response[i].ReminderId
59
+                                    }">
33 60
                                         
34 61
                                     </div>
35 62
                                 </div>
36 63
                             </div>
37 64
                         </li>`;
38 65
             }
39
-            bdyUI += '</div>'
40
-            $('.bdy-ul').append(bdyUI);
41
-            $('.notifiListItms').on('click', function () {
42
-                let _this = $(this).parents('.item-li');
43
-                let obj = { "FromDate": "2022/11/30", "InstalledAppId": Number($(_this).attr('data-installedAppId')), "RecordId": Number($(_this).attr('data-ref')), "ToDate": "2022/11/30" };
66
+            bdyUI += "</div>";
67
+            $(".bdy-ul").append(bdyUI);
68
+            
69
+            $(".notifiListItms").on("click", function() {
70
+                let _this = $(this).parents(".item-li");
71
+                let obj = {
72
+                    FromDate: "2022/11/30",
73
+                    InstalledAppId: Number($(_this).attr("data-installedAppId")),
74
+                    RecordId: Number($(_this).attr("data-ref")),
75
+                    ToDate: "2022/11/30",
76
+                };
44 77
                 //let obj = { "FromDate": "2022/11/30", "InstalledAppId": 102530270000109, "RecordId": 102533490346298, "ToDate": "2022/11/30" };
45
-                getDataObj('apis/v4/unibase/platform/widgets/getdefaultwidget', obj, true, "POST").then(function (response) {
78
+                getDataObj(
79
+                    "apis/v4/unibase/platform/widgets/getdefaultwidget",
80
+                    obj,
81
+                    true,
82
+                    "POST"
83
+                ).then(function(response) {
46 84
                     let res = JSON.parse(response.result),
47
-                        html = '';
48
-                    if (response.message == '200' && response.errors == null) {
85
+                        html = "";
86
+                    if (response.message == "200" && response.errors == null) {
49 87
                         html = `<ul class="p-0 m-0 d-flex flex-row">`;
50
-                        if (res.AppConfigurations != null && res.AppConfigurations.length > 0) {
88
+                        if (
89
+                            res.AppConfigurations != null &&
90
+                            res.AppConfigurations.length > 0
91
+                        ) {
51 92
                             for (var k = 0; k < res.AppConfigurations.length; k++) {
52 93
                                 html += `<li class="mx-2 btn-outline-primary btn btn-sm">${res.AppConfigurations[k].SettingName}</li>`;
53 94
                             }
@@ -71,86 +112,130 @@ function loadData() {
71 112
                                     html += `<li><a class="dropdown-item" href="javascript:void(0);">${res.Stages[i].StageName}</a></li>`;
72 113
                                 }
73 114
                             }
74
-                            html += '</ul></li>'
115
+                            html += "</ul></li>";
75 116
                         } else {
76 117
                             html += `<li class="p-1 my-0 alert alert-danger ml-auto" role="alert">
77 118
                                     No Stages
78 119
                                 </li>`;
79 120
                         }
80
-                        html += `</ul>`;
121
+                        html += `<li class="p-1 mx-2 my-0 btn-outline-info detailBtn btn btn-sm" data-appid="${Number($(_this).attr("data-installedAppId"))}" data-recordid="${Number($(_this).attr("data-ref"))}">Details-Page</li></ul>`;
81 122
                     } else {
82 123
                         html += `<div class="alert alert-danger" role="alert">
83 124
                                     ${response.message} ${response.errors}
84
-                                </div>`
125
+                                </div>`;
85 126
                     }
86
-                    $(_this).find('.accordion-body').html(html);
127
+                    $(_this).find(".accordion-body").html(html);
128
+                    detailClick();
87 129
                 });
88
-            })
130
+            });
89 131
         }
90
-    })
91
-    getData('apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/20').then(function (tskResp) {
92
-        let response = JSON.parse(tskResp.result)
132
+    });
133
+    getData(
134
+        "apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/20"
135
+    ).then(function(tskResp) {
136
+        let response = JSON.parse(tskResp.result);
93 137
         if (response.length != 0) {
94 138
             let _tskhtml = '<div class="accordion" id="task-list">';
95 139
             for (var i = 0; i < response.length; i++) {
96
-                _tskhtml += `<li class="item-li" id="${response[i].ReminderId}" data-ref="${response[i].RedirectOptions.RefId}" data-installedAppId="${response[i].RedirectOptions.InstalledAppId}" data-formId="${response[i].RedirectOptions.CreateFormId}">
97
-                                <div class="accordion-header" id="accHeader-${response[i].ReminderId}">
98
-                                    <div class="tskListItms accordion-button collapsed" data-bs-toggle="collapse"  data-bs-target="#collapse-${response[i].ReminderId}" aria-expanded="false" aria-controls="collapseOne">
140
+                
141
+                _tskhtml += `<li class="item-li" id="${
142
+          response[i].ReminderId
143
+        }" data-ref="${
144
+          response[i].RedirectOptions.RefId
145
+        }" data-installedAppId="${
146
+          response[i].RedirectOptions.InstalledAppId
147
+        }" data-formId="${response[i].RedirectOptions.CreateFormId}">
148
+                                <div class="accordion-header" id="accHeader-${
149
+                                  response[i].ReminderId
150
+                                }">
151
+                                    <div class="tskListItms accordion-button collapsed" data-bs-toggle="collapse"  data-bs-target="#collapse-${
152
+                                      response[i].ReminderId
153
+                                    }" aria-expanded="false" aria-controls="collapseOne">
99 154
                                         <div class="row m-0 w-100 p-0 ">
100 155
                                             <div class="col-1 ">
101 156
                                                 <input class="form-check-input mx-1" type="checkbox" value="" id="flexCheckDefault">
102 157
                                             </div>
103 158
                                             <div class="col-4 text-truncate">
104
-                                                <span class="mx-1">${response[i].Subject}</span>
159
+                                                <span class="mx-1">${
160
+                                                  response[i].Subject
161
+                                                }</span>
105 162
                                             </div>
106 163
                                             <div class="col-5 text-truncate">
107
-                                                <span class="mx-1">${response[i].Message}</span>
164
+                                                <span class="mx-1">${
165
+                                                  response[i].Message
166
+                                                }</span>
108 167
                                             </div>
109 168
                                             <div class="col-2 text-truncate">
110
-                                                <span class="mx-1">${formatLocal(response[i].ReminderDate)}</span>
169
+                                                <span class="mx-1">2 seconds</span>
111 170
                                             </div>
112 171
                                         </div>    
113 172
                                     </div>
114
-                                    <div id="collapse-${response[i].ReminderId}"  class="accordion-collapse collapse" aria-labelledby="accHeader-${response[i].ReminderId}" data-bs-parent="#notifi-list">
115
-                                        <div class="accordion-body" id="accBody${response[i].ReminderId}">
173
+                                    <div id="collapse-${
174
+                                      response[i].ReminderId
175
+                                    }"  class="accordion-collapse collapse" aria-labelledby="accHeader-${
176
+          response[i].ReminderId
177
+        }" data-bs-parent="#notifi-list">
178
+                                        <div class="accordion-body" id="accBody${
179
+                                          response[i].ReminderId
180
+                                        }">
116 181
                                             <ul class="p-0 m-0 d-flex flex-row justify-content-between">
117 182
                                                 <li class="mx-2 btn-outline-success btn btn-sm">Confirm</li>
118 183
                                                 <li class="mx-2 btn-outline-danger btn btn-sm">Reject</li>
119 184
                                                 <li class="mx-2 btn-outline-primary btn btn-sm">Close</li>
185
+                                                <li class="mx-2 btn-outline-info detailBtn btn btn-sm" data-appId="${response[i].RedirectOptions.InstalledAppId}" data-recordId="${response[i].RedirectOptions.RefId}">Details-Page</li>
120 186
                                             </ul>
121 187
                                         </div>
122 188
                                     </div>
123 189
                                 </div>
124 190
                             </li>`;
125 191
             }
126
-            _tskhtml += '</div>'
127
-            $('.bdy-ul').append(_tskhtml);
192
+            _tskhtml += "</div>";
193
+            $(".bdy-ul").append(_tskhtml);
194
+            detailClick()
128 195
         }
129 196
     });
130 197
 }
131
-
132
-
133
-
134
-
198
+export function detailClick(){
199
+    $('.detailBtn').click(function() {
200
+        $('.bdy-ul').addClass('d-none');
201
+        let installedAppId = +$(this).attr('data-appId');
202
+        let recordId = +$(this).attr('data-recordId')
203
+        // Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(105013010001972,105010260000090,'Details','null',6,0,null)
204
+        const cookie = getCookie('_idty');
205
+        if (cookie) {
206
+            const {
207
+                unibaseId,
208
+                tenantId,
209
+                userId
210
+            } = JSON.parse(cookie);
211
+            debugger;
212
+            $('#detailIframe').html(
213
+                `<iframe width="100%" style="min-height:746px"  name="srcframe" id="srcframe" class="srcframe" src="http://localhost:3086/#/${unibaseId}/${tenantId}/${userId}/${recordId}/${installedAppId}/loadDetail"></iframe>`
214
+            );
215
+    
216
+        }
217
+    
218
+    });
219
+}
135 220
 
136 221
 export function initListIndex() {
137
-    let _userInfo = atob(document.cookie.split('=')[1]);
138
-    let userInfo = ' JSON.parse(_userInfo).result';
139
-    let sessionId = 'userInfo.sessionId';
222
+    let _userInfo = atob(document.cookie.split("=")[1]);
223
+    let userInfo = " JSON.parse(_userInfo).result";
224
+    let sessionId = "userInfo.sessionId";
140 225
 
141 226
     let usrinfoHTML = `<li><a class="dropdown-item" href="javascript:void(0);">${userInfo.name}</a></li>
142 227
 <li><a class="dropdown-item" href="javascript:void(0);">Cloud Settings</a></li>
143 228
 <li><a class="dropdown-item" href="javascript:void(0);">Help</a></li>
144 229
                     <li><a class="dropdown-item" href="javascript:void(0);">Logoff</a></li>`;
145
-    $('.icn-circle').text(userInfo?.name?.charAt(0)?.toUpperCase())
146
-    $('.uindtls').html(usrinfoHTML)
230
+    $(".icn-circle").text(userInfo?.name?.charAt(0)?.toUpperCase());
231
+    $(".uindtls").html(usrinfoHTML);
147 232
 
148 233
     // List Page loading
149 234
 
150 235
     /*Data  loading  start here*/
151
-    $('.mnNvIcn').click(function () {
152
-        $('.lft-nav-bar').toggleClass('lft-nav-bar-Wrap');
153
-        $('.ctr-lst-pge').toggleClass('lft-nav-bar-Wrap');
236
+    $(".mnNvIcn").click(function() {
237
+        $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
238
+        $(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
154 239
     });
155 240
     loadData();
156 241
 }

+ 98
- 90
assets/js/login.js Wyświetl plik

@@ -1,6 +1,14 @@
1
-import { setCookie } from "./cookiehelper.js";
1
+import {
2
+    setCookie
3
+} from "./cookiehelper.js";
4
+import {
5
+    _serverUrl
6
+} from "./setting.js";
7
+
8
+
9
+const serverUrl = _serverUrl();
10
+
2 11
 
3
-const serverUrl = 'http://localhost:1188/';
4 12
 const emailInputEl = document.getElementById('email');
5 13
 const passwordInputEl = document.getElementById('password');
6 14
 const emailErrEl = document.getElementById('emailErrMsg');
@@ -16,124 +24,124 @@ passwordContainerEl.style.display = 'none';
16 24
 emailInputEl.focus();
17 25
 
18 26
 function showPasswordBox() {
19
-  const email = emailInputEl.value;
20
-  if (validateEmailOrPhone()) {
21
-    emailContainerEl.style.display = 'none';
22
-    passwordContainerEl.style.display = 'block';
23
-    document.getElementById('entered-email').innerHTML = email;
24
-    passwordInputEl.focus();
25
-    emailInputEl.classList.remove('error');
26
-    emailErrEl.innerText = '';
27
-  } else {
28
-    emailInputEl.classList.add('error');
29
-    emailErrEl.innerText = 'Please enter valid email or phone';
30
-  }
27
+    const email = emailInputEl.value;
28
+    if (validateEmailOrPhone()) {
29
+        emailContainerEl.style.display = 'none';
30
+        passwordContainerEl.style.display = 'block';
31
+        document.getElementById('entered-email').innerHTML = email;
32
+        passwordInputEl.focus();
33
+        emailInputEl.classList.remove('error');
34
+        emailErrEl.innerText = '';
35
+    } else {
36
+        emailInputEl.classList.add('error');
37
+        emailErrEl.innerText = 'Please enter valid email or phone';
38
+    }
31 39
 }
32 40
 
33 41
 function validateEmailOrPhone() {
34
-  const value = emailInputEl.value.trim();
35
-  const regx = /^[6-9]\d{9}$/;
36
-  if (value.includes('@') || regx.test(value)) {
37
-    return true;
38
-  }
39
-  return false;
42
+    const value = emailInputEl.value.trim();
43
+    const regx = /^[6-9]\d{9}$/;
44
+    if (value.includes('@') || regx.test(value)) {
45
+        return true;
46
+    }
47
+    return false;
40 48
 }
41 49
 
42 50
 function togglePassword() {
43
-  const ele = document.getElementById('showPassword');
44
-  const password = passwordInputEl;
45
-
46
-  if (password.value.length > 0) {
47
-    passwordInputEl.value = password.value;
48
-    password.focus();
49
-    if (ele.checked) {
50
-      password.setAttribute('type', 'text');
51
-    } else {
52
-      password.setAttribute('type', 'password');
51
+    const ele = document.getElementById('showPassword');
52
+    const password = passwordInputEl;
53
+
54
+    if (password.value.length > 0) {
55
+        passwordInputEl.value = password.value;
56
+        password.focus();
57
+        if (ele.checked) {
58
+            password.setAttribute('type', 'text');
59
+        } else {
60
+            password.setAttribute('type', 'password');
61
+        }
53 62
     }
54
-  }
55 63
 }
56 64
 
57 65
 function onPasswordFocusOut() {
58
-  const passwordLabel = document.getElementById('passwordLabel');
59
-  if (passwordInputEl.value.length > 0) {
60
-    passwordLabel.classList.add('password-fixed');
61
-  } else {
62
-    passwordLabel.classList.remove('password-fixed');
63
-  }
66
+    const passwordLabel = document.getElementById('passwordLabel');
67
+    if (passwordInputEl.value.length > 0) {
68
+        passwordLabel.classList.add('password-fixed');
69
+    } else {
70
+        passwordLabel.classList.remove('password-fixed');
71
+    }
64 72
 }
65 73
 
66 74
 function onEmailFocusOut() {
67
-  const emailLabel = document.getElementById('emailLabel');
68
-  if (emailInputEl.value.trim()) {
69
-    emailLabel.classList.add('password-fixed');
70
-  } else {
71
-    emailLabel.classList.remove('password-fixed');
72
-  }
75
+    const emailLabel = document.getElementById('emailLabel');
76
+    if (emailInputEl.value.trim()) {
77
+        emailLabel.classList.add('password-fixed');
78
+    } else {
79
+        emailLabel.classList.remove('password-fixed');
80
+    }
73 81
 }
74 82
 
75 83
 function loginUser(email, password) {
76
-  const postData = JSON.stringify({
77
-    UserName: email,
78
-    Password: password,
79
-    UnibaseId: '',
80
-    RememberMe: false,
81
-  });
82
-
83
-  const requestOptions = {
84
-    method: 'POST',
85
-    headers: {
86
-      'Content-Type': 'application/json',
87
-    },
88
-    body: postData,
89
-    redirect: 'follow',
90
-  };
91
-
92
-  fetch(serverUrl + 'account/login', requestOptions)
93
-    .then((response) => response.text())
94
-    .then((result) => {
95
-      const data = JSON.parse(result);
96
-      if (data.status === 0) {
97
-        setCookie('_idty', JSON.stringify(data.result), 1);
98
-        window.location = '../authentication';
99
-      } else {
100
-        passwordErrEl.innerText = data.message;
101
-      }
102
-    })
103
-    .catch((error) => {
104
-      passwordErrEl.innerText = error;
84
+    const postData = JSON.stringify({
85
+        UserName: email,
86
+        Password: password,
87
+        UnibaseId: '',
88
+        RememberMe: false,
105 89
     });
90
+
91
+    const requestOptions = {
92
+        method: 'POST',
93
+        headers: {
94
+            'Content-Type': 'application/json',
95
+        },
96
+        body: postData,
97
+        redirect: 'follow',
98
+    };
99
+
100
+    fetch(serverUrl + 'account/login', requestOptions)
101
+        .then((response) => response.text())
102
+        .then((result) => {
103
+            const data = JSON.parse(result);
104
+            if (data.status === 0) {
105
+                setCookie('_idty', JSON.stringify(data.result), 1);
106
+                window.location = '../authentication';
107
+            } else {
108
+                passwordErrEl.innerText = data.message;
109
+            }
110
+        })
111
+        .catch((error) => {
112
+            passwordErrEl.innerText = error;
113
+        });
106 114
 }
107 115
 
108 116
 function validateLogin() {
109
-  const email = emailInputEl.value;
110
-  const password = passwordInputEl.value;
111
-  if (password.trim().length !== 0) {
112
-    loginUser(email, password);
113
-  } else {
114
-    passwordInputEl.classList.add('error');
115
-    passwordErrEl.innerText = 'Please enter valid password';
116
-  }
117
+    const email = emailInputEl.value;
118
+    const password = passwordInputEl.value;
119
+    if (password.trim().length !== 0) {
120
+        loginUser(email, password);
121
+    } else {
122
+        passwordInputEl.classList.add('error');
123
+        passwordErrEl.innerText = 'Please enter valid password';
124
+    }
117 125
 }
118 126
 
119 127
 function reEnterEmailClickHandler() {
120
-  emailContainerEl.style.display = 'block';
121
-  passwordContainerEl.style.display = 'none';
122
-  emailInputEl.focus();
128
+    emailContainerEl.style.display = 'block';
129
+    passwordContainerEl.style.display = 'none';
130
+    emailInputEl.focus();
123 131
 }
124 132
 
125 133
 function initializeEventListeners() {
126
-  emailNextBtn.addEventListener('click', showPasswordBox);
134
+    emailNextBtn.addEventListener('click', showPasswordBox);
127 135
 
128
-  showPasswordChk.addEventListener('click', togglePassword);
136
+    showPasswordChk.addEventListener('click', togglePassword);
129 137
 
130
-  passwordInputEl.addEventListener('focusout', onPasswordFocusOut);
138
+    passwordInputEl.addEventListener('focusout', onPasswordFocusOut);
131 139
 
132
-  emailInputEl.addEventListener('focusout', onEmailFocusOut);
140
+    emailInputEl.addEventListener('focusout', onEmailFocusOut);
133 141
 
134
-  loginSubmitBtn.addEventListener('click', validateLogin);
142
+    loginSubmitBtn.addEventListener('click', validateLogin);
135 143
 
136
-  renterEmailLink.addEventListener('click', reEnterEmailClickHandler);
144
+    renterEmailLink.addEventListener('click', reEnterEmailClickHandler);
137 145
 }
138 146
 
139
-initializeEventListeners();
147
+initializeEventListeners();

+ 3
- 0
assets/js/setting.js Wyświetl plik

@@ -0,0 +1,3 @@
1
+export function _serverUrl() {
2
+    return 'http://localhost:3086/';
3
+}

+ 9
- 2
authentication/index.html Wyświetl plik

@@ -30,7 +30,7 @@
30 30
                 <input type="text" class="form-control" id="searchBar" placeholder="Search here">
31 31
             </li>
32 32
             <li class="ml-auto">
33
-                <button class="btn btn-outline-primary" id="detailBtn">Detail</button>
33
+                <button class="btn btn-sm btn-outline-primary detailBtn" id="detailBtn">Detail</button>
34 34
                 <span><i class="la la-question-circle"></i></span>
35 35
             </li>
36 36
             <li>
@@ -92,6 +92,13 @@
92 92
         </div>
93 93
     </section>
94 94
 </body>
95
-
95
+<script>
96
+            window.addEventListener('message', function (e) {
97
+                debugger;
98
+                $('#detailIframe').empty();
99
+                $('.bdy-ul').removeClass('d-none');
100
+            //do stuff
101
+        });
102
+</script>
96 103
 
97 104
 </html>

+ 3
- 4
login/index.html Wyświetl plik

@@ -25,7 +25,7 @@
25 25
                 <div class="form-body">
26 26
                     <div class="form-input-wrap">
27 27
                         <div class="form-group">
28
-                            <input type="text" id="email" class="email-input">
28
+                            <input type="text" id="email" class="email-input" value="common_20220630_1453@bizgaze.com">
29 29
                             <label class="form-control-placeholder" id="emailLabel" for="email">Email or phone</label>
30 30
                         </div>
31 31
                         <div class="err-msg" id="emailErrMsg"></div>
@@ -53,14 +53,13 @@
53 53
                 <div class="form-body password-form-box">
54 54
                     <div class="form-input-wrap">
55 55
                         <div class="form-group">
56
-                            <input type="password" id="password" class="password-input">
56
+                            <input type="password" id="password" class="password-input" value="UABvAHcAbgBlAHIAcwBAADEAMgAzAA==!~`^e_n_c-^`~!">
57 57
                             <label class="form-control-placeholder" id="passwordLabel" for="password">Enter Your
58 58
                                 Password</label>
59 59
                         </div>
60 60
                         <div class="err-msg" id="passwordErrMsg"></div>
61 61
                         <div class="form-link show-password-link flex-between-center">
62
-                            <div class="flex-between-center"><input type="checkbox" id="showPassword"
63
-                                    class="password-checkbox">
62
+                            <div class="flex-between-center"><input type="checkbox" id="showPassword" class="password-checkbox">
64 63
                                 <label for="showPassword">Show password</label></div>
65 64
                             <label><a href="../forgotpassword">Forgot password?</a></label>
66 65
                         </div>

Ładowanie…
Anuluj
Zapisz