Skip to content

Admin organizations order #361

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

Merged
merged 6 commits into from
Aug 8, 2018
Merged

Admin organizations order #361

merged 6 commits into from
Aug 8, 2018

Conversation

markets
Copy link
Collaborator

@markets markets commented May 19, 2018

Closes #360

One annoying thing in Active Admin is when superadmin creates a new user and add membership the select of all organitzations list show the organitzations list without an order

Will be perfect if orgs are ordered by ID

EXTRA

Helpers cleanup:

  • remove empty helpers to avoid loading unnecessary constants (and it's pretty easy to add it again if necessary)
  • minor refactor on avatar_url helper
  • moved alert_class to ApplicationHelper (+ minor refactor)
  • use valid css error class when using show_error_messages!(resource) helper (possible regression introduce in d03726c)
  • added some tests for ApplicationHelper and GlyphHelper

d: "identicon"
}

"https://www.gravatar.com/avatar/#{gravatar_id}.png?#{gravatar_options.to_param}"
Copy link
Contributor

Choose a reason for hiding this comment

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

😍

Copy link
Collaborator

@sauloperez sauloperez May 22, 2018

Choose a reason for hiding this comment

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

I don't mean to do it now but these are the kind of things that I like to turn into a value object. And this will eventually reduce the amount of helpers. Just a thought worth sharing.

@rewritten
Copy link
Contributor

Hey sorry to chime in now. Can we instead use RSpec.describe everywhere?

@markets
Copy link
Collaborator Author

markets commented May 21, 2018

Hi @rewritten, if I'm not wrong to use RSpec.describe is recommended by the RSpec team (https://relishapp.com/rspec/rspec-core/v/3-0/docs/configuration/global-namespace-dsl) and the official docs, so I'm +1 to move to this form, but I'd leave it for a different PR, so the team can discuss about pros/cons, thoughts, settings, ....

@rewritten
Copy link
Contributor

rewritten commented May 22, 2018 via email

@@ -67,15 +68,12 @@
# the seed, which is printed after each run.
# --seed 1234

puts "Randomized with seed #{config.seed}."

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this printed out by default now? I find it useful.

Copy link
Collaborator Author

@markets markets May 22, 2018

Choose a reason for hiding this comment

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

Yes @enricostano, I saw it duplicated before:
captura de pantalla 2018-05-22 a la s 21 54 37

After this:
captura de pantalla 2018-05-22 a la s 21 57 20

Copy link
Contributor

Choose a reason for hiding this comment

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

Weirdly enough I don't see it duplicated in develop 🤔

Copy link
Collaborator Author

@markets markets Jun 7, 2018

Choose a reason for hiding this comment

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

@enricostano maybe you have a global .rspec with any kind of setting preventing this to be displayed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not that I am aware of 😂

timeoverflow@timeoverflow:/var/www/timeoverflow$ ls ~/.rspec
ls: cannot access '/home/timeoverflow/.rspec': No such file or directory
timeoverflow@timeoverflow:/var/www/timeoverflow$ ls ./.rspec
ls: cannot access './.rspec': No such file or directory

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok @enricostano, it's my global .rspec 😂

[2.3.0] markets: ~/workspace/timeoverflow (develop)$ more ~/.rspec 
--color
--order random
--format documentation

This is printed by default by RSpec if you have config.order = "random", but this was removed here: 94c50fb. I'm going to put it back 😅

@enricostano
Copy link
Contributor

@markets @rewritten I created an issue to keep track of the RSpec scope thing #362

d: "identicon"
}

"https://www.gravatar.com/avatar/#{gravatar_id}.png?#{gravatar_options.to_param}"
Copy link
Collaborator

@sauloperez sauloperez May 22, 2018

Choose a reason for hiding this comment

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

I don't mean to do it now but these are the kind of things that I like to turn into a value object. And this will eventually reduce the amount of helpers. Just a thought worth sharing.

@markets markets changed the title Admin orgs order Admin organizations order Jun 13, 2018
markets added 5 commits June 21, 2018 21:33
- remove empty helpers to avoid load unnecessary constants (can be added on demand easily)
- add some tests for ApplicationHelper and GlyphHelper
- return to RSpec.describe as per #362
- manually print seed as we don't use "config.order = 'random'" (we're using a custom ordering) ~> more info. 94c50fb
- [EXTRA] remove sudo in Travis
@markets markets force-pushed the admin_orgs_order branch from 9b577ff to 761c7ff Compare June 21, 2018 19:57
else
'alert-info'
end
end
Copy link
Collaborator Author

@markets markets Jun 21, 2018

Choose a reason for hiding this comment

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

@mllocs what do you think? specially this commit: 761c7ff 😄 I also fixed the css error class returned by show_error_messages!, now in develop looks like:

captura de pantalla 2018-06-21 a la s 22 04 56

@enricostano
Copy link
Contributor

Deployed on https://staging.timeoverflow.org/

@enricostano
Copy link
Contributor

@sseerrggii tested it 🍏

@enricostano enricostano merged commit 52f889d into develop Aug 8, 2018
@enricostano enricostano deleted the admin_orgs_order branch August 8, 2018 11:27
@enricostano enricostano mentioned this pull request Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants