Skip to content

Conversation

@PVince81
Copy link
Member

@PVince81 PVince81 commented Oct 9, 2020

Description

Focus on the custom message field after picking an emoji.
Enter key in the custom message field saves the status.
Disable the save button when no custom message is entered (would result
in a server error).

Disable save buttons while saving is in progress.

Fixes setting an empty message for clearing when not touching the field (#23411)

Motivation

~~
This was mostly because I noticed that entering no custom message triggered an error. I didn't manage to make the server accept empty messages (and even then who knows what side effects...), so I went with prevent empty status message.
And as a bonus added the enter key + autofocus.
~~

Issues

Partial fix for #23276 by introducing "save by enter key"
Fixes #23411

@PVince81 PVince81 added bug design Design, UI, UX, etc. feature: status labels Oct 9, 2020
@PVince81 PVince81 added this to the Nextcloud 21 milestone Oct 9, 2020
@PVince81 PVince81 self-assigned this Oct 9, 2020
@PVince81
Copy link
Member Author

PVince81 commented Oct 9, 2020

Regarding compiled assets, I had to guess by looking at other PRs.
I've updated the README to make it clearer: #23306

{{ $t('user_status', 'Clear status message') }}
</button>
<button class="status-buttons__primary primary" @click="saveStatus">
<button class="status-buttons__primary primary" :disabled="isSavingStatus || !message" @click="saveStatus">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<button class="status-buttons__primary primary" :disabled="isSavingStatus || !message" @click="saveStatus">
<button class="status-buttons__primary primary" :disabled="isSavingStatus" @click="saveStatus">

Setting to empty clears the status just fine, might be less confusing

Copy link
Member Author

@PVince81 PVince81 Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't in my instance and caused a server error as it was sending a status icon + empty message.
I personally wanted to set a status icon without message at that time, this is how I found the issue. Another user might think likewise. So if we fix it to clear the status on empty, the icon would not be set and would not match the user's expectation here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, then it's either a regression or I found an action path that doesn't work:
image

I'll split this into a separate PR and keep this PR here for just the enter key improvements

@skjnldsv skjnldsv added the 3. to review Waiting for reviews label Oct 9, 2020
@PVince81 PVince81 force-pushed the bugfix/noid/change-status-ux-fixes branch from 55f5522 to 73cdb88 Compare October 13, 2020 09:35
@PVince81
Copy link
Member Author

I've now removed the code related to empty messages.

The disabled attribute is still there but only for disabling the button when saving as we do in other places.

Adjusted and squashed.

@PVince81
Copy link
Member Author

I've raised #23411 for the empty status issue

@PVince81 PVince81 force-pushed the bugfix/noid/change-status-ux-fixes branch from 73cdb88 to ead50ec Compare October 13, 2020 09:49
@PVince81
Copy link
Member Author

I did rebuild and check in the assets. Strange.

After rerunning make dev-setup from scratch the build marked those files again as modified.
Anyway, I've pushed them now.

@PVince81 PVince81 force-pushed the bugfix/noid/change-status-ux-fixes branch from 72740c8 to 997ce7c Compare October 13, 2020 10:08
@PVince81
Copy link
Member Author

ouch, pushed on wrong branch... fixing...

@PVince81
Copy link
Member Author

okay, I decided to push the empty message fix here as well to avoid needless future conflicts.

Fixes #23411

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff design-wise, great work @PVince81! :)

@PVince81
Copy link
Member Author

there was a weird unrelated error:

1) Test\Files\Cache\ScannerTest::testETagRecreation
Failed asserting that null is of type "string".

build restarted

@PVince81
Copy link
Member Author

@nickvergessen CI green, can you review teh codez ?

@rullzer
Copy link
Member

rullzer commented Oct 20, 2020

@PVince81 could you rebase so we can get this in?

When selecting an emoji but not specifying a message, the internal
message value was null which caused a server validation error on
sending.

This fixes the SetStatusModal to always work with an empty string
upfront, as this is the value the field would have if edited and cleared
manually.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Focus on the custom message field after picking an emoji.
Hitting the enter key while in the custom message field now triggers
saving.
Disable save buttons while saving is in progress.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
@PVince81 PVince81 force-pushed the bugfix/noid/change-status-ux-fixes branch from 2d6a50b to 08813f5 Compare October 20, 2020 10:19
@PVince81
Copy link
Member Author

Rebased and rebuilt the module in question, as it was the only conflict.

@faily-bot
Copy link

faily-bot bot commented Oct 20, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 34374: failure

nodb

Show full log
There were 26 warnings:

1) Test\AppFramework\Controller\AuthPublicShareControllerTest::testAuthenticateAuthenticated
Trying to configure method "isAuthenticated" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) OCA\DAV\Tests\unit\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJobTest::testRun
Passing an array of interface names to createMock() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.
Passing an array of interface names to getMockBuilder() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.

3) OCA\DAV\Tests\unit\CalDAV\CalendarTest::testConfidentialClassification with data set #0 (3, false)
No method rule is set

4) OCA\DAV\Tests\Command\MoveCalendarTest::testMove
Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.

5) ExpirationTest::testParseRetentionObligation with data set #0 ('disabled', null, null, null)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

6) ExpirationTest::testParseRetentionObligation with data set #1 ('auto', 30, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

7) ExpirationTest::testParseRetentionObligation with data set #2 ('auto,auto', 30, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

8) ExpirationTest::testParseRetentionObligation with data set #3 ('auto, auto', 30, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

9) ExpirationTest::testParseRetentionObligation with data set #4 ('auto, 3', -1, 3, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

10) ExpirationTest::testParseRetentionObligation with data set #5 ('5, auto', 5, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

