Skip to content

Conversation

@matchish
Copy link
Contributor

@matchish matchish commented Jan 8, 2020

#18717
Signed-off-by: Sergey Shliakhov husband.sergey@gmail.com

@matchish
Copy link
Contributor Author

matchish commented Jan 8, 2020

@jancborchardt @kesselb

@matchish
Copy link
Contributor Author

matchish commented Jan 8, 2020

I've extracted avatar creating to private methods because I need a user with different display names for each case.

@juliusknorr
Copy link
Member

Screenshots to make reviews for @nextcloud/designers easier:

image

image

@juliusknorr juliusknorr added 3. to review Waiting for reviews enhancement labels Jan 8, 2020
@juliusknorr juliusknorr added this to the Nextcloud 19 milestone Jan 8, 2020
@kesselb
Copy link
Contributor

kesselb commented Jan 8, 2020

Thanks 👍 Great contribution 🎉

image

Also seems to work with cyrillic characters. Chinese characters not. That's an issue with the font and also not working on master.

@skjnldsv
Copy link
Member

skjnldsv commented Jan 9, 2020

Also seems to work with cyrillic characters. Chinese characters not. That's an issue with the font and also not working on master.

With or without imagick? I think it depends on the fonts installed on the os?

@kesselb
Copy link
Contributor

kesselb commented Jan 9, 2020

Also seems to work with cyrillic characters. Chinese characters not. That's an issue with the font and also not working on master.

With or without imagick? I think it depends on the fonts installed on the os?

$font = __DIR__ . '/../../core/fonts/NotoSans-Regular.ttf';

I think @jancborchardt discussed this at some other issue. The lack of cyrillic / chinese characters was one motivation to use native fonts. Noto Sans seems to support chinese characters. Probably we have to update the font. But that's a different story ;) If you press merge it's the first pr merged for 19 🎉

@matchish
Copy link
Contributor Author

@kesselb Seems like some checks failed accidentally. Can't figure out how to re-run it.

@skjnldsv
Copy link
Member

Tests failing

