Git Product home page Git Product logo

bcgov / cas-ciip-portal Goto Github PK

View Code? Open in Web Editor NEW
10.0 11.0 2.0 28.95 MB

The Climate Action Secretariat's CleanBC Industrial Incentive Program application

Home Page: https://ciip.gov.bc.ca/

License: Apache License 2.0

JavaScript 4.93% PLpgSQL 63.99% Shell 0.44% Makefile 0.45% Perl 0.01% TypeScript 29.08% Gherkin 0.47% Dockerfile 0.18% CSS 0.02% HTML 0.12% Smarty 0.06% Mustache 0.07% Python 0.16%
env react relay postgresql nextjs cas-ggircs

cas-ciip-portal's Introduction

Welcome to the CIIP Portal

CIIP stands for the CleanBC Industrial Incentive Program and is part of the CleanBC Program for Industry, which applies to large industrial operations that report their emissions under the Greenhouse Gas Industrial Reporting and Control Act (GGIRCA). The CIIP helps eligible industrial operations across the province by reducing carbon tax costs for facilities based on product-specific emissions benchmarks.

See the Documentation section below for more information and links.

Description

CIIP requires an application form to be submitted annually. CIIP is a voluntary program created for industrial operations in B.C. Operators must submit a CIIP application form by the program application deadline (announced by the program area). As part of the application, information about an industrial facility's energy use, emissions, and production is required. This project is the portal to that application, which upon approval, leads to the GGIRCS (Greenhouse Gas Industrial Reporting and Control System) for the Climate Action Secretariat (CAS).

Status

  • Lifecycle:Stable

  • Quality Gate: Quality Gate Status

  • CircleCI: CircleCI

  • CII Best Practices: CII Best Practices

Notes

Supported Browsers

  • Safari: 11+
  • Edge: All versions. Note: All versions of IE are currently unsupported.
  • Firefox: 61+
  • Chrome desktop: 68+
  • iOS: 11+

Backend

  • Sqitch
  • Postgres
  • Postgraphile
  • GraphQL
  • Express
  • Next for SSR React

Frontend

  • React
  • React Bootstrap
  • Relay Modern

Data

Data Architecture

(TBC)

Project Material Publication

The materials published include:

  • /bcgov/cas-airflow-dags
  • /bcgov/cas-ciip-portal
  • /bcgov/cas-docker-metabase
  • /bcgov/cas-docker-sqitch
  • /bcgov/cas-ggircs
  • /bcgov/cas-ggircs-ciip-2018-extract
  • /bcgov/cas-ggircs-ciip-2018-schema
  • /bcgov/cas-ggircs-metabase
  • /bcgov/cas-ggircs-metabase-build
  • /bcgov/cas-ggircs-metabase-builder
  • /bcgov/cas-helm
  • /bcgov/cas-metascript
  • /bcgov/cas-pipeline
  • /bcgov/cas-postgres
  • /bcgov/cas-shelf
  • /bcgov/cas-shipit
  • /bcgov/cas-shipit-engine
  • /bcgov/cas-sqitch

Documentation

Contributors

cas-ciip-portal's People

Contributors

bcerki avatar blueqcloud avatar dependabot-preview[bot] avatar dependabot[bot] avatar dianadec avatar dimak1 avatar dleard avatar gurjmatharu avatar hamzajaved avatar joshgamache avatar joshlarouche avatar junminahn avatar kriscooke avatar maralsotoudehnia avatar matthieu-foucault avatar mikevespi avatar pbastia avatar rajpersram avatar repo-mountie[bot] avatar sam-warren avatar sepehr-sobhani avatar tmastrom avatar wenzowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dimak1 benbender

cas-ciip-portal's Issues

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means its critical that we work to make our content as discoverable as possible; Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's in, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip 🤓

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
FLNR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Safety & Solicitor General & Emergency B.C.
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means its critical that we work to make our content as discoverable as possible; Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's in, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip 🤓

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
FLNR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Safety & Solicitor General & Emergency B.C.
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

Reporter: triple-notification on empty product form

On the products page of the application, when adding a new product line and leaving it empty, the notification shows up 3 times

To reproduce

start a new application
go to the products page
click "add product"
click the product form field, then click away

Probability (1-5): 3

Effect (1-5): 1

image.png

(UX) Admin - Manage Products table changes column width unexpectedly

