Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort values in AdminDynamicFieldScreenConfiguration #327

Merged
merged 9 commits into from
Jan 23, 2023

Conversation

eyazi
Copy link
Contributor

@eyazi eyazi commented Dec 22, 2022

Proposed change

In „Assignment of dynamic fields to screens“ (AdminDynamicFieldScreenConfiguration) screens and default columns get sorted by the key of the setting and not the value of the setting.

This PR adds proper sorting. The „sorting“ doesn't look that bad on the screenshots below, but if you add your own modules where the key differs from the screen name, the view gets confusing very fast.

Type of change

  • '1 - 🚀 feature'

Additional information

Old:
Old

New:
New

Checklist

  • The code change is tested and works locally.(❗)
  • There is no commented out code in this PR.(❕)
  • You improved or added new unit tests.(❕)
  • Local ZnunyCodePolicy passed.(❕)
  • Local UnitTests / Selenium passed.(❕)
  • GitHub workflow CI (UnitTests / Selenium) passed.(❗)

@dennykorsukewitz dennykorsukewitz added 1 - 🚀 feature New feature or request 1 - 💎 code quality Code quality improvements to existing code or addition of unit tests. 3 - wait for reviewer Znuny, it's your turn. 2 - Frontend labels Jan 10, 2023
@dennykorsukewitz dennykorsukewitz added this to the rel-6_5_1 milestone Jan 10, 2023
@dennykorsukewitz
Copy link
Member

Hi @eyazi ,
thanks for your PR.

Please, keep your fork up-to-date with the upstream repository.
Syncing a fork 🚀 🆙

Regards 🚀

@NiklasSchmitt
Copy link
Contributor

NiklasSchmitt commented Jan 10, 2023

Hi @eyazi,

thank you for your PR. I would like to accept and merge it but first you have to cleanup the code that the ZnunyCodePolicy and all other pipelines successes. Also, please sync your fork with the upstream repository.

Best regards,
Niklas Schmitt ☕ 🚀

@NiklasSchmitt NiklasSchmitt assigned eyazi and unassigned NiklasSchmitt Jan 10, 2023
@NiklasSchmitt NiklasSchmitt added 3 - wait for contributor Contributor, it's your turn. and removed 3 - wait for reviewer Znuny, it's your turn. labels Jan 10, 2023
Copy link
Member

@dennykorsukewitz dennykorsukewitz left a comment

Choose a reason for hiding this comment

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

index 0767c2f927..a292d6b14f 100644
--- a/Kernel/Modules/AdminDynamicFieldScreenConfiguration.pm
+++ b/Kernel/Modules/AdminDynamicFieldScreenConfiguration.pm
@@ -278,7 +278,9 @@ sub _ShowOverview {

     $LayoutObject->Block( Name => 'Overview' );

-    for my $DynamicFieldScreen ( sort { $DynamicFieldScreens{$a} cmp $DynamicFieldScreens{$b} } keys %DynamicFieldScreens ) {
+    for my $DynamicFieldScreen ( sort { $DynamicFieldScreens{$a} cmp $DynamicFieldScreens{$b} }
+        keys %DynamicFieldScreens )
+    {
         $LayoutObject->Block(
             Name => 'DynamicFieldScreenOverviewRow',
             Data => {
@@ -288,7 +290,9 @@ sub _ShowOverview {
         );
     }

-    for my $DefaultColumnsScreen ( sort { $DefaultColumnsScreens{$a} cmp $DefaultColumnsScreens{$b} } keys %DefaultColumnsScreens ) {
+    for my $DefaultColumnsScreen ( sort { $DefaultColumnsScreens{$a} cmp $DefaultColumnsScreens{$b} }
+        keys %DefaultColumnsScreens )
+    {
         $LayoutObject->Block(
             Name => 'DefaultColumnsScreenOverviewRow',
             Data => {
(END)

Copy link
Member

@dennykorsukewitz dennykorsukewitz left a comment

Choose a reason for hiding this comment

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

@eyazi sorry for that.

Today the code policy is bit ...

@dennykorsukewitz dennykorsukewitz self-requested a review January 23, 2023 13:07
@dennykorsukewitz dennykorsukewitz added 4 - verified This issue or pull request was verified. 3 - wait for reviewer Znuny, it's your turn. and removed 3 - wait for contributor Contributor, it's your turn. labels Jan 23, 2023
@NiklasSchmitt NiklasSchmitt added 3 - wait for merge Znuny, it's your turn. and removed 3 - wait for reviewer Znuny, it's your turn. labels Jan 23, 2023
@dennykorsukewitz dennykorsukewitz removed the 3 - wait for merge Znuny, it's your turn. label Jan 23, 2023
@dennykorsukewitz dennykorsukewitz merged commit c977525 into znuny:dev Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 💎 code quality Code quality improvements to existing code or addition of unit tests. 1 - 🚀 feature New feature or request 2 - Frontend 4 - verified This issue or pull request was verified.
Development

Successfully merging this pull request may close these issues.

3 participants