-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into email-this-building
- Loading branch information
Showing
8 changed files
with
10,543 additions
and
9,913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<script lang="ts"> | ||
import { Component, Vue } from 'vue-property-decorator'; | ||
import BuildingsTable from '~/components/BuildingsTable.vue'; | ||
import DataDisclaimer from '~/components/DataDisclaimer.vue'; | ||
import DataSourceFootnote from '~/components/DataSourceFootnote.vue'; | ||
import NewTabIcon from '~/components/NewTabIcon.vue'; | ||
import { IBuilding } from '../common-functions.vue'; | ||
import { | ||
BuildingsCustomInfo, IBuildingCustomInfo, | ||
BuildingTags, | ||
} from '../constants/buildings-custom-info.constant.vue'; | ||
interface IBuildingEdge { node: IBuilding; } | ||
// TODO: Figure out a way to get metaInfo working without any | ||
// https://github.com/xerebede/gridsome-starter-typescript/issues/37 | ||
@Component<any>({ | ||
components: { | ||
BuildingsTable, | ||
DataDisclaimer, | ||
DataSourceFootnote, | ||
NewTabIcon, | ||
}, | ||
metaInfo() { | ||
return { title: 'Retrofit Chicago Participant Case Studies' }; | ||
}, | ||
}) | ||
export default class ChicagoRetrofitParticipants extends Vue { | ||
/** Set by Gridsome to results of GraphQL query */ | ||
readonly $static: any; | ||
readonly $context: any; | ||
buildingsFiltered: Array<IBuildingEdge> = []; | ||
created(): void { | ||
this.filterBuildings(); | ||
} | ||
filterBuildings(): void { | ||
// Loop through BuildingsCustomInfo to get the IDs of buildings we are looking for | ||
const retrofitBuildingSlugs: Array<string> = Object.entries(BuildingsCustomInfo) | ||
.filter(([ , buildingInfo ]: [string, IBuildingCustomInfo]) => { | ||
return buildingInfo.tags?.includes(BuildingTags.hasRetrofitCaseStudy); | ||
}).map(([ buildingID ]: [string, IBuildingCustomInfo]) => buildingID); | ||
this.buildingsFiltered = | ||
this.$static.allBuilding.edges.filter((buildingEdge: IBuildingEdge) => { | ||
return retrofitBuildingSlugs.some((ownedBuildingID) => | ||
buildingEdge.node.ID === ownedBuildingID); | ||
}); | ||
} | ||
} | ||
</script> | ||
|
||
<!-- | ||
This page grabs all buildings and then filters by owner on the client-side, since that data isn't | ||
baked into the actual building CSV | ||
--> | ||
<static-query> | ||
query { | ||
allBuilding(sortBy: "GHGIntensity") { | ||
edges { | ||
node { | ||
slugSource | ||
ID | ||
DataYear | ||
PropertyName | ||
Address | ||
path | ||
PrimaryPropertyType | ||
GHGIntensity | ||
GHGIntensityRank | ||
GHGIntensityPercentileRank | ||
TotalGHGEmissions | ||
TotalGHGEmissionsRank | ||
TotalGHGEmissionsPercentileRank | ||
ElectricityUse | ||
ElectricityUseRank | ||
ElectricityUsePercentileRank | ||
NaturalGasUse | ||
NaturalGasUseRank | ||
NaturalGasUsePercentileRank | ||
} | ||
} | ||
} | ||
} | ||
</static-query> | ||
|
||
<template> | ||
<DefaultLayout> | ||
<div class="retrofit-page"> | ||
<h1 | ||
id="main-content" | ||
tabindex="-1" | ||
> | ||
Retrofit Chicago Participant Case Studies | ||
</h1> | ||
|
||
<p class="constrained -wide"> | ||
These buildings participated in the Retrofit Chicago program and have published case | ||
studies, so you can learn more about how they became more efficient! | ||
</p> | ||
|
||
<p> | ||
Buildings sourced from | ||
<a href="https://www.chicago.gov/city/en/sites/retrofit-chicago2/home/participant-achievments/past-participants.html#case-studies"> | ||
City of Chicago - Retrofit Chicago | ||
</a>. | ||
</p> | ||
|
||
<DataDisclaimer /> | ||
|
||
<BuildingsTable | ||
:buildings="buildingsFiltered" | ||
/> | ||
|
||
<DataSourceFootnote /> | ||
</div> | ||
</DefaultLayout> | ||
</template> | ||
|
||
<style lang="scss"> | ||
.retrofit-page { | ||
|
||
} | ||
</style> |
Oops, something went wrong.