[SM-89] Updates to encrypted export
Type of change
- [ ] Bug fix
- [ x ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
Objective
Code changes
- file.ext: Description of what was changed and why
Screenshots
Before you submit
- [ ] I have checked for **linting** errors (`npm run lint`) (required)
- [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required)
- [ ] This change requires a **documentation update** (notify the documentation team)
- [ ] This change has particular **deployment requirements** (notify the DevOps team)
Should I just put notes above the code that needs to be moved, so that it can be moved by the person working on web/app/browser etc?
@cd-bitwarden My last commit fixes the problem we were having when moving around ImportService and FilePasswordPromptComponent between modules. The issue is that ImportService and FilePasswordPromptComponent should both be scoped at the ImportExportModule level (feature module), but the ModalService which creates the dialog is scoped at the app level. So ModalService couldn't find ImportService to inject into FilePasswordPromptComponent when creating it. Which is an interesting problem.
There's probably a more elegant solution, but for now I've just passed in ImportService in the ModalConfig.data.
@cd-bitwarden, I've fixed the error handling as follows:
- changed
FilePasswordPromptComponentto just get the password and return it toImportComponent ImportComponenthas the password protected import logic
I also addressed some CodeScene feedback, mostly by just reducing nesting in some of the conditionals.
Please review and let me know what you think, and test it out to make sure the errors you were hitting are properly displayed.
One issue I ran out of time to solve is that if you select a non-encrypted export format -> click submit -> cancel out of the modal, then change to a File-Encrypted Export, the file password fields remain disabled. I think we need to enable/disable the fields based when the format and/or encryption type changes.