Skip to content
Merged
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
162 changes: 0 additions & 162 deletions OwnersRefactor.md

This file was deleted.

12 changes: 6 additions & 6 deletions src/pages/AllElectric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class AllElectric extends Vue {}
</script>

<!-- If this query is updated, make sure to update PageSocialCard as well -->
<static-query>
<page-query>
query {
allBuilding(
filter: {
Expand Down Expand Up @@ -106,15 +106,15 @@ export default class AllElectric extends Vue {}
}
}
}
</static-query>
</page-query>

<template>
<DefaultLayout main-class="layout -full-width">
<BuildingsHero
:buildings="$static.allBuilding.edges.map((edge) => edge.node)"
:buildings="$page.allBuilding.edges.map((edge) => edge.node)"
>
<h1 id="main-content" tabindex="-1">
Chicago's {{ $static.allBuilding.edges.length }} All Electric Buildings
Chicago's {{ $page.allBuilding.edges.length }} All Electric Buildings
</h1>
</BuildingsHero>

Expand All @@ -135,12 +135,12 @@ export default class AllElectric extends Vue {}
<DataDisclaimer />

<BuildingsMap
:buildings="$static.allBuilding.edges"
:buildings="$page.allBuilding.edges"
filter-label="all electric"
/>

<BuildingsTable
:buildings="$static.allBuilding.edges"
:buildings="$page.allBuilding.edges"
:show-square-footage="true"
/>

Expand Down
10 changes: 5 additions & 5 deletions src/pages/BiggestBuildings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class BiggestBuildings extends Vue {
</script>

<!-- If this query is updated, make sure to update PageSocialCard as well -->
<static-query>
<page-query>
query {
allBuilding(sortBy: "GrossFloorArea", limit: 50) {
edges {
Expand Down Expand Up @@ -74,15 +74,15 @@ export default class BiggestBuildings extends Vue {
}
}
}
</static-query>
</page-query>

<template>
<DefaultLayout main-class="layout -full-width">
<BuildingsHero
:buildings="$static.allBuilding.edges.map((edge) => edge.node)"
:buildings="$page.allBuilding.edges.map((edge) => edge.node)"
>
<h1 id="main-content" tabindex="-1">
Top {{ $static.allBuilding.edges.length }} Buildings By Square Footage
Top {{ $page.allBuilding.edges.length }} Buildings By Square Footage
</h1>
</BuildingsHero>

Expand All @@ -100,7 +100,7 @@ export default class BiggestBuildings extends Vue {
<DataDisclaimer />

<BuildingsTable
:buildings="$static.allBuilding.edges"
:buildings="$page.allBuilding.edges"
:show-square-footage="true"
/>

Expand Down
10 changes: 5 additions & 5 deletions src/pages/CleanestBuildings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class CleanestBuildings extends Vue {
</script>

<!-- If this query is updated, make sure to update PageSocialCard as well -->
<static-query>
<page-query>
query {
allBuilding(
filter: {
Expand Down Expand Up @@ -86,15 +86,15 @@ export default class CleanestBuildings extends Vue {
}
}
}
</static-query>
</page-query>

<template>
<DefaultLayout main-class="layout -full-width">
<BuildingsHero
:buildings="$static.allBuilding.edges.map((edge) => edge.node)"
:buildings="$page.allBuilding.edges.map((edge) => edge.node)"
>
<h1 id="main-content" tabindex="-1">
Cleanest {{ $static.allBuilding.edges.length }} Buildings by Greenhouse
Cleanest {{ $page.allBuilding.edges.length }} Buildings by Greenhouse
Gas Intensity
</h1>
</BuildingsHero>
Expand All @@ -115,7 +115,7 @@ export default class CleanestBuildings extends Vue {

<DataDisclaimer />

<BuildingsTable :buildings="$static.allBuilding.edges" />
<BuildingsTable :buildings="$page.allBuilding.edges" />

<DataSourceFootnote />
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/GeothermalBuildings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ interface IBuildingEdge {
})
export default class GeothermalBuildings extends Vue {
/** Set by Gridsome to results of GraphQL query */
readonly $static!: { allBuilding: { edges: Array<IBuildingEdge> } };
readonly $page!: { allBuilding: { edges: Array<IBuildingEdge> } };

buildingsFiltered: Array<IBuildingEdge> = [];

created(): void {
validateTaggedBuildings(
BuildingTags.hasGeothermalHeatPump,
this.$static.allBuilding.edges.map((e) => e.node.ID.toString()),
this.$page.allBuilding.edges.map((e) => e.node.ID.toString()),
);
this.buildingsFiltered = this.$static.allBuilding.edges;
this.buildingsFiltered = this.$page.allBuilding.edges;
}
}
</script>
Expand All @@ -51,7 +51,7 @@ export default class GeothermalBuildings extends Vue {
performance optimization. The IDs MUST match buildings tagged with hasGeothermalHeatPump in
buildings-custom-info.constant.vue (validated at runtime via validateTaggedBuildings).
-->
<static-query>
<page-query>
query {
# PERFORMANCE OPTIMIZATION: Hard-coded filter for buildings with hasGeothermalHeatPump tag
# These IDs MUST match buildings-custom-info.constant.vue (validated at runtime)
Expand Down Expand Up @@ -87,7 +87,7 @@ export default class GeothermalBuildings extends Vue {
}
}
}
</static-query>
</page-query>

<template>
<DefaultLayout>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/LargeOwners.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class LargeOwners extends Vue {
}
</script>

<static-query>
<page-query>
query {
allBuilding(sortBy: "GHGIntensity", limit: 50) {
edges {
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class LargeOwners extends Vue {
}
}
}
</static-query>
</page-query>

<template>
<DefaultLayout>
Expand Down
12 changes: 6 additions & 6 deletions src/pages/LatestUpdates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class LatestUpdates extends Vue {
readonly Links: typeof Links = Links;

/** Set by Gridsome to results of GraphQL query */
readonly $static!: {
readonly $page!: {
newBuildings: { edges: Array<IBuildingNode> };
stoppedReporting: { edges: Array<IBuildingNode> };
consistentReporters: { totalCount: number };
Expand All @@ -47,14 +47,14 @@ export default class LatestUpdates extends Vue {

get newBuildings(): Array<{ node: IBuilding }> {
// Already filtered by GraphQL, just sort by square footage
return this.$static.newBuildings.edges
return this.$page.newBuildings.edges
.slice()
.sort((a, b) => b.node.GrossFloorArea - a.node.GrossFloorArea);
}

get consistentReportersCount(): number {
// Already calculated by GraphQL totalCount
return this.$static.consistentReporters.totalCount;
return this.$page.consistentReporters.totalCount;
}

get netChangeInReporting(): number {
Expand All @@ -63,14 +63,14 @@ export default class LatestUpdates extends Vue {

get stoppedReportingBuildings(): Array<{ node: IBuilding }> {
// Already filtered by GraphQL, just sort by square footage
return this.$static.stoppedReporting.edges
return this.$page.stoppedReporting.edges
.slice()
.sort((a, b) => b.node.GrossFloorArea - a.node.GrossFloorArea);
}
}
</script>

<static-query>
<page-query>
query {
# New buildings: FirstYearReported equals latest year (2023)
newBuildings: allBuilding(filter: { FirstYearReported: { eq: 2023 } }) {
Expand Down Expand Up @@ -126,7 +126,7 @@ export default class LatestUpdates extends Vue {
FirstYearReported
LastYearReported
}
</static-query>
</page-query>

<template>
<DefaultLayout>
Expand Down
Loading
Loading