feat: renamed old frontend and fixed some minor bugs

This commit is contained in:
=
2025-01-06 14:56:49 +05:30
parent 8c902d7699
commit 54377a44d3
2577 changed files with 35240 additions and 35116 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ const decryptPrivateKeyHelper = async ({
} else {
throw new Error("Insufficient details to decrypt private key");
}
} catch (err) {
} catch {
throw new Error("Failed to decrypt private key");
}
+9
View File
@@ -0,0 +1,9 @@
const INTEGRATION_PROJECT_ID = "integration_project_id";
export const localStorageService = {
getIintegrationProjectId() {
return localStorage.getItem(INTEGRATION_PROJECT_ID);
},
setIntegrationProjectId(projectId: string) {
return localStorage.setItem(INTEGRATION_PROJECT_ID, projectId);
}
};
+31 -31
View File
@@ -1,31 +1,31 @@
/** Extracts the key and value from a passed in env string based on the provided delimiters. */
export const getKeyValue = (pastedContent: string, delimiters: string[]) => {
if (!pastedContent) {
return { key: "", value: "" };
}
let firstDelimiterIndex = -1;
let foundDelimiter = "";
delimiters.forEach((delimiter) => {
const index = pastedContent.indexOf(delimiter);
if (index !== -1 && (firstDelimiterIndex === -1 || index < firstDelimiterIndex)) {
firstDelimiterIndex = index;
foundDelimiter = delimiter;
}
});
const hasValueAfterDelimiter = pastedContent.length > firstDelimiterIndex + foundDelimiter.length;
if (firstDelimiterIndex === -1 || !hasValueAfterDelimiter) {
return { key: pastedContent.trim(), value: "" };
}
const key = pastedContent.substring(0, firstDelimiterIndex);
const value = pastedContent.substring(firstDelimiterIndex + foundDelimiter.length);
return {
key: key.trim(),
value: value.trim()
};
};
/** Extracts the key and value from a passed in env string based on the provided delimiters. */
export const getKeyValue = (pastedContent: string, delimiters: string[]) => {
if (!pastedContent) {
return { key: "", value: "" };
}
let firstDelimiterIndex = -1;
let foundDelimiter = "";
delimiters.forEach((delimiter) => {
const index = pastedContent.indexOf(delimiter);
if (index !== -1 && (firstDelimiterIndex === -1 || index < firstDelimiterIndex)) {
firstDelimiterIndex = index;
foundDelimiter = delimiter;
}
});
const hasValueAfterDelimiter = pastedContent.length > firstDelimiterIndex + foundDelimiter.length;
if (firstDelimiterIndex === -1 || !hasValueAfterDelimiter) {
return { key: pastedContent.trim(), value: "" };
}
const key = pastedContent.substring(0, firstDelimiterIndex);
const value = pastedContent.substring(firstDelimiterIndex + foundDelimiter.length);
return {
key: key.trim(),
value: value.trim()
};
};
+1 -1
View File
@@ -9,4 +9,4 @@ export const policyDetails: Record<PolicyType, { name: string; className: string
className: "bg-indigo-900 text-indigo-100",
name: "Change Policy"
}
};
};
+1 -13
View File
@@ -60,20 +60,8 @@ export const initProjectHelper = async ({ projectName }: { projectName: string }
return project;
};
export const getProjectHomePage = (workspace: Workspace) => {
if (workspace.type === ProjectType.SecretManager) {
return `/${workspace.type}/${workspace.id}/secrets/overview`;
}
if (workspace.type === ProjectType.CertificateManager) {
return `/${workspace.type}/${workspace.id}/certificates`;
}
if (workspace.type === ProjectType.KMS) {
return `/${workspace.type}/${workspace.id}/kms`;
}
return `/${workspace.type}/${workspace.id}/ssh`;
return `/${workspace.type}/$projectId/overview` as const;
};
export const getProjectTitle = (type: ProjectType) => {
+1 -1
View File
@@ -11,4 +11,4 @@ export const isValidPath = (val: string): boolean => {
// Check for valid characters and no consecutive slashes
const validPathRegex = /^[a-zA-Z0-9-_.:]+(?:\/[a-zA-Z0-9-_.:]+)*$/;
return validPathRegex.test(val);
}
};