Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lfinance into feature/comp-creation-new
  • Loading branch information
npy11 authored and npy11 committed Oct 4, 2024
2 parents 371ca97 + aff2c2d commit 3621b03
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 15 deletions.
7 changes: 4 additions & 3 deletions blocks/accordion/accordion.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -23,11 +24,11 @@ export function generateAccordionDOM(block) {
elementDiv.innerHTML = elementText;
}


details.append(elementDiv);
}
});

return details;
}

Expand Down Expand Up @@ -55,7 +56,7 @@ function KYCDocuments(data) {
<td style=" text-align: right;"><img src="${each.rowtwoimg}" alt=""></td>`
: "";
html +=
`<table class="${each.class} " cellpadding="1" cellspacing="0" border="1">
`<table class="${each.class} " cellpadding="1" cellspacing="0" border="1">
<tbody>
<tr>
<th style="text-align: left;">${each.title}
Expand Down
4 changes: 2 additions & 2 deletions blocks/branch-detail-description/branch-detail-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,7 +15,7 @@ export default function decorate(block) {
let seemoreContent = pagecontent.split(" ").slice(90).join(" ");
block.innerHTML = `
<div class="branch-description-wrapper">
<h2 class="branch-heading">About Piramal Finance ${city} Branch</h2>
<h2 class="branch-heading">About Piramal Finance ${location} Branch</h2>
<p>
<span class="branch-description-content">
<strong>${slicedbold}</strong>${slicedData}
Expand Down
3 changes: 3 additions & 0 deletions blocks/branchlocator/branchlocator-render.js
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions blocks/branchlocator/branchlocator.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
16 changes: 16 additions & 0 deletions blocks/branchlocator/sort.js
Original file line number Diff line number Diff line change
@@ -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));
}
12 changes: 4 additions & 8 deletions blocks/keyfeatures/keyfeatures.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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{
Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion blocks/moredetailsaddress/moredetailsaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
22 changes: 21 additions & 1 deletion component-models.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -2727,4 +2747,4 @@
}
]
}
]
]

0 comments on commit 3621b03

Please sign in to comment.