fix: Implement functionality for admin to edit tooltips#2633
Conversation
…o execute store procedure to update description for tooltips
…escription in the server
… icons toggle base on tooltip availability
…ure and toggle "+" and "i" to rulestrategy allowing page 4 to exhibit the same behaviors like page 1
entrotech
left a comment
There was a problem hiding this comment.
There are a few more things that need to be done to finish this issue. The accordion tooltips were not working at all on Page 2 of the Wizard, due to a bug not really related to your changes, but some of the changes you made also needed to be made to different components used on page 2. I had to do some experimentation to fix Page 2 tooltips, and will merge another PR after this one to fix those.
Also, the plus icon next to the label and the pencil icon on the tootip are still displayed if the user is not an admin, which allows the tooltip edit dialog to appear. Fortunately, if you try to make changes to the tooltip and save them the web api security prevents the change from actually being made. I'll create a follow-up issue to fix this.
What changes did you make?
The server side:
-Added a stored procedure CalculationRule_UpdateDescription that updates only the description column of the CalculationRule table
-Added an endpoint for a PUT request to url /api/calculations/updatedescription/:id by creating the router, contoller method and service method to execute the stored procedure.
The client side:
-Created a new method in the calculation.service module called updateDescription. that calls the above api.
-Added code for admin tooltip UI functionality to AccordionToolTip, RuleLabel, RuleStrategy and RuleInput.
-Added a hook file, useToolTipEditor.
Why did you make the changes (we will use this info to test)?
-Admin users need the ability to edit the tooltip text in the calculator pages (1-4). So that they can update the information related to Strategies and Input fields that define a project (e.g., APN number).
The "i" icon shows a Tooltip exists on a field
Clicking on the icon opens the Tooltip with related information
However Admin users need ability to modify the tooltips. We need to create mockups for the different actions admin user can take on tooltips:
-View existing tooltips
-Add a new tooltip if it does not exist
-Edit the tooltip
Please review issue 1903 for more details on UI:
Implement the designs created in 1903
Issue-Specific User Account
Admin Account
Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Visuals before changes are applied
Visuals after changes are applied