The column width is not fixed, as a result when sorting / paginating through elements, the column width can change.

  • This shuffles the position of elements that are expected to stay in the same place, in particular the search input boxes and the sort carets
  • This reduces the visibility of the data and makes is difficult for the user to understand the change that just happened
To reproduce:
  • as an admin, go to the Products and Benchmarks page
  • sort by Product
  • then sort by Benchmark (for example)

Expected outcome: the data is sorted in the table, the headers stay in place
Actual outcome: the headers move around with the content width

Note: this doesn't happen when the table contains all the rows (Pagination set to 100 items per page)

image.png

Comment (YT GGIRCS-2416):

unable to reproduce this (MacOS Chrome, Firefox or Safari) - could it be that it only occurs on extra-large monitors?

Error on submitting a blank date when editing a reporting year

react-jsonschema-form's required fields validation is somehow getting bypassed - only in the form to edit an existing reporting year. The required fields are correctly specified in the JSON schema, and the required fields work as expected in the New Reporting Year dialog.

Instead of adding a form error saying each of the date fields are required (which blocks the form from being submitted), it allows you to submit, causing an error popup.

Impact on the user (affects admin only):
Minimal; the form data entered is not saved, due to the error, and it should work find it they re-opened the dialog to enter more complete information and edit again.

Probability (1-5): 2

Effect (1-5): 1

Bug: null application status when clicking on svg icon

As an analyst,

When making a decision on an application, clicking on the icon of the button (the checkmark, ...), a null status for that application is registered in the database, making the application not accessible to anyone.

image.png

As a developer, I want to analyze collected load testing data

...and identify slow queries (identify threshold for what slow means) or mutations, and find opportunities for optimization.

https://youtrack.button.is/issue/GGIRCS-2487

AC:

  • In the excel load test report, identify and document which page hosts which query
  • Create a short report that:
    • Describes very quickly the load testing methodology
    • Orders the queries by response time - slowest first
    • Confirm response time to qualify as a "slow" request is > 1s under load
  • Create user stories to speed up the "slow" ones
  • Identify if express server is a bottleneck (if it is the case, recommendation should be to add a HorizontalPodAutoscaler)

Stretch goal: (not included in estimate)

  • Schedule a load testing presentation for the DevOps/Dev guild

bin scripts

#!/usr/bin/env bash

# add obs ppa
echo | sudo add-apt-repository ppa:obsproject/obs-studio

# install all dependencies
sudo apt update
cat apt.txt | xargs sudo apt install -y

# update sudoers to be NOPASSWD: ALL before running
sudo passwd -d ubuntu

# get a text editor
if [[ ! -d ~/.vim ]]; then
  git clone https://github.com/wenzowski/vim-config.git ~/.vim 
  ~/.vim/bin/install
fi

# install asdf-vm
if [[ ! "$(asdf --version)" == 'v0.7.4' ]]; then
  git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.4
  echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
  echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
  source ~/.bashrc
fi

if [[ -d "~/Desktop/cas-ciip-portal" ]]; then
  git clone https://github.com/bcgov/cas-ciip-portal.git ~/Desktop/cas-ciip-portal
  pushd ~/Desktop/cas-ciip-portal
    make install_dev_tools # need to `source ~/.bashrc` and rerun for now
    pushd app
      yarn install
    popd
    cat .tool-versions | xargs -n2 asdf global # make this project's versions global
  popd
fi
chromium-browser
git
curl
vim
build-essential
zlib1g-dev
libncurses5-dev
libgdbm-dev
libnss3-dev
libssl-dev
libreadline-dev
libffi-dev
wget
obs-studio
vlc
iotop
libxml++2.6-dev
#!/usr/bin/env bash
pushd ~/Desktop/cas-ciip-portal || exit 1
  pg_ctl start || pg_ctl restart
  pushd schema || exit 1
    sqitch status || sqitch rebase
  popd
  pushd app || exit 1
    yarn build
    yarn start
  popd
popd

refactor pgTap style tests

Reference: back in 2019

need to make it so it's more reusable for us
make it schema-agnostic
rather than copy and pasting/find and replace
could make it into its own repo (BC Gov) as a whole
Needs refactoring
operational tests are still running on the schema defined inside the test file (are they useful?)

Explore Metabase dashboard for Validation spreadsheet

