Skip to content

Commit

Permalink
Allowed upper case for environment names
Browse files Browse the repository at this point in the history
  • Loading branch information
vmatsiiako committed Jan 18, 2023
1 parent 9315019 commit e47530d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/src/controllers/v2/environmentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const createWorkspaceEnvironment = async (
}

workspace?.environments.push({
name: environmentName.toLowerCase(),
name: environmentName,
slug: environmentSlug.toLowerCase(),
});
await workspace.save();
Expand Down Expand Up @@ -96,7 +96,7 @@ export const renameWorkspaceEnvironment = async (
throw new Error('Invalid environment given');
}

workspace.environments[envIndex].name = environmentName.toLowerCase();
workspace.environments[envIndex].name = environmentName;
workspace.environments[envIndex].slug = environmentSlug.toLowerCase();

await workspace.save();
Expand Down
8 changes: 4 additions & 4 deletions backend/src/models/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ const workspaceSchema = new Schema<IWorkspace>({
],
default: [
{
name: "development",
name: "Development",
slug: "dev"
},
{
name: "test",
name: "Test",
slug: "test"
},
{
name: "staging",
name: "Staging",
slug: "staging"
},
{
name: "production",
name: "Production",
slug: "prod"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const AddUpdateEnvironmentDialog = ({
const onFormSubmit: FormEventHandler = (e) => {
e.preventDefault();
const data = {
name: formInput.name.toLowerCase(),
name: formInput.name,
slug: formInput.slug.toLowerCase(),
};
if (isEditMode) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/basic/table/EnvironmentsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const EnvironmentTable = ({ data = [], onCreateEnv, onDeleteEnv, onUpdateEnv }:
{data?.length > 0 ? (
data.map(({ name, slug }) => (
<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}
</td>
<td className="pl-6 py-2 border-mineshaft-700 border-t text-gray-300">{slug}</td>
Expand Down

0 comments on commit e47530d

Please sign in to comment.