From 3f2727e754f7d288de77d88da83ce1df776dcd3b Mon Sep 17 00:00:00 2001 From: abdu <abdukiran@gmail.com> Date: Sat, 19 Oct 2024 16:12:31 +0200 Subject: [PATCH] fix sign-up input fields "disabled" attribute not working properly, update some texts --- frontend/src/components/LoginPage.vue | 17 ++++++++++------- frontend/src/components/MainPage.vue | 12 ++++++------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/LoginPage.vue b/frontend/src/components/LoginPage.vue index 006d003..7736071 100644 --- a/frontend/src/components/LoginPage.vue +++ b/frontend/src/components/LoginPage.vue @@ -24,12 +24,15 @@ export default { return this.user.userName === '' || this.user.password === '' }, checkPasswordSame(){ - console.log("pw length: " + this.repeatedPassword.length + "\n not same? " + (this.repeatedPassword !== this.user.password)) - if(this.repeatedPassword.length > 1 && this.repeatedPassword !== this.user.password){ - return true + let pw = this.user.password + let pw_repeated = this.repeatedPassword + + if(pw.length > 0 || pw_repeated > 0){ + return this.user.password.length === this.repeatedPassword.length } - return false + return null + } }, methods: { @@ -104,9 +107,9 @@ export default { <!-- sign-up modal --> <b-modal class="signup-modal" :ok-disabled="checkEmptyFieldsSignup" @ok="signUp" hide-header id="signup-modal"> - <b-input v-model="user.userName" class="mb-4 mt-4" id="signup-username" type="text" placeholder="enter username"></b-input> - <b-input v-model="user.password" class="mb-4" id="signup-password" type="password" placeholder="enter password"></b-input> - <b-input :state="checkPasswordSame" v-model="repeatedPassword" class="mb-4" id="signup-repeat-password" type="password" placeholder="repeat password"></b-input> + <b-input required v-model="user.userName" class="mb-4 mt-4" id="signup-username" type="text" placeholder="enter username"></b-input> + <b-input required v-model="user.password" class="mb-4" id="signup-password" type="password" placeholder="enter password"></b-input> + <b-input required :state="checkPasswordSame" v-model="repeatedPassword" class="mb-4" id="signup-repeat-password" type="password" placeholder="repeat password"></b-input> </b-modal> <!-- sign-in modal --> diff --git a/frontend/src/components/MainPage.vue b/frontend/src/components/MainPage.vue index 87b5302..3133c86 100644 --- a/frontend/src/components/MainPage.vue +++ b/frontend/src/components/MainPage.vue @@ -160,7 +160,7 @@ export default { <b-row> <b-col> <b-button class="mb-4" variant="primary" @click="showAddModal = true"> - Hinzufügen + Add new ToDo </b-button> </b-col> <b-col> @@ -217,12 +217,12 @@ export default { <p>{{this.todoIdForDeleteModal}}</p> </b-modal> - <b-modal v-model="showAddModal" title="Neuen Namen hinzufügen" @ok="addTodo" hide-header id="showAddModal"> - <b-form-group label="Titel"> - <b-form-input v-model="todo.title" placeholder="Name eingeben"></b-form-input> + <b-modal v-model="showAddModal" title="add title" @ok="addTodo" hide-header id="showAddModal"> + <b-form-group label="Title"> + <b-form-input required v-model="todo.title" placeholder="todo title"></b-form-input> </b-form-group> - <b-form-group label="Beschreibung"> - <b-form-input v-model="todo.description" placeholder="Beschreibung eingeben"></b-form-input> + <b-form-group label="Description"> + <b-form-input v-model="todo.description" placeholder="todo description"></b-form-input> </b-form-group> </b-modal> </b-card-body> -- GitLab