Skip to content

Commit

Permalink
Last fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Emil Balitzki <[email protected]>
  • Loading branch information
Corgam committed Jul 13, 2024
1 parent c158415 commit 06f4161
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/metadata-database/init-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ const datasets = [
DatasetId: "building_models",
Name: "Building Models",
ShortDescription: `Simplified 3D building models.`,
Icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M104,216V152h48v64h64V120a8,8,0,0,0-2.34-5.66l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,40,120v96Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>',
Icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,228H204V28h12a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8H52V228H24a4,4,0,0,0,0,8H232a4,4,0,0,0,0-8ZM60,28H196V228H156V184a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v44H60Zm88,200H108V188h40ZM92,64a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H96A4,4,0,0,1,92,64Zm48,0a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H144A4,4,0,0,1,140,64ZM92,104a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H96A4,4,0,0,1,92,104Zm48,0a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H144A4,4,0,0,1,140,104ZM96,148a4,4,0,0,1,0-8h16a4,4,0,0,1,0,8Zm44-4a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H144A4,4,0,0,1,140,144Z"></path></svg>',
},
additionalData: {
Icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M104,216V152h48v64h64V120a8,8,0,0,0-2.34-5.66l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,40,120v96Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>',
Icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,228H204V28h12a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8H52V228H24a4,4,0,0,0,0,8H232a4,4,0,0,0,0-8ZM60,28H196V228H156V184a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v44H60Zm88,200H108V188h40ZM92,64a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H96A4,4,0,0,1,92,64Zm48,0a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H144A4,4,0,0,1,140,64ZM92,104a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H96A4,4,0,0,1,92,104Zm48,0a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H144A4,4,0,0,1,140,104ZM96,148a4,4,0,0,1,0-8h16a4,4,0,0,1,0,8Zm44-4a4,4,0,0,1,4-4h16a4,4,0,0,1,0,8H144A4,4,0,0,1,140,144Z"></path></svg>',
Type: "areas",
DataType: "CITYGML",
LongDescription: `The building models have a 3D object of each building plus additional information on its dimentions.`,
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/components/DataView/DataRow.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
.data-row-title-flex {
display: flex;
gap: 0.5rem;
vertical-align: middle;
height: 100%;
align-items: center;
}

.data-row-value {
Expand All @@ -34,3 +37,11 @@
width: 18px;
height: 18px;
}

.data-row-title-icon {
max-width: 1rem;
align-items: center;
vertical-align: middle;
text-align: center;
display: flex;
}
16 changes: 9 additions & 7 deletions frontend/src/components/DataView/DataRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TableRow,
Tooltip,
} from "@mui/material";
import { CaretDown, CaretUp, MapPin } from "@phosphor-icons/react";
import { CaretDown, CaretUp, DotOutline, MapPin } from "@phosphor-icons/react";
import "./DataRow.css";
import { Dataset, DatasetBasicData } from "../../types/DatasetTypes";
import CustomSvgIcon from "../DatasetsList/CustomSvgIcon";
Expand Down Expand Up @@ -108,7 +108,7 @@ const DataRow: React.FC<RowProps> = ({ row, currentDatasets }) => {
return <CustomSvgIcon svgString={dataset.icon} size={18} />;
}
}
return <div className="mock-icon" />;
return <DotOutline size={18} />;
};

return (
Expand All @@ -134,8 +134,10 @@ const DataRow: React.FC<RowProps> = ({ row, currentDatasets }) => {
className="data-row-title-container"
>
<div className="data-row-title-flex">
{getDatasetIcon(row.datasetID)}
{row.displayName}
<div className="data-row-title-icon">
{getDatasetIcon(row.datasetId)}
</div>
<div>{row.displayName}</div>
</div>
</TableCell>
{row.value && row.value !== "" ? (
Expand All @@ -150,8 +152,8 @@ const DataRow: React.FC<RowProps> = ({ row, currentDatasets }) => {
) : (
<TableCell />
)}
{row.datasetID &&
row.datasetID !== "" &&
{row.datasetId &&
row.datasetId !== "" &&
row.coordinate &&
row.coordinate.length === 2 ? (
<TableCell className="toggle-column" size="small">
Expand All @@ -160,7 +162,7 @@ const DataRow: React.FC<RowProps> = ({ row, currentDatasets }) => {
aria-label="open on the map"
size="small"
onClick={() => {
openDatasetFromMapIcon(row.datasetID, row.coordinate);
openDatasetFromMapIcon(row.datasetId, row.coordinate);
}}
>
<MapPin />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/LocationDataTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface LocationDataResponse {
export interface DatasetItem {
displayName: string;
value: string | null;
datasetID: string | null;
datasetId: string | null;
coordinate: number[] | null;
subdata: SubdataItem[] | null;
}
Expand Down

0 comments on commit 06f4161

Please sign in to comment.