new changes
Bu işleme şunda yer alıyor:
@@ -1,7 +1,13 @@
|
||||
const serverUrl = 'http://localhost:1188/';
|
||||
let _baseUserInfo = atob(document.cookie.split('=')[1]);
|
||||
let baseUserInfo = 'JSON.parse(_baseUserInfo).result';
|
||||
let baseSessionId = 'baseUserInfo.sessionId';
|
||||
import {
|
||||
decrypt
|
||||
} from "./cookiehelper.js";
|
||||
import {
|
||||
_serverUrl
|
||||
} from "./setting.js";
|
||||
|
||||
let serverUrl = _serverUrl();
|
||||
let baseUserInfo = decrypt(document.cookie.split('=')[1]);
|
||||
let baseSessionId = baseUserInfo.sessionId;
|
||||
|
||||
export function getData(url) {
|
||||
var datastr = null;
|
||||
@@ -16,9 +22,9 @@ export function getData(url) {
|
||||
cache: true,
|
||||
jsonp: false,
|
||||
data: datastr,
|
||||
beforeSend: function (xhr) {
|
||||
beforeSend: function(xhr) {
|
||||
if (baseUserInfo != undefined && baseUserInfo != null) {
|
||||
xhr.setRequestHeader("Authorization", "Basic " + baseSessionId);
|
||||
xhr.setRequestHeader("Authorization", "Basic " + JSON.parse(baseUserInfo).sessionId);
|
||||
xhr.setRequestHeader('geoposition', 0 + ':' + 0);
|
||||
}
|
||||
}
|
||||
@@ -36,9 +42,9 @@ export function getDataObj(url, data, async, type) { //url, data, true, "POST"
|
||||
traditional: true,
|
||||
crossDomain: true,
|
||||
async: async,
|
||||
beforeSend: function (xhr) {
|
||||
beforeSend: function(xhr) {
|
||||
if (baseUserInfo != undefined && baseUserInfo != null) {
|
||||
xhr.setRequestHeader('Authorization', 'Basic ' + baseSessionId);
|
||||
xhr.setRequestHeader('Authorization', 'Basic ' + JSON.parse(baseUserInfo).sessionId);
|
||||
xhr.setRequestHeader('geoposition', 0 + ':' + 0);
|
||||
}
|
||||
}
|
||||
|
||||
+116
-121
@@ -1,147 +1,142 @@
|
||||
const serverUrl = 'http://localhost:3088/';
|
||||
const serverUrl = 'http://localhost:3086/';
|
||||
let otpid;
|
||||
let sendotp;
|
||||
let unibaseid;
|
||||
async function showOtpBox() {
|
||||
let inputdetails = document.getElementById('txt_PhoneorMail').value;
|
||||
|
||||
let sendnumber = await fetch(serverUrl + 'account/getuserbyphoneormail/'+inputdetails+'/'+inputdetails)
|
||||
let textdata = await sendnumber.json();
|
||||
if(textdata.result != null){
|
||||
unibaseid = textdata.result.unibaseId;
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/json");
|
||||
|
||||
var raw = JSON.stringify({
|
||||
"FirstName": "",
|
||||
"LastName": "",
|
||||
"ContactNumber": "",
|
||||
"Email": "",
|
||||
"TenantName": "",
|
||||
"ContactOrEmail": inputdetails,
|
||||
"IsSignup": false,
|
||||
"IsRegisterUser": false,
|
||||
"IsForgotPswd": true,
|
||||
"UnibaseId": unibaseid,
|
||||
"OtpId": 0,
|
||||
"UserOtp": ""
|
||||
});
|
||||
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: raw,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
fetch(serverUrl + 'account/sendotp', requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(function(result){
|
||||
optid = result;
|
||||
document.getElementById('div_ForgotPswd').style.display = 'none';
|
||||
document.getElementById('modal_Otp').style.display = 'block';
|
||||
|
||||
let sendnumber = await fetch(serverUrl + 'account/getuserbyphoneormail/' + inputdetails + '/' + inputdetails)
|
||||
let textdata = await sendnumber.json();
|
||||
if (textdata.result != null) {
|
||||
unibaseid = textdata.result.unibaseId;
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/json");
|
||||
|
||||
var raw = JSON.stringify({
|
||||
"FirstName": "",
|
||||
"LastName": "",
|
||||
"ContactNumber": "",
|
||||
"Email": "",
|
||||
"TenantName": "",
|
||||
"ContactOrEmail": inputdetails,
|
||||
"IsSignup": false,
|
||||
"IsRegisterUser": false,
|
||||
"IsForgotPswd": true,
|
||||
"UnibaseId": unibaseid,
|
||||
"OtpId": 0,
|
||||
"UserOtp": ""
|
||||
});
|
||||
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: raw,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
fetch(serverUrl + 'account/sendotp', requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(function(result) {
|
||||
optid = result;
|
||||
document.getElementById('div_ForgotPswd').style.display = 'none';
|
||||
document.getElementById('modal_Otp').style.display = 'block';
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
} else {
|
||||
let html = '<div class="p-2"><span class="error-warning">Error !</span> Email/Phonenumber does not exist</div>';
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
}
|
||||
else{
|
||||
let html = '<div class="p-2"><span class="error-warning">Error !</span> Email/Phonenumber does not exist</div>' ;
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
let error = document.getElementById('div_ValidationSummary');
|
||||
error.insertAdjacentHTML('beforeend',html);
|
||||
let error = document.getElementById('div_ValidationSummary');
|
||||
error.insertAdjacentHTML('beforeend', html);
|
||||
}
|
||||
}
|
||||
|
||||
/*verify otp*/
|
||||
async function showPasswordBox() {
|
||||
let inputdetails = document.getElementById('txt_Code').value;
|
||||
if(inputdetails.length > 0){
|
||||
async function showPasswordBox() {
|
||||
let inputdetails = document.getElementById('txt_Code').value;
|
||||
if (inputdetails.length > 0) {
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/json");
|
||||
var raw = JSON.stringify({
|
||||
"FirstName": "",
|
||||
"LastName": "",
|
||||
"ContactNumber": "",
|
||||
"Email": "",
|
||||
"TenantName": "",
|
||||
"ContactOrEmail": "",
|
||||
"IsForgotPswd": false,
|
||||
"IsRegisterUser": false,
|
||||
"IsSignup": true,
|
||||
"UnibaseId": "",
|
||||
"OtpId": optid,
|
||||
"UserOtp": inputdetails
|
||||
"FirstName": "",
|
||||
"LastName": "",
|
||||
"ContactNumber": "",
|
||||
"Email": "",
|
||||
"TenantName": "",
|
||||
"ContactOrEmail": "",
|
||||
"IsForgotPswd": false,
|
||||
"IsRegisterUser": false,
|
||||
"IsSignup": true,
|
||||
"UnibaseId": "",
|
||||
"OtpId": optid,
|
||||
"UserOtp": inputdetails
|
||||
});
|
||||
|
||||
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: raw,
|
||||
redirect: 'follow'
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: raw,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
|
||||
fetch(serverUrl + 'account/verifyotp', requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(function(result){
|
||||
let data = JSON.parse(result);
|
||||
if(data.result.contactConfirmed == true){
|
||||
document.getElementById('modal_Otp').style.display = 'none';
|
||||
document.getElementById('div_ResetPswd').style.display = 'block';
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
}else{
|
||||
let html = '<div class="p-2" ><span class="error-warning">Error !</span> Enter Valid OTP</div>' ;
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
let error = document.getElementById('div_ValidationSummary');
|
||||
error.insertAdjacentHTML('beforeend',html);
|
||||
}
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
}else{
|
||||
.then(response => response.text())
|
||||
.then(function(result) {
|
||||
let data = JSON.parse(result);
|
||||
if (data.result.contactConfirmed == true) {
|
||||
document.getElementById('modal_Otp').style.display = 'none';
|
||||
document.getElementById('div_ResetPswd').style.display = 'block';
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
} else {
|
||||
let html = '<div class="p-2" ><span class="error-warning">Error !</span> Enter Valid OTP</div>';
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
let error = document.getElementById('div_ValidationSummary');
|
||||
error.insertAdjacentHTML('beforeend', html);
|
||||
}
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function showSuccessBox() {
|
||||
let txt_NewPassword = document.getElementById('txt_NewPassword').value;
|
||||
let txt_ConfirmPassword = document.getElementById('txt_ConfirmPassword').value;
|
||||
if(txt_NewPassword == txt_ConfirmPassword){
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/json");
|
||||
var raw = JSON.stringify({
|
||||
"Password": txt_NewPassword,
|
||||
"UserName": unibaseid
|
||||
});
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: raw,
|
||||
redirect: 'follow'
|
||||
};
|
||||
fetch(serverUrl + 'account/updatepassword', requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(function(result){
|
||||
let updatepassword = JSON.parse(result);
|
||||
let message = updatepassword.message;
|
||||
if(message == 'Password Updated Successfully'){
|
||||
let txt_NewPassword = document.getElementById('txt_NewPassword').value;
|
||||
let txt_ConfirmPassword = document.getElementById('txt_ConfirmPassword').value;
|
||||
if (txt_NewPassword == txt_ConfirmPassword) {
|
||||
var myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "application/json");
|
||||
var raw = JSON.stringify({
|
||||
"Password": txt_NewPassword,
|
||||
"UserName": unibaseid
|
||||
});
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
headers: myHeaders,
|
||||
body: raw,
|
||||
redirect: 'follow'
|
||||
};
|
||||
fetch(serverUrl + 'account/updatepassword', requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(function(result) {
|
||||
let updatepassword = JSON.parse(result);
|
||||
let message = updatepassword.message;
|
||||
if (message == 'Password Updated Successfully') {
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
document.getElementById('div_ResetPswd').style.display = 'none';
|
||||
document.getElementById('div_SuccessMsg').style.display = 'block';
|
||||
}
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
|
||||
} else {
|
||||
let html = '<div class="p-2"> <span class="error-warning">Error !</span> Password Does not Match</div>';
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
document.getElementById('div_ResetPswd').style.display = 'none';
|
||||
document.getElementById('div_SuccessMsg').style.display = 'block';
|
||||
let error = document.getElementById('div_ValidationSummary');
|
||||
error.insertAdjacentHTML('beforeend', html);
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch(error => console.log('error', error));
|
||||
|
||||
}else{
|
||||
let html = '<div class="p-2"> <span class="error-warning">Error !</span> Password Does not Match</div>' ;
|
||||
document.getElementById('div_ValidationSummary').innerHTML = "";
|
||||
let error = document.getElementById('div_ValidationSummary');
|
||||
error.insertAdjacentHTML('beforeend',html);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +1,9 @@
|
||||
import { getCookie } from "./cookiehelper.js";
|
||||
import { initListIndex } from "./list.index.js";
|
||||
import {
|
||||
getCookie
|
||||
} from "./cookiehelper.js";
|
||||
import {
|
||||
initListIndex
|
||||
} from "./list.index.js";
|
||||
|
||||
initListIndex();
|
||||
|
||||
$('#detailBtn').click(function () {
|
||||
$('.bdy-ul').addClass('d-none');
|
||||
// Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(105013010001972,105010260000090,'Details','null',6,0,null)
|
||||
const cookie = getCookie('_idty');
|
||||
if (cookie) {
|
||||
const {
|
||||
unibaseId,
|
||||
tenantId,
|
||||
userId
|
||||
} = JSON.parse(cookie);
|
||||
debugger;
|
||||
$('#detailIframe').html(
|
||||
`<iframe width="100%" style="min-height:746px" name="srcframe" id="srcframe" class="srcframe" src="http://localhost:1188/#/${unibaseId}/${tenantId}/${userId}/106457720000011/100010270000325/loadDetail"></iframe>`
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
+137
-52
@@ -1,53 +1,94 @@
|
||||
/*Data loading start here*/
|
||||
import {
|
||||
getCookie
|
||||
} from "./cookiehelper.js";
|
||||
|
||||
import { getData, getDataObj } from "./base.js";
|
||||
|
||||
|
||||
import {
|
||||
getData,
|
||||
getDataObj
|
||||
} from "./base.js";
|
||||
|
||||
function loadData() {
|
||||
getData('apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20').then(function (result) {
|
||||
getData(
|
||||
"apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20"
|
||||
).then(function(result) {
|
||||
let response = JSON.parse(result.result);
|
||||
if (response.length != 0) { // Notifcations
|
||||
if (response.length != 0) {
|
||||
// Notifcations
|
||||
let bdyUI = '<div class="accordion" id="notifi-list">';
|
||||
for (var i = 0; i < response.length; i++) {
|
||||
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}">
|
||||
<div class="accordion-header" id="accHeader-${response[i].ReminderId}">
|
||||
<div class="notifiListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${response[i].ReminderId}" aria-expanded="false" aria-controls="collapseOne">
|
||||
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}">
|
||||
<div class="accordion-header" id="accHeader-${
|
||||
response[i].ReminderId
|
||||
}">
|
||||
<div class="notifiListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${
|
||||
response[i].ReminderId
|
||||
}" aria-expanded="false" aria-controls="collapseOne">
|
||||
<div class="row m-0 w-100 p-0 ">
|
||||
<div class="col-1 ">
|
||||
<input class="form-check-input mx-1" type="checkbox" value="" id="flexCheckDefault">
|
||||
</div>
|
||||
<div class="col-4 text-truncate">
|
||||
<span class="mx-1">${response[i].Subject}</span>
|
||||
<span class="mx-1">${
|
||||
response[i].Subject
|
||||
}</span>
|
||||
</div>
|
||||
<div class="col-5 text-truncate">
|
||||
<span class="mx-1">${response[i].Message}</span>
|
||||
<span class="mx-1">${
|
||||
response[i].Message
|
||||
}</span>
|
||||
</div>
|
||||
<div class="col-2 text-truncate">
|
||||
<span class="mx-1">${formatLocal(response[i].ReminderDate)}</span>
|
||||
<span class="mx-1">22 minutes ago</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="collapse-${response[i].ReminderId}" class="accordion-collapse collapse" aria-labelledby="accHeader-${response[i].ReminderId}" data-bs-parent="#notifi-list">
|
||||
<div class="accordion-body" id="accBody${response[i].ReminderId}">
|
||||
<div id="collapse-${
|
||||
response[i].ReminderId
|
||||
}" class="accordion-collapse collapse" aria-labelledby="accHeader-${
|
||||
response[i].ReminderId
|
||||
}" data-bs-parent="#notifi-list">
|
||||
<div class="accordion-body" id="accBody${
|
||||
response[i].ReminderId
|
||||
}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`;
|
||||
}
|
||||
bdyUI += '</div>'
|
||||
$('.bdy-ul').append(bdyUI);
|
||||
$('.notifiListItms').on('click', function () {
|
||||
let _this = $(this).parents('.item-li');
|
||||
let obj = { "FromDate": "2022/11/30", "InstalledAppId": Number($(_this).attr('data-installedAppId')), "RecordId": Number($(_this).attr('data-ref')), "ToDate": "2022/11/30" };
|
||||
bdyUI += "</div>";
|
||||
$(".bdy-ul").append(bdyUI);
|
||||
|
||||
$(".notifiListItms").on("click", function() {
|
||||
let _this = $(this).parents(".item-li");
|
||||
let obj = {
|
||||
FromDate: "2022/11/30",
|
||||
InstalledAppId: Number($(_this).attr("data-installedAppId")),
|
||||
RecordId: Number($(_this).attr("data-ref")),
|
||||
ToDate: "2022/11/30",
|
||||
};
|
||||
//let obj = { "FromDate": "2022/11/30", "InstalledAppId": 102530270000109, "RecordId": 102533490346298, "ToDate": "2022/11/30" };
|
||||
getDataObj('apis/v4/unibase/platform/widgets/getdefaultwidget', obj, true, "POST").then(function (response) {
|
||||
getDataObj(
|
||||
"apis/v4/unibase/platform/widgets/getdefaultwidget",
|
||||
obj,
|
||||
true,
|
||||
"POST"
|
||||
).then(function(response) {
|
||||
let res = JSON.parse(response.result),
|
||||
html = '';
|
||||
if (response.message == '200' && response.errors == null) {
|
||||
html = "";
|
||||
if (response.message == "200" && response.errors == null) {
|
||||
html = `<ul class="p-0 m-0 d-flex flex-row">`;
|
||||
if (res.AppConfigurations != null && res.AppConfigurations.length > 0) {
|
||||
if (
|
||||
res.AppConfigurations != null &&
|
||||
res.AppConfigurations.length > 0
|
||||
) {
|
||||
for (var k = 0; k < res.AppConfigurations.length; k++) {
|
||||
html += `<li class="mx-2 btn-outline-primary btn btn-sm">${res.AppConfigurations[k].SettingName}</li>`;
|
||||
}
|
||||
@@ -71,86 +112,130 @@ function loadData() {
|
||||
html += `<li><a class="dropdown-item" href="javascript:void(0);">${res.Stages[i].StageName}</a></li>`;
|
||||
}
|
||||
}
|
||||
html += '</ul></li>'
|
||||
html += "</ul></li>";
|
||||
} else {
|
||||
html += `<li class="p-1 my-0 alert alert-danger ml-auto" role="alert">
|
||||
No Stages
|
||||
</li>`;
|
||||
}
|
||||
html += `</ul>`;
|
||||
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>`;
|
||||
} else {
|
||||
html += `<div class="alert alert-danger" role="alert">
|
||||
${response.message} ${response.errors}
|
||||
</div>`
|
||||
</div>`;
|
||||
}
|
||||
$(_this).find('.accordion-body').html(html);
|
||||
$(_this).find(".accordion-body").html(html);
|
||||
detailClick();
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
getData('apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/20').then(function (tskResp) {
|
||||
let response = JSON.parse(tskResp.result)
|
||||
});
|
||||
getData(
|
||||
"apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/20"
|
||||
).then(function(tskResp) {
|
||||
let response = JSON.parse(tskResp.result);
|
||||
if (response.length != 0) {
|
||||
let _tskhtml = '<div class="accordion" id="task-list">';
|
||||
for (var i = 0; i < response.length; i++) {
|
||||
_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}">
|
||||
<div class="accordion-header" id="accHeader-${response[i].ReminderId}">
|
||||
<div class="tskListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${response[i].ReminderId}" aria-expanded="false" aria-controls="collapseOne">
|
||||
|
||||
_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}">
|
||||
<div class="accordion-header" id="accHeader-${
|
||||
response[i].ReminderId
|
||||
}">
|
||||
<div class="tskListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${
|
||||
response[i].ReminderId
|
||||
}" aria-expanded="false" aria-controls="collapseOne">
|
||||
<div class="row m-0 w-100 p-0 ">
|
||||
<div class="col-1 ">
|
||||
<input class="form-check-input mx-1" type="checkbox" value="" id="flexCheckDefault">
|
||||
</div>
|
||||
<div class="col-4 text-truncate">
|
||||
<span class="mx-1">${response[i].Subject}</span>
|
||||
<span class="mx-1">${
|
||||
response[i].Subject
|
||||
}</span>
|
||||
</div>
|
||||
<div class="col-5 text-truncate">
|
||||
<span class="mx-1">${response[i].Message}</span>
|
||||
<span class="mx-1">${
|
||||
response[i].Message
|
||||
}</span>
|
||||
</div>
|
||||
<div class="col-2 text-truncate">
|
||||
<span class="mx-1">${formatLocal(response[i].ReminderDate)}</span>
|
||||
<span class="mx-1">2 seconds</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="collapse-${response[i].ReminderId}" class="accordion-collapse collapse" aria-labelledby="accHeader-${response[i].ReminderId}" data-bs-parent="#notifi-list">
|
||||
<div class="accordion-body" id="accBody${response[i].ReminderId}">
|
||||
<div id="collapse-${
|
||||
response[i].ReminderId
|
||||
}" class="accordion-collapse collapse" aria-labelledby="accHeader-${
|
||||
response[i].ReminderId
|
||||
}" data-bs-parent="#notifi-list">
|
||||
<div class="accordion-body" id="accBody${
|
||||
response[i].ReminderId
|
||||
}">
|
||||
<ul class="p-0 m-0 d-flex flex-row justify-content-between">
|
||||
<li class="mx-2 btn-outline-success btn btn-sm">Confirm</li>
|
||||
<li class="mx-2 btn-outline-danger btn btn-sm">Reject</li>
|
||||
<li class="mx-2 btn-outline-primary btn btn-sm">Close</li>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`;
|
||||
}
|
||||
_tskhtml += '</div>'
|
||||
$('.bdy-ul').append(_tskhtml);
|
||||
_tskhtml += "</div>";
|
||||
$(".bdy-ul").append(_tskhtml);
|
||||
detailClick()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export function detailClick(){
|
||||
$('.detailBtn').click(function() {
|
||||
$('.bdy-ul').addClass('d-none');
|
||||
let installedAppId = +$(this).attr('data-appId');
|
||||
let recordId = +$(this).attr('data-recordId')
|
||||
// Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(105013010001972,105010260000090,'Details','null',6,0,null)
|
||||
const cookie = getCookie('_idty');
|
||||
if (cookie) {
|
||||
const {
|
||||
unibaseId,
|
||||
tenantId,
|
||||
userId
|
||||
} = JSON.parse(cookie);
|
||||
debugger;
|
||||
$('#detailIframe').html(
|
||||
`<iframe width="100%" style="min-height:746px" name="srcframe" id="srcframe" class="srcframe" src="http://localhost:3086/#/${unibaseId}/${tenantId}/${userId}/${recordId}/${installedAppId}/loadDetail"></iframe>`
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
export function initListIndex() {
|
||||
let _userInfo = atob(document.cookie.split('=')[1]);
|
||||
let userInfo = ' JSON.parse(_userInfo).result';
|
||||
let sessionId = 'userInfo.sessionId';
|
||||
let _userInfo = atob(document.cookie.split("=")[1]);
|
||||
let userInfo = " JSON.parse(_userInfo).result";
|
||||
let sessionId = "userInfo.sessionId";
|
||||
|
||||
let usrinfoHTML = `<li><a class="dropdown-item" href="javascript:void(0);">${userInfo.name}</a></li>
|
||||
<li><a class="dropdown-item" href="javascript:void(0);">Cloud Settings</a></li>
|
||||
<li><a class="dropdown-item" href="javascript:void(0);">Help</a></li>
|
||||
<li><a class="dropdown-item" href="javascript:void(0);">Logoff</a></li>`;
|
||||
$('.icn-circle').text(userInfo?.name?.charAt(0)?.toUpperCase())
|
||||
$('.uindtls').html(usrinfoHTML)
|
||||
$(".icn-circle").text(userInfo?.name?.charAt(0)?.toUpperCase());
|
||||
$(".uindtls").html(usrinfoHTML);
|
||||
|
||||
// List Page loading
|
||||
|
||||
/*Data loading start here*/
|
||||
$('.mnNvIcn').click(function () {
|
||||
$('.lft-nav-bar').toggleClass('lft-nav-bar-Wrap');
|
||||
$('.ctr-lst-pge').toggleClass('lft-nav-bar-Wrap');
|
||||
$(".mnNvIcn").click(function() {
|
||||
$(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
|
||||
$(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
|
||||
});
|
||||
loadData();
|
||||
}
|
||||
+97
-89
@@ -1,6 +1,14 @@
|
||||
import { setCookie } from "./cookiehelper.js";
|
||||
import {
|
||||
setCookie
|
||||
} from "./cookiehelper.js";
|
||||
import {
|
||||
_serverUrl
|
||||
} from "./setting.js";
|
||||
|
||||
|
||||
const serverUrl = _serverUrl();
|
||||
|
||||
|
||||
const serverUrl = 'http://localhost:1188/';
|
||||
const emailInputEl = document.getElementById('email');
|
||||
const passwordInputEl = document.getElementById('password');
|
||||
const emailErrEl = document.getElementById('emailErrMsg');
|
||||
@@ -16,124 +24,124 @@ passwordContainerEl.style.display = 'none';
|
||||
emailInputEl.focus();
|
||||
|
||||
function showPasswordBox() {
|
||||
const email = emailInputEl.value;
|
||||
if (validateEmailOrPhone()) {
|
||||
emailContainerEl.style.display = 'none';
|
||||
passwordContainerEl.style.display = 'block';
|
||||
document.getElementById('entered-email').innerHTML = email;
|
||||
passwordInputEl.focus();
|
||||
emailInputEl.classList.remove('error');
|
||||
emailErrEl.innerText = '';
|
||||
} else {
|
||||
emailInputEl.classList.add('error');
|
||||
emailErrEl.innerText = 'Please enter valid email or phone';
|
||||
}
|
||||
const email = emailInputEl.value;
|
||||
if (validateEmailOrPhone()) {
|
||||
emailContainerEl.style.display = 'none';
|
||||
passwordContainerEl.style.display = 'block';
|
||||
document.getElementById('entered-email').innerHTML = email;
|
||||
passwordInputEl.focus();
|
||||
emailInputEl.classList.remove('error');
|
||||
emailErrEl.innerText = '';
|
||||
} else {
|
||||
emailInputEl.classList.add('error');
|
||||
emailErrEl.innerText = 'Please enter valid email or phone';
|
||||
}
|
||||
}
|
||||
|
||||
function validateEmailOrPhone() {
|
||||
const value = emailInputEl.value.trim();
|
||||
const regx = /^[6-9]\d{9}$/;
|
||||
if (value.includes('@') || regx.test(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
const value = emailInputEl.value.trim();
|
||||
const regx = /^[6-9]\d{9}$/;
|
||||
if (value.includes('@') || regx.test(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function togglePassword() {
|
||||
const ele = document.getElementById('showPassword');
|
||||
const password = passwordInputEl;
|
||||
const ele = document.getElementById('showPassword');
|
||||
const password = passwordInputEl;
|
||||
|
||||
if (password.value.length > 0) {
|
||||
passwordInputEl.value = password.value;
|
||||
password.focus();
|
||||
if (ele.checked) {
|
||||
password.setAttribute('type', 'text');
|
||||
} else {
|
||||
password.setAttribute('type', 'password');
|
||||
if (password.value.length > 0) {
|
||||
passwordInputEl.value = password.value;
|
||||
password.focus();
|
||||
if (ele.checked) {
|
||||
password.setAttribute('type', 'text');
|
||||
} else {
|
||||
password.setAttribute('type', 'password');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onPasswordFocusOut() {
|
||||
const passwordLabel = document.getElementById('passwordLabel');
|
||||
if (passwordInputEl.value.length > 0) {
|
||||
passwordLabel.classList.add('password-fixed');
|
||||
} else {
|
||||
passwordLabel.classList.remove('password-fixed');
|
||||
}
|
||||
const passwordLabel = document.getElementById('passwordLabel');
|
||||
if (passwordInputEl.value.length > 0) {
|
||||
passwordLabel.classList.add('password-fixed');
|
||||
} else {
|
||||
passwordLabel.classList.remove('password-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
function onEmailFocusOut() {
|
||||
const emailLabel = document.getElementById('emailLabel');
|
||||
if (emailInputEl.value.trim()) {
|
||||
emailLabel.classList.add('password-fixed');
|
||||
} else {
|
||||
emailLabel.classList.remove('password-fixed');
|
||||
}
|
||||
const emailLabel = document.getElementById('emailLabel');
|
||||
if (emailInputEl.value.trim()) {
|
||||
emailLabel.classList.add('password-fixed');
|
||||
} else {
|
||||
emailLabel.classList.remove('password-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
function loginUser(email, password) {
|
||||
const postData = JSON.stringify({
|
||||
UserName: email,
|
||||
Password: password,
|
||||
UnibaseId: '',
|
||||
RememberMe: false,
|
||||
});
|
||||
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: postData,
|
||||
redirect: 'follow',
|
||||
};
|
||||
|
||||
fetch(serverUrl + 'account/login', requestOptions)
|
||||
.then((response) => response.text())
|
||||
.then((result) => {
|
||||
const data = JSON.parse(result);
|
||||
if (data.status === 0) {
|
||||
setCookie('_idty', JSON.stringify(data.result), 1);
|
||||
window.location = '../authentication';
|
||||
} else {
|
||||
passwordErrEl.innerText = data.message;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
passwordErrEl.innerText = error;
|
||||
const postData = JSON.stringify({
|
||||
UserName: email,
|
||||
Password: password,
|
||||
UnibaseId: '',
|
||||
RememberMe: false,
|
||||
});
|
||||
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: postData,
|
||||
redirect: 'follow',
|
||||
};
|
||||
|
||||
fetch(serverUrl + 'account/login', requestOptions)
|
||||
.then((response) => response.text())
|
||||
.then((result) => {
|
||||
const data = JSON.parse(result);
|
||||
if (data.status === 0) {
|
||||
setCookie('_idty', JSON.stringify(data.result), 1);
|
||||
window.location = '../authentication';
|
||||
} else {
|
||||
passwordErrEl.innerText = data.message;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
passwordErrEl.innerText = error;
|
||||
});
|
||||
}
|
||||
|
||||
function validateLogin() {
|
||||
const email = emailInputEl.value;
|
||||
const password = passwordInputEl.value;
|
||||
if (password.trim().length !== 0) {
|
||||
loginUser(email, password);
|
||||
} else {
|
||||
passwordInputEl.classList.add('error');
|
||||
passwordErrEl.innerText = 'Please enter valid password';
|
||||
}
|
||||
const email = emailInputEl.value;
|
||||
const password = passwordInputEl.value;
|
||||
if (password.trim().length !== 0) {
|
||||
loginUser(email, password);
|
||||
} else {
|
||||
passwordInputEl.classList.add('error');
|
||||
passwordErrEl.innerText = 'Please enter valid password';
|
||||
}
|
||||
}
|
||||
|
||||
function reEnterEmailClickHandler() {
|
||||
emailContainerEl.style.display = 'block';
|
||||
passwordContainerEl.style.display = 'none';
|
||||
emailInputEl.focus();
|
||||
emailContainerEl.style.display = 'block';
|
||||
passwordContainerEl.style.display = 'none';
|
||||
emailInputEl.focus();
|
||||
}
|
||||
|
||||
function initializeEventListeners() {
|
||||
emailNextBtn.addEventListener('click', showPasswordBox);
|
||||
emailNextBtn.addEventListener('click', showPasswordBox);
|
||||
|
||||
showPasswordChk.addEventListener('click', togglePassword);
|
||||
showPasswordChk.addEventListener('click', togglePassword);
|
||||
|
||||
passwordInputEl.addEventListener('focusout', onPasswordFocusOut);
|
||||
passwordInputEl.addEventListener('focusout', onPasswordFocusOut);
|
||||
|
||||
emailInputEl.addEventListener('focusout', onEmailFocusOut);
|
||||
emailInputEl.addEventListener('focusout', onEmailFocusOut);
|
||||
|
||||
loginSubmitBtn.addEventListener('click', validateLogin);
|
||||
loginSubmitBtn.addEventListener('click', validateLogin);
|
||||
|
||||
renterEmailLink.addEventListener('click', reEnterEmailClickHandler);
|
||||
renterEmailLink.addEventListener('click', reEnterEmailClickHandler);
|
||||
}
|
||||
|
||||
initializeEventListeners();
|
||||
initializeEventListeners();
|
||||
@@ -0,0 +1,3 @@
|
||||
export function _serverUrl() {
|
||||
return 'http://localhost:3086/';
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
<input type="text" class="form-control" id="searchBar" placeholder="Search here">
|
||||
</li>
|
||||
<li class="ml-auto">
|
||||
<button class="btn btn-outline-primary" id="detailBtn">Detail</button>
|
||||
<button class="btn btn-sm btn-outline-primary detailBtn" id="detailBtn">Detail</button>
|
||||
<span><i class="la la-question-circle"></i></span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -92,6 +92,13 @@
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
window.addEventListener('message', function (e) {
|
||||
debugger;
|
||||
$('#detailIframe').empty();
|
||||
$('.bdy-ul').removeClass('d-none');
|
||||
//do stuff
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="form-body">
|
||||
<div class="form-input-wrap">
|
||||
<div class="form-group">
|
||||
<input type="text" id="email" class="email-input">
|
||||
<input type="text" id="email" class="email-input" value="common_20220630_1453@bizgaze.com">
|
||||
<label class="form-control-placeholder" id="emailLabel" for="email">Email or phone</label>
|
||||
</div>
|
||||
<div class="err-msg" id="emailErrMsg"></div>
|
||||
@@ -53,14 +53,13 @@
|
||||
<div class="form-body password-form-box">
|
||||
<div class="form-input-wrap">
|
||||
<div class="form-group">
|
||||
<input type="password" id="password" class="password-input">
|
||||
<input type="password" id="password" class="password-input" value="UABvAHcAbgBlAHIAcwBAADEAMgAzAA==!~`^e_n_c-^`~!">
|
||||
<label class="form-control-placeholder" id="passwordLabel" for="password">Enter Your
|
||||
Password</label>
|
||||
</div>
|
||||
<div class="err-msg" id="passwordErrMsg"></div>
|
||||
<div class="form-link show-password-link flex-between-center">
|
||||
<div class="flex-between-center"><input type="checkbox" id="showPassword"
|
||||
class="password-checkbox">
|
||||
<div class="flex-between-center"><input type="checkbox" id="showPassword" class="password-checkbox">
|
||||
<label for="showPassword">Show password</label></div>
|
||||
<label><a href="../forgotpassword">Forgot password?</a></label>
|
||||
</div>
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle