{"record":{"id":"8aa0b6cfc241df80","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-group-name-required","errorCode":null,"errorMessage":"this.$t('message.group_name_required')","messagePattern":"this\\.\\$t\\('message\\.group_name_required'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/Connections.vue","lineNumber":249,"sourceCode":"    onGroupOrderEnd({ newIndex, oldIndex }) {\n      if (newIndex === oldIndex) {\n        return;\n      }\n\n      const groups = [...this.groups];\n      groups.splice(newIndex, 0, groups.splice(oldIndex, 1)[0]);\n      this.groups = groups;\n      storage.setGroups(groups);\n    },\n    openEditGroupDialog(group) {\n      this.groupForm = { id: group.id, name: group.name };\n      this.showGroupDialog = true;\n    },\n    handleGroupSubmit() {\n      const name = this.groupForm.name.trim();\n\n      if (!name) {\n        return this.$message.error(this.$t('message.group_name_required'));\n      }\n\n      if (!storage.renameGroup(this.groupForm.id, name)) {\n        return this.$message.error(this.$t('message.group_exists'));\n      }\n\n      this.showGroupDialog = false;\n      this.$message.success(this.$t('message.modify_success'));\n      this.$bus.$emit('groups-updated');\n    },\n    deleteGroup(groupId) {\n      this.$confirm(this.$t('message.delete_group_confirm'), { type: 'warning' }).then(() => {\n        storage.deleteGroup(groupId);\n        this.$message.success(this.$t('message.delete_success'));\n        // reload connections so in-memory groupId is cleared(in connections)\n        this.initConnections();\n      }).catch(() => {});\n    },","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/Connections.vue#L231-L267","documentation":"This is not a thrown exception but an Element UI toast (this.$message.error) shown when the connection-group rename dialog is submitted with an empty name. handleGroupSubmit() trims groupForm.name and rejects falsy values before calling storage.renameGroup, so the group is never modified. The i18n key 'message.group_name_required' resolves to a localized 'Group name is required' string.","triggerScenarios":"Clicking the edit (pencil) icon on a connection group in Connections.vue to open the group dialog, clearing the name input (or entering only whitespace), and clicking save. `const name = this.groupForm.name.trim(); if (!name) { return this.$message.error(...) }` fires and the dialog stays open.","commonSituations":"User opens the edit-group dialog intending to delete the group but instead blanks the name and submits; automated UI tests (e.g. Spectron/Playwright) submit the form without filling fields; the dialog is opened, name field fully selected and deleted via keyboard, then Enter pressed.","solutions":["Type a non-empty, non-whitespace group name and submit again","Trim input automatically and disable the submit button while the name is blank so the error path is unreachable","Add maxlength/required attribute on the el-input to prevent whitespace-only submissions"],"exampleFix":"// before\n<el-input v-model=\"groupForm.name\"/>\n<el-button @click=\"handleGroupSubmit\">OK</el-button>\n\n// after\n<el-input v-model=\"groupForm.name\" maxlength=\"30\"/>\n<el-button :disabled=\"!groupForm.name.trim()\" @click=\"handleGroupSubmit\">OK</el-button>","handlingStrategy":"validation","validationCode":"const name = this.groupForm.name.trim();\nif (!name) {\n  this.$message.error(this.$t('message.group_name_required'));\n  return; // block submit before storage is touched\n}","typeGuard":"// Vue template-level guard\n// :disabled=\"!groupForm.name.trim()\"","tryCatchPattern":null,"preventionTips":["Trim inputs on blur so whitespace-only names are visible immediately","Disable the dialog's confirm button while the trimmed name is empty","Run form validation in UI automation before submitting the dialog"],"tags":["ui-validation","i18n","vue","element-ui","connection-groups"],"backgroundTag":"empty-required-field","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}