Skip to content

SimpleReport Style Guide

fzhao99 edited this page May 31, 2022 · 15 revisions

This style guide is very much a WIP!

Java

Whenever possible, avoid throwing a generic Exception in the method signature, preferring to throw the explicit Exception type.

No:

private String getUserStatus(UUID id) throws Exception {}

Yes:

private String getUserStatus(UUID id) throws IllegalStateException, BadRequestException {}

Frontend

Graphql Queries

All graphql queries used in a container component (a component that is the root of a view e.g.: Test Results View) should be place in a operations.graphql file that lives in the relevant subdirectory. For example, for the Test Results view the file that lives in the testResults folder.

Whenever you change the location/contents of a query file, run the command yarn codegen. This will generated the necessary hooks that will allow you call the query on the front end. For example, to fetch data using the query GetResultsCountByFacility you need to use the hook useGetResultsCountByFacilityQuery which will get automatically generated by the codegen command.

To see this example in action check the file TestResultsList.tsx in the repo.

Local development

Setup

How to

Development process and standards

Oncall

Technical resources

How-to guides

Environments/Azure

Misc

?

Clone this wiki locally