diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 0c6ea51aa..83b8a1f0b 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -22,8 +22,6 @@ export const updateUserInfos = gql` mutation( $firstName: String $lastName: String - $description: String - $username: String $password: String $passwordNew: String $locale: String @@ -32,8 +30,6 @@ export const updateUserInfos = gql` updateUserInfos( firstName: $firstName lastName: $lastName - description: $description - username: $username password: $password passwordNew: $passwordNew language: $locale diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index c6d5a36c3..ff211fc07 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -4,11 +4,9 @@ export const login = gql` query($email: String!, $password: String!, $publisherId: Int) { login(email: $email, password: $password, publisherId: $publisherId) { email - username firstName lastName language - description coinanimation klickTipp { newsletterState @@ -24,11 +22,9 @@ export const verifyLogin = gql` query { verifyLogin { email - username firstName lastName language - description coinanimation klickTipp { newsletterState @@ -93,12 +89,6 @@ export const sendResetPasswordEmail = gql` } ` -export const checkUsername = gql` - query($username: String!) { - checkUsername(username: $username) - } -` - export const listGDTEntriesQuery = gql` query($currentPage: Int!, $pageSize: Int!) { listGDTEntries(currentPage: $currentPage, pageSize: $pageSize) { diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 1a6521cd7..0297af6ea 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -15,18 +15,15 @@ export const mutations = { email: (state, email) => { state.email = email }, - username: (state, username) => { - state.username = username - }, + // username: (state, username) => { + // state.username = username + // }, firstName: (state, firstName) => { state.firstName = firstName }, lastName: (state, lastName) => { state.lastName = lastName }, - description: (state, description) => { - state.description = description - }, token: (state, token) => { state.token = token }, @@ -56,10 +53,9 @@ export const actions = { login: ({ dispatch, commit }, data) => { commit('email', data.email) commit('language', data.language) - commit('username', data.username) + // commit('username', data.username) commit('firstName', data.firstName) commit('lastName', data.lastName) - commit('description', data.description) commit('coinanimation', data.coinanimation) commit('newsletterState', data.klickTipp.newsletterState) commit('hasElopage', data.hasElopage) @@ -69,10 +65,9 @@ export const actions = { logout: ({ commit, state }) => { commit('token', null) commit('email', null) - commit('username', '') + // commit('username', '') commit('firstName', '') commit('lastName', '') - commit('description', '') commit('coinanimation', true) commit('newsletterState', null) commit('hasElopage', false) @@ -96,8 +91,7 @@ try { language: null, firstName: '', lastName: '', - username: '', - description: '', + // username: '', token: null, isAdmin: false, coinanimation: true, diff --git a/frontend/src/validation-rules.js b/frontend/src/validation-rules.js index 54f4c3090..f0865d251 100644 --- a/frontend/src/validation-rules.js +++ b/frontend/src/validation-rules.js @@ -1,7 +1,6 @@ import { configure, extend } from 'vee-validate' // eslint-disable-next-line camelcase import { required, email, min, max, is_not } from 'vee-validate/dist/rules' -import { checkUsername } from './graphql/queries' export const loadAllRules = (i18nCallback) => { configure({ @@ -49,32 +48,6 @@ export const loadAllRules = (i18nCallback) => { }, }) - extend('gddUsernameUnique', { - async validate(value) { - this.$apollo - .query({ - query: checkUsername, - variables: { - username: value, - }, - }) - .then((result) => { - return result.data.checkUsername - }) - .catch(() => { - return false - }) - }, - message: (_, values) => i18nCallback.t('form.validation.usernmae-unique', values), - }) - - extend('gddUsernameRgex', { - validate(value) { - return !!value.match(/^[a-zA-Z][-_a-zA-Z0-9]{2,}$/) - }, - message: (_, values) => i18nCallback.t('form.validation.usernmae-regex', values), - }) - // eslint-disable-next-line camelcase extend('is_not', { // eslint-disable-next-line camelcase diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue index 84f8b60df..106529d0d 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue @@ -43,17 +43,6 @@ - - - {{ $t('form.description') }} - - - {{ form.description }} - - - - - @@ -85,7 +74,6 @@ export default { form: { firstName: this.$store.state.firstName, lastName: this.$store.state.lastName, - description: this.$store.state.description, }, loading: true, } @@ -94,14 +82,12 @@ export default { cancelEdit() { this.form.firstName = this.$store.state.firstName this.form.lastName = this.$store.state.lastName - this.form.description = this.$store.state.description this.showUserData = true }, loadSubmitButton() { if ( this.form.firstName !== this.$store.state.firstName || - this.form.lastName !== this.$store.state.lastName || - this.form.description !== this.$store.state.description + this.form.lastName !== this.$store.state.lastName ) { this.loading = false } else { @@ -116,13 +102,11 @@ export default { variables: { firstName: this.form.firstName, lastName: this.form.lastName, - description: this.form.description, }, }) .then(() => { this.$store.commit('firstName', this.form.firstName) this.$store.commit('lastName', this.form.lastName) - this.$store.commit('description', this.form.description) this.showUserData = true this.$toasted.success(this.$t('settings.name.change-success')) }) diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js.old similarity index 100% rename from frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js rename to frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js.old diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue.old similarity index 100% rename from frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue rename to frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue.old