nextcloud-libraries / nextcloud-files

Nextcloud Files helpers for Nextcloud apps and libraries https://npmjs.org/@nextcloud/files
https://nextcloud-libraries.github.io/nextcloud-files
GNU Affero General Public License v3.0
26 stars 12 forks source link

Fixed deprecation warning `Node.attributes.displayname` should be accessed directly on the `Node` #1074

Closed dvaerum closed 1 month ago

dvaerum commented 1 month ago

Hey Nextcloud people.

I can see that I get a lot of these warning in the console of my browser (Firefox). They are floating my console so much that it prevents me from using it to find another bug/issue/problem on Nextcloud :sweat:

[WARN] @nextcloud/files: Accessing "Node.attributes.displayname" is deprecated, access it directly on the Node instance. 
Object { app: "@nextcloud/files", uid: "dvaerum", level: 2 }
[index.mjs:51:16](webpack:///nextcloud/node_modules/@nextcloud/logger/dist/index.mjs)

and I believe that I have traced it down to this line

https://github.com/nextcloud-libraries/nextcloud-files/blob/ae0a991cf74d2444f1c8af9637cdea904f978de2/lib/utils/fileSorting.ts#L68

Which uses v.attributes?.displayname instead of v.displayname.

Sorry, I don't follow the contributor guidelines, but I did not see any.

skjnldsv commented 1 month ago

Thanks Denis! We'll investigate :)

dvaerum commented 1 month ago

Hey @susnux

Do you know there I find the rules for commit messages because it looks like I need to update one of them

Block unconventional commits / Block unconventional commits (pull_request) 

It is obvious what I need to correct :confused:

susnux commented 1 month ago

Yes please squash you commits and use conventional commits like: fix(sorting): access displayname directly on Node

See https://www.conventionalcommits.org/en/v1.0.0/

dvaerum commented 1 month ago

Hey @susnux

I believe that I have fixed the commit names. I didn't find your YAML config for configuring git-conventional-commits, so I just went with the one used in the example here: https://github.com/qoomon/git-conventional-commits?tab=readme-ov-file#config-file