e-mission / op-admin-dashboard

An admin/deployer dashboard for the NREL OpenPATH platform
0 stars 8 forks source link

Make QR codes visible on token page and delete tokens. #99

Open achasmita opened 6 months ago

achasmita commented 6 months ago
shankari commented 6 months ago

@achasmita this PR is still a draft Where is the testing done?

achasmita commented 6 months ago

I made use of dash dcc.ConfirmDialogProvider to create a confirmation dialog that appears when user select Delete Selected Rows button

https://dash.plotly.com/dash-core-components/confirmdialogprovider

Screen Shot 2024-02-02 at 10 29 51 AM

If user select ok it will delete respective token else cancel the deletion.

shankari commented 6 months ago

I still don't see "Testing done" for the initial fix (QR code not visible), or for that matter, validation that the token is actually deleted from the database (as opposed to the in-memory dataframe).

achasmita commented 6 months ago

I have tested and QR code is visible and also tokens get deleted. I generated two new tokens and tried deleting them, and also verified it by checking it manually. Screen Shot 2024-02-03 at 10 43 46 PM

shankari commented 6 months ago

have tested and QR code is visible

Screenshot please.

Also, while reporting command line outputs, it is better to copy and paste rather than include a screenshot since the screenshot is not searchable

achasmita commented 6 months ago

qr_code_snapshot_example

shankari commented 6 months ago

@achasmita you want to not display real QR codes on tokens on a public website. I have now edited to remove them and only leave in the test tokens. Please be cognizant of what you put up publicly versus internally.

shankari commented 6 months ago

@achasmita why is this back in ready for review? I don't see changes other than the merge and the QRCODE_WITH_PATH directoy check, which will be obsolete once you switch to generating QR codes on the fly

shankari commented 5 months ago

@achasmita as I suggested earlier, please make the token deletion functionality configurable. We currently do not have permission from our cyber team to modify the database. I don't anticipate any issues getting that permission, but we cannot enable the functionality until we have the permission. To make sure that we don't enable it inadvertently, please make sure that this is an env variable (similar to the COGNITO keys) instead of being specified deployment by deployment in the dynamic config.

achasmita commented 5 months ago

Testing is done. The token_deletion_enabled is set false for now and delete button remains disable when it is false.