-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New state-specific calculator design (#20)
## Description This implements most of the spec'd design. There are some significant pieces still missing. They're tracked in Asana, but just as a summary: - Multiple selection of projects. - Adding authority logos to the bottom of the page. - Handling the case of entering a location outside RI. - Adding an optional email field for people to join the mailing list. In addition, there are some more pieces missing before this frontend is ready to replace the existing IRA calculator wholesale: - Spanish localization - Analytics - Appearance customizability via CSS ### Guide to new code - New .html page for the RI calculator, which pretty much just has the embed. It's included in the Parcel targets, which means it will be built and deployed. It's not ready for the public yet, so it uses a meta tag to disable search engine indexing. - `state-calculator.ts` is the custom HTML element. This contains all the state management. - `state-incentive-details.ts` is the view layer. - A couple of sub-parts are factored out: `utility-selector.ts` and `icon-tab-bar.ts`. - `calculator-types-v1.ts` corresponds to the shape of the API responses. This is manually maintained right now, not generated from the API in any way; eventually it'd be good to change that. - `projects.ts` has icons and labels for the various projects. ## Test Plan - Enter a RI zip code. 02807 for Block Island, 02861 for Providence (RI Energy only), 02814 for Pascoag (RIE and PUD available). - Fill in the rest of the form, click Calculate. Look at results. In the 02814 case, switch to the other utility and make sure the incentives reload. - Click the pill buttons to switch projects. - Click the "Learn more" / "Visit site" buttons. Resize the window to look at the three possible layouts. (1, 2, or 3 columns of incentive cards.)
- Loading branch information
Showing
13 changed files
with
1,546 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export type IncentiveType = | ||
| 'tax_credit' | ||
| 'pos_rebate' | ||
| 'rebate' | ||
| 'account_credit' | ||
| 'performance_rebate'; | ||
export type AuthorityType = 'federal' | 'state' | 'utility'; | ||
|
||
export type AmountType = 'dollar_amount' | 'percent' | 'dollars_per_unit'; | ||
export interface Amount { | ||
type: AmountType; | ||
number: number; | ||
maximum?: number; | ||
representative?: number; | ||
unit?: string; | ||
} | ||
|
||
export type ItemType = | ||
| 'battery_storage_installation' | ||
| 'efficiency_rebates' | ||
| 'electric_panel' | ||
| 'electric_stove' | ||
| 'electric_vehicle_charger' | ||
| 'electric_wiring' | ||
| 'geothermal_heating_installation' | ||
| 'heat_pump_air_conditioner_heater' | ||
| 'heat_pump_clothes_dryer' | ||
| 'heat_pump_water_heater' | ||
| 'new_electric_vehicle' | ||
| 'rooftop_solar_installation' | ||
| 'used_electric_vehicle' | ||
| 'weatherization'; | ||
|
||
export interface Item { | ||
type: ItemType; | ||
name: string; | ||
url: string; | ||
} | ||
|
||
export interface Incentive { | ||
type: IncentiveType; | ||
authority_type: AuthorityType; | ||
authority_name: string | null; | ||
program: string; | ||
program_url?: string; | ||
item: Item; | ||
amount: Amount; | ||
start_date: number; | ||
end_date: number; | ||
short_description?: string; | ||
|
||
eligible: boolean; | ||
} | ||
|
||
export interface APIResponse { | ||
savings: { | ||
tax_credit: number; | ||
pos_rebate: number; | ||
rebate: number; | ||
account_credit: number; | ||
}; | ||
incentives: Incentive[]; | ||
} |
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
Oops, something went wrong.
0f32d67
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
embed-rewiringamerica-org – ./
embed-rewiringamerica-org-git-main-rewiring-america.vercel.app
embed.rewiringamerica.org
embed-rewiringamerica-org-rewiring-america.vercel.app
embed-rewiringamerica-org.vercel.app