Skip to content

Commit

Permalink
Fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
louislam committed Nov 13, 2023
1 parent 54e8484 commit d764424
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions backend/stack.ts
Expand Up @@ -72,9 +72,9 @@ export class Stack {
}

validate() {
// Check name, allows [a-z][A-Z][0-9] _ - only
if (!this.name.match(/^[a-zA-Z0-9_-]+$/)) {
throw new ValidationError("Stack name can only contain [a-z][A-Z][0-9] _ - only");
// Check name, allows [a-z][0-9] _ - only
if (!this.name.match(/^[a-z0-9_-]+$/)) {
throw new ValidationError("Stack name can only contain [a-z][0-9] _ - only");
}

// Check YAML format
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/pages/Compose.vue
Expand Up @@ -68,9 +68,10 @@
<h4 class="mb-3">{{ $t("general") }}</h4>
<div class="shadow-box big-padding mb-3">
<!-- Stack Name -->
<div class="mb-3">
<div>
<label for="name" class="form-label">{{ $t("stackName") }}</label>
<input id="name" v-model="stack.name" type="text" class="form-control" required>
<input id="name" v-model="stack.name" type="text" class="form-control" required @blur="stackNameToLowercase">
<div class="form-text">Lowercase only</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -582,6 +583,10 @@ export default {
});
},
stackNameToLowercase() {
this.stack.name = this.stack?.name?.toLowerCase();
},
}
};
</script>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/styles/main.scss
Expand Up @@ -680,6 +680,10 @@ code {
}
}

.form-text {
color: $dark-font-color3;
}

// Vue Prism Editor bug - workaround
// https://github.com/koca/vue-prism-editor/issues/87
/*
Expand Down

0 comments on commit d764424

Please sign in to comment.