After #ggircs-2366 is done, schedule mtg with ICU for this task. PO also flagged that we could send info to SMEs in advance of the call to save some time.

  • obtain latest spreadsheet, capture info about the work needed
  • Setup meeting and include new ICU team members and GGIRCS team members new to working with metabase - example dashboard
  • Record notes on what would be needed to create a dashboard according to the validation spreadsheet v1.6 - Guidance document for the spreadsheet HERE.
  • Next steps: Fill in the Placeholder Epic (linked to this card) and break down into user stories to outline the work involved for this particular Metabase Dashboard.

As a logged in user, I want to see a modal prompting me to extend my session before I get logged out for being inactive

Description

See comments in GGIRCS-1799 for relevant discussion

image.png
Following GGIRCS-1799, sessions do not expire if the user is active (send requests to the server). However, if they remain idle, or are simply viewing a page without interacting with it, they will get redirected to the login-redirect page.
This feature will display a toast message prompting them to extend their session. Clicking on the toast message would send a request to the server, automatically refreshing the session.
Reference: https://youtrack.button.is/issue/GGIRCS-1799

Acceptance Criteria

  1. Given that I am logged in
    When I have not been active for 28 mins
    Then I should get a modal prompting me to extend my session

  2. Given that I am seeing the modal
    When I click the 'remain active' button
    Then my session is extended for another 30 minutes

  3. Given that I am seeing the modal
    When I click the 'logout' button
    Then my session ends immediately

Development Checklist

  • follow above wireframe
  • have as a full overlay

Support post-registration redirects

We decided to go ahead and ship the direct link to register for now without support for post-registration redirects, due to some difficulties that would add precious time to debug before impending use by the public (pull request). Those difficulties were:

  • Return trip to /login after registering returns a 403 (however the user is still created, and subsequently clicking "Login" automatically logs them in).
  • The login service improperly decodes the redirectTo query param. Not sure why or how relevant.

Probability (1-5):

Effect (1-5):

See discussion on GGIRCS-1767

Add project lifecycle badge

No Project Lifecycle Badge found in your readme!

Hello! I scanned your readme and could not find a project lifecycle badge. A project lifecycle badge will provide contributors to your project as well as other stakeholders (platform services, executive) insight into the lifecycle of your repository.

What is a Project Lifecycle Badge?

It is a simple image that neatly describes your project's stage in its lifecycle. More information can be found in the project lifecycle badges documentation.

What do I need to do?

I suggest you make a PR into your README.md and add a project lifecycle badge near the top where it is easy for your users to pick it up :). Once it is merged feel free to close this issue. I will not open up a new one :)

YouTrack to ZenHub Transition

We are transitioning from YouTrack to ZenHub.
As a team member, I want to access a tracker that is in line with org best practices and guidelines

Explore Metascript's broken question function as an alert

This function https://github.com/bcgov/cas-metascript/blob/master/test/get_broken_questions.js leverages the metabase api to check for any questions that are broken.
Explore a way to integrate this as an alert somewhere to let us know if any changes we make to metabase (or the underlying data in the database) have broken any questions along the way.

AC:

  • a repeatable way to get a list of all the metabase questions that result in an error
  • could be a manual check before deploying to prod (eg part of QA process) for first iteration
    • copy questions from prod into test
  • (Stretch goal) - more automated way

Minor inconsistency with terminology in NAICS code UI

This isn't so much a bug but an cognition issue but didn't know how else to categorize the type) The NAICS code interface used when adding an allowable products, uses a mix of terminology of 'required' and 'mandatory'. Suggest that we replace the former with the latter.

Probability (1-5): 5

Effect (1-5): 1

image.png

users should be automatically logged into CIIP if logged in in keycloak

Reporter: a reporter
Description:

I get an error saying my user name and email is already registered, I tried to login but of course I don’t know my password. I was able to reset my password but when I click on the link in my email it brings me to a page that says “you are already logged in” but when I go back to the CIIP main page it asks to login, but I still don’t know my password….

Additional information:
Discussion in GGIRCS-1801

As an administrator, I want to define the reporting years for which the CIIP configuration is valid

As a reporter/analyst/admin, I want to have consistency across reporting years when product data (name, benchmark) change. See Miro board, 'NAICS - Products maintainability scratchpad'.

The set of features needed to prevent and manage the effects of deleting or archiving a NAICS code, product, or NAICS-product association.

• With the current implementation, when a NAICS code, a product or a NAICS-product association gets deleted/archived, it will result in errors/warnings displayed in previous years’ applications that use these deleted/archived items, even though that was valid at the time.

Metabase cannot filter based on an enum type

Figure out a permanent solution to dealing with enum types that are not recognized properly by metabase.
Issue on metabase github: metabase/metabase#7092
A comment in the github issue suggests a possible workaround, which we can try.

I am thinking that maybe setting the database search path in the metabase connection (if possible) might fix the issue

Probability (1-5): 2

Effect (1-5): 3

CIIP website redesign

Context: ICU are looking to review the design of the CIIP website and seeking UX support to do so.

Pre-Design

  • Conduct a discovery session with ICU team
  • Connect with ICU's tech specialist about layout constraints
  • Information architecture analysis (CIIF Webpage Redesign MiroBoard)

AC:

  • reach out to our SME at ICU and determine the scope of work
  • assess the website(s) in question
  • make recommendations for content redesign

DELL ECS object storage is configured

To do:

  • need separate accounts for Terraform (currently using Alec's)
  • Setup a call with Neal Li since he has configured Dell ECS (Team Falcon) - after June 18
  • Need to transfer the 3 service account secrets that Maral has (also Dylan D.)
  • Maral to connect with Julian

Questions to answer:
What does our migration look like?
Which services are we moving over vs. leaving on google Cloud?

Onboard Stakeholders to GitHub

Once setup on GH, we'll go over:

  • ZenHub Board: what view to use
  • What each column means
  • Epic Prioritization
  • how to view what we are working on in the current sprint/what will likely be demoed at the sprint review.
  • how ZH relates to our roadmap

Express server does not use updated SSL cert until it is restarted

This affects both CIIP and GGIRCS apps.
In practice, this only happens if we don't push changes of that app to prod for a month, and if the pod wasn't affected by any maintenance.
When it does happen, the app becomes inaccessible to a non-technical user.

To resolve this, instead of having the express server taking care of the SSL termination, our applications should rely on an nginx reverse proxy deployed in a sidecar pod. See the metabase deployment for an example

Probability (1-5): 2

Effect (1-5): 5

(UI) Application forms input alignments are off

The new 'Attention required' warning on the right side of the forms has squished the forms. This has caused some vertical alignment issues with the inputs in the forms.
Inputs with longer titles that span 2 lines are not aligned with inputs with shorter titles that span only 1 line.
Screenshots attached.
Probably just needs some css or bootstrap fiddling.

Probability (1-5): 5

Effect (1-5): 1

image.png

image.png

Global Bootstrap color style overrides for AA contrast accessibility

There are Bootstrap color variants (with resulting background-color, border-color, and color styles) throughout the site that always need to be globally overridden to meet WCAG AA contrast. We should do these overrides once in the default layout, instead of haphazardly throughout the code base.

Ideally, we can then remove the inline overrides scattered everywhere.

Focus:

The issue comes mainly from Button and Badge components.
Implement overrides for the following non-accessible variants of both Button and Badge:

        .btn-primary
        .btn-success
        .btn-info
        .btn-link
        .btn-outline-warning (the regular .btn-outline is fine as-is)

I'm not sure what would be the point of implementing .btn-outline-light as it's practically invisible...
Ensure each of the related outline- variants are overridden with the same colors and pass AA contrast
Ensure all variants' :focus, :active, :hover, :disabled and .disabled states are also overridden with the accessible colors.

See discussion in GGIRCS-2405

Fuel charge interface (ggircs app)

As an admin
I want an interface that allows editing the fuel charge associated to each fuel
So when changes to the charges associated to individual fuels are applied I can easily make the change in CIIP

Background:
The fuel charges associated to each individual fuel originally went up at the same rate as the carbon tax's $/tCO2e rate. This stopped in 2020. The charges associated to each fuel are no longer linear and predictable. Having an interface where an admin can make the necessary changes on a fuel by fuel basis would be a better solution than having developers continually updating hardcoded data based on changes in the CTA.

Form validation isn't run (to highlight overridden errors) on application review page

Describe the Bug:

Required validations that would normally prevent submission, but which have been overridden with justification by the applicant, should be highlighted in red on the application review page. Currently, they are not.

Probability (1-5): 1

Effect (1-5): 3

Steps to reproduce the behaviour: submit an application with validation errors, by using the validation override. When viewing the submitted application, the errors should be visible, but they are not

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.