Skip to content

Commit

Permalink
Fix sift
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Aug 31, 2024
1 parent 03fcc2a commit e08bc82
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/sift/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"author": "John J Czaplewski <[email protected]>",
"license": "CC0-1.0",
"dependencies": {
"@macrostrat-web/settings": "workspace:*",
"@macrostrat/hyper": "^2.2.1",
"async": "^1.5.2",
"chart.js": "^1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/sift/src/js/components/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ class _Column extends React.Component {
<PrevalentTaxa data={this.state.prevalentTaxa} />

<StratColumn data={this.state.units} />
<LinkComponent
<VikeLink
href={"/columns/" + this.state.properties.col_id}
target="_blank"
className="normalize-link alternate-column"
>
Alternate column view
</LinkComponent>
</VikeLink>
</div>

<Footer data={this.state.refs} />
Expand Down
4 changes: 3 additions & 1 deletion packages/sift/src/js/components/Config.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { apiV2Prefix } from "@macrostrat-web/settings";

var Config = {
apiURL: "https://v2.macrostrat.org/api/v2",
apiURL: apiV2Prefix,
pbdbURL: "https://paleobiodb.org/data1.2",

totalColumns: 1681,
Expand Down
13 changes: 10 additions & 3 deletions pages/lex/strat-names/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import hyper from "@macrostrat/hyper";
import { ContentPage } from "~/layouts";
import { PageHeader, Link, AttributedLithTag } from "~/components";
import {
PageHeader,
Link,
AttributedLithTag,
PageBreadcrumbs,
} from "~/components";
import {
InputGroup,
Spinner,
Expand Down Expand Up @@ -67,14 +72,15 @@ export function Page() {
return h(ContentPage, [
h("div.page-header.stick-to-top", [
h("div.flex.row.align-center", [
h(PageHeader, { title: "Stratigraphic names" }),
h(PageBreadcrumbs, { showLogo: true }),
h("div.spacer"),
h(FilterControl, {
searchString: state.match,
setSearchString(value) {
dispatch({ type: "set-search-string", value });
},
}),
/* TODO
h(Button, {
icon: "settings",
minimal: true,
Expand All @@ -83,8 +89,9 @@ export function Page() {
setShowSettings(!showSettings);
},
}),
*/
]),
h(SettingsPanel, { isOpen: showSettings, state, dispatch }),
//h(SettingsPanel, { isOpen: showSettings, state, dispatch }),
]),
h(StratNamesView, { initialData: data, filters: state }),
h("div.background-placeholder"),
Expand Down
6 changes: 5 additions & 1 deletion pages/lex/strat-names/data-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ export async function fetchStratNames(
perPage = 20,
abortSignal?: AbortSignal
) {
let base = postgrest.from("strat_names_units_kg").select("*");
let base = postgrest
.from("strat_names_units_kg")
.select(
"id,strat_name,rank,concept_id,concept,interval_id,interval_name,units"
);
if (filters.match != null && filters.match != "") {
base = base.ilike("strat_name", `%${filters.match}%`);
}
Expand Down
2 changes: 1 addition & 1 deletion pages/sift/+route.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default "/sift/*";
export default "/sift*";
15 changes: 15 additions & 0 deletions src/components/navigation/PageBreadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ export const sitemap: Routes = {
slug: "lithology",
name: "Lithology",
},
{
slug: "strat-names",
name: "Stratigraphic names",
children: [
{
param: "@id",
name(urlPart, ctx) {
return h(
"code",
ctx.pageProps?.stratName?.strat_name ?? urlPart
);
},
},
],
},
],
},
columnsSubtree,
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6348,6 +6348,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@macrostrat-web/sift@workspace:packages/sift"
dependencies:
"@macrostrat-web/settings": "workspace:*"
"@macrostrat/hyper": "npm:^2.2.1"
"@types/react": "npm:^18"
"@types/react-dom": "npm:^18"
Expand Down

0 comments on commit e08bc82

Please sign in to comment.