diff --git a/js/src/views/Group/Create.vue b/js/src/views/Group/Create.vue
index 6be2b3ab..64c8afe0 100644
--- a/js/src/views/Group/Create.vue
+++ b/js/src/views/Group/Create.vue
@@ -22,11 +22,8 @@
}}
@@ -140,13 +137,17 @@ export default class CreateGroup extends mixins(IdentityEditionMixin) {
errors: string[] = [];
- fieldErrors: Record = {};
+ fieldErrors: Record = {
+ preferred_username: undefined,
+ summary: undefined,
+ };
usernameWithDomain = usernameWithDomain;
async createGroup(): Promise {
try {
this.errors = [];
+ this.fieldErrors = { preferred_username: undefined, summary: undefined };
await this.$apollo.mutate({
mutation: CREATE_GROUP,
variables: this.buildVariables(),
@@ -263,6 +264,24 @@ export default class CreateGroup extends mixins(IdentityEditionMixin) {
}
});
}
+
+ get summaryErrors() {
+ const message = this.fieldErrors.summary
+ ? this.fieldErrors.summary
+ : undefined;
+ const type = this.fieldErrors.summary ? "is-danger" : undefined;
+ return [message, type];
+ }
+
+ get preferredUsernameErrors() {
+ const message = this.fieldErrors.preferred_username
+ ? this.fieldErrors.preferred_username
+ : this.$t(
+ "Only alphanumeric lowercased characters and underscores are supported."
+ );
+ const type = this.fieldErrors.preferred_username ? "is-danger" : undefined;
+ return [message, type];
+ }
}