diff --git a/backend/src/middleware/notifications/notificationsMiddleware.js b/backend/src/middleware/notifications/notificationsMiddleware.js
index 2bc53ab7c..5419771ea 100644
--- a/backend/src/middleware/notifications/notificationsMiddleware.js
+++ b/backend/src/middleware/notifications/notificationsMiddleware.js
@@ -41,7 +41,6 @@ const publishNotifications = async (context, promises) => {
notifications.forEach((notificationAdded, index) => {
pubsub.publish(NOTIFICATION_ADDED, { notificationAdded })
if (notificationAdded.to.sendNotificationEmails) {
- // Wolle await
sendMail(
notificationTemplate({
email: notificationsEmailAddresses[index].email,
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
index e1d4d421b..2c279d0e6 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
@@ -106,7 +106,12 @@ describe('MySomethingList.vue', () => {
await Vue.nextTick()
const expectedItem = expect.objectContaining({ id: '' })
expect(propsData.callbacks.submit).toHaveBeenCalledTimes(1)
- expect(propsData.callbacks.submit).toHaveBeenCalledWith(expect.any(Object), true, expectedItem, { dummy: '' })
+ expect(propsData.callbacks.submit).toHaveBeenCalledWith(
+ expect.any(Object),
+ true,
+ expectedItem,
+ { dummy: '' },
+ )
})
it('call delete', async () => {
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.vue b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
index b5d44e111..2b1b176ba 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.vue
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
@@ -4,16 +4,15 @@
:schema="formSchema"
@input="handleInput"
@input-valid="handleInputValid"
- @submit="handleSubmitSocialMedia"
+ @submit="handleSubmitItem"
>
-
{{
- /* $t('settings.social-media.name') */ isCreation
- ? 'Add new'
- : 'Edit "' + editingItem[namePropertyKey] + '"'
+ isCreation
+ ? $t('settings.social-media.addNewTitle')
+ : $t('settings.social-media.editTitle', { name: editingItem[namePropertyKey] })
}}
@@ -25,7 +24,6 @@
-
|
@@ -33,7 +31,7 @@
icon="edit"
circle
ghost
- @click="handleEditSocialMedia(item)"
+ @click="handleEditItem(item)"
:title="$t('actions.edit')"
data-test="edit-button"
/>
@@ -41,7 +39,7 @@
icon="trash"
circle
ghost
- @click="handleDeleteSocialMedia(item)"
+ @click="handleDeleteItem(item)"
:title="$t('actions.delete')"
data-test="delete-button"
/>
@@ -55,7 +53,8 @@
@@ -95,7 +94,13 @@ export default {
},
callbacks: {
type: Object,
- default: () => ({ edit: () => {}, submit: () => {}, delete: () => {} }),
+ default: () => ({
+ handleInput: () => {},
+ handleInputValid: () => {},
+ edit: () => {},
+ submit: () => {},
+ delete: () => {},
+ }),
},
},
data() {
@@ -104,6 +109,7 @@ export default {
formSchema: this.useFormSchema,
items: this.useItems,
disabled: true,
+ loading: false,
editingItem: null,
}
},
@@ -116,43 +122,42 @@ export default {
},
},
watch: {
- // can change by a parents callback and again given trough by bind from there
+ // can change by a parents callback and again given trough by v-bind from there
useItems(newItems) {
this.items = newItems
},
},
methods: {
- handleCancel() {
- this.editingItem = null
- this.disabled = true
- },
- handleEditSocialMedia(item) {
- this.editingItem = item
- this.callbacks.edit(this, item)
- },
handleInput(data) {
+ this.callbacks.handleInput(this, data)
this.disabled = true
},
handleInputValid(data) {
- if (data.socialMediaUrl.length < 1) {
- this.disabled = true
- } else {
- this.disabled = false
- }
+ this.callbacks.handleInputValid(this, data)
},
- async handleDeleteSocialMedia(item) {
- await this.callbacks.delete(this, item)
+ handleEditItem(item) {
+ this.editingItem = item
+ this.callbacks.edit(this, item)
},
- async handleSubmitSocialMedia() {
+ async handleSubmitItem() {
if (!this.isEditing) {
- this.handleEditSocialMedia({ ...this.defaultItem, id: '' })
+ this.handleEditItem({ ...this.defaultItem, id: '' })
} else {
+ this.loading = true
if (await this.callbacks.submit(this, this.isCreation, this.editingItem, this.formData)) {
this.disabled = true
this.editingItem = null
}
+ this.loading = false
}
},
+ handleCancel() {
+ this.editingItem = null
+ this.disabled = true
+ },
+ async handleDeleteItem(item) {
+ await this.callbacks.delete(this, item)
+ },
},
}
diff --git a/webapp/locales/de.json b/webapp/locales/de.json
index 9816e167a..a98f0a320 100644
--- a/webapp/locales/de.json
+++ b/webapp/locales/de.json
@@ -773,6 +773,8 @@
"name": "Sicherheit"
},
"social-media": {
+ "addNewTitle": "Neuen Link hinzufügen",
+ "editTitle": "Link \"{name}\" ändern",
"name": "Soziale Netzwerke",
"placeholder": "Deine Webadresse des Sozialen Netzwerkes",
"requireUnique": "Dieser Link existiert bereits",
diff --git a/webapp/locales/en.json b/webapp/locales/en.json
index 11b920056..f6606b933 100644
--- a/webapp/locales/en.json
+++ b/webapp/locales/en.json
@@ -773,6 +773,8 @@
"name": "Security"
},
"social-media": {
+ "addNewTitle": "Add new link",
+ "editTitle": "Edit link \"{name}\"",
"name": "Social media",
"placeholder": "Your social media url",
"requireUnique": "You added this url already",
diff --git a/webapp/pages/settings/my-social-media.vue b/webapp/pages/settings/my-social-media.vue
index ca6ab9233..a985371d6 100644
--- a/webapp/pages/settings/my-social-media.vue
+++ b/webapp/pages/settings/my-social-media.vue
@@ -8,6 +8,8 @@
:defaultItem="{ url: '' }"
:namePropertyKey="'url'"
:callbacks="{
+ handleInput: () => {},
+ handleInputValid,
edit: callbackEditSocialMedia,
submit: handleSubmitSocialMedia,
delete: callbackDeleteSocialMedia,
@@ -80,6 +82,13 @@ export default {
...mapMutations({
setCurrentUser: 'auth/SET_USER',
}),
+ handleInputValid(thisList, data) {
+ if (data.socialMediaUrl.length < 1) {
+ thisList.disabled = true
+ } else {
+ thisList.disabled = false
+ }
+ },
callbackEditSocialMedia(thisList, link) {
thisList.formData.socialMediaUrl = link.url
// try to set focus on link edit field
@@ -162,11 +171,11 @@ export default {
id: item.id,
},
update: (store, { data }) => {
- const socialMedia = thisList.currentUser.socialMedia.filter(
+ const socialMedia = this.currentUser.socialMedia.filter(
(element) => element.id !== item.id,
)
- thisList.setCurrentUser({
- ...thisList.currentUser,
+ this.setCurrentUser({
+ ...this.currentUser,
socialMedia,
})
},