mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 06:29:37 +00:00
Feedback fixes
This commit is contained in:
@@ -18,21 +18,18 @@ export const HighlightText = ({
|
||||
const escapedSearchTerm = searchTerm.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
const regex = new RegExp(escapedSearchTerm, "gi");
|
||||
|
||||
while (true) {
|
||||
const match = regex.exec(text);
|
||||
if (match === null) break;
|
||||
|
||||
for (const match of text.matchAll(regex)) {
|
||||
if (match.index > lastIndex) {
|
||||
parts.push(<span key={`pre-${lastIndex}`}>{text.substring(lastIndex, match.index)}</span>);
|
||||
}
|
||||
|
||||
parts.push(
|
||||
<span key={`match-${match.index}`} className={highlightClassName || "bg-yellow/30"}>
|
||||
{text.substring(match.index, match.index + match[0].length)}
|
||||
{match[0]}
|
||||
</span>
|
||||
);
|
||||
|
||||
lastIndex = regex.lastIndex;
|
||||
lastIndex = match.index + match[0].length;
|
||||
}
|
||||
|
||||
if (lastIndex < text.length) {
|
||||
|
||||
@@ -189,10 +189,15 @@ export const EnvironmentPageForm = () => {
|
||||
});
|
||||
|
||||
reset(formData);
|
||||
} catch {
|
||||
} catch (error) {
|
||||
const errorMessage =
|
||||
(error as any)?.response?.data?.message ||
|
||||
(error as any)?.message ||
|
||||
"An unknown error occurred";
|
||||
createNotification({
|
||||
type: "error",
|
||||
text: "Failed to update environment overrides"
|
||||
title: "Failed to update environment overrides",
|
||||
text: errorMessage
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user