Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lfinance into feature/bugfixes-dev
  • Loading branch information
npy11 authored and npy11 committed Oct 8, 2024
2 parents 397389d + 0002c34 commit 9abcebd
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 25 deletions.
30 changes: 26 additions & 4 deletions blocks/applyloanform/loanformapiurls.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
const accessTokenURL = "https://mobileapi.pchf.in/api/mobile/access-token";
const generateOTPURL = "https://mobileapi.pchf.in/api/website/generate-otp";
// V1 API URL
// const accessTokenURL = "https://mobileapi.pchf.in/api/mobile/access-token";

// V2 API URL
const accessTokenURL = "https://campaignapi.piramalfinance.com/api/account/access-token";

// V1 API URL
// const generateOTPURL= "https://mobileapi.pchf.in/api/website/generate-otp";

// V2 API URL
const generateOTPURL = "https://campaignapi.piramalfinance.com/api/website/generate-otp";

// V1 API URL
// const resendOTPUrl = "https://mobileapi.pchf.in/api/website/resend-otp";

// V2 API URL
const resendOTPUrl = "https://campaignapi.piramalfinance.com/api/website/resend-otp";

// V1 API URL
// const verifyOTPURL = "https://mobileapi.pchf.in/api/website/verify-otp";

// V2 API URL
const verifyOTPURL = "https://campaignapi.piramalfinance.com/api/website/verify-otp";

// V1 API URL
const otpTokenURL = "https://apisit.piramal.com/oauth/v1/cc/accesstoken";
const smsURL = "https://apisit.piramal.com/communication/v2/karix/sms-query?ver=1.0&key=HbUcyrewWm27hdKRZyj2zA%3D%3D&encrypt=0&send=PIRCHF&dest=8007359739&text=Please%20use%20this%20one-time%20password%20for%20Piramal%20User%20Account%20Verification%3A%209106.%20DO%20NOT%20SHARE%20THIS%20WITH%20ANYONE%20and%20it%20is%20valid%20for%205%20minutes%20only";
const leadAPIURL = "https://mobileapi.pchf.in/api/website/insert-lead-data";
const verifyOTPURL = "https://mobileapi.pchf.in/api/website/verify-otp";
const resendOTPUrl = "https://mobileapi.pchf.in/api/website/resend-otp";
const getWhatAPIAuthURL = "https://piramal.allincall.in/campaign/external/get-auth-token/";
const getWhatAPIURL = "https://piramal.allincall.in/campaign/external/send-event-based-triggered-whatsapp-campaign/";

export { accessTokenURL, generateOTPURL, otpTokenURL, smsURL, leadAPIURL, verifyOTPURL, resendOTPUrl, getWhatAPIAuthURL, getWhatAPIURL };
Empty file.
30 changes: 30 additions & 0 deletions blocks/schema-tag/schema-tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export default function decorate(block) {
// document.head += (block.textContent);

// const schema = {
// "@context": "https://schema.org",
// "@type": "Organization",
// "name": "Apply for a Home loan online with Piramal Finance 1 ",
// "url": "https://www.piramalfinance.com/",
// "logo": "/",
// "contactPoint": {
// "@type": "ContactPoint",
// "telephone": "1800-266-9777",
// "contactType": "customer service",
// "areaServed": "IN",
// "availableLanguage": "en"
// },
// "sameAs": [
// "https://www.facebook.com/pf",
// "https://twitter.com/pf",
// "https://www.instagram.com/pf/",
// "https://www.youtube.com/pfInsurance",
// "https://www.linkedin.com/company/pf"
// ]
// }
const script = document.createElement('script')
script.type = "application/ld+json";
script.innerHTML = block.textContent;
block.innerHTML = '';
document.head.append(script)
}
13 changes: 6 additions & 7 deletions blocks/teaser/teaser.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ export function generateTeaserDOM(props, classes) {
);
}