11) ExpirationTest::testParseRetentionObligation with data set #6 ('3, 5', 3, 5, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

12) ExpirationTest::testParseRetentionObligation with data set #7 ('10, 3', 10, 10, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

13) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #0 ('disabled', null, null, null)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

14) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #1 ('auto', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

15) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #2 ('auto,auto', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

16) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #3 ('auto, auto', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

17) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #4 ('auto, 3', -1, 3, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

18) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #5 ('5, auto', 5, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

19) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #6 ('3, 5', 3, 5, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

20) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #7 ('10, 3', 10, 10, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

21) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #8 ('g,a,r,b,a,g,e', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

22) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #9 ('-3,8', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

23) OCA\Settings\Tests\Mailer\NewUserMailHelperTest::testGenerateTemplateWithPasswordResetToken
Method getTime may not return value of type string, its return declaration is ": int"

24) OCA\TwoFactorBackupCodes\Tests\Unit\Listener\ActivityPublisherTest::testHandleCodesGeneratedEvent
Method publish may not return value of type Mock_IEvent_ccdf22ff, its return declaration is ": void"

25) OCA\UpdateNotification\Tests\Notification\BackgroundJobTest::testCreateNotifications with data set #1 ('app2', '1.0.1', '1.0.0', '1.0.0', true, array('user1'), array(array('user1')))
Method notify may not return value of type Mock_INotification_7c1151b3, its return declaration is ": void"

26) OCA\UpdateNotification\Tests\Notification\BackgroundJobTest::testCreateNotifications with data set #2 ('app3', '1.0.1', false, false, true, array('user2', 'user3'), array(array('user2'), array('user3')))
Method notify may not return value of type Mock_INotification_7c1151b3, its return declaration is ": void"

--

There was 1 failure:

1) OCA\Theming\Tests\Controller\ThemingControllerTest::testGetManifest
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
             0 => Array (
                 'src' => 'touchicon?v=0'
                 'type' => 'image/png'
-                'sizes' => '128x128'
+                'sizes' => '512x512'
             )
             1 => Array (...)
         )

/drone/src/apps/theming/tests/Controller/ThemingControllerTest.php:831

acceptance-app-files-sharing

  • tests/acceptance/features/app-files-sharing.feature:338
Show full log
  Scenario: sharee can revoke create permission from reshare after the sharer disabled it # /drone/src/tests/acceptance/features/app-files-sharing.feature:338
    Given I act as John                                                                   # ActorContext::iActAs()
    And I am logged in as the admin                                                       # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I act as Jane                                                                     # ActorContext::iActAs()
    And I am logged in                                                                    # LoginPageContext::iAmLoggedIn()
    And I act as Jim                                                                      # ActorContext::iActAs()
    And I am logged in as "user1"                                                         # LoginPageContext::iAmLoggedInAs()
    And I act as John                                                                     # ActorContext::iActAs()
    And I create a new folder named "Shared folder"                                       # FileListContext::iCreateANewFolderNamed()
    And I see that the file list contains a file named "Shared folder"                    # FileListContext::iSeeThatTheFileListContainsAFileNamed()
    And I share "Shared folder" with "user0"                                              # FilesAppSharingContext::iShareWith()
    And I see that the file is shared with "user0"                                        # FilesAppSharingContext::iSeeThatTheFileIsSharedWith()
    And I act as Jane                                                                     # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I share "Shared folder" with "user1"                                              # FilesAppSharingContext::iShareWith()
    And I see that the file is shared with "user1"                                        # FilesAppSharingContext::iSeeThatTheFileIsSharedWith()
    And I act as John                                                                     # ActorContext::iActAs()
    And I set the share with "user0" as not creatable                                     # FilesAppSharingContext::iSetTheShareWithAsNotCreatable()
    And I see that "user0" can not create in the share                                    # FilesAppSharingContext::iSeeThatCanNotCreateInTheShare()
    And I act as Jim                                                                      # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I enter in the folder named "Shared folder"                                       # FileListContext::iEnterInTheFolderNamed()
    And I create a new folder named "Subfolder"                                           # FileListContext::iCreateANewFolderNamed()
    And I see that the file list contains a file named "Subfolder"                        # FileListContext::iSeeThatTheFileListContainsAFileNamed()
    When I act as Jane                                                                    # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I open the details view for "Shared folder"                                       # FileListContext::iOpenTheDetailsViewFor()
    And I see that the details view is open                                               # FilesAppContext::iSeeThatTheDetailsViewIsOpen()
    And I open the "Sharing" tab in the details view                                      # FilesAppContext::iOpenTheTabInTheDetailsView()
    And I see that the "Sharing" tab in the details view is eventually loaded             # FilesAppContext::iSeeThatTheTabInTheDetailsViewIsEventuallyLoaded()
    And I set the share with "user1" as not creatable                                     # FilesAppSharingContext::iSetTheShareWithAsNotCreatable()
    Then I see that "user1" can not create in the share                                   # FilesAppSharingContext::iSeeThatCanNotCreateInTheShare()
    And I see that "user1" can not be allowed to create in the share                      # FilesAppSharingContext::iSeeThatCanNotBeAllowedToCreateInTheShare()
    And I act as Jim                                                                      # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I enter in the folder named "Shared folder"                                       # FileListContext::iEnterInTheFolderNamed()
    And I see that it is not possible to create new files                                 # FileListContext::iSeeThatItIsNotPossibleToCreateNewFiles()
      Failed asserting that true is false.

@rullzer rullzer merged commit 3d2024f into master Oct 20, 2020
@rullzer rullzer deleted the bugfix/noid/change-status-ux-fixes branch October 20, 2020 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug design Design, UI, UX, etc. feature: status

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting empty custom status raises an error

7 participants