{
  "reqId": "2PvlYgKwiAD5CzA9a6da",
  "level": 3,
  "time": "2020-01-09T05:27:55+00:00",
  "remoteAddr": "127.0.0.1",
  "user": "admin",
  "app": "no app in context",
  "method": "DELETE",
  "url": "/ocs/v1.php/cloud/users/user1",
  "message": {
    "Exception": "Exception",
    "Message": "Return value of OC\\Avatar\\Avatar::getAvatarText() must be of the type string, null returned",
    "Code": 0,
    "Trace": [
      {
        "file": "/drone/src/lib/private/AppFramework/App.php",
        "line": 125,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Provisioning_API\\Controller\\UsersController"
          },
          "deleteUser"
        ]
      },
      {
        "file": "/drone/src/lib/private/AppFramework/Routing/RouteActionHandler.php",
        "line": 47,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Provisioning_API\\Controller\\UsersController",
          "deleteUser",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "userId": "user1",
            "_route": "ocs.provisioning_api.Users.deleteUser"
          }
        ]
      },
      {
        "function": "__invoke",
        "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
        "type": "->",
        "args": [
          {
            "userId": "user1",
            "_route": "ocs.provisioning_api.Users.deleteUser"
          }
        ]
      },
      {
        "file": "/drone/src/lib/private/Route/Router.php",
        "line": 299,
        "function": "call_user_func",
        "args": [
          {
            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
          },
          {
            "userId": "user1",
            "_route": "ocs.provisioning_api.Users.deleteUser"
          }
        ]
      },
      {
        "file": "/drone/src/ocs/v1.php",
        "line": 82,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/ocsapp/cloud/users/user1"
        ]
      }
    ],
    "File": "/drone/src/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 109,
    "Previous": {
      "Exception": "TypeError",
      "Message": "Return value of OC\\Avatar\\Avatar::getAvatarText() must be of the type string, null returned",
      "Code": 0,
      "Trace": [
        {
          "file": "/drone/src/lib/private/Avatar/Avatar.php",
          "line": 173,
          "function": "getAvatarText",
          "class": "OC\\Avatar\\Avatar",
          "type": "->",
          "args": []
        },
        {
          "file": "/drone/src/lib/private/Avatar/UserAvatar.php",
          "line": 248,
          "function": "generateAvatar",
          "class": "OC\\Avatar\\Avatar",
          "type": "->",
          "args": [
            "user1",
            1024
          ]
        },
        {
          "file": "/drone/src/lib/private/Avatar/Avatar.php",
          "line": 110,
          "function": "getFile",
          "class": "OC\\Avatar\\UserAvatar",
          "type": "->",
          "args": [
            -1
          ]
        },
        {
          "file": "/drone/src/lib/private/User/User.php",
          "line": 434,
          "function": "get",
          "class": "OC\\Avatar\\Avatar",
          "type": "->",
          "args": [
            -1
          ]
        },
        {
          "file": "/drone/src/apps/dav/lib/CardDAV/Converter.php",
          "line": 148,
          "function": "getAvatarImage",
          "class": "OC\\User\\User",
          "type": "->",
          "args": [
            -1
          ]
        },
        {
          "file": "/drone/src/apps/dav/lib/CardDAV/Converter.php",
          "line": 58,
          "function": "getAvatarImage",
          "class": "OCA\\DAV\\CardDAV\\Converter",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/apps/dav/lib/CardDAV/SyncService.php",
          "line": 278,
          "function": "createCardFromUser",
          "class": "OCA\\DAV\\CardDAV\\Converter",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/apps/dav/lib/HookManager.php",
          "line": 148,
          "function": "updateUser",
          "class": "OCA\\DAV\\CardDAV\\SyncService",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/drone/src/lib/private/legacy/hook.php",
          "line": 111,
          "function": "changeUser",
          "class": "OCA\\DAV\\HookManager",
          "type": "->",
          "args": [
            {
              "run": true,
              "user": "*** sensitive parameter replaced ***",
              "feature": "*** sensitive parameter replaced ***",
              "value": "*** sensitive parameter replaced ***",
              "old_value": "*** sensitive parameter replaced ***"
            }
          ]
        },
        {
          "file": "/drone/src/lib/private/Server.php",
          "line": 541,
          "function": "emit",
          "class": "OC_Hook",
          "type": "::",
          "args": [
            "OC_User",
            "changeUser",
            {
              "run": true,
              "user": "*** sensitive parameter replaced ***",
              "feature": "*** sensitive parameter replaced ***",
              "value": "*** sensitive parameter replaced ***",
              "old_value": "*** sensitive parameter replaced ***"
            }
          ]
        },
        {
          "function": "OC\\{closure}",
          "class": "OC\\Server",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/drone/src/lib/private/Hooks/EmitterTrait.php",
          "line": 100,
          "function": "call_user_func_array",
          "args": [
            {
              "__class__": "Closure"
            },
            [
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***"
            ]
          ]
        },
        {
          "file": "/drone/src/lib/private/Hooks/PublicEmitter.php",
          "line": 40,
          "function": "emit",
          "class": "OC\\Hooks\\BasicEmitter",
          "type": "->",
          "args": [
            "\\OC\\User",
            "changeUser",
            [
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***"
            ]
          ]
        },
        {
          "file": "/drone/src/lib/private/User/User.php",
          "line": 476,
          "function": "emit",
          "class": "OC\\Hooks\\PublicEmitter",
          "type": "->",
          "args": [
            "\\OC\\User",
            "changeUser",
            [
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***",
              "*** sensitive parameter replaced ***"
            ]
          ]
        },
        {
          "file": "/drone/src/lib/private/Avatar/UserAvatar.php",
          "line": 211,
          "function": "triggerChange",
          "class": "OC\\User\\User",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/lib/private/Server.php",
          "line": 1346,
          "function": "remove",
          "class": "OC\\Avatar\\UserAvatar",
          "type": "->",
          "args": []
        },
        {
          "file": "/drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 260,
          "function": "OC\\{closure}",
          "class": "OC\\Server",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 235,
          "function": "doDispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              {
                "__class__": "Closure"
              }
            ],
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 73,
          "function": "callListeners",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              {
                "__class__": "Closure"
              }
            ],
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/lib/private/EventDispatcher/SymfonyAdapter.php",
          "line": 70,
          "function": "dispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/lib/private/User/User.php",
          "line": 203,
          "function": "dispatch",
          "class": "OC\\EventDispatcher\\SymfonyAdapter",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/drone/src/apps/provisioning_api/lib/Controller/UsersController.php",
          "line": 658,
          "function": "delete",
          "class": "OC\\User\\User",
          "type": "->",
          "args": []
        },
        {
          "file": "/drone/src/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 170,
          "function": "deleteUser",
          "class": "OCA\\Provisioning_API\\Controller\\UsersController",
          "type": "->",
          "args": [
            "user1"
          ]
        },
        {
          "file": "/drone/src/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 99,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Provisioning_API\\Controller\\UsersController"
            },
            "deleteUser"
          ]
        },
        {
          "file": "/drone/src/lib/private/AppFramework/App.php",
          "line": 125,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Provisioning_API\\Controller\\UsersController"
            },
            "deleteUser"
          ]
        },
        {
          "file": "/drone/src/lib/private/AppFramework/Routing/RouteActionHandler.php",
          "line": 47,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OCA\\Provisioning_API\\Controller\\UsersController",
            "deleteUser",
            {
              "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
            },
            {
              "userId": "user1",
              "_route": "ocs.provisioning_api.Users.deleteUser"
            }
          ]
        },
        {
          "function": "__invoke",
          "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
          "type": "->",
          "args": [
            {
              "userId": "user1",
              "_route": "ocs.provisioning_api.Users.deleteUser"
            }
          ]
        },
        {
          "file": "/drone/src/lib/private/Route/Router.php",
          "line": 299,
          "function": "call_user_func",
          "args": [
            {
              "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
            },
            {
              "userId": "user1",
              "_route": "ocs.provisioning_api.Users.deleteUser"
            }
          ]
        },
        {
          "file": "/drone/src/ocs/v1.php",
          "line": 82,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": [
            "/ocsapp/cloud/users/user1"
          ]
        }
      ],
      "File": "/drone/src/lib/private/Avatar/Avatar.php",
      "Line": 100
    },
    "CustomMessage": "--"
  },
  "userAgent": "GuzzleHttp/6.3.3 curl/7.38.0 PHP/7.3.12-1+0~20191128.49+debian8~1.gbp24559b",
  "version": "18.0.0.8"
}

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jan 10, 2020
@matchish
Copy link
Contributor Author

