Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into change-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarsonsoff3 authored Jan 19, 2024
2 parents a7db39a + d0d594b commit 78f86f1
Show file tree
Hide file tree
Showing 30 changed files with 364 additions and 171 deletions.
6 changes: 0 additions & 6 deletions .github/scripts/check-filenames.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
let fileNames = process.env.FILENAMES.split(" ");
const baseFileNames = process.env.BASE_FILENAMES.split(" ");
const user = process.env.USERNAME;
let exitCode = 0;

// Remove files not changed in this PR from list
if (baseFileNames.length > 0) {
fileNames = fileNames.filter((file) => !baseFileNames.includes(file));
}

if (fileNames.length > 0) {
fileNames.forEach((file) => {
const splitFile = file.split("/");
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/data-filenames.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,20 @@ jobs:
name: Test changed-files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "lts/*"

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]

- name: Get changed files between base & head
id: base-changed-files
uses: tj-actions/[email protected]
with:
base_sha: ${{ github.event.pull_request.head.sha }}
uses: tj-actions/changed-files@v41

- name: Check changed files
env:
BASE_FILENAMES: ${{ steps.base-changed-files.outputs.all_changed_files }}
FILENAMES: ${{ steps.changed-files.outputs.all_changed_files }}
USERNAME: ${{ github.actor }}
run: |
Expand Down
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
## [2.97.9](https://github.com/EddieHubCommunity/BioDrop/compare/v2.97.8...v2.97.9) (2024-01-07)
## [2.99.4](https://github.com/EddieHubCommunity/BioDrop/compare/v2.99.3...v2.99.4) (2024-01-13)


### Bug Fixes

* version description in bug template ([#9947](https://github.com/EddieHubCommunity/BioDrop/issues/9947))([#9946](https://github.com/EddieHubCommunity/BioDrop/issues/9946)) ([5083539](https://github.com/EddieHubCommunity/BioDrop/commit/5083539cf6820b852104b41e43be59e1eca2a9d1))
* placeholder to select element ([#9905](https://github.com/EddieHubCommunity/BioDrop/issues/9905)) ([efbe58a](https://github.com/EddieHubCommunity/BioDrop/commit/efbe58abe4f986269f1d3f88f3834edc763321da))



## [2.97.8](https://github.com/EddieHubCommunity/BioDrop/compare/v2.97.7...v2.97.8) (2024-01-05)
## [2.99.3](https://github.com/EddieHubCommunity/BioDrop/compare/v2.99.2...v2.99.3) (2024-01-12)


### Bug Fixes

* mongoose validate error and upgrade ([#10102](https://github.com/EddieHubCommunity/BioDrop/issues/10102)) ([052f076](https://github.com/EddieHubCommunity/BioDrop/commit/052f0765369dd86dfe25e1461d506e73540d1fea))
* space between add link and first link [#9822](https://github.com/EddieHubCommunity/BioDrop/issues/9822) ([#9943](https://github.com/EddieHubCommunity/BioDrop/issues/9943)) ([0bcce23](https://github.com/EddieHubCommunity/BioDrop/commit/0bcce23511935336953d040d846f7a37ab931c1c)), closes [#9406](https://github.com/EddieHubCommunity/BioDrop/issues/9406)



## [2.97.7](https://github.com/EddieHubCommunity/BioDrop/compare/v2.97.6...v2.97.7) (2024-01-04)
## [2.99.2](https://github.com/EddieHubCommunity/BioDrop/compare/v2.99.1...v2.99.2) (2024-01-12)


### Bug Fixes

* rolled back mongoose version ([#10097](https://github.com/EddieHubCommunity/BioDrop/issues/10097)) ([8b13530](https://github.com/EddieHubCommunity/BioDrop/commit/8b13530294083b1578fba769436c20efa303c6cc))
* login url in the navbar ([#9893](https://github.com/EddieHubCommunity/BioDrop/issues/9893)) ([fd0567b](https://github.com/EddieHubCommunity/BioDrop/commit/fd0567bffda11586225d5fbbc7c59caca7d22394))



## [2.97.6](https://github.com/EddieHubCommunity/BioDrop/compare/v2.97.5...v2.97.6) (2023-12-30)
## [2.99.1](https://github.com/EddieHubCommunity/BioDrop/compare/v2.99.0...v2.99.1) (2024-01-12)


### Bug Fixes

* alert info for dark mode ([#9902](https://github.com/EddieHubCommunity/BioDrop/issues/9902)) ([2e1ce65](https://github.com/EddieHubCommunity/BioDrop/commit/2e1ce6545f64e1b6ad7c1208715c540644d2f0d9))
* manage save button prevent multiple clicks ([#9713](https://github.com/EddieHubCommunity/BioDrop/issues/9713)) ([59da077](https://github.com/EddieHubCommunity/BioDrop/commit/59da07795083ee6a9ca8a5f77cb6acd67e904cbd))



## [2.97.5](https://github.com/EddieHubCommunity/BioDrop/compare/v2.97.4...v2.97.5) (2023-12-30)
# [2.99.0](https://github.com/EddieHubCommunity/BioDrop/compare/v2.98.1...v2.99.0) (2024-01-12)


### Bug Fixes
### Features

* update action dependencies ([#10053](https://github.com/EddieHubCommunity/BioDrop/issues/10053)) ([aa1149b](https://github.com/EddieHubCommunity/BioDrop/commit/aa1149b91b07f3b81e6a7c424f0bee908a1678e2))
* link group suggestions ([#10127](https://github.com/EddieHubCommunity/BioDrop/issues/10127)) ([3de1e09](https://github.com/EddieHubCommunity/BioDrop/commit/3de1e09cd74019ce60cfde1dc24a790fca1c54a8))



60 changes: 60 additions & 0 deletions components/GroupLinkSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { useState } from "react";
import { Combobox } from "@headlessui/react";
import Label from "./form/Label";

function GroupLinkSearch({ selectedGroup, handleGroupSelection, groups }) {
const [query, setQuery] = useState("");

const handleGroupChange = (e) => {
setQuery(e.target.value);
const currentValue = e.target.value;
if (!groups.includes(currentValue)) {
handleGroupSelection(currentValue);
}
};

const filteredGroup =
query === ""
? groups.length > 0 && groups.slice(0, 5)
: groups.length > 0 &&
groups
.filter((group) => {
return group.toLowerCase().includes(query.toLowerCase());
})
.slice(0, 5);

return (
<Combobox value={selectedGroup} onChange={handleGroupSelection}>
<Label htmlFor="search-groups">Group</Label>
<Combobox.Input
name="search-group"
onChange={handleGroupChange}
className={
"border-2 transition-all duration-250 ease-linear rounded px-6 py-2 mb-2 block w-full dark:bg-primary-high hover:border-tertiary-medium focus:ring-0 focus:border-tertiary-medium focus:outline-0"
}
/>
<Combobox.Options
className={
"border-2 rounded border-tertiary-medium dark:bg-primary-medium"
}
>
{filteredGroup.length > 0 &&
filteredGroup.map((group) => {
return (
<Combobox.Option
key={group}
value={group}
className={
"px-3 py-2 flex items-center dark:hover:bg-tertiary-medium/60 hover:bg-secondary-low/40"
}
>
{group !== "" && <span>{group}</span>}
</Combobox.Option>
);
})}
</Combobox.Options>
</Combobox>
);
}

export default GroupLinkSearch;
3 changes: 2 additions & 1 deletion components/Tabs.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import Select from "@components/form/Select";
import { classNames } from "@services/utils/classNames";

export default function Tabs({ tabs, setTabs, selectedTab }) {
export default function Tabs({ tabs, setTabs, selectedTab, placeholder }) {
return (
<div>
<div className="sm:hidden">
{tabs.length > 1 && (
<Select
name="tabs"
value={selectedTab?.name}
placeholder={placeholder}
onChange={(e) =>
setTabs(tabs.find((tab) => tab.name === e.currentTarget.value))
}
Expand Down
4 changes: 2 additions & 2 deletions components/account/manage/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default function Edit({ href, label = "", children }) {
<a
href={href}
aria-label={`Edit ${label}`}
className="rounded-full bg-secondary-medium p-2 text-white shadow-sm hover:bg-tertiary-medium focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-secondary-medium absolute top-0 left-0 pointer z-10"
className="rounded-full bg-secondary-medium p-2 mt-1 text-white shadow-sm hover:bg-tertiary-medium focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-secondary-medium absolute top-0 left-0 pointer z-10"
>
<PencilIcon className="h-5 w-5" aria-hidden="true" />
<PencilIcon className="h-4 w-4" aria-hidden="true" />
</a>
{children}
</div>
Expand Down
6 changes: 3 additions & 3 deletions components/event/EventTabs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Link from "@components/Link";
import Select from "@components/form/Select";
import { classNames } from "@services/utils/classNames";
export function EventTabs({ tabs, eventType, setEventType }) {
export function EventTabs({ tabs, eventType, onEventTypeChange }) {
const changeTab = (e, value) => {
e.preventDefault();
setEventType(value);
onEventTypeChange(value);
if (!value) {
setEventType(tabs.find((tab) => tab.title === e.target.value).key);
onEventTypeChange(tabs.find((tab) => tab.title === e.target.value).key);
}
};

Expand Down
8 changes: 7 additions & 1 deletion components/form/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { classNames } from "@services/utils/classNames";
import Label from "./Label";

export default function Select({
value,
value = "",
onChange,
options = [],
label,
name,
className,
placeholder,
...restProps
}) {
return (
Expand All @@ -27,6 +28,11 @@ export default function Select({
)}
{...restProps}
>
{placeholder && (
<option value="" disabled>
{placeholder}
</option>
)}
{options.map((option) => (
<option
className="checked:text-secondary-high checked:font-bold dark:checked:text-secondary-low-high"
Expand Down
2 changes: 1 addition & 1 deletion components/navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function Navbar() {
{!session && (
<>
<NavLink
item={{ name: "Login", url: "/login" }}
item={{ name: "Login", url: "/auth/signin" }}
setIsOpen={setIsOpen}
onClick={(e) => {
e.preventDefault();
Expand Down
9 changes: 8 additions & 1 deletion components/navbar/SubNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ export default function SubNav({ tabs }) {
});
};

return <Tabs tabs={tabs} setTabs={changeTab} selectedTab={selectedTab} />;
return (
<Tabs
tabs={tabs}
setTabs={changeTab}
selectedTab={selectedTab}
placeholder="Choose a category"
/>
);
}
95 changes: 35 additions & 60 deletions components/user/UserEvents.js
Original file line number Diff line number Diff line change
@@ -1,76 +1,51 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import EventCard from "@components/event/EventCard";
import Alert from "@components/Alert";
import Select from "@components/form/Select";
import {
filterByEventType,
getFilteredEvents,
} from "@services/utils/event/filterEvent";

const allEventOptions = [
{ value: "all", name: "All Events" },
{ value: "future", name: "Future Events" },
{ value: "ongoing", name: "Ongoing Events" },
{ value: "virtual", name: "Virtual Events" },
{ value: "inPerson", name: "In-Person Events" },
{ value: "cfpOpen", name: "Events with open CFP" },
{ value: "free", name: "Free Events" },
{ value: "paid", name: "Paid Events" },
{ value: "past", name: "Past Events" },
];

export default function UserEvents({
manage = false,
events,
filter = "future",
}) {
const [eventType, setEventType] = useState(filter);
const [eventsToShow, setEventsToShow] = useState([]);
const [eventOptions, setEventOptions] = useState([]);

const eventOptions = [
{ value: "all", name: "All Events" },
{ value: "future", name: "Future Events" },
{ value: "ongoing", name: "Ongoing Events" },
{ value: "virtual", name: "Virtual Events" },
{ value: "inPerson", name: "In-Person Events" },
{ value: "cfpOpen", name: "Events with open CFP" },
{ value: "free", name: "Free Events" },
{ value: "paid", name: "Paid Events" },
{ value: "past", name: "Past Events" },
];
const handleEventTypeChange = (event) => {
setEventType(event.target.value);
};

const filterByEventType = (event, eventType) => {
switch (eventType) {
case "future":
return event.date.future;
case "ongoing":
return event.date.ongoing;
case "virtual":
return event.date.future && event.isVirtual;
case "inPerson":
return event.date.future && event.isInPerson;
case "cfpOpen":
return event.date.cfpOpen;
case "free":
return event.price?.startingFrom === 0;
case "paid":
return event.price?.startingFrom > 0;
case "past":
return !event.date.future;
default:
useEffect(() => {
setEventsToShow(getFilteredEvents(events, "future"));
const filteredEventOptions = allEventOptions.filter((option) => {
if (option.value === "all") {
return true;
}
};
const getFilteredEvents = () => {
if (eventType === "all") {
return events;
}
let filteredEvents = events.filter((event) =>
filterByEventType(event, eventType),
);
if (eventType === "future" && filteredEvents.length === 0) {
filteredEvents = events.filter((event) =>
filterByEventType(event, "all"),
}
const filterEvents = events.filter((event) =>
filterByEventType(event, option.value),
);
}
return filteredEvents;
return filterEvents.length > 0;
});
setEventOptions(filteredEventOptions);
}, [events]);

const handleEventTypeChange = (event) => {
setEventType(event.target.value);
setEventsToShow(getFilteredEvents(events, event.target.value));
};
const eventsToShow = getFilteredEvents();
const filteredEventOptions = eventOptions.filter((option) => {
if (option.value === "all") {
return true;
}
const filterEvents = events.filter((event) =>
filterByEventType(event, option.value),
);
return filterEvents.length > 0;
});

return (
<>
Expand All @@ -84,7 +59,7 @@ export default function UserEvents({
value={eventType}
label="Select an event type"
onChange={handleEventTypeChange}
options={filteredEventOptions.map((option) => ({
options={eventOptions.map((option) => ({
label: option.name,
value: option.value,
}))}
Expand Down
2 changes: 1 addition & 1 deletion config/app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.97.9",
"version": "2.99.4",
"alerts": [],
"layouts": [
"classic",
Expand Down
3 changes: 0 additions & 3 deletions data/Prashanth-bokkala.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "Prashanth Bokkala",
"displayStatusPublic": true,
"type": "public",
"bio": "I'm a passionate frontend developer on a journey to master React. Currently immersed in the world of web development, I enjoy crafting user-friendly interfaces that bring ideas to life. Eager to learn and contribute, I'm dedicated to staying on top of the latest technologies. Let's build something amazing together!",
"avatar": "https://github.com/Prashanth-bokkala.png",
"tags": [
"frontend",
"JavaScript",
Expand Down
Loading

0 comments on commit 78f86f1

Please sign in to comment.