Merge pull request #19621 from Scroody/poll-answer-verification

Client: Poll answer verification
This commit is contained in:
Ramón Souza 2024-02-26 14:20:37 -03:00 committed by GitHub
commit 4f6d5f368b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 5 deletions

View File

@ -41,6 +41,10 @@ const intlMessages = defineMessages({
id: 'app.poll.liveResult.secretLabel',
description: 'label shown instead of users in poll responses if poll is secret',
},
noAnswersLabel: {
id: 'app.poll.noAnswerWarning',
description: 'label shown when no answers have been received',
},
});
const getResponseString = (obj) => {
@ -214,7 +218,7 @@ class LiveResult extends PureComponent {
? (
<Styled.ButtonsActions>
<Styled.PublishButton
disabled={!isMeteorConnected}
disabled={!isMeteorConnected || !currentPoll.responses}
onClick={() => {
Session.set('pollInitiated', false);
publishPoll(currentPoll?.id);
@ -246,8 +250,9 @@ class LiveResult extends PureComponent {
color="primary"
data-test="restartPoll"
/>
)
}
)}
{currentPoll && !currentPoll.responses
&& intl.formatMessage(intlMessages.noAnswersLabel)}
<Styled.Separator />
{ currentPoll && !currentPoll.secretPoll
? (

View File

@ -172,6 +172,7 @@ const ButtonsActions = styled.div`
const PublishButton = styled(Button)`
width: 48%;
margin-bottom: ${smPaddingY};
overflow-wrap: break-word;
white-space: pre-wrap;
`;

View File

@ -394,6 +394,7 @@
"app.poll.showRespDesc": "Displays response configuration",
"app.poll.addRespDesc": "Adds poll response input",
"app.poll.deleteRespDesc": "Removes option {0}",
"app.poll.noAnswerWarning": "To publish a poll, at least one response is required",
"app.poll.t": "True",
"app.poll.f": "False",
"app.poll.tf": "True / False",

View File

@ -69,7 +69,7 @@ test.describe.parallel('Notifications', () => {
});
test.describe.parallel('Presenter @ci', () => {
test('Poll results notification', async ({ browser, context, page }) => {
test('Poll results notification @flaky', async ({ browser, context, page }) => {
const presenterNotifications = new PresenterNotifications(browser, context);
await presenterNotifications.initModPage(page);
await presenterNotifications.publishPollResults();

View File

@ -53,7 +53,7 @@ test.describe('Polling', async () => {
});
// Results
test('Poll results in chat message @ci', async () => {
test('Poll results in chat message @ci @flaky', async () => {
await polling.pollResultsOnChat();
});