komiser icon indicating copy to clipboard operation
komiser copied to clipboard

Improve utils/providerHelper.ts

Open umrkhn opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Currently there is a lot of duplicated code as you can see below: https://github.com/tailwarden/komiser/blob/5983512d89c7bc44da7a11830d1f539f33dca039/dashboard/utils/providerHelper.ts#L1-L57 Describe the solution you'd like we can improve it by converting Provider and DBProvider into an enum as was suggested in the PR #1125 for IntegrationProvider https://github.com/tailwarden/komiser/blob/5983512d89c7bc44da7a11830d1f539f33dca039/dashboard/utils/providerHelper.ts#L57-L62

Why should we implement this? It would reduce code duplication and runtime errors, for ex: instead of hard-coding the values like 'postgres' we can import the enum and reference the property name as shown in the screenshot below:

issue

Would you like to work on this issue? Yes, once approved I'll start working on it.

umrkhn avatar Nov 10 '23 17:11 umrkhn

Hey, thank you for opening your first Issue! 🙂 While a Tailwarden team member takes a look at your issue we would like to invite you to join our official Discord server, where you can interact directly with other contributors and Tailwarden team members. Link here: https://discord.tailwarden.com

github-actions[bot] avatar Nov 10 '23 17:11 github-actions[bot]