Skip to content

Commit

Permalink
Merge branch 'master' into scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmit-coder authored Jan 14, 2025
2 parents 8b90a13 + c33c344 commit 947d6d2
Show file tree
Hide file tree
Showing 14 changed files with 208 additions and 88 deletions.
2 changes: 1 addition & 1 deletion components/Form/Cfp/stepThree.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function StepThree({ setStep, setForm, data }) {
const [value, setValue] = useState({});
useEffect(() => {
setForm({ ...data, ...value});
}, [value]);
}, [value, data, setForm]);
return (
<form className="mt-3 w-[30rem] lg:w-[auto]" onSubmit={(e) => setStep(e, 4)}>
<h1 className="text-white font-bold text-4xl lg:text-3xl">
Expand Down
2 changes: 1 addition & 1 deletion components/Form/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Dropdown({ options, title, setValue, multi ,dataTest}) {
} else {
setValue(selectedOption.value);
}
}, [selectedOption]);
}, [selectedOption, multi, setValue]);
return (
<div className="relative inline-block w-full">
<Select
Expand Down
9 changes: 3 additions & 6 deletions components/Navbar/navDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const NavDrop = forwardRef((props, ref)=> {
const {setDrop}=props;
const [show, setShow] = useState(null);
return (
<div ref ={ref} className='absolute ml-[-20px] top-16 w-full bg-[#1B1130]'>
<div ref ={ref} className='z-[99] absolute left-0 top-[74px] w-full h-screen bg-[#1B1130]/90 backdrop-filter backdrop-blur-md'>
<div className='flex flex-col p-5 pb-8 w-full'>
{links.map((link) => {
return (
Expand All @@ -22,13 +22,10 @@ const NavDrop = forwardRef((props, ref)=> {
>
{link.subMenu ? (
<div>
<div className='flex items-center justify-between'
>
<div className='flex'>
<div className='text-white'>{link.title}</div>
<Dropdown
className={`transition-transform duration-700 ${
show === link.title ? 'rotate-0' : 'rotate-[-90deg]'
}`}
className={`transition-transform duration-700`}
/>
</div>
{show && show === link.title && (
Expand Down
4 changes: 2 additions & 2 deletions components/Navbar/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Navbar() {
};

return (
<div className='flex justify-center items-center sticky top-0 z-[99] text-white'>
<div className={`flex justify-center items-center fixed w-full backdrop-blur ${ drop && 'bg-[#1B1130]/90'} top-0 z-[99] text-white`}>
<div className='w-[1131px]'>
<div className='p-5 flex justify-between h-[75px] w-full items-center'>
<div className='flex items-center sm:justify-between sm:w-full' data-test="nav-Home">
Expand All @@ -86,7 +86,7 @@ function Navbar() {
<Cancel />
</button>
) : (
<button >
<button>
<Hamburger ref={svg} />
</button>
)}
Expand Down
25 changes: 17 additions & 8 deletions components/Venue/venue.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@ import React from 'react';
import Link from 'next/link';
import Image from 'next/image';

export function isEventEnded(date){
const eventDate = date.split(" ");
const month = eventDate[0];
const year = eventDate[eventDate.length-1];
const startDay = eventDate[1].split("-")[0];
return new Date(`${startDay} ${month} ${year}`) < Date.now()
export function getEventStatus(date){
const today = new Date();
const event = new Date(date);

if (event.toDateString() === today.toDateString()) {
return "Ongoing";
} else if (event > today) {
return "Upcoming";
} else {
return "Ended";
}
}

export function isEventEnded(date){
return getEventStatus(date) === "Ended";
}

function Venue({ className, city }) {

const eventEnded = isEventEnded(city.date);
const textColor = eventEnded ? "text-white": "text-white";
const eventStatus = getEventStatus(city.date);

return (
<Link href={`/venue/${city.name}`}>
Expand All @@ -37,8 +46,8 @@ function Venue({ className, city }) {
{city.name=='Online'?<span className='text-lg font-bold'>{city.name} {city.country}</span>:<span className='text-lg font-bold'>{city.country}, {city.name}</span>}
</div>
<div className='flex align-end flex-row justify-between pt-2'>
<div className='inline-block border border-gray-400 rounded-lg py-1 px-2 text-center'>{city.date}</div>
<span className=' text-white flex align-middle pt-2' style={{ fontSize: ".9em" }}>{eventEnded ? "ENDED" : ""}</span>
<div className='inline-block border border-gray-400 rounded-lg py-1 px-2 text-center sm:text-sm text-base'>{city.date}</div>
<span className=' text-white flex align-middle pt-2 sm:text-[0.8rem] sm:leading-4 text-base'>{eventStatus}</span>
</div>
</div>
</div>
Expand Down
90 changes: 75 additions & 15 deletions config/city-lists.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@
{
"name": "Online",
"country": " Edition",
"date": "30th October 2024",
"date": "October 30, 2024",
"cfpdate":"Not announced yet",
"description": "Join us for the AsyncAPI Online Conference Edition as the community unites across the globe to share experiences, collaborate, and foster meaningful connections.",
"img": "/img/testMic.webp",
"address": "AsyncAPI YouTube Channel",
"map": "https://www.youtube.com/live/F9wHxd-v2f0?si=PT8BuAUKNmoLHRiM",
"sponsors": [
"/img/apidays.png"
],
"sponsors": {
"eventSponsors" : [{
"image":"/img/apidays.png",
"websiteUrl":"https://www.apidays.global/"
}],
"financialSponsors" : [
{
"image":"/img/graviteeio.svg" ,
"websiteUrl": "https://www.gravitee.io/",
"className":"w-[250px] h-[50px]"
},
{
"image":"/img/postman.png" ,
"websiteUrl":"https://www.postman.com/",
"className":"w-[240px] h-[70px]"
}
]
},
"ticket": false,
"isFree": true,
"ended": true,
Expand All @@ -21,15 +36,30 @@
{
"name": "Helsinki",
"country": "Finland",
"date": "May 29 2024",
"date": "May 29, 2024",
"cfpdate":"Not announced yet",
"description": "Join us in Helsinki for the AsyncAPI Conference, where we will explore all things AsyncAPI and connect physical and digital worlds. Get excited as we delve into sustainable APIs for the Era of AI, Data Platforms, and Quantum Computing!.",
"img": "/img/finland.webp",
"address": "Pikku-Finlandia, Helsinki, Karamzininranta 4, 00100 Helsinki, Finland",
"map": "https://maps.app.goo.gl/UpdEp188m5YNEAEo9",
"sponsors": [
"/img/apidays.png"
],
"sponsors": {
"eventSponsors" : [{
"image":"/img/apidays.png",
"websiteUrl":"https://www.apidays.global/"
}],
"financialSponsors" : [
{
"image":"/img/graviteeio.svg" ,
"websiteUrl": "https://www.gravitee.io/",
"className":"w-[250px] h-[50px]"
},
{
"image":"/img/postman.png" ,
"websiteUrl":"https://www.postman.com/",
"className":"w-[240px] h-[70px]"
}
]
},
"ticket": false,
"isFree": false,
"ended": true
Expand All @@ -43,9 +73,24 @@
"img": "/img/london.gif",
"address": "155 Bishopsgate, London EC2M 3YD",
"map": "https://maps.app.goo.gl/b2Vb5H2mM41F9nQA6",
"sponsors": [
"/img/apidays.png"
],
"sponsors": {
"eventSponsors" : [{
"image":"/img/apidays.png",
"websiteUrl":"https://www.apidays.global/"
}],
"financialSponsors" : [
{
"image":"/img/graviteeio.svg" ,
"websiteUrl": "https://www.gravitee.io/",
"className":"w-[250px] h-[50px]"
},
{
"image":"/img/postman.png" ,
"websiteUrl":"https://www.postman.com/",
"className":"w-[240px] h-[70px]"
}
]
},
"ticket": "https://ticket.apidays.global/event/apidays-london-2024/869eca20-bfb6-4103-b8bb-d0348932e940/",
"isFree": true,
"ended": true,
Expand All @@ -61,12 +106,27 @@
"img": "https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd24yenR4djEyZzRoeDA0ZmEyb3Y1c2F4NWVmbG13NmZwYWNhZzdnNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Tuy3QxNZF1cxG/giphy.gif",
"address": "CNIT (Centre des Nouvelles Industries et Technologies), Paris 2 Place de la Défense, 92092 Puteaux",
"map": "https://maps.app.goo.gl/5te8WRM9Rb8B6vNd9",
"sponsors": [
"/img/apidays.png"
],
"sponsors": {
"eventSponsors" : [{
"image":"/img/apidays.png",
"websiteUrl":"https://www.apidays.global/"
}],
"financialSponsors" : [
{
"image":"/img/graviteeio.svg" ,
"websiteUrl": "https://www.gravitee.io/",
"className":"w-[250px] h-[50px]"
},
{
"image":"/img/postman.png" ,
"websiteUrl":"https://www.postman.com/",
"className":"w-[240px] h-[70px]"
}
]
},
"ticket": "https://ticket.apidays.global/event/apidays-paris-2024/f8f61349-4f78-4bba-a162-68d598833116/cart?coupon=ASYNCAPICONF",
"isFree": true,
"cfp": false,
"ended": false
"ended": true
}
]
7 changes: 6 additions & 1 deletion config/links.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@
"title": "Online Conf Slides",
"ref": "https://drive.google.com/drive/folders/1gw_kr6mLX5lITe_DHG94pGUOVYYS0DjY?usp=drive_link",
"target": "_blank"
},
{
"title": "Paris Slides",
"ref": "https://drive.google.com/drive/folders/1MBqecV7Q__tLIciF2vaPvwG5gV4RxcI_?usp=drive_link",
"target": "_blank"
}


]
}

]
]
24 changes: 23 additions & 1 deletion cypress/e2e/Landing.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import path from "path";
import cities from "../../config/city-lists.json"

describe("Landing Page Tests", () => {
beforeEach(() => {
cy.visit("/");
Expand Down Expand Up @@ -33,11 +35,31 @@ describe("Landing Page Tests", () => {
cy.getTestData("sponsor-section").should("be.visible");
});

it("Should contain logos in Sponsor component", () => {
const eventSponsors = cities[0].sponsors.eventSponsors;

const financialSponsor = cities[0].sponsors.financialSponsors;

eventSponsors.forEach((sponsor) => {
cy.getTestData('sponsor-section')
.find(`img[src="${sponsor.image}"]`)
.should('be.visible');
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
});

financialSponsor.forEach((sponsor) => {
cy.getTestData('sponsor-section')
.find(`img[src="${sponsor.image}"]`)
.should('be.visible');
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
});
});

it("Subscribe Button is functional", () => {
cy.getTestData("subscribe-button").invoke("removeAttr", "target").click();

cy.origin("https://www.asyncapi.com/newsletter", () => {
cy.url().should("eq", "https://www.asyncapi.com/newsletter");
cy.url().should("match", /https:\/\/www\.asyncapi\.com\/[a-z]{2}\/newsletter/);
});
});
});
30 changes: 28 additions & 2 deletions cypress/e2e/Venue.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{

cy.getTestData(`venue-${city.name}`).then(val=>{

if(!city.ended){
if(Date.now()>Date(city.date) && !city.ended){
cy.getTestData("guideline-com").should("be.visible");
}
else{
Expand All @@ -18,7 +18,33 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{

});

it.only("Form should work",()=>{
it("Should contain logos in Sponsor component", () => {
const eventSponsors = cities[0].sponsors.eventSponsors;

const financialSponsor = cities[0].sponsors.financialSponsors;

cy.wrap(cities).each((city) => {
cy.visit(`http://localhost:3000/venue/${city.name}`);

cy.getTestData("sponsor-section").should("exist");

eventSponsors.forEach((sponsor) => {
cy.getTestData('sponsor-section')
.find(`img[src="${sponsor.image}"]`)
.should('be.visible');
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
});

financialSponsor.forEach((sponsor) => {
cy.getTestData('sponsor-section')
.find(`img[src="${sponsor.image}"]`)
.should('be.visible');
cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist');
});
})
});

it("Form should work",()=>{
cy.visit('http://localhost:3000/venue/online/register');

cy.getTestData("cfp-form").should('be.visible');
Expand Down
Loading

0 comments on commit 947d6d2

Please sign in to comment.