Skip to content

Commit 5d95d92

Browse files
committed
add hideprov list to toplevel
1 parent 5d88fbf commit 5d95d92

File tree

7 files changed

+28
-10
lines changed

7 files changed

+28
-10
lines changed

src/App.jsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@ import { OptimadeClient } from "./components/OptimadeClient";
44

55
import "./index.css";
66

7+
// current known bad providers.
8+
const badProviders = [
9+
"exmpl", // example provider shouldnt be shown.
10+
"aiida", // base_url is null...
11+
"aflow", // returns a 500 error.
12+
"ccdc", // base_url is null...
13+
"cod", // - is fine but doesnt have 3d format i can currently parse?!
14+
"ccpnc", // base_url is null...
15+
//"cmr", - is fine but has weird data.
16+
"httk", // base_url is null...
17+
"matcloud", // child endpoint doesnt work or return properly?
18+
"mpds", // behind a paywall - should skip i guess.
19+
"mpod", // url seems to be down at the moment - skip.
20+
"optimake", // not an actual provider
21+
"optimade", // not an actual provider
22+
"pcod", // base_url is null...
23+
"psdi", // base_url is null...
24+
];
25+
726
function App() {
8-
return <OptimadeClient />;
27+
return <OptimadeClient hideProviderList={badProviders} />;
928
}
1029

1130
export default App;

src/components/OptimadeClient/OptimadeFAQs.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState, useRef, useEffect } from "react";
22

3+
// unused for now.
34
export default function OptimadeFAQs() {
45
const [isOpen, setIsOpen] = useState(false);
56
const contentRef = useRef(null);

src/components/OptimadeClient/OptimadeFilters/OptimadePTable/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function PTable({
2222
selectedClassName = "bg-green-400 border border-green-700 text-white scale-105",
2323
deselectedClassName = "bg-red-400 border border-red-700 text-white scale-105",
2424
defaultBorderClassName = "border border-slate-700",
25-
hoverClassName = "transform transition-transform duration-100 hover:scale-105 hover:z-10",
25+
hoverClassName = "transform transition-transform duration-100 hover:scale-105 hover:z-10 hover:cursor-pointer",
2626
}) {
2727
const toggle = (sym) => {
2828
if (!onSelectionChange) return;

src/components/OptimadeClient/OptimadeProviderSection.jsx

Whitespace-only changes.

src/components/OptimadeClient/index.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ProviderInfo } from "./ProviderInfo";
99
import { PaginationHandler } from "./PaginationHandler";
1010
import { AnimatePresence, motion } from "framer-motion";
1111

12-
export function OptimadeClient() {
12+
export function OptimadeClient({ hideProviderList = ["exmpl", "matcloud"] }) {
1313
const [providers, setProviders] = useState([]);
1414
const [queryUrl, setQueryUrl] = useState("");
1515
const [currentFilter, setCurrentFilter] = useState("");
@@ -28,10 +28,7 @@ export function OptimadeClient() {
2828
useEffect(() => {
2929
const loadProviders = async () => {
3030
try {
31-
const provObj = await getProvidersList(undefined, [
32-
"exmpl",
33-
"matcloud",
34-
]);
31+
const provObj = await getProvidersList(undefined, hideProviderList);
3532
setProviders(provObj.data);
3633
} catch (err) {
3734
console.error("Error fetching providers:", err);

src/components/OptimadeStructureHandler/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ export function StructureViewerWithDownload({
3737
className={`relative rounded-sm w-full px-20 min-h-[450px] ${className} flex items-center justify-center border-1 border-slate-500`}
3838
>
3939
<div className="text-red-500 text-center">
40-
Malformed data found - skipping the crystal structure rendering.
40+
<p>Unexpected or malformed data format found. </p>
41+
<p>--</p>
42+
43+
<p>Crystal structure rendering skipped...</p>
4144
</div>
4245
</div>
4346
);

src/utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ _atom_site_fract_z
7777
)} ${site.y.toFixed(6)} ${site.z.toFixed(6)}\n`;
7878
});
7979

80-
console.log("cif", cif);
81-
8280
return cif;
8381
}
8482

0 commit comments

Comments
 (0)