Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for 3d views. Updates combined 2d/3d view. #492

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion amplify/backend/api/collectionarchives/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface Object {
location: [String!]
modified_date: String
parent_collection: [String!]
parent_collection_identifer: [String!]
provenance: [String!]
relation: [String!]
rights_holder: [String!]
Expand Down Expand Up @@ -58,6 +59,7 @@ type Collection implements Object
modified_date: String
ownerinfo: AWSJSON
parent_collection: [String!]
parent_collection_identifer: [String!]
provenance: [String!]
relation: [String!]
rights_holder: [String!]
Expand Down Expand Up @@ -130,6 +132,7 @@ type Archive implements Object
date: [String!]
description: [String!]
display_date: [String!]
download_link:[String!]
end_date: String
explicit: Boolean
extent: [String!]
Expand All @@ -149,11 +152,12 @@ type Archive implements Object
license: [String!]
location: [String!]
manifest_file_characterization: AWSJSON
manifest_url: String!
manifest_url: String
medium: [String!]
modified_date: String
other_identifier: [String!]
parent_collection: [String!]
parent_collection_identifer: [String!]
provenance: [String!]
publisher: [String!]
references: [String!]
Expand Down
24 changes: 12 additions & 12 deletions amplify/backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/images/fallback_thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 3 additions & 13 deletions src/components/CollapsibleCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,17 @@ import * as React from "react";
import { styled } from "@mui/material/styles";
import Card from "@mui/material/Card";
import CardHeader from "@mui/material/CardHeader";
import CardMedia from "@mui/material/CardMedia";
import CardContent from "@mui/material/CardContent";
import CardActions from "@mui/material/CardActions";
import Collapse from "@mui/material/Collapse";
import Avatar from "@mui/material/Avatar";
import IconButton from "@mui/material/IconButton";
import Typography from "@mui/material/Typography";
import { red } from "@mui/material/colors";
import FavoriteIcon from "@mui/icons-material/Favorite";
import ShareIcon from "@mui/icons-material/Share";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import MoreVertIcon from "@mui/icons-material/MoreVert";
import LocationOnIcon from "@mui/icons-material/LocationOn";
import InfoIcon from "@mui/icons-material/Info";
import CopyrightIcon from "@mui/icons-material/Copyright";
import LocalLibraryIcon from "@mui/icons-material/LocalLibrary";
import { LeafletThumb } from "./LeafletThumb";
import Citation from "../components/Citation";
import { useNavigate } from "react-router-dom";

import "../css/CollapsibleCards.scss";

Expand Down Expand Up @@ -58,6 +50,7 @@ const multi_value_headers = [
"date",
"description",
"display_date",
"download_link",
"extent",
"format",
"has_format",
Expand Down Expand Up @@ -108,7 +101,6 @@ const getMarker = (marker) => {
};

const getLocationData = (data) => {
console.log(data.location);
return (
<>
{data.location ? (
Expand All @@ -123,7 +115,7 @@ const getLocationData = (data) => {
};

const modifyKey = (key) => {
if (key == "display_date") {
if (key === "display_date") {
return "Date";
}
const newKey = key
Expand Down Expand Up @@ -185,7 +177,6 @@ export default function CollapsibleCard({
setExpanded(!expanded);
};

const navigate = useNavigate();
let facetSearchItems = ["format", "medium", "type", "tags"];

const renderContent = (key, value, index) => {
Expand All @@ -205,7 +196,7 @@ export default function CollapsibleCard({
</a>
</div>
);
} else if (key == "language") {
} else if (key === "language") {
return (
<div key={index}>
<a
Expand All @@ -223,7 +214,6 @@ export default function CollapsibleCard({
};

const getAboutData = (data) => {
console.log("about: ", data);
let items = [
"description",
"date",
Expand Down
31 changes: 17 additions & 14 deletions src/components/ThreeD2DiiifHandler/ThreeD2DiiifHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const ThreeD2DiiifHandler: FC<Props> = ({ item, site }) => {

return () => {
if (x3dElement) {
console.log("Removing event listeners");
x3dElement.removeEventListener("mousedown", handleMouseDown);
x3dElement.removeEventListener("touchstart", handleMouseDown);
}
Expand Down Expand Up @@ -120,17 +119,19 @@ export const ThreeD2DiiifHandler: FC<Props> = ({ item, site }) => {
</div>
)}
</div>
<div
style={{ height: height, width: width }}
hidden={threeD === "primary"}
>
<MiradorViewer
item={item}
site={site}
type="3d_2diiif"
{item.manifest_url && (
<div
style={{ height: height, width: width }}
hidden={threeD === "primary"}
/>
</div>
>
<MiradorViewer
item={item}
site={site}
type="3d_2diiif"
hidden={threeD === "primary"}
/>
</div>
)}
</>
);
} catch (e) {
Expand Down Expand Up @@ -198,9 +199,11 @@ export const ThreeD2DiiifHandler: FC<Props> = ({ item, site }) => {
<div className="image-wrapper" id="image-wrapper">
{primarySectionContent()}
</div>
<div className="thumbnail-wrapper" id="thumbnail-wrapper">
{secondarySectionContent()}
</div>
{item.manifest_url && (
<div className="thumbnail-wrapper" id="thumbnail-wrapper">
{secondarySectionContent()}
</div>
)}
</div>
);
};
12 changes: 8 additions & 4 deletions src/components/Thumbnail/Thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { FC } from "react";
import "../../css/Thumbnail.scss";
import { useSignedLink } from "../../hooks/useSignedLink";

const THUMBNAIL_FALLBACK = "/images/fallback_thumbnail.jpg";

type Props = {
item: Collection | Archive;
site: Site;
Expand All @@ -24,17 +26,19 @@ export const Thumbnail: FC<Props> = ({
"image",
site?.siteId
);
if (!image) {
return null;
}

return (
<div className="image-container">
{category && (
<div className={`${category}-label`}>
<p>{category === "collection" ? "Collection" : "Item"}</p>
</div>
)}
<img className={className} src={image} alt={altText ? item.title : ""} />
<img
className={className}
src={image || THUMBNAIL_FALLBACK}
alt={altText ? item.title : ""}
/>
</div>
);
};
1 change: 1 addition & 0 deletions src/css/RelatedItems.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.related-items-wrapper {
background-color: var(--light-gray);
margin-top: 40px;
padding: 40px;
width: 100%;
overflow: hidden;
Expand Down
15 changes: 15 additions & 0 deletions src/graphql/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const createCollection = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -87,6 +88,7 @@ export const updateCollection = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -147,6 +149,7 @@ export const deleteCollection = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -214,6 +217,7 @@ export const createCollectionmap = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -270,6 +274,7 @@ export const updateCollectionmap = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -326,6 +331,7 @@ export const deleteCollectionmap = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -483,6 +489,7 @@ export const createArchive = /* GraphQL */ `
date
description
display_date
download_link
end_date
explicit
extent
Expand All @@ -506,6 +513,7 @@ export const createArchive = /* GraphQL */ `
modified_date
other_identifier
parent_collection
parent_collection_identifer
provenance
publisher
references
Expand Down Expand Up @@ -544,6 +552,7 @@ export const createArchive = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -588,6 +597,7 @@ export const updateArchive = /* GraphQL */ `
date
description
display_date
download_link
end_date
explicit
extent
Expand All @@ -611,6 +621,7 @@ export const updateArchive = /* GraphQL */ `
modified_date
other_identifier
parent_collection
parent_collection_identifer
provenance
publisher
references
Expand Down Expand Up @@ -649,6 +660,7 @@ export const updateArchive = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down Expand Up @@ -693,6 +705,7 @@ export const deleteArchive = /* GraphQL */ `
date
description
display_date
download_link
end_date
explicit
extent
Expand All @@ -716,6 +729,7 @@ export const deleteArchive = /* GraphQL */ `
modified_date
other_identifier
parent_collection
parent_collection_identifer
provenance
publisher
references
Expand Down Expand Up @@ -754,6 +768,7 @@ export const deleteArchive = /* GraphQL */ `
modified_date
ownerinfo
parent_collection
parent_collection_identifer
provenance
relation
rights_holder
Expand Down
Loading