Allowed upper case for environment names

This commit is contained in:
Vladyslav Matsiiako
2023-01-17 22:00:52 -08:00
parent 93150199a4
commit e47530dc71
4 changed files with 8 additions and 8 deletions
@@ -33,7 +33,7 @@ export const createWorkspaceEnvironment = async (
} }
workspace?.environments.push({ workspace?.environments.push({
name: environmentName.toLowerCase(), name: environmentName,
slug: environmentSlug.toLowerCase(), slug: environmentSlug.toLowerCase(),
}); });
await workspace.save(); await workspace.save();
@@ -96,7 +96,7 @@ export const renameWorkspaceEnvironment = async (
throw new Error('Invalid environment given'); throw new Error('Invalid environment given');
} }
workspace.environments[envIndex].name = environmentName.toLowerCase(); workspace.environments[envIndex].name = environmentName;
workspace.environments[envIndex].slug = environmentSlug.toLowerCase(); workspace.environments[envIndex].slug = environmentSlug.toLowerCase();
await workspace.save(); await workspace.save();
+4 -4
View File
@@ -29,19 +29,19 @@ const workspaceSchema = new Schema<IWorkspace>({
], ],
default: [ default: [
{ {
name: "development", name: "Development",
slug: "dev" slug: "dev"
}, },
{ {
name: "test", name: "Test",
slug: "test" slug: "test"
}, },
{ {
name: "staging", name: "Staging",
slug: "staging" slug: "staging"
}, },
{ {
name: "production", name: "Production",
slug: "prod" slug: "prod"
} }
], ],
@@ -49,7 +49,7 @@ export const AddUpdateEnvironmentDialog = ({
const onFormSubmit: FormEventHandler = (e) => { const onFormSubmit: FormEventHandler = (e) => {
e.preventDefault(); e.preventDefault();
const data = { const data = {
name: formInput.name.toLowerCase(), name: formInput.name,
slug: formInput.slug.toLowerCase(), slug: formInput.slug.toLowerCase(),
}; };
if (isEditMode) { if (isEditMode) {
@@ -84,7 +84,7 @@ const EnvironmentTable = ({ data = [], onCreateEnv, onDeleteEnv, onUpdateEnv }:
{data?.length > 0 ? ( {data?.length > 0 ? (
data.map(({ name, slug }) => ( data.map(({ name, slug }) => (
<tr key={name} className="bg-bunker-800 hover:bg-bunker-800/5 duration-100"> <tr key={name} className="bg-bunker-800 hover:bg-bunker-800/5 duration-100">
<td className="pl-6 py-2 border-mineshaft-700 border-t text-gray-300 capitalize"> <td className="pl-6 py-2 border-mineshaft-700 border-t text-gray-300">
{name} {name}
</td> </td>
<td className="pl-6 py-2 border-mineshaft-700 border-t text-gray-300">{slug}</td> <td className="pl-6 py-2 border-mineshaft-700 border-t text-gray-300">{slug}</td>