From abedfe62df5e1d16373d9cdc02140aceb4963c84 Mon Sep 17 00:00:00 2001 From: Sebin Song Date: Sat, 22 Jun 2024 09:35:35 +1200 Subject: [PATCH 1/5] #2089 - Remove 'Edit poll' menu (#2090) * remove edit poll menu * remove unused constants * fix the linter err * restore delete option --- frontend/views/containers/chatroom/MessageActions.vue | 5 +++-- frontend/views/containers/chatroom/MessageBase.vue | 11 ++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/views/containers/chatroom/MessageActions.vue b/frontend/views/containers/chatroom/MessageActions.vue index 3de90e59d2..4207de7911 100644 --- a/frontend/views/containers/chatroom/MessageActions.vue +++ b/frontend/views/containers/chatroom/MessageActions.vue @@ -164,10 +164,11 @@ export default ({ return this.isText || this.isPoll }, isEditable () { - return this.isMsgSender && (this.isText || this.isPoll) + return this.isMsgSender && this.isText }, isDeletable () { - return this.isEditable || this.isGroupCreator + return this.isGroupCreator || + (this.isMsgSender && (this.isText || this.isPoll)) } }, methods: { diff --git a/frontend/views/containers/chatroom/MessageBase.vue b/frontend/views/containers/chatroom/MessageBase.vue index e1524de083..35cf9f9829 100644 --- a/frontend/views/containers/chatroom/MessageBase.vue +++ b/frontend/views/containers/chatroom/MessageBase.vue @@ -116,10 +116,7 @@ import SendArea from './SendArea.vue' import ChatAttachmentPreview from './file-attachment/ChatAttachmentPreview.vue' import { humanDate } from '@model/contracts/shared/time.js' import { swapMentionIDForDisplayname } from '@model/contracts/shared/functions.js' -import { - MESSAGE_TYPES, - MESSAGE_VARIANTS -} from '@model/contracts/shared/constants.js' +import { MESSAGE_VARIANTS } from '@model/contracts/shared/constants.js' import { OPEN_TOUCH_LINK_HELPER } from '@utils/events.js' import { L, LTags } from '@common/common.js' @@ -201,11 +198,7 @@ export default ({ humanDate, swapMentionIDForDisplayname, editMessage () { - if (this.type === MESSAGE_TYPES.POLL) { - alert('TODO: implement editting a poll') - } else { - this.isEditing = true - } + this.isEditing = true }, onMessageEdited (newMessage) { this.isEditing = false From 18ba6b425c19a162148e7b8f13b2f30423079a88 Mon Sep 17 00:00:00 2001 From: Snowteamer <64228468+snowteamer@users.noreply.github.com> Date: Sat, 22 Jun 2024 21:53:21 +0200 Subject: [PATCH 2/5] Enable source maps in production (#2109) * Fix package-lock.json version * Enable source maps in production --- Gruntfile.js | 2 +- package-lock.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b02baf2eb2..c6785c4f78 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -239,7 +239,7 @@ module.exports = (grunt) => { minifySyntax: production, minifyWhitespace: production, outdir: distJS, - sourcemap: development, + sourcemap: true, // Warning: split mode has still a few issues. See https://github.com/okTurtles/group-income/pull/1196 splitting: !grunt.option('no-chunks'), watch: false // Not using esbuild's own watch mode since it involves polling. diff --git a/package-lock.json b/package-lock.json index 12378bf3ee..de6f82916c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "group-income", - "version": "0.5.1", + "version": "0.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "group-income", - "version": "0.5.1", + "version": "0.5.4", "license": "AGPL-3.0", "dependencies": { "@babel/core": "7.23.7", From 9a646729d41dc3e1e961583fc886a990c84c8aac Mon Sep 17 00:00:00 2001 From: Alex Jin <57976479+Silver-IT@users.noreply.github.com> Date: Tue, 25 Jun 2024 00:46:17 +0800 Subject: [PATCH 3/5] Add Cypress test scenario for Chat Poll (#2114) * feat: add test scenario for create/votes poll * feat: improved test case for creating a poll * chore: fixed dry * feat: added test case for chat poll --- .../views/containers/chatroom/CreatePoll.vue | 14 +- .../containers/chatroom/MessageActions.vue | 2 +- .../views/containers/chatroom/SendArea.vue | 26 +-- .../poll-message-content/PollToVote.vue | 12 +- .../poll-message-content/PollVoteResult.vue | 2 +- .../integration/group-chat-message.spec.js | 156 ++++++++++++++---- 6 files changed, 156 insertions(+), 56 deletions(-) diff --git a/frontend/views/containers/chatroom/CreatePoll.vue b/frontend/views/containers/chatroom/CreatePoll.vue index 6b8ec7159f..cfb6c8dbff 100644 --- a/frontend/views/containers/chatroom/CreatePoll.vue +++ b/frontend/views/containers/chatroom/CreatePoll.vue @@ -3,14 +3,17 @@ @click='onBackDropClick' @keyup.esc='close' ) - .c-create-poll-wrapper(:style='this.ephemeral.isDesktopScreen ? this.ephemeral.wrapperPosition : {}') + .c-create-poll-wrapper( + data-test='createPollWrapper' + :style='this.ephemeral.isDesktopScreen ? this.ephemeral.wrapperPosition : {}' + ) header.c-header i18n.is-title-2.c-popup-title(tag='h2') New poll modal-close.c-popup-close-btn(v-if='!ephemeral.isDesktopScreen' @close='close') section.c-body form.c-form(@submit.prevent='' :disabled='form.disabled') - .field + .field(data-test='question') input.input.c-input( name='question' ref='question' @@ -22,7 +25,7 @@ v-error:question='' ) - .field.c-add-options + .field.c-add-options(data-test='options') i18n.label Add options .c-option-list(ref='optList') @@ -46,13 +49,14 @@ button.link.has-icon( v-if='enableMoreButton' + data-test='addOption' type='button' @click='addOption' ) i.icon-plus i18n Add more - label.field + label.field(data-test='expiration') i18n.label Expires after (days) .selectbox select.select.c-duration-select( @@ -81,6 +85,7 @@ .buttons.c-btns-container(:class='{ "is-vertical": ephemeral.isDesktopScreen }') i18n.is-outlined( :class='{ "is-small": ephemeral.isDesktopScreen }' + data-test='cancel' tag='button' type='button' @click='close' @@ -89,6 +94,7 @@ i18n( :disabled='disableSubmit' :class='{ "is-small": ephemeral.isDesktopScreen }' + data-test='submit' tag='button' type='button' @click='submit' diff --git a/frontend/views/containers/chatroom/MessageActions.vue b/frontend/views/containers/chatroom/MessageActions.vue index 4207de7911..a97da3d65d 100644 --- a/frontend/views/containers/chatroom/MessageActions.vue +++ b/frontend/views/containers/chatroom/MessageActions.vue @@ -1,5 +1,5 @@