Skip to content

Commit

Permalink
Merge branch 'main' into tem-1303
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstanton authored Jul 13, 2023
2 parents d18b515 + 8b9fc2b commit b63b3e7
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 21 deletions.
28 changes: 28 additions & 0 deletions contrib/postgis_raster/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG PG_VERSION=15
FROM quay.io/coredb/c-builder:pg${PG_VERSION}
USER root

RUN apt-get update && apt-get install -y \
build-essential \
libreadline-dev \
zlib1g-dev \
flex \
bison \
libxml2-dev \
libxslt-dev \
libssl-dev \
libxml2-utils \
xsltproc \
ccache \
libgdal-dev \
libgeos-dev \
osm2pgsql \
libprotobuf-c-dev \
protobuf-c-compiler

RUN wget https://download.osgeo.org/postgis/source/postgis-3.3.3.tar.gz && \
tar xvf postgis-3.3.3.tar.gz && \
cd postgis-3.3.3 && \
./configure && \
cd raster && \
make
21 changes: 21 additions & 0 deletions contrib/postgis_raster/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[extension]
name = "postgis_raster"
version = "3.3.3"
repository = "https://github.com/postgis/postgis"
license = "GPL-2.0"
description = "Raster is a PostGIS type for storing and analyzing raster data."
homepage = "http://postgis.net/"
documentation = "https://postgis.net/docs/RT_reference.html"
categories = ["data_transformations"]

[build]
postgres_version = "15"
platform = "linux/amd64"
dockerfile = "Dockerfile"
install_command = """
cd postgis-3.3.3/raster && make install
set -x
mv /usr/local/pgsql/share/extension/* /usr/share/postgresql/15/extension
mv /usr/local/pgsql/lib/* /usr/lib/postgresql/15/lib
"""

28 changes: 28 additions & 0 deletions contrib/postgis_tiger_geocoder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG PG_VERSION=15
FROM quay.io/coredb/c-builder:pg${PG_VERSION}
USER root

RUN apt-get update && apt-get install -y \
build-essential \
libreadline-dev \
zlib1g-dev \
flex \
bison \
libxml2-dev \
libxslt-dev \
libssl-dev \
libxml2-utils \
xsltproc \
ccache \
libgdal-dev \
libgeos-dev \
osm2pgsql \
libprotobuf-c-dev \
protobuf-c-compiler

RUN wget https://download.osgeo.org/postgis/source/postgis-3.3.3.tar.gz && \
tar xvf postgis-3.3.3.tar.gz && \
cd postgis-3.3.3 && \
./configure && \
cd extensions/postgis_tiger_geocoder && \
make
21 changes: 21 additions & 0 deletions contrib/postgis_tiger_geocoder/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[extension]
name = "postgis_tiger_geocoder"
version = "3.3.3"
repository = "https://github.com/postgis/postgis"
license = "GPL-2.0"
description = "A plpgsql based geocoder written to work with the TIGER (Topologically Integrated Geographic Encoding and Referencing system ) / Line and Master Address database export released by the US Census Bureau."
homepage = "http://postgis.net/"
documentation = "https://postgis.net/docs/Extras.html"
categories = ["data_transformations"]

[build]
postgres_version = "15"
platform = "linux/amd64"
dockerfile = "Dockerfile"
install_command = """
cd postgis-3.3.3/extensions/postgis_tiger_geocoder && make install
set -x
mv /usr/local/pgsql/share/extension/* /usr/share/postgresql/15/extension
mv /usr/local/pgsql/lib/* /usr/lib/postgresql/15/lib
"""

34 changes: 34 additions & 0 deletions ui/package-lock.json

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

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"react-dom": "18.2.0",
"react-markdown": "^8.0.7",
"remark-gfm": "^3.0.1",
"swr": "^2.2.0",
"typescript": "5.1.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/ExtGrid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function ExtGrid({
<div className={styles.container} ref={sectionTitleRef}>
<div className={styles.sectionHeader}>
<h1 className={cx(styles.interMed24, styles.title)}>{title}</h1>
<Search extensions={extensions}></Search>
<Search />
</div>
<div className={styles.gridContainer}>
{filteredList.map((ext) => (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Header({ white = false, search = false, extensions = []
</button>
{search && (
<div className={styles.headerSearchCont}>
<Search extensions={extensions}></Search>
<Search />
</div>
)}
</div>
Expand Down
19 changes: 13 additions & 6 deletions ui/src/Components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ import cx from "classnames";
import styles from "./search.module.scss";
import { Extension } from "@/types";
import { truncate } from "@/stringHelpers";
import useExtList from "@/hooks/useExtList";

export default function Search({ extensions }: { extensions: Extension[] }) {
export default function Search() {
const [searchString, setSearchString] = useState("");
const [selectedItemIndex, setSelectedItemIndex] = useState(-1);
const [showresults, setShowResults] = useState(false);
const router = useRouter();
const filteredList = extensions.filter(
(ext) =>
ext.name.toLowerCase().includes(searchString.toLowerCase()) || ext.description.toLowerCase().includes(searchString.toLowerCase())
);
const { extensions, isLoading, isError }: { extensions: Extension[]; isLoading: boolean; isError: boolean } = useExtList();

const filteredList =
isLoading || isError
? []
: extensions.filter(
(ext) =>
ext.name.toLowerCase().includes(searchString.toLowerCase()) ||
ext.description.toLowerCase().includes(searchString.toLowerCase())
);
const resultContainerRef: RefObject<HTMLInputElement> = useRef(null);

useEffect(() => {
Expand Down Expand Up @@ -52,7 +59,7 @@ export default function Search({ extensions }: { extensions: Extension[] }) {
<input
type="text"
className={cx(styles.input, styles.interReg16)}
placeholder={`Search ${extensions.length} extensions`}
placeholder={`Search ${isLoading || isError ? "" : extensions.length} extensions`}
value={searchString}
onKeyDown={handleKeyDown}
onChange={(e) => {
Expand Down
13 changes: 13 additions & 0 deletions ui/src/hooks/useExtList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import useSWR from "swr";

const fetcher = (...args: [RequestInfo, RequestInit]): Promise<any> => fetch(...args).then((res) => res.json());

export default function useExtList() {
const { data, error, isLoading } = useSWR("https://registry.pgtrunk.io/extensions/all", fetcher);

return {
extensions: data,
isLoading,
isError: error,
};
}
13 changes: 0 additions & 13 deletions ui/src/pages/api/hello.ts

This file was deleted.

12 changes: 12 additions & 0 deletions ui/src/pages/api/revalidate/[ext].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { NextApiRequest, NextApiResponse } from "next";

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
const { ext } = req.query;
await res.revalidate(`/extensions/${ext}`);
await res.revalidate("/");
return res.json({ revalidated: true });
} catch (err) {
return res.status(500).send("Error revalidating");
}
}

0 comments on commit b63b3e7

Please sign in to comment.