{"action":"created","issue":{"url":"https://api.github.com/repos/opnsense/core/issues/1261","repository_url":"https://api.github.com/repos/opnsense/core","labels_url":"https://api.github.com/repos/opnsense/core/issues/1261/labels{/name}","comments_url":"https://api.github.com/repos/opnsense/core/issues/1261/comments","events_url":"https://api.github.com/repos/opnsense/core/issues/1261/events","html_url":"https://github.com/opnsense/core/issues/1261","id":189701462,"number":1261,"title":"[plugins] sorting of GUI items unpredictable","user":{"login":"fraenki","id":909706,"avatar_url":"https://avatars.githubusercontent.com/u/909706?v=3","gravatar_id":"","url":"https://api.github.com/users/fraenki","html_url":"https://github.com/fraenki","followers_url":"https://api.github.com/users/fraenki/followers","following_url":"https://api.github.com/users/fraenki/following{/other_user}","gists_url":"https://api.github.com/users/fraenki/gists{/gist_id}","starred_url":"https://api.github.com/users/fraenki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fraenki/subscriptions","organizations_url":"https://api.github.com/users/fraenki/orgs","repos_url":"https://api.github.com/users/fraenki/repos","events_url":"https://api.github.com/users/fraenki/events{/privacy}","received_events_url":"https://api.github.com/users/fraenki/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-16T13:19:36Z","updated_at":"2016-11-17T12:16:50Z","closed_at":"2016-11-17T12:14:01Z","body":"I've just noticed that the sorting of items in plugins is somewhat unpredictable.\r\n\r\nFor example, the default sort order of \"Backends\" in HAProxy looks like this:\r\n\r\n![sort_default](https://cloud.githubusercontent.com/assets/909706/20348688/038b71e6-ac07-11e6-9cde-c7851f658c48.png)\r\n\r\nYou can clearly see that the default sort order is not alphanumeric. I assume that it's sorted by date or internal ID.\r\n\r\nWhen clicking on the \"Backend Name\" header I'd assume that it would switch to alphanumeric sorting, but it doesn't work:\r\n\r\n![sort_by_name](https://cloud.githubusercontent.com/assets/909706/20348727/44656e2e-ac07-11e6-81af-a001c2e49ec2.png)\r\n\r\nYou can clearly see that there's no change.\r\n\r\nMaybe the plugin developer needs to do some adjustements that I'm not aware of? Please advice or point me to an example so I'll be able to fix it for the HAProxy plugin."},"comment":{"url":"https://api.github.com/repos/opnsense/core/issues/comments/261232695","html_url":"https://github.com/opnsense/core/issues/1261#issuecomment-261232695","issue_url":"https://api.github.com/repos/opnsense/core/issues/1261","id":261232695,"user":{"login":"AdSchellevis","id":9783985,"avatar_url":"https://avatars.githubusercontent.com/u/9783985?v=3","gravatar_id":"","url":"https://api.github.com/users/AdSchellevis","html_url":"https://github.com/AdSchellevis","followers_url":"https://api.github.com/users/AdSchellevis/followers","following_url":"https://api.github.com/users/AdSchellevis/following{/other_user}","gists_url":"https://api.github.com/users/AdSchellevis/gists{/gist_id}","starred_url":"https://api.github.com/users/AdSchellevis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdSchellevis/subscriptions","organizations_url":"https://api.github.com/users/AdSchellevis/orgs","repos_url":"https://api.github.com/users/AdSchellevis/repos","events_url":"https://api.github.com/users/AdSchellevis/events{/privacy}","received_events_url":"https://api.github.com/users/AdSchellevis/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T12:16:50Z","updated_at":"2016-11-17T12:16:50Z","body":"@fraenki ok found it, ArrayField->SortedBy aligns text before sorting https://github.com/opnsense/core/commit/1a37f39f687a02c74eb9c714548c24ee5a03d77c . Eventually we probably better add a sortableValue() to the baseFieldType and use that for sorting, this method always delivers a best guess. "}}
{"actor":{"display_login":"AdSchellevis"}}