From 511268015a9c7c28ca09e12359e2e9626e0eb21a Mon Sep 17 00:00:00 2001 From: Vaibhav sasulkar Date: Thu, 3 Oct 2024 13:04:33 +0530 Subject: [PATCH 1/4] branch locator bugs in progress --- .../branch-detail-description.js | 4 ++-- blocks/branchlocator/branchlocator-render.js | 3 +++ blocks/branchlocator/sort.js | 16 ++++++++++++++++ blocks/keyfeatures/keyfeatures.css | 12 ++++-------- 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 blocks/branchlocator/sort.js diff --git a/blocks/branch-detail-description/branch-detail-description.js b/blocks/branch-detail-description/branch-detail-description.js index 17be03cd1e..6e72a1bbb3 100644 --- a/blocks/branch-detail-description/branch-detail-description.js +++ b/blocks/branch-detail-description/branch-detail-description.js @@ -4,7 +4,7 @@ import { setLocationObj } from "../moredetailsaddress/moredetailsaddress.js"; export default function decorate(block) { - let {pagecontent, geoInfo:{city}} = setLocationObj; + let {pagecontent, geoInfo:{location}} = setLocationObj; if(!pagecontent){ return false; @@ -15,7 +15,7 @@ export default function decorate(block) { let seemoreContent = pagecontent.split(" ").slice(90).join(" "); block.innerHTML = `
-

About Piramal Finance ${city} Branch

+

About Piramal Finance ${location} Branch

${slicedbold}${slicedData} diff --git a/blocks/branchlocator/branchlocator-render.js b/blocks/branchlocator/branchlocator-render.js index 334536b2dc..42e7747cff 100644 --- a/blocks/branchlocator/branchlocator-render.js +++ b/blocks/branchlocator/branchlocator-render.js @@ -1,10 +1,12 @@ import { showingStateCity } from "../../scripts/scripts.js"; import { onClickCity, onClickState } from "./branchlocator-biz.js"; import { setLocationObj } from "./branchlocator-init.js"; +import { sortElements } from "./sort.js"; export function renderState(block, setLocationObj){ let renderStateLi = block.closest('.section').querySelector('.state-wrapper > .option-wrapper'); renderStateLi.innerHTML = setLocationObj.stateLi; + sortElements(renderStateLi); hideshowState(block); searchStateCity(block); onClickState(block); @@ -13,6 +15,7 @@ export function renderState(block, setLocationObj){ export function renderCity(block){ let renderCityLi = block.closest('.section').querySelector('.city-wrapper > .option-wrapper'); renderCityLi.innerHTML = setLocationObj.cityLi; + sortElements(renderCityLi); hideshowCity(block); searchStateCity(block); onClickCity(block); diff --git a/blocks/branchlocator/sort.js b/blocks/branchlocator/sort.js new file mode 100644 index 0000000000..7df33dfb84 --- /dev/null +++ b/blocks/branchlocator/sort.js @@ -0,0 +1,16 @@ +function comparator(a, b) { + if (a.innerText < b.innerText) + return -1; + if (a.innerText > b.innerText) + return 1; + return 0; +} + +// Function to sort Data +export function sortElements(el) { + // var subjects = + // el.querySelectorAll("[data-subject]"); + var subjectsArray = Array.from(el.children); + let sorted = subjectsArray.sort(comparator); + sorted.forEach(e => el.appendChild(e)); +} \ No newline at end of file diff --git a/blocks/keyfeatures/keyfeatures.css b/blocks/keyfeatures/keyfeatures.css index bb376b7029..e72afabfc8 100644 --- a/blocks/keyfeatures/keyfeatures.css +++ b/blocks/keyfeatures/keyfeatures.css @@ -26,8 +26,8 @@ justify-content: start; padding: 16px 24px; flex-direction: column-reverse; - min-height: 220px; - row-gap: 10px; + min-height: 240px; + row-gap: 16px; } .section.home-loans-products-wrapper.home-loans-products-single-card .wrappercreation-wrapper .wrappercreation .wrapper-creation-container .keyfeatures-wrapper .keyfeatures .homeloanteaser .cmp-teaser .cmp-teaser__link, @@ -331,8 +331,8 @@ @media (min-width:768px) and (max-width: 1024px) { .section.home-loans-products-wrapper .wrappercreation-wrapper .wrappercreation .wrapper-creation-container .keyfeatures-wrapper .keyfeatures .homeloanteaser .cmp-teaser .cmp-teaser__link{ - min-height: 240px; - row-gap: 12px; + min-height: 270px; + /* row-gap: 12px; */ padding: 16px 24px; } .section.home-loans-products-wrapper .wrappercreation-wrapper .wrappercreation .wrapper-creation-container .keyfeatures-wrapper .keyfeatures .homeloanteaser .cmp-teaser .cmp-teaser__link .cmp-teaser__content p{ @@ -344,10 +344,6 @@ .section.home-loans-products-wrapper.renovation-home-loan-products .keyfeature-container .keyfeatures-info .keyfeatures{ min-height: 272px; } - - .section.personal-loan-key-feature>.fragment-wrapper>.section .wrappercreation-wrapper .wrappercreation .wrapper-creation-container .keyfeatures-wrapper .keyfeatures .homeloanteaser .cmp-teaser .cmp-teaser__link { - min-height: 220px; - } } @media (min-width:1024px) and (max-width:1366px) { From 80318ac030e40a2c678808c127fde25acb21ae5e Mon Sep 17 00:00:00 2001 From: Vaibhav sasulkar Date: Thu, 3 Oct 2024 15:56:09 +0530 Subject: [PATCH 2/4] add metadata for branch locator --- blocks/branchlocator/branchlocator.css | 9 +++++++++ component-models.json | 22 +++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/blocks/branchlocator/branchlocator.css b/blocks/branchlocator/branchlocator.css index 9eac010c13..4384f32098 100644 --- a/blocks/branchlocator/branchlocator.css +++ b/blocks/branchlocator/branchlocator.css @@ -478,4 +478,13 @@ line-height: 22px; padding: 3px 0; } + + .section.branchlocator-dropdown .container .dropdown-wrapper .dropdown .dropdown-selectvalue { + padding: 8px 18px 8px 10px; + } + + .section.branchlocator-dropdown .container .dropdown-wrapper .dropdown .dropdown-selectvalue::after { + top: 13px; + right: 10px; + } } \ No newline at end of file diff --git a/component-models.json b/component-models.json index 10f86408ac..0a7c881819 100644 --- a/component-models.json +++ b/component-models.json @@ -1,4 +1,24 @@ [ + { + "id": "page-metadata", + "fields": [ + { + "component": "text", + "name": "title", + "label": "Title" + }, + { + "component": "text", + "name": "description", + "label": "Description" + }, + { + "component": "text", + "name": "theme", + "label": "Theme" + } + ] + }, { "id": "title", "fields": [ @@ -2727,4 +2747,4 @@ } ] } -] +] \ No newline at end of file From a3c5663772caf225cf3ffec5876aa21aef7a60f0 Mon Sep 17 00:00:00 2001 From: Om Gupta Date: Thu, 3 Oct 2024 18:10:28 +0530 Subject: [PATCH 3/4] code change added --- blocks/accordion/accordion.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blocks/accordion/accordion.js b/blocks/accordion/accordion.js index 610f7e2be8..34ff4cfcc9 100644 --- a/blocks/accordion/accordion.js +++ b/blocks/accordion/accordion.js @@ -1,4 +1,5 @@ import { fetchAPI } from "../../scripts/scripts.js"; +console.log('Accordian'); /* this function also gets called by accordion-group */ export function generateAccordionDOM(block) { @@ -23,11 +24,11 @@ export function generateAccordionDOM(block) { elementDiv.innerHTML = elementText; } - + details.append(elementDiv); } }); - + return details; } @@ -55,7 +56,7 @@ function KYCDocuments(data) { ` : ""; html += - ` + `
${each.title} From aff2c2d978babff22c4f03f242a6d0912e8080f2 Mon Sep 17 00:00:00 2001 From: Smit Shah Date: Thu, 3 Oct 2024 18:30:01 +0530 Subject: [PATCH 4/4] branch locator response changes --- blocks/moredetailsaddress/moredetailsaddress.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/moredetailsaddress/moredetailsaddress.js b/blocks/moredetailsaddress/moredetailsaddress.js index 878d1890f2..f756b16b90 100644 --- a/blocks/moredetailsaddress/moredetailsaddress.js +++ b/blocks/moredetailsaddress/moredetailsaddress.js @@ -25,7 +25,8 @@ export default async function decorate(block) { let url = linkURL.textContent.trim(); let urlRepoonse = await CFApiCall(url); - const jsonResponseData = JSON.parse(urlRepoonse?.data[0]?.branchlocatorobj); + // const jsonResponseData = JSON.parse(urlRepoonse?.data[0]?.branchlocatorobj); + const jsonResponseData = urlRepoonse?.data; if(sessionStorage.getItem('data')){ setLocationObj.getExcelData = JSON.parse(sessionStorage.getItem('data'));