Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/map-bottom-popup-card
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoLyn committed Feb 26, 2025
2 parents bdb3682 + d4cd680 commit 082d5c4
Show file tree
Hide file tree
Showing 23 changed files with 201 additions and 489 deletions.
2 changes: 1 addition & 1 deletion playwright/pages/components/tabs/associated_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class AssociatedRecordsTab(BasePage):
TAB_NAME = 'Associated Records'
TAB_NAME = 'Related Resources'
PARENT_RECORD = 'Parent Record'
SIBLING_RECORDS = 'Sibling Records'
CHILD_RECORDS = 'Child Records'
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/detail_page/test_detail_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_contact_details(
expect(detail_page.contact_area.phone).to_contain_text(phone)
expect(detail_page.contact_area.link).to_contain_text(link)


@pytest.mark.skip("Section moved tab")
@pytest.mark.parametrize(
'title, uuid, tab, item_list',
[
Expand Down
30 changes: 0 additions & 30 deletions playwright/tests/detail_page/test_lineage_tab.py

This file was deleted.

2 changes: 1 addition & 1 deletion playwright/tests/detail_page/test_metadata_info_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pages.detail_page import DetailPage


@pytest.mark.skip("Section moved tab")
@pytest.mark.parametrize(
'title, uuid, metadata_contact, metadata_identifier, full_metadata_link, metadata_dates',
[
Expand Down
Binary file added public/images/pagenotfound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const marineParkDefault = {
};

const detailPageDefault = {
ABOUT: "about",
ASSOCIATED_RECORDS: "associated records",
ADDITIONAL_INFO: "additional-info",
ASSOCIATED_RECORDS: "associated-records",
CITATION: "citation",
DATA_ACCESS: "data_access",
DATA_ACCESS: "data-access",
LINEAGE: "lineage",
METADATA_INFORMATION: "metadata information",
METADATA_INFORMATION: "metadata-information",
SUMMARY: "summary",
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/list/ContactList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ContactList: React.FC<ContactListProps> = ({ contacts }) => {

return (
<ExpandableList
title={"Contacts"}
title={"Contact of Data Owner"}
childrenList={collapseComponents}
></ExpandableList>
);
Expand Down
5 changes: 1 addition & 4 deletions src/components/list/MetadataContactList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ const MetadataContactList: React.FC<MetadataContactListProps> = ({
}, [contacts, theme.mp.md]);

return (
<ExpandableList
title="Contact of Data Owner"
childrenList={metadataContacts}
/>
<ExpandableList title="Metadata Contact" childrenList={metadataContacts} />
);
};

Expand Down
5 changes: 3 additions & 2 deletions src/components/list/StatementList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import ItemBaseGrid from "./listItem/ItemBaseGrid";
import TextArea from "./listItem/subitem/TextArea";

interface StatementListProps {
title?: string;
statement: string;
}

const StatementList: React.FC<StatementListProps> = ({ statement }) => {
const StatementList: React.FC<StatementListProps> = ({ title, statement }) => {
const statementItem = (
<ItemBaseGrid container key={statement}>
<TextArea text={statement} />
Expand All @@ -17,7 +18,7 @@ const StatementList: React.FC<StatementListProps> = ({ statement }) => {
return (
<ExpandableList
childrenList={statement ? [statementItem] : []}
title="Statement"
title={title}
/>
);
};
Expand Down
32 changes: 32 additions & 0 deletions src/components/list/ThemeList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { useMemo } from "react";
import ExpandableList from "./ExpandableList";
import ItemBaseGrid from "./listItem/ItemBaseGrid";
import TextArea from "./listItem/subitem/TextArea";
import { ITheme } from "../common/store/OGCCollectionDefinitions";
import NaList from "./NaList";

interface ThemeListProps {
title: string;
themes?: ITheme[];
}

const ThemeList: React.FC<ThemeListProps> = ({ title, themes = [] }) => {
const statementItem = useMemo(
() => (
<ItemBaseGrid container key={"theme-list-container-key"}>
{themes.length !== 0 ? (
themes.map((theme: ITheme) => (
<TextArea key={theme.title} text={theme.title} />
))
) : (
<NaList title={title}></NaList>
)}
</ItemBaseGrid>
),
[themes, title]
);

return <ExpandableList childrenList={[statementItem]} title={title} />;
};

export default ThemeList;
38 changes: 34 additions & 4 deletions src/pages/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
import * as React from "react";
import { Box, Typography } from "@mui/material";

/*
* TODO: Implement this page
*/
const NotFoundPage = () => {
return <div>Page Not Found...</div>;
return (
<Box
sx={{
backgroundImage: "url(/images/pagenotfound.png)",
backgroundSize: "cover", // Covers the entire area
backgroundPosition: "center", // Centers the image
backgroundRepeat: "no-repeat", // Prevents tiling
height: "100vh", // Full viewport height
width: "100vw", // Full viewport width
display: "flex",
margin: 0, // Removes default margins
}}
>
<Box sx={{ marginTop: "25vh", marginLeft: "20vw" }}>
<Typography
sx={{
fontSize: "50px",
color: "black",
}}
>
404 Error Page
</Typography>
<Typography
sx={{
fontSize: "26px",
color: "black",
}}
>
The page you were looking for doesn&rsquo;t exist.
</Typography>
</Box>
</Box>
);
};

export default NotFoundPage;
40 changes: 8 additions & 32 deletions src/pages/detail-page/subpages/ContentSection.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { FC, useCallback, useEffect, useMemo, useState } from "react";
import DataAccessPanel from "./tab-panels/DataAccessPanel";
import AboutPanel from "./tab-panels/AboutPanel";
import MetadataInformationPanel from "./tab-panels/MetadataInformationPanel";
import AdditionalInfoPanel from "./tab-panels/AdditionalInfoPanel";
import CitationPanel from "./tab-panels/CitationPanel";
import SummaryAndDownloadPanel from "./tab-panels/SummaryAndDownloadPanel";
import LineagePanel from "./tab-panels/LineagePanel";
import AssociatedRecordsPanel from "./tab-panels/AssociatedRecordsPanel";
import { Card, Grid } from "@mui/material";
import { borderRadius } from "../../../styles/constants";
Expand Down Expand Up @@ -37,11 +35,11 @@ const ContentSection: FC<ContentSectionProps> = ({ mapFocusArea }) => {
[mapFocusArea]
);

const aboutPanelTab: Tab = useMemo(
const additionalInfoPanelTab: Tab = useMemo(
() => ({
label: "About",
value: detailPageDefault.ABOUT,
component: <AboutPanel />,
label: "Additional Information",
value: detailPageDefault.ADDITIONAL_INFO,
component: <AdditionalInfoPanel />,
}),
[]
);
Expand All @@ -55,24 +53,6 @@ const ContentSection: FC<ContentSectionProps> = ({ mapFocusArea }) => {
[]
);

const lineagePanelTab: Tab = useMemo(
() => ({
label: "Lineage",
value: detailPageDefault.LINEAGE,
component: <LineagePanel />,
}),
[]
);

const metadataInformationPanelTab: Tab = useMemo(
() => ({
label: "Metadata Information",
value: detailPageDefault.METADATA_INFORMATION,
component: <MetadataInformationPanel />,
}),
[]
);

const citationPanelTab: Tab = useMemo(
() => ({
label: "Citation and Usage",
Expand All @@ -84,7 +64,7 @@ const ContentSection: FC<ContentSectionProps> = ({ mapFocusArea }) => {

const associatedRecordsPanelTab: Tab = useMemo(
() => ({
label: "Associated Records",
label: "Related Resources",
value: detailPageDefault.ASSOCIATED_RECORDS,
component: <AssociatedRecordsPanel />,
}),
Expand All @@ -96,19 +76,15 @@ const ContentSection: FC<ContentSectionProps> = ({ mapFocusArea }) => {
summaryAndDownloadPanelTab,
dataAccessPanelTab,
citationPanelTab,
aboutPanelTab,
lineagePanelTab,
metadataInformationPanelTab,
additionalInfoPanelTab,
associatedRecordsPanelTab,
],
[
aboutPanelTab,
additionalInfoPanelTab,
summaryAndDownloadPanelTab,
associatedRecordsPanelTab,
citationPanelTab,
lineagePanelTab,
dataAccessPanelTab,
metadataInformationPanelTab,
]
);

Expand Down
2 changes: 0 additions & 2 deletions src/pages/detail-page/subpages/SideSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import DownloadCard from "./side-cards/DownloadCard";
import SpatialCoverageCard, {
SpatialCoverageCardProps,
} from "./side-cards/SpatialCoverageCard";
import ThemesCard from "./side-cards/ThemesCard";
import { useDetailPageContext } from "../context/detail-page-context";
import DataAccessPanel, { TYPE } from "./tab-panels/DataAccessPanel";
import CitationPanel from "./tab-panels/CitationPanel";
Expand Down Expand Up @@ -35,7 +34,6 @@ const SideSection: FC<SideSectionProps> = ({ onSpatialCoverageLayerClick }) => {
)}
{!isCollectionNotFound && (
<>
<ThemesCard />
<DataAccessPanel mode={MODE.COMPACT} type={TYPE.DATA_ACCESS} />
<SpatialCoverageCard
onSpatialCoverageLayerClick={onSpatialCoverageLayerClick}
Expand Down
45 changes: 0 additions & 45 deletions src/pages/detail-page/subpages/side-cards/ThemesCard.tsx

This file was deleted.

Loading

0 comments on commit 082d5c4

Please sign in to comment.