- -
+
-
${appName}
@@ -53,13 +53,7 @@ function createLoad(data) {
-
-
-
+
@@ -79,11 +73,11 @@ function hdrCrtnClckEvnt(number) {
let isPopUpState = $(this).attr("data-ispopup");
let height = $(`.frm-ifre-${id}`).find(".frm-hdr").height();
$(".list-page").css({filter: "unset", opacity: 1});
- $(`.frm-ifre-${id} .frm-hdr`).toggleClass("d-none");
$(`.frm-ifre-${id} .frm-bdy`).toggleClass("d-none");
if (isPopUpState == "true") {
// popup large
$(this).attr("data-ispopup", "false");
+ $(this).parents('.frm-hdr').removeClass('d-none').attr('data-frm_hdr', 'false');
$(`.frm-ifre-${id} .maximum`).addClass("d-none");
$(`.frm-ifre-${id} .minimize`).attr("data-ispopup", "false");
$(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
@@ -96,6 +90,7 @@ function hdrCrtnClckEvnt(number) {
} else {
// popup small
$(this).attr("data-ispopup", "true");
+ $(this).parents('.frm-hdr').addClass('d-none').attr('data-frm_hdr', 'true');
$(`.frm-ifre-${id} .maximum`).removeClass("d-none");
$(`.frm-ifre-${id} .minimize`).attr("data-ispopup", "true");
$(`.frm-ifre-${id}`).attr("data-ispop_up", "true");
@@ -104,6 +99,9 @@ function hdrCrtnClckEvnt(number) {
height: "",
bottom: "",
});
+ if($(this).parents('.frm-hdr').attr("data-saveform") == 'true'){
+ $(this).parents('.frm-hdr').removeClass('d-none')
+ }
}
resetwidth();
});
@@ -136,264 +134,90 @@ function hdrCrtnClckEvnt(number) {
resetwidth();
});
}
-function loadData() {
- $(".bdy-ul").empty();
- $('[class="refrsh"]')
- .unbind()
- .on("click", function () {
- loadData();
- });
- $('[data-clck="ri-grid-fill"]').on("click", function () {
- $(".apps-list").toggleClass("d-flex");
- });
- getData("apis/v4/unibase/platform/apps/myapps").then(function (response) {
- let result = JSON.parse(response.result);
- let html = "";
- for (var i = 0; i < result.length; i++) {
- html += `
${result[i].AppTitle}`;
- }
- $("#apps-list").html(html);
- $("li.appsBind").on("click", function () {
- $(".apps-list").removeClass("d-flex");
- });
- });
- getData(
- "apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20"
- ).then(function (result) {
- let response = JSON.parse(result.result);
+function loadData(ApiPath, isSentBy) {
+ $(".bdy-ul").empty().removeClass("d-none");
+ $(".hdr-ul").removeClass("d-none");
+ getData(ApiPath).then(function (result) {
+ let response = JSON.parse(result.result),
+ html = "";
+ const cookie = getCookie("_idty");
if (response.length != 0) {
- // Notifcations
- let bdyUI = '
';
- for (var i = 0; i < response.length; i++) {
- bdyUI += `
-
- `;
- }
- bdyUI += "";
- $(".bdy-ul").append(bdyUI);
- $('.sub-nav-item[data-buttonType="inbox"] .length').remove();
- $('.sub-nav-item[data-buttonType="inbox"]').append(
- `
`
- );
- $(".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) {
- let res = JSON.parse(response.result),
- html = "";
- if (response.message == "200" && response.errors == null) {
- html = `
`;
- if (
- res.AppConfigurations != null &&
- res.AppConfigurations.length > 0
- ) {
- for (var k = 0; k < res.AppConfigurations.length; k++) {
- html += `- ${res.AppConfigurations[k].SettingName}
`;
- }
- } else {
- html += `-
- App Configurations Not configure
-
`;
- }
- if (res.Stages != null) {
- for (var x = 0; x < res.Stages.length; x++) {
- if (res.Stages[x].IsDefault) {
- html += `-
-
- ${res.Stages[x].StageName}
-
-
";
- } else {
- html += `-
- No Stages
-
`;
- }
- html += `- Details-Page
`;
- } else {
- html += `
- ${response.message} ${response.errors}
-
`;
- }
- $(_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);
- if (response.length != 0) {
- let _tskhtml = '
';
- for (var i = 0; i < response.length; i++) {
- _tskhtml += `
-
- `;
- }
- _tskhtml += "";
- $(".bdy-ul").append(_tskhtml);
- detailClick();
- }
- });
-
- // create button apps load
- let appName = [];
- getData("apis/v4/unibase/platform/apps/myapps").then(function (res) {
- let response = JSON.parse(res.result);
- jQuery.each(response, async function (index, item) {
- let installedAppId = Number(item.MyAppId);
- await getData(
- `apis/v4/unibase/platform/apps/listappconfigurations/installedappid/${installedAppId}`
- ).then(function (result) {
- if (
- result.result != null &&
- result.result != "" &&
- result.result != "[]"
- ) {
- let _data = JSON.parse(result.result);
- let data = _data.filter((x) => x.SettingUrlType == 1);
- if (data.length != 0) {
- appName.push({
- SettingUrlType: data[0].SettingUrlType,
- AppTitle: data[0].AppTitle,
- FormId: data[0].FormId,
- InstalledAppId: data[0].InstalledAppId,
- RoleSettingAppId: data[0].RoleSettingAppId,
- InstalledAppGuid: data[0].InstalledAppGuid,
- AppConfigurationId: data[0].AppConfigurationId,
- AppPermissionId: data[0].AppPermissionId,
- AppConfigType: data[0].AppConfigType,
- });
- }
+ response.forEach(function (Item, index) {
+ let isSent = false;
+ if (Item.FromUserName == JSON.parse(cookie).name) {
+ isSent = true;
}
+ if (Item.FromUserName == null) {
+ Item.FromUserName = 'Please check it Notification Team';
+ }
+ //if(window.innerWidth >1024){ // Desktop Width
+ html += `
`;
+ html += ``; // check-box
+ html += ``;
+ html += `
${Item.FromUserName}
`;
+ html += `
${Item.Subject}
-
`; // Subject
+ html += `
${Item.Message}
`; // Message
+ html += `
`;
+ html += `${dateTimeFormat(
+ Item.ReminderDate
+ )}
`;
+ html += `
+
`;
+ if (Item.RedirectOptions.CreateFormId != 0) {
+ html += ` `;
+ } else {
+ html += ` `;
+ }
+ html += `
+
`;
+ html += "";
+ /* }else{ // Mobile Width card view
+ html += `
`
+ html += ` S
+
+
+ ${Item.FromUserName}
+ ${dateTimeFormat(
+ Item.ReminderDate
+ )}
+
+
${Item.Subject}
+
${Item.Message}`;
+ if (Item.ReminderTypeId == 1) {
+ html += ``;
+ } else {
+ html += ``;
+ }
+ html += `
+
`
+ html +=``
+ }*/
+
});
- await createLoad(appName);
- });
+ $(".ctr-lst-pge .bdy-ul").html(html);
+ if (isSentBy) {
+ $(".pdng.lst-Notifi").addClass("d-none");
+ $(".pdng.lst-Notifi[data-issentby='true']").removeClass("d-none");
+ }
+ detailClick();
+ //stagesLoad();
+ }
});
getData("apis/v4/unibase/reminders/platform/getunreadreminderscount").then(
function (response) {
let result = JSON.parse(response.result);
let count = Number(result.NotificationCount) + Number(result.TasksCount);
- $('[data-buttontype="inbox"] .length').text(count);
+ $('[data-buttontype="inbox"] .length.rounded-pill').remove();
+ $('[data-buttontype="inbox"]').append(
+ `
${count}`
+ );
$('[data-notification="count"]').text(count);
if (count > 40) {
$('[data-paggtn="true"]').text(`1-40`);
@@ -402,10 +226,15 @@ function loadData() {
}
}
);
+ if(window.innerWidth() < 1024){
+ $('.ctr-lst-pge').on('click', function(){
+ $('.mnNvIcn').click()
+ })
+ }
}
function iFrmeWdth() {
let width = 0,
- erwdth = 32;
+ erwdth = 15;
$(".frm-ifre").each(function (i, e) {
if ($(this).length == 0) {
erwdth = 0;
@@ -418,7 +247,7 @@ function iFrmeWdth() {
}
function resetwidth() {
let width = 0,
- erwdth = 32;
+ erwdth = 15;
$(".frm-ifre").each(function (i, e) {
if (i == 0) {
$(this).css("right", width + "px");
@@ -432,22 +261,74 @@ function resetwidth() {
});
}
export function detailClick() {
- $(".detailBtn").click(function () {
- let serverUrl = _serverUrl();
- $(".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);
+ // Details Popup Abihram popup page
+ $(".wi-sbjt-msge").on("click", function (e) {
+ e.stopPropagation();
+ detailsPage(this, true, "Details-page");
+ });
+ // Details Page Loading
+ $(".detailBtn[data-urltype='Details']").click(function (e) {
+ e.stopPropagation();
+ detailsPage(this, false, "Details-page");
+ });
+ //Form Page Loading
+ $(".formBtn[data-urltype='Form']").on("click", function (e) {
+ e.stopPropagation();
+ detailsPage(this, true, "Form-page");
+ });
+ //List Page Loading
+ $("[data-urltype='List']").on("click", function (e) {
+ e.stopPropagation();
+ detailsPage(this, true, "List-page");
+ });
+ // get stages
+}
+export function detailsPage(e, ifrmPopup, isPage) {
+ let serverUrl = _serverUrl();
+ $(".bdy-ul").addClass("d-none");
+ $(".hdr-ul").addClass("d-none");
+ let installedAppId = $(e)
+ .parents(".pdng.lst-Notifi")
+ .attr("data-instlledappid");
+ let recordId = $(e).parents(".pdng.lst-Notifi").attr("data-refid");
+ let reminderid = $(e).parents(".pdng.lst-Notifi").attr("data-reminderid");
+ let remindertype = $(e)
+ .parents(".pdng.lst-Notifi")
+ .attr("data-remindertypeid");
+ // 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);
+ if (isPage == "Details-page") {
$("#detailIframe").html(
`
`
+ ).height()}px)" name="srcframe" id="srcframe" class="srcframe" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${recordId}/${installedAppId}/${remindertype}/${reminderid}/${ifrmPopup}/loadDetail">`
+ );
+ } else if (isPage == "Form-page") {
+ getData(
+ `apis/v4/unibase/platform/apps/listappconfigurations/installedappid/${installedAppId}`
+ ).then(function (result) {
+ let _data = JSON.parse(result.result);
+ let data = _data.filter((x) => x.SettingUrlType == 1);
+ $("#detailIframe").html(
+ `
`
+ );
+ });
+ } else if (isPage == "List-page") {
+ $("#detailIframe").html(
+ `
`
);
}
- });
+ }
}
export function signaRInit() {
var huburl = _serverUrl() + "notificationhub";
@@ -459,7 +340,10 @@ export function signaRInit() {
export async function register() {
connection.on("sendnotification", (obj) => {
$(".ctr-lst-pge .bdy-ul").empty();
- loadData();
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ false
+ );
});
const cookie = getCookie("_idty");
const {unibaseId, tenantId, userId, sessionId, name} = JSON.parse(cookie);
@@ -486,16 +370,16 @@ export function resetClckEvnt() {
}
export function initListIndex() {
- let _userInfo = atob(document.cookie.split("=")[1]);
- let userInfo = " JSON.parse(_userInfo).result";
- let sessionId = "userInfo.sessionId";
+ let userInfo = JSON.parse(getCookie("_idty"));
+ let sessionId = userInfo.sessionId;
+
signaRInit();
- let usrinfoHTML = `
${userInfo.name}
-
Cloud Settings
-
Help
+ let usrinfoHTML = `
${userInfo.name}
+
Help
Logoff`;
$(".icn-circle").text(userInfo?.name?.charAt(0)?.toUpperCase());
$(".uindtls").html(usrinfoHTML);
+
$('[data-btn="logoff"]').on("click", function () {
document.cookie = "_idty=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
window.location = "../login";
@@ -526,8 +410,17 @@ export function initListIndex() {
}
);
$(".mnNvIcn").click(function () {
- $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
- $(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
+ $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
+ $(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
+ if ($(".apps-loading:visible").length != 0) {
+ $(".ctr-lst-pge").css("width", "");
+ $(".ctr-lst-pge").toggleClass("apps-loaded");
+ $(".ctr-lst-pge").toggleClass("apps-loaded-tr");
+ }
+ if(window.innerWidth < 1025){
+ $(".ctr-lst-pge").toggleClass('d-block');
+ $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap d-flex w-100").css('background-color','rgb(0 0 0 / 50%)');
+ }
});
$(".mre-drp a.sub-nav-item.more").on("click", function () {
$(".sub-nav-item").removeClass("active");
@@ -547,9 +440,240 @@ export function initListIndex() {
$(this).addClass("active");
});
+ $('[data-buttontype="inbox"], [data-application="Mail Application"]').on(
+ "click",
+ function () {
+ $("#detailIframe").empty();
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ false
+ );
+ }
+ );
+ window.addEventListener("message", function (e) {
+ if (e.data != undefined) {
+ if(e.data == "Edit-form"){
+ $('.frm-hdr').addClass('d-none')
+ }
+ if (e.data == "closeForm") {
+ $("#detailIframe").empty();
+ $(".hdr-ul, .bdy-ul").removeClass("d-none");
+ $('.frm-bdy [class="close"]')[0].click();
+ }
+ if (e.data == "clickToBack") {
+ $("#detailIframe").empty();
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ false
+ );
+ }
+ if (e.data.includes("save-form")) {
+ let spilt = e.data.split("/");
+ $(`.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr`).removeClass(
+ "d-none"
+ ).attr('data-frm_hdr','false');
+ }
+ if (e.data == "close apps") {
+ $("body").removeClass("d-flex flex-row");
+ $("#detailIframe").empty();
+ $(".hdr-ul, .bdy-ul").removeClass("d-none");
+ $(".apps-loading").remove();
+ $("#list-page").css("width", "100%");
+ $(".lft-nav-bar").removeClass(".lft-nav-bar-Wrap");
+ $(".ctr-lst-pge").removeClass("apps-loaded");
+ $(".ctr-lst-pge").removeClass("apps-loaded-tr");
+ }
+ if (e.data.includes("/")) {
+ let spilt = e.data.split("/");
+ $(
+ `.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr .ctrl .${spilt[0]}`
+ ).click();
+ if(spilt[0].includes('success')){
+ $(`.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr`).removeClass("d-none").attr({'data-frm_hdr': 'false', 'data-saveform':'true'});
+ }
+ if(!spilt[0].includes('maximum') && !spilt[0].includes('compress')){
+ $(`.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr`).removeClass("d-none").attr({'data-frm_hdr': 'false'});
+ }
+ }
+ if (e.data == "closeForm_detailIframe") {
+ $("#detailIframe").empty();
+ $(".hdr-ul, .bdy-ul").removeClass("d-none");
+ }
+ }
+ });
+ $('[class="refrsh"]').on("click", function () {
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ false
+ );
+ });
+
+ getData("apis/v4/unibase/platform/apps/myapps").then(function (response) {
+ if(response.message.includes("User Authentication Failed")){
+ window.location = "../login";
+ }else{
+ let result = JSON.parse(response.result);
+ let html = "
";
+ for (var i = 0; i < result.length; i++) {
+ html += `- `;
+ if (
+ result[i].SvgIconUrl != undefined &&
+ result[i].SvgIconUrl != null &&
+ result[i].SvgIconUrl != ""
+ ) {
+ html += `${result[i].SvgIconUrl}`;
+ } else {
+ html +=
+ '';
+ }
+ html += `${result[i].AppTitle}
`;
+ }
+ html += "
";
+ $("#apps-list").html(html);
+ $(".appsBind").on("click", function () {
+ let width = "330px";
+ if(window.innerWidth> 1024){
+ $("#list-page").css("width", `calc(100% - ${width})`);
+ }
+ if( $('.lft-nav-bar-2:visible').length !=0 ){
+ $(".ctr-lst-pge").addClass("apps-loaded-tr");
+ }else{
+ $(".ctr-lst-pge").addClass("apps-loaded lft-nav-bar-Wrap")
+ }
+ let installedAppId = $(this).attr("data-myappid");
+ const cookie = getCookie("_idty");
+ if (cookie) {
+ let serverUrl = _serverUrl();
+ const {unibaseId, tenantId, userId} = JSON.parse(cookie);
+ $("body").addClass("d-flex flex-row");
+ $(".apps-loading").remove();
+ $("#list-page").after(
+ `
`
+ );
+ }
+ });
+ }
+ });
+ $(".btn.dropdown-toggle.create").on("click", function () {
+ let appName = [];
+ getData("apis/v4/unibase/platform/apps/myapps").then(async function (res) {
+ let response = await JSON.parse(res.result);
+ jQuery.each(response, async function (index, item) {
+ let installedAppId = Number(item.MyAppId);
+ await getData(
+ `apis/v4/unibase/platform/apps/listappconfigurations/installedappid/${installedAppId}`
+ ).then(function (result) {
+ if (
+ result.result != null &&
+ result.result != "" &&
+ result.result != "[]"
+ ) {
+ let _data = JSON.parse(result.result);
+ let data = _data.filter((x) => x.SettingUrlType == 1);
+ if (data.length != 0) {
+ appName.push({
+ SettingUrlType: data[0].SettingUrlType,
+ AppTitle: data[0].AppTitle,
+ FormId: data[0].FormId,
+ InstalledAppId: data[0].InstalledAppId,
+ RoleSettingAppId: data[0].RoleSettingAppId,
+ InstalledAppGuid: data[0].InstalledAppGuid,
+ AppConfigurationId: data[0].AppConfigurationId,
+ AppPermissionId: data[0].AppPermissionId,
+ AppConfigType: data[0].AppConfigType,
+ });
+ }
+ }
+ });
+ await appName.sort(function (a, b) {
+ var a1 = a.AppTitle.toLowerCase().trim(), b1 = b.AppTitle.toLowerCase().trim();
+ if (a1 == b1) return 0;
+ return a1 > b1 ? 1 : -1;
+ });
+ await createLoad(appName);
+ });
+ });
+ });
+ $('[data-buttontype="Starred"]').on("click", function () {
+ let count = 20;
+ if (
+ $('[data-buttontype="inbox"] .length').attr("data-taskscount") !=
+ undefined
+ ) {
+ count = $('[data-buttontype="inbox"] .length').attr("data-taskscount");
+ }
+ loadData(
+ `apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/${count}`,
+ false
+ );
+ });
+
+ $('[data-buttontype="unstarred"]').on("click", function () {
+ let count = 20;
+ if (
+ $('[data-buttontype="inbox"] .length').attr("data-notificount") !=
+ undefined
+ ) {
+ count = $('[data-buttontype="inbox"] .length').attr("data-notificount");
+ }
+ loadData(
+ `apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/${count}`,
+ false
+ );
+ });
+ $('[data-buttontype="all"]').on("click", function () {
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ false
+ );
+ });
+ $('[data-buttontype="read"]').on("click", function () {
+ $(".pdng.lst-Notifi").addClass("d-none");
+ $(".pdng.lst-Notifi[data-isreaded='2']").removeClass("d-none");
+ });
+ $('[data-buttontype="unread"]').on("click", function () {
+ $(".pdng.lst-Notifi").addClass("d-none");
+ $(".pdng.lst-Notifi[data-isreaded='8']").removeClass("d-none");
+ });
+ $('[data-buttontype="sent"]').on("click", function () {
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ true
+ );
+ });
try {
- loadData();
+ loadData(
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
+ false
+ );
} catch (error) {
console.log("LoadData Method is not loading, and getting error");
}
}
+
+export function stagesLoad() {
+ $(".stgs-li").each(function () {
+ let html = "";
+ let InstalledAppId = $(this).attr("data-installedappid");
+ getData(
+ `apis/v4/unibase/platform/apps/getallchangestageroles/installedappid/${InstalledAppId}`
+ ).then(function (stg_rslt) {
+ let data = JSON.parse(stg_rslt.result);
+ let _stage = data.filter(function (o) {
+ return o.IsDefault == true;
+ });
+ html += `
+ ";
+ $(`.stgs-li[data-installedappid='${InstalledAppId}']`).html(html);
+ });
+ });
+}
diff --git a/authentication/index.html b/authentication/index.html
index 7c6148a..ee046c8 100644
--- a/authentication/index.html
+++ b/authentication/index.html
@@ -36,7 +36,7 @@
-
+
@@ -48,13 +48,13 @@
-
+
-
-
+
@@ -88,14 +88,14 @@
-
+
Drive
-
+
Meet
@@ -112,10 +112,6 @@
Create
@@ -126,30 +122,30 @@