Skip to content

Commit

Permalink
[instruments] Fix properly disabling/enabling 'Delete instrument data…
Browse files Browse the repository at this point in the history
…' button display (#8686)

Currently, if the 'InstrumentResetting' config is set to 'No', the 'Delete instrument data' button is displayed and the user is able to clear the instrument. This fixes that by letting the if statement check a true boolean instead of string "true" by calling 'settingEnabled'. The PR also modifies the testing plan so this is tested in the future.
  • Loading branch information
zaliqarosli authored Jun 7, 2023
1 parent d7e1de1 commit 737b67e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/instruments/test/TestPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ is correct.
5. If the instrument has multiple pages (on the left pane), move from page to page and check that the
saved data stays the same. The data that wasn't saved should be lost.
6. Make sure that the 'Delete instrument data' button on the left pane is only visible when the user
has the 'Send to DCC' permission.
has the 'Send to DCC' permission, and the configuration `InstrumentResetting` (_"Instrument Resetting"_) is set to
'Yes' in the Configuration module.
7. Click on the 'Delete instrument data' button and check if the instrument's data is cleared.
8. Select a candidate with a Date Of Death (DoD) or put one in for a candidate as needed, then select an
instrument for that candidate. Enter a date (same a step 4) posterior to the DoD. Refresh the page and check that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class NDB_BVL_InstrumentStatus_ControlPanel extends NDB_BVL_InstrumentStatus
$this->tpl_data['access']['validity'] = $this->_displayValidity();
}

if ($config->getSetting('InstrumentResetting')
if ($config->settingEnabled('InstrumentResetting')
&& $this->getDataEntryStatus() != 'Complete'
) {
$user = User::singleton();
Expand Down

0 comments on commit 737b67e

Please # to comment.