Skip to content

Commit

Permalink
cleanup, added Lennart
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinvanschoren committed Nov 1, 2023
1 parent 8a06748 commit 9e582d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 49 deletions.
7 changes: 5 additions & 2 deletions app/src/components/search/CoreFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { withSearch } from "@elastic/react-search-ui";

const CoreFilter = ({ addFilter, removeFilter, setSort }) => {
useEffect(() => {
// An example list of user IDs
const core_ids = [1, 2, 27, 86, 348, 970, 1140, 869, 8111, 9186, 3744];
// List of core contributor IDs
const core_ids = [
1, 2, 27, 86, 348, 970, 1140, 869, 8111, 9186, 3744, 34097,
];

// Clear previous filters for user_id field
removeFilter("user_id.keyword");
addFilter("user_id.keyword", core_ids, "any");
Expand Down
50 changes: 3 additions & 47 deletions app/src/pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import { purple, blue, red, green, pink, grey } from "@mui/material/colors";
// Server-side translation
import { useTranslation } from "next-i18next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import Link from "next/link";
export async function getStaticProps({ locale }) {
return {
props: {
Expand All @@ -67,16 +66,8 @@ export async function getStaticProps({ locale }) {
};
}

import {
SearchProvider,
Results,
withSearch,
Facet,
SearchBox,
Sorting,
} from "@elastic/react-search-ui";
import { SearchProvider, Results } from "@elastic/react-search-ui";
import CoreFilter from "../components/search/CoreFilter";
import { Layout } from "react-feather";

const Card = styled(MuiCard)(spacing);

Expand Down Expand Up @@ -111,11 +102,6 @@ const BigAvatar = styled(Avatar)`
MediumVioletRed
);
`;
const BigBadge = styled(Badge)`
width: 130px;
margin-top: -15px;
position: absolute;
`;

// Needed to override the default list styling of the search results
const ResultsWrapper = styled.div`
Expand All @@ -141,12 +127,6 @@ const Person = ({ result }) => {
<BigAvatar alt="..." src={result.image.raw} align="center">
{name.match(/\b(\w)/g).join("")}
</BigAvatar>
{core_ids.includes(id) && !tc_ids.includes(id) && (
<BigBadge badgeContent="core" color="primary" align="center" />
)}
{core_ids.includes(id) && tc_ids.includes(id) && (
<BigBadge badgeContent="SC, core" color="primary" align="center" />
)}
<Typography
variant="h6"
display="block"
Expand All @@ -164,25 +144,6 @@ const Person = ({ result }) => {
);
};

function orderList(a, b) {
if (core_ids.includes(a.user_id) && !core_ids.includes(b.user_id)) return -1;
else if (core_ids.includes(b.user_id) && !core_ids.includes(a.user_id))
return 1;
else if (
active_ids.includes(a.user_id) &&
contributor_ids.includes(b.user_id)
)
return -1;
else if (
active_ids.includes(b.user_id) &&
contributor_ids.includes(a.user_id)
)
return 1;
else if (a.user_id < b.user_id && b.user_id !== 2) {
return -1;
} else return 1;
}

const TitleIcon = styled(FontAwesomeIcon)`
padding-right: 15px;
`;
Expand Down Expand Up @@ -309,7 +270,7 @@ const mission = {
const community = {
id: "about.community",
icon: faUserAstronaut,
iconColor: grey[100],
iconColor: grey[400],
};

const governance = {
Expand Down Expand Up @@ -341,15 +302,10 @@ const foundation = {
const foundation_mission = {
id: "about.foundation_mission",
icon: faFlagCheckered,
iconColor: grey[100],
iconColor: grey[400],
};

const tc_ids = [1, 2, 27, 86, 348, 970];
const core_ids = [1, 2, 27, 86, 348, 970, 1140, 869, 8111, 9186, 3744];
const active_ids = [10700, 5348, 2902, 8309, 3744];
const contributor_ids = [1478, 5341];
const apiConnector = new Connector("user");

const coreConfig = {
apiConnector: apiConnector,
alwaysSearchOnInitialLoad: true,
Expand Down

0 comments on commit 9e582d2

Please sign in to comment.