From 999255b2b5e2a74ba94f75ed3d6a3fb4d09bf604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 20 Jul 2023 12:38:43 +0200 Subject: [PATCH 01/10] Change general search hint --- webapp/locales/de.json | 2 +- webapp/locales/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/locales/de.json b/webapp/locales/de.json index cafa030ff..1ad5b0926 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -901,7 +901,7 @@ "Tag": "Hashtag ::: Hashtags", "User": "Nutzer ::: Nutzer" }, - "hint": "Wonach suchst Du? Nutze !… für Beiträge, @… für Mitglieder, &… für Gruppen, #… für Hashtags", + "hint": "!... sucht Beiträge, @... sucht Nutzer, &... sucht Gruppen, #… sucht Hashtags", "no-results": "Keine Ergebnisse für \"{search}\" gefunden. Versuch' es mit einem anderen Begriff!", "page": "Seite", "placeholder": "Suchen", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 29df284bd..9d7ce1a5f 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -901,7 +901,7 @@ "Tag": "Hashtag ::: Hashtags", "User": "User ::: Users" }, - "hint": "What are you searching for? Use !… for posts, @… for users, &… for groups, #… for hashtags.", + "hint": "!... searches posts, @... searches users, &... searches groups, #… searches hashtags", "no-results": "No results found for \"{search}\". Try a different search term!", "page": "Page", "placeholder": "Search", From 2decf90b6b2f9ebb62b35b34292e6b5c44fbdb0c Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 20 Jul 2023 13:40:29 +0200 Subject: [PATCH 02/10] Change the background color of my messages to the same color as the one in side menu. --- webapp/constants/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/constants/chat.js b/webapp/constants/chat.js index 181d88e0e..082d018f3 100644 --- a/webapp/constants/chat.js +++ b/webapp/constants/chat.js @@ -58,7 +58,7 @@ const STYLE = { message: { background: styleData.chatMessageBgOthers, - backgroundMe: styleData.chatMessageBgMe, + backgroundMe: styleData.colorPrimaryLight, color: styleData.chatMessageColor, colorStarted: '#9ca6af', backgroundDeleted: '#dadfe2', From 1b8b356432e753ba0919f63bd7629f1c5adabd97 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 20 Jul 2023 13:41:59 +0200 Subject: [PATCH 03/10] notification subscription --- backend/src/schema/resolvers/notifications.ts | 4 ++-- backend/src/schema/types/type/NOTIFIED.gql | 2 +- webapp/components/NotificationMenu/NotificationMenu.vue | 5 ----- webapp/graphql/User.js | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/backend/src/schema/resolvers/notifications.ts b/backend/src/schema/resolvers/notifications.ts index e427de227..6a3e232cc 100644 --- a/backend/src/schema/resolvers/notifications.ts +++ b/backend/src/schema/resolvers/notifications.ts @@ -7,8 +7,8 @@ export default { notificationAdded: { subscribe: withFilter( () => pubsub.asyncIterator(NOTIFICATION_ADDED), - (payload, variables) => { - return payload.notificationAdded.to.id === variables.userId + (payload, variables, context) => { + return payload.notificationAdded.to.id === context.user?.id }, ), }, diff --git a/backend/src/schema/types/type/NOTIFIED.gql b/backend/src/schema/types/type/NOTIFIED.gql index 62a1f3696..1f825decc 100644 --- a/backend/src/schema/types/type/NOTIFIED.gql +++ b/backend/src/schema/types/type/NOTIFIED.gql @@ -38,5 +38,5 @@ type Mutation { } type Subscription { - notificationAdded(userId: ID!): NOTIFIED + notificationAdded: NOTIFIED } diff --git a/webapp/components/NotificationMenu/NotificationMenu.vue b/webapp/components/NotificationMenu/NotificationMenu.vue index 9e94e07d7..d0e21bf96 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.vue +++ b/webapp/components/NotificationMenu/NotificationMenu.vue @@ -137,11 +137,6 @@ export default { }, subscribeToMore: { document: notificationAdded(), - variables() { - return { - userId: this.user.id, - } - }, updateQuery: (previousResult, { subscriptionData }) => { const { data: { notificationAdded: newNotification }, diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index fcdac0989..4b743a0e3 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -245,8 +245,8 @@ export const notificationAdded = () => { ${postFragment} ${groupFragment} - subscription notifications($userId: ID!) { - notificationAdded(userId: $userId) { + subscription notifications { + notificationAdded { id read reason From f7c381efd820e11f872544516df3c35ec0c6e850 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 20 Jul 2023 13:44:04 +0200 Subject: [PATCH 04/10] subscription chatMessageAdded security fix --- backend/src/schema/resolvers/messages.ts | 4 ++-- backend/src/schema/types/type/Message.gql | 2 +- webapp/components/Chat/Chat.vue | 3 --- webapp/graphql/Messages.js | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/src/schema/resolvers/messages.ts b/backend/src/schema/resolvers/messages.ts index b7e7a7a73..c1381045f 100644 --- a/backend/src/schema/resolvers/messages.ts +++ b/backend/src/schema/resolvers/messages.ts @@ -25,8 +25,8 @@ export default { chatMessageAdded: { subscribe: withFilter( () => pubsub.asyncIterator(CHAT_MESSAGE_ADDED), - (payload, variables) => { - return payload.userId === variables.userId + (payload, variables, context) => { + return payload.userId === context.user?.id }, ), }, diff --git a/backend/src/schema/types/type/Message.gql b/backend/src/schema/types/type/Message.gql index 71d175e1c..16e458151 100644 --- a/backend/src/schema/types/type/Message.gql +++ b/backend/src/schema/types/type/Message.gql @@ -46,5 +46,5 @@ type Query { } type Subscription { - chatMessageAdded(userId: ID!): Message + chatMessageAdded: Message } diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index c2c7c412c..a1e5adf01 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -195,9 +195,6 @@ export default { // Subscriptions const observer = this.$apollo.subscribe({ query: chatMessageAdded(), - variables: { - userId: this.currentUser.id, - }, }) observer.subscribe({ diff --git a/webapp/graphql/Messages.js b/webapp/graphql/Messages.js index cb5d37df9..ffa2760f9 100644 --- a/webapp/graphql/Messages.js +++ b/webapp/graphql/Messages.js @@ -54,8 +54,8 @@ export const messageQuery = () => { export const chatMessageAdded = () => { return gql` - subscription chatMessageAdded($userId: ID!) { - chatMessageAdded(userId: $userId) { + subscription chatMessageAdded { + chatMessageAdded { _id id indexId From 604e1d8465bc6054eebc1f16b6778c6d34507cb9 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 20 Jul 2023 13:44:23 +0200 Subject: [PATCH 05/10] subscription roomCountUpdated security fix --- backend/src/schema/resolvers/rooms.ts | 4 ++-- backend/src/schema/types/type/Room.gql | 2 +- .../components/ChatNotificationMenu/ChatNotificationMenu.vue | 5 ----- webapp/graphql/Rooms.js | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/backend/src/schema/resolvers/rooms.ts b/backend/src/schema/resolvers/rooms.ts index 5e931a446..5382c5ee7 100644 --- a/backend/src/schema/resolvers/rooms.ts +++ b/backend/src/schema/resolvers/rooms.ts @@ -20,8 +20,8 @@ export default { roomCountUpdated: { subscribe: withFilter( () => pubsub.asyncIterator(ROOM_COUNT_UPDATED), - (payload, variables) => { - return payload.userId === variables.userId + (payload, variables, context) => { + return payload.userId === context.user?.id }, ), }, diff --git a/backend/src/schema/types/type/Room.gql b/backend/src/schema/types/type/Room.gql index 0cf5b22c8..221df8299 100644 --- a/backend/src/schema/types/type/Room.gql +++ b/backend/src/schema/types/type/Room.gql @@ -57,5 +57,5 @@ type Query { } type Subscription { - roomCountUpdated(userId: ID!): Int + roomCountUpdated: Int } diff --git a/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue b/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue index ec3f9fbc7..dd36b965a 100644 --- a/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue +++ b/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue @@ -44,11 +44,6 @@ export default { }, subscribeToMore: { document: roomCountUpdated(), - variables() { - return { - userId: this.user.id, - } - }, updateQuery: (previousResult, { subscriptionData }) => { return { UnreadRooms: subscriptionData.data.roomCountUpdated } }, diff --git a/webapp/graphql/Rooms.js b/webapp/graphql/Rooms.js index 757a6cfa4..577eb8eff 100644 --- a/webapp/graphql/Rooms.js +++ b/webapp/graphql/Rooms.js @@ -52,8 +52,8 @@ export const unreadRoomsQuery = () => { export const roomCountUpdated = () => { return gql` - subscription roomCountUpdated($userId: ID!) { - roomCountUpdated(userId: $userId) + subscription roomCountUpdated { + roomCountUpdated } ` } From db3c625dfb0100c7c5b294d22c23e1bf0ad1e7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 20 Jul 2023 15:39:11 +0200 Subject: [PATCH 06/10] Revert general change of PR --- webapp/constants/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/constants/chat.js b/webapp/constants/chat.js index 082d018f3..181d88e0e 100644 --- a/webapp/constants/chat.js +++ b/webapp/constants/chat.js @@ -58,7 +58,7 @@ const STYLE = { message: { background: styleData.chatMessageBgOthers, - backgroundMe: styleData.colorPrimaryLight, + backgroundMe: styleData.chatMessageBgMe, color: styleData.chatMessageColor, colorStarted: '#9ca6af', backgroundDeleted: '#dadfe2', From 65e5545c9a2396340699632b8ba755160e938acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 20 Jul 2023 15:40:21 +0200 Subject: [PATCH 07/10] Test branding --- webapp/assets/styles/imports/_branding.scss | 127 +++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/webapp/assets/styles/imports/_branding.scss b/webapp/assets/styles/imports/_branding.scss index 75058595d..1bb4291af 100644 --- a/webapp/assets/styles/imports/_branding.scss +++ b/webapp/assets/styles/imports/_branding.scss @@ -2,4 +2,129 @@ * * Here, all SCSS variables and classes can be adapted to your custom design. * -*/ \ No newline at end of file +*/ + +$color-primary: rgb(110, 139, 135); +$color-primary-light: rgb(161, 179, 177); +$color-primary-dark: rgb(81, 99, 97); +$color-primary-active: rgb(123, 160, 149); +$color-primary-inverse: rgb(241, 248, 243); + +$color-secondary: rgb(166, 255, 0); +$color-secondary-active: rgb(188, 255, 130); +$color-secondary-inverse: rgb(241, 255, 225); + +$font-family-heading: 'Overpass', Helvetica, Arial, Lucida, sans-serif; +$font-family-text: 'Overpass', Helvetica, Arial, Lucida, sans-serif; + +$color-header-background: $color-primary; +$color-footer-background: $color-secondary; + +$color-locale-menu: $color-secondary; + +$color-donation-bar: $color-secondary; + +$color-toast-blue: rgb(0, 142, 230); +$color-toast-green: $color-primary; + +$chat-message-bg-me: $color-primary-light; +// $chat-message-color: $text-color-base; +// $chat-message-bg-others: $color-neutral-80; +// $chat-sidemenu-bg: $color-secondary-active; +// $chat-new-message-color: $color-secondary-active; +// $chat-message-timestamp: $text-color-soft; +$chat-message-checkmark-seen: $color-secondary; +$chat-message-checkmark: $text-color-inverse; + + +.main-navigation a { + color: #fff; + text-transform: uppercase; + font-size: 16px; + font-weight: 500; +} + +.main-navigation a:hover { + color: hsla(0, 0%, 100%, .8); +} + +.main-navigation .router-link-exact-active { + color: #A6FF00 !important; +} + +.main-navigation .locale-menu { + color: #fff; +} + +.main-navigation .base-button { + color: #fff; +} + +#nav-search-box .hc-hashtag a { + color: #17b53f; +} + +#footer { + background-color: $color-secondary; +} + +#footer a { + color: $color-primary; +} + +.avatar-menu .profile-avatar { + color: $color-primary; +} + +.profile-avatar .initials { + color: $color-primary; +} + +.branding-menu .ds-text { + font-family: 'Overpass', Helvetica, Arial, Lucida, sans-serif; + font-weight: 500; + text-transform: uppercase; + font-size: 16px; +} + +/* avoid uppercase for user slug */ +span.slug { + text-transform: none; +} + +.ds-footer { + font-family: 'Overpass', Helvetica, Arial, Lucida, sans-serif; + text-transform: uppercase; + font-size: 16px; + font-weight: 300; +} + +/* chips on group teaser */ +a.group-teaser footer .ds-chip-primary { + background-color: $color-primary; +} + +/* chips on group profile */ +.group-profile .ds-chip-primary { + background-color: $color-primary; +} + +/* number count color */ +div.ds-number>p.ds-number-count { + color: $color-primary; +} + +/* active tab border bottom color */ +div.tab-navigation li.Tabs__tab { + border-bottom-color: $color-primary; +} + +/* submit button color group form */ +form.group-form button.ds-button-primary { + background-color: $color-primary; +} + +/* color of active filter tags in post teaser */ +span.category-tag.filterActive { + background-color: $color-primary; +} \ No newline at end of file From 39eef13a51a561b3a015e8502ea6cc1bb80ce174 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 20 Jul 2023 16:45:44 +0200 Subject: [PATCH 08/10] Change the ocelot chat room badge color --- webapp/assets/_new/styles/export.scss | 3 +++ webapp/assets/_new/styles/tokens.scss | 2 ++ webapp/assets/styles/imports/_branding.scss | 7 ++----- webapp/constants/chat.js | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/webapp/assets/_new/styles/export.scss b/webapp/assets/_new/styles/export.scss index 5b866d6b7..e29c014e2 100644 --- a/webapp/assets/_new/styles/export.scss +++ b/webapp/assets/_new/styles/export.scss @@ -31,4 +31,7 @@ chatMessageTimestamp: $chat-message-timestamp; chatMessageCheckmarkSeen: $chat-message-checkmark-seen; chatMessageCheckmark: $chat-message-checkmark; + + chatRoomBackgroundCounterBadge: $chat-room-background-counter-badge; + chatRoomColorCounterBadge: $chat-room-color-counter-badge; } \ No newline at end of file diff --git a/webapp/assets/_new/styles/tokens.scss b/webapp/assets/_new/styles/tokens.scss index ef5086240..3e189abf2 100644 --- a/webapp/assets/_new/styles/tokens.scss +++ b/webapp/assets/_new/styles/tokens.scss @@ -420,3 +420,5 @@ $chat-new-message-color: $color-secondary-active; $chat-message-timestamp: $text-color-soft; $chat-message-checkmark-seen: $text-color-secondary; $chat-message-checkmark: $text-color-soft; +$chat-room-color-counter-badge: $color-primary; +$chat-room-background-counter-badge: $color-secondary; diff --git a/webapp/assets/styles/imports/_branding.scss b/webapp/assets/styles/imports/_branding.scss index 1bb4291af..733f2856c 100644 --- a/webapp/assets/styles/imports/_branding.scss +++ b/webapp/assets/styles/imports/_branding.scss @@ -28,13 +28,10 @@ $color-toast-blue: rgb(0, 142, 230); $color-toast-green: $color-primary; $chat-message-bg-me: $color-primary-light; -// $chat-message-color: $text-color-base; -// $chat-message-bg-others: $color-neutral-80; -// $chat-sidemenu-bg: $color-secondary-active; -// $chat-new-message-color: $color-secondary-active; -// $chat-message-timestamp: $text-color-soft; $chat-message-checkmark-seen: $color-secondary; $chat-message-checkmark: $text-color-inverse; +$chat-room-color-counter-badge: $color-primary; +$chat-room-background-counter-badge: $color-secondary; .main-navigation a { diff --git a/webapp/constants/chat.js b/webapp/constants/chat.js index 181d88e0e..de391707d 100644 --- a/webapp/constants/chat.js +++ b/webapp/constants/chat.js @@ -109,8 +109,8 @@ const STYLE = { colorTimestamp: '#a2aeb8', colorStateOnline: '#4caf50', colorStateOffline: '#9ca6af', - backgroundCounterBadge: '#0696c7', - colorCounterBadge: '#fff', + backgroundCounterBadge: styleData.chatRoomBackgroundCounterBadge, + colorCounterBadge: styleData.chatRoomColorCounterBadge, }, emoji: { From 69394d800b6766e87a39c6a065359d90746cdf91 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 20 Jul 2023 16:53:10 +0200 Subject: [PATCH 09/10] Change default ocelot badge color to text-color-inverted. --- webapp/assets/_new/styles/tokens.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/assets/_new/styles/tokens.scss b/webapp/assets/_new/styles/tokens.scss index 3e189abf2..dd3a042d1 100644 --- a/webapp/assets/_new/styles/tokens.scss +++ b/webapp/assets/_new/styles/tokens.scss @@ -420,5 +420,5 @@ $chat-new-message-color: $color-secondary-active; $chat-message-timestamp: $text-color-soft; $chat-message-checkmark-seen: $text-color-secondary; $chat-message-checkmark: $text-color-soft; -$chat-room-color-counter-badge: $color-primary; +$chat-room-color-counter-badge: $text-color-inverse; $chat-room-background-counter-badge: $color-secondary; From fa9b8390812a7f89648719876f351b1d8110df56 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 20 Jul 2023 16:56:33 +0200 Subject: [PATCH 10/10] Remove client customizing. --- webapp/assets/styles/imports/_branding.scss | 124 +------------------- 1 file changed, 1 insertion(+), 123 deletions(-) diff --git a/webapp/assets/styles/imports/_branding.scss b/webapp/assets/styles/imports/_branding.scss index 733f2856c..75058595d 100644 --- a/webapp/assets/styles/imports/_branding.scss +++ b/webapp/assets/styles/imports/_branding.scss @@ -2,126 +2,4 @@ * * Here, all SCSS variables and classes can be adapted to your custom design. * -*/ - -$color-primary: rgb(110, 139, 135); -$color-primary-light: rgb(161, 179, 177); -$color-primary-dark: rgb(81, 99, 97); -$color-primary-active: rgb(123, 160, 149); -$color-primary-inverse: rgb(241, 248, 243); - -$color-secondary: rgb(166, 255, 0); -$color-secondary-active: rgb(188, 255, 130); -$color-secondary-inverse: rgb(241, 255, 225); - -$font-family-heading: 'Overpass', Helvetica, Arial, Lucida, sans-serif; -$font-family-text: 'Overpass', Helvetica, Arial, Lucida, sans-serif; - -$color-header-background: $color-primary; -$color-footer-background: $color-secondary; - -$color-locale-menu: $color-secondary; - -$color-donation-bar: $color-secondary; - -$color-toast-blue: rgb(0, 142, 230); -$color-toast-green: $color-primary; - -$chat-message-bg-me: $color-primary-light; -$chat-message-checkmark-seen: $color-secondary; -$chat-message-checkmark: $text-color-inverse; -$chat-room-color-counter-badge: $color-primary; -$chat-room-background-counter-badge: $color-secondary; - - -.main-navigation a { - color: #fff; - text-transform: uppercase; - font-size: 16px; - font-weight: 500; -} - -.main-navigation a:hover { - color: hsla(0, 0%, 100%, .8); -} - -.main-navigation .router-link-exact-active { - color: #A6FF00 !important; -} - -.main-navigation .locale-menu { - color: #fff; -} - -.main-navigation .base-button { - color: #fff; -} - -#nav-search-box .hc-hashtag a { - color: #17b53f; -} - -#footer { - background-color: $color-secondary; -} - -#footer a { - color: $color-primary; -} - -.avatar-menu .profile-avatar { - color: $color-primary; -} - -.profile-avatar .initials { - color: $color-primary; -} - -.branding-menu .ds-text { - font-family: 'Overpass', Helvetica, Arial, Lucida, sans-serif; - font-weight: 500; - text-transform: uppercase; - font-size: 16px; -} - -/* avoid uppercase for user slug */ -span.slug { - text-transform: none; -} - -.ds-footer { - font-family: 'Overpass', Helvetica, Arial, Lucida, sans-serif; - text-transform: uppercase; - font-size: 16px; - font-weight: 300; -} - -/* chips on group teaser */ -a.group-teaser footer .ds-chip-primary { - background-color: $color-primary; -} - -/* chips on group profile */ -.group-profile .ds-chip-primary { - background-color: $color-primary; -} - -/* number count color */ -div.ds-number>p.ds-number-count { - color: $color-primary; -} - -/* active tab border bottom color */ -div.tab-navigation li.Tabs__tab { - border-bottom-color: $color-primary; -} - -/* submit button color group form */ -form.group-form button.ds-button-primary { - background-color: $color-primary; -} - -/* color of active filter tags in post teaser */ -span.category-tag.filterActive { - background-color: $color-primary; -} \ No newline at end of file +*/ \ No newline at end of file