@skjnldsv I've fixed typo but don't understand why a build is failing now. I run tests on a local machine and its passes.

@skjnldsv
Copy link
Member

@skjnldsv I've fixed typo but don't understand why a build is failing now. I run tests on a local machine and its passes.

sometimes tests can timeout or crash :)
Let's restart! This si for nc 19 anyway, there is no rush 😉

@matchish
Copy link
Contributor Author

@skjnldsv Restart button inactive for me. Could you restart build? Thanks)

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.

Super nice design wise 👍 great job @matchish!

@matchish
Copy link
Contributor Author

matchish commented Jan 14, 2020

Super nice design wise great job @matchish!

Thanks) I'm happy to be part of this great community!

@juliusknorr
Copy link
Member

Remaining test failures seem unrelated

@juliusknorr juliusknorr added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Jan 24, 2020
@matchish
Copy link
Contributor Author

@juliushaertl You're right. I've restarted tests ten times and tests fail always in different places.

@jancborchardt
Copy link
Member

So do we merge this? @skjnldsv want to give it a last look? :)

@skjnldsv
Copy link
Member

@matchish please rebase and squash your commits in 1 (or allow us to push to your branch ;) )

nextcloud#18717
Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>
@skjnldsv skjnldsv merged commit a573039 into nextcloud:master Jan 27, 2020
@welcome
Copy link

welcome bot commented Jan 27, 2020

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
Most developers hang out on IRC. So join #nextcloud-dev on Freenode for a chat!

@rullzer
Copy link
Member

rullzer commented Jan 27, 2020

seems this merge broke the unit tests...

rullzer added a commit that referenced this pull request Jan 27, 2020
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
rullzer added a commit that referenced this pull request Jan 27, 2020
@nickvergessen
Copy link
Member

I think this needs a bit more fixing. Escpecially in mentions it looks a bit awkward now, as it is not readable at all:
Bildschirmfoto von 2020-01-31 16-45-31

Any ideas what we could do there? Showing a single character in small and 2 in big is not going to work.

@raimund-schluessler
Copy link
Member

Is it really necessary to show the auto-generated avatar in mentions? It doesn't really add information in my opinion as the user name is written next to it anyway.

@nickvergessen
Copy link
Member

It helps visually to find the mentions e.g. when scrolling through a long chat history, anyway this is not the right place to discuss this.

@nickvergessen
Copy link
Member

Also core/src/jquery/avatar.js was not updated and therefor now produces a different avatar then whatever the other method is.

StCyr added a commit to nextcloud-libraries/nextcloud-vue that referenced this pull request Oct 13, 2020
1- Returns 2 initials instead of 1 (in line with nextcloud/server#18745)
2- Adds supports for unicode-encoded names

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
StCyr added a commit to nextcloud-libraries/nextcloud-vue that referenced this pull request Oct 13, 2020
1- Returns 2 initials instead of 1 (in line with nextcloud/server#18745)
2- Adds supports for unicode-encoded names

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants