cseseniordesign / know-your-well

2022-2025 Nebraska Water Center Senior Design Capstone Project
6 stars 1 forks source link

Tooltips #427

Closed ColinSalem closed 4 weeks ago

ColinSalem commented 4 weeks ago

This PR adds a new feature for showing tooltips next to fields that are used during data entry for Well Info, Field Activities, and Class Labs. Fields with a tooltip will have an ⓘ icon displayed next to them, and clicking it will pull up a pop-up box that holds supplementary text and one or more image.

To add a tooltip, you need to add a row with the text to the SQL database in the tblTooltip table and a row with the filename to the tblTooltipImage table. The filename needs to reference a file that is stored in the tooltip-images container in the Azure Blob site. Example queries for adding a tooltip for aquifertype can be seen below:

insert into tblTooltip (prompt_id, text, active) values ('aquifertype', 'An unconfined aquifer is easily accessible through the unsaturated layer and starts at the top of the water table and ends when there is an impermeable layer or bedrock beneath it. A confined aquifer, sometimes called an artesian aquifer, lies between two impermeable layers, called confining layers. Confined aquifers often have increased water pressure which, when accessed, may produce flowing water without the need for a pump.', 1)
insert into tblTooltipImage (prompt_id, im_filename, active) values ('aquifertype', 'aquifertype-1.jpg', 1)

Note: This assumes that a file with the filename aquifertype-1.jpg is in the tooltip-images container in the Azure Blob site.