console.log("Purge test ")
teaserDOM?.querySelectorAll("a").forEach(function (el, index) {
el.addEventListener("click", function (e) {
try {
if(!e.target.closest(".calc-desktop-carousel-wrapper")){
if (index || e.target.closest(".cta")) {
bannerClick(e.target.innerText, targetObject.pageName);
if (!e.target.closest(".calc-desktop-carousel-wrapper")) {
if (index || e.target.closest(".cta")) {
bannerClick(e.target.innerText, targetObject.pageName);
}
} else if (this.closest('.carousel-articles-wrapper')) {
readMoreAnalytics(e);
Expand All @@ -137,13 +136,13 @@ export function generateTeaserDOM(props, classes) {
data.click_text = e.target.closest('.long-description').querySelector('p').textContent.trim();
data.cta_position = e.target.closest('.section').querySelector('.tab-name-wrapper .carousel-inner .active').textContent.trim();
ctaClickInteraction(data);
} else if(e.target.closest(".calc-desktop-carousel-wrapper")){
} else if (e.target.closest(".calc-desktop-carousel-wrapper")) {
let data = {};
data.click_text =e.target.closest(".text").querySelector(".long-description p").textContent.trim();
data.click_text = e.target.closest(".text").querySelector(".long-description p").textContent.trim();
data.cta_position = e.target.closest('.section').querySelector('.default-content-wrapper').textContent.trim();
ctaClickInteraction(data);
}
else {
else {
applyLoanNow(
eyebrow.textContent.trim() + " " + title.textContent.trim(),
targetObject.pageName,
Expand Down
28 changes: 28 additions & 0 deletions component-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@
}
}
},
{
"title": "Table Tag",
"id": "table-tag",
"plugins": {
"xwalk": {
"page": {
"resourceType": "core/franklin/components/block/v1/block",
"name": "Table Tag",
"model": "table-tag"
}
}
}
},
{
"title": "Hero",
"id": "hero",
Expand Down Expand Up @@ -1004,6 +1017,21 @@
}
}
}
},
{
"title": "Schema Tag",
"id": "schema-tag",
"plugins": {
"xwalk": {
"page": {
"resourceType": "core/franklin/components/block/v1/block",
"template": {
"name": "Schema Tag",
"model": "schema-tag"
}
}
}
}
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions component-filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"testimonial",
"financialreports",
"faq",
"table-tag",
"schema-tag",
"offer-documents",
"carousel",
"teaser",
Expand Down
32 changes: 31 additions & 1 deletion component-models.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,25 @@
}
]
},
{
"id": "table-tag",
"fields": [
{
"component": "text",
"valueType": "number",
"name": "columns",
"value": "",
"label": "Columns"
},
{
"component": "text",
"valueType": "number",
"name": "rows",
"value": "",
"label": "Rows"
}
]
},
{
"id": "card",
"fields": [
Expand Down Expand Up @@ -2754,5 +2773,16 @@
"label": "URL Text"
}
]
},
{
"id": "schema-tag",
"fields": [
{
"component": "text",
"valueType": "string",
"name": "schema-tag",
"label": "Schema Tag"
}
]
}
]
]
3 changes: 2 additions & 1 deletion paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"/content/piramalfinance-eds/in/en/api/branch-locator:/api/branch-locator.json",
"/content/piramalfinance-eds/in/en/api/branchlocatorobj:/api/branchlocatorobj.json",
"/content/piramalfinance-eds/in/en/api/updatesheet:/api/updatesheet.json",
"/content/piramalfinance-eds/in/en/api/branchloanmapping:/api/branchloanmapping.json"
"/content/piramalfinance-eds/in/en/api/branchloanmapping:/api/branchloanmapping.json",
"/content/piramalfinance-eds/in/en/api/flat-demo:/api/flat-demo.json"
]
}
24 changes: 12 additions & 12 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ function decorateImageIcons(element, prefix = '') {
let { href } = anchor;
let imageName = '';

if(href.includes('/play.google.com-s/')){
if (href.includes('/play.google.com-s/')) {
anchor.href = href.replace('play.google.com-s', "play.google.com");
}else if(href.includes('/apps.apple.com-s/')){
} else if (href.includes('/apps.apple.com-s/')) {
anchor.href = href.replace('apps.apple.com-s', "apps.apple.com");
}else if (href.includes('play.google.com')) {
} else if (href.includes('play.google.com')) {
imageName = 'playstore';
} else if (href.includes('apps.apple.com')) {
imageName = 'appstore';
Expand Down Expand Up @@ -855,7 +855,7 @@ export function showingStateCity(searchInputAll) {
eachLi.classList.remove("dp-none");
});
});
}
}

setTimeout(() => {
try {
Expand Down Expand Up @@ -907,7 +907,7 @@ function renderSchema() {
const schema = {
"@context": "https://schema.org",
"@type": "Organization",
"name": "Apply for a Home loan online with Piramal Finance ",
"name": "Apply for a Home loan online with Piramal Finance 1 ",
"url": "https://www.piramalfinance.com/",
"logo": "/",
"contactPoint": {
Expand All @@ -932,26 +932,26 @@ function renderSchema() {
}
renderSchema();

export function getDay(){
export function getDay() {
const date = new Date();
const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const currentDayOfWeek = daysOfWeek[date.getDay()];
return currentDayOfWeek
}


export function branchURLStr(location = "", city = "", state = "", urlstrhand, locationcode = ""){
export function branchURLStr(location = "", city = "", state = "", urlstrhand, locationcode = "") {
let locationAdd = location?.replace(/\s+/g, "-").replace(/[()/]/g, "").trim().toLowerCase();
let cityStr = city?.replace(/\s+/g, "-").replace(/[()/]/g, "").trim().toLowerCase();
let stateStr = state?.replace(/\s+/g, "-").replace(/[()/]/g, "").trim().toLowerCase();
if(urlstrhand == "shorthand"){
if (urlstrhand == "shorthand") {
return `/branch-locator/${stateStr}/${cityStr}`;
}else if(urlstrhand == "shorthandstate"){
} else if (urlstrhand == "shorthandstate") {
return `/branch-locator/${stateStr}`;
}else if(urlstrhand == "loans"){
if(locationAdd == cityStr){
} else if (urlstrhand == "loans") {
if (locationAdd == cityStr) {
return `/branch-locator/loans-in-${cityStr}-${stateStr}-${locationcode}`;
}else{
} else {
return `/branch-locator/loans-in-${locationAdd}-${cityStr}-${stateStr}-${locationcode}`;
}
}
Expand Down

0 comments on commit 9abcebd

Please sign in to comment.