-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PM-11624] Fixed SecureSafe csv import fail #10875
base: main
Are you sure you want to change the base?
Conversation
Thank you for your contribution! We've added this to our internal Community PR board for review. |
@macronym Thank you for your contribution 🚀. I haven't had any time yet to investigate further, but assuming the surrounding slashes on column headers are present on all SecureSafe exports, this seems to address the issue. This PR does not solve the original issue with translated column headers. Examples are currently present in German and French but there might be more. |
Ah, my apologies. So I need to also translate column headers to the English headers. I will continue to look for a solution later today. |
* Replace headers with english form * Remove slashes surrounding the values if present * Added test
Hey @djsmith85 I believe I have written an improved solution that accounts for translated headers. Do I have to reissue another pull request or just push to the same branch I was working on before? |
Same branch is fine |
How do I get it reviewed? |
// SecureSafe currently exports values in multiple languages. - 09/05/2024 | ||
// New headers are used to ensure import success. | ||
const newHeaders = ["Title", "Username", "Password", "URL", "Comment"]; | ||
|
||
// SecureSafe can surround values in slashes. - 09/05/2024 | ||
// This removes any surrounding slashes from the values. | ||
const headers = Object.keys(results[0]); | ||
const remappedResults = results.map((row) => { | ||
const remappedRow: any = {}; | ||
newHeaders.forEach((header, index) => { | ||
let value = row[headers[index]]; | ||
if (typeof value === "string" && value.startsWith("/") && value.endsWith("/")) { | ||
value = value.slice(1, -1); | ||
} | ||
remappedRow[header] = value; | ||
}); | ||
return remappedRow; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the headers always come in the same order, can we simply refer to them by index instead of by name? I would imagine it'd be more reliable than trying to translate the source language
🎟️ Tracking
#10786
📔 Objective
SecureSafe exports csvs in a format where headers can be in non-English form and where every value is surrounded by slashes (Ex: /Titel/ vs. Title). This was causing the import to fail when trying to reference
value.Title
. I replaced the headers with those described in SecureSafe's website so the import succeeds and removed any surrounding slashes from the values since those are unintended.https://help.securesafe.com/exporting-passwords
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes