Commit Graph

111 Commits

Author SHA1 Message Date
Mario de la Ossa 49c74068ae
Save sorting preference for Issues/MRs in BE
In order to let users' sorting preferences transfer between devices, we
save the preference for issues and MRs (one preference for issues, one
for MRs) in the backend inside the UserPreference object
2019-01-28 12:48:05 -06:00
Cindy Pallares fe5f75930e
Merge branch 'security-fix-pat-web-access' into 'master'
[master] Resolve "Personal access token with only `read_user` scope can be used to authenticate any web request"

See merge request gitlab/gitlabhq!2583
2018-11-28 19:13:59 -05:00
Heinrich Lee Yu 2a53198324 Refactor whitelisting of filter params 2018-11-15 01:12:07 +08:00
Heinrich Lee Yu 91f235df08 Fix tests 2018-11-13 15:27:42 +08:00
Heinrich Lee Yu 2da7759271 Apply new search bar on issues and merge request dashboards 2018-11-13 15:27:42 +08:00
Rémy Coutable d2afddfeff
Refactor EventFilter and increase its test coverage
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-09-26 18:34:26 +02:00
gfyoung 73322a0e55 Enable frozen string in app/controllers/**/*.rb
Enables frozen string for the following:

* app/controllers/*.rb
* app/controllers/admin/**/*.rb
* app/controllers/boards/**/*.rb
* app/controllers/ci/**/*.rb
* app/controllers/concerns/**/*.rb

Partially addresses #47424.
2018-09-18 21:22:45 -07:00
Jasper Maes ce30d14be5 Rails5 fix expected: 0 times with any arguments received: 1 time with arguments: DashboardController 2018-06-20 10:59:34 +02:00
Jan Provaznik d10416e231 Fixed dashboard filtering tests 2018-04-03 20:19:20 +02:00
Jan Provaznik c1b71e2fa1 Check if at least one filter is set on dashboard
When listing issues and merge requests on dasboard page,
make sure that at least one filter is enabled.

User's id is used in search autocomplete widget instead
of username, which allows presetting user in filter dropdowns.

Related to #43246
2018-04-03 20:19:09 +02:00
Francisco Javier López bf0331dc72 Resolve "DashboardController#activity.json is slow due to SQL" 2017-11-06 16:52:56 +00:00
Yorick Peterse aac1de46c9
Use a specialized class for querying events
This changes various controllers to use the new EventCollection class
for retrieving events. This class uses a JOIN LATERAL query on
PostgreSQL to retrieve queries in a more efficient way, while falling
back to a simpler / less efficient query for MySQL.

The EventCollection class also includes a limit on the number of events
to display to prevent malicious users from cycling through all events,
as doing so could put a lot of pressure on the database.

JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0
and as such this optimisation is only used when using PostgreSQL 9.3 or
newer.
2017-08-10 17:45:49 +02:00
Toon Claes 1e5506d016 Remove some deprecated methods
To avoid the use of slow queries, remove some deprecated methods and encourage
the use of ProjectFinder to find projects.
2017-05-30 23:24:17 +02:00
Douwe Maan e45e540d1d Consistently display last push event widget 2017-05-25 15:21:30 -05:00
Oswaldo Ferreira aeb9db6753 Present group and dashboard MR list without grouping by project 2017-01-27 20:20:18 -02:00
Sean McGivern 97424ea544 Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.
2016-05-10 18:13:52 +01:00
Rémy Coutable 7dc16346bb Fix an issue causing the Dashboard/Milestones page to be blank 2016-03-23 12:02:15 +01:00
Rémy Coutable 733ae58798 Dedupe labels in labels selector in Dashboard pages
Also moved useless helper methods and directly to the
DashboardController.
2016-03-18 21:49:56 +01:00
Phil Hughes 0eecc21485 Updated controller with before_action
Fixed other issues based on feedback
2016-03-18 15:18:06 +00:00
Phil Hughes d847db79cb Fixes issue on dashboard issues
They would try to load JSON from a project even though it isn't a single project
2016-03-18 15:18:06 +00:00
Yorick Peterse 128a6411d2 Don't pluck project IDs for events
By instead using a sub-query we save ourselves the overhead of loading
any data into memory only to pass it on to another query.
2016-01-26 10:51:53 +01:00
Dmitriy Zaporozhets 3cebe9e780
Refactor duplciate code for groups_controller.rb and slack_service/note_message.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-17 11:03:18 +01:00
Dmitriy Zaporozhets c79d801bf5 Fix a bug when milestone/label filter was empty for dashboard issues page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 14:07:38 +01:00
Douwe Maan 5d785457db Clean up overlap between dashboard and explore.
- Split up SnippetsController into separate dashboard and explore sections.
- Use consistent page titles, header titles and sidebars between dashboard and explore sections when signed in or not.
2015-09-08 14:49:20 +01:00
Dmitriy Zaporozhets 5bbe6c4d54
Split starred projects list and activity in same way like we did with your projects
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-02 19:17:04 +02:00
Dmitriy Zaporozhets 8f68c38746
Dashboard activity as separate page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-25 14:13:04 +02:00
Eaden 003e1d39af projects doesn't seem to be a valid action in this controller 2015-05-16 23:04:45 +10:00
Douwe Maan 26ad250989 Add a page title to every page. 2015-04-30 19:12:15 +02:00
Jeroen van Baarsen 5a4ebfb47a Fixed the Rails/ActionFilter cop
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-04-20 15:39:37 +02:00
Dmitriy Zaporozhets f0cbbd70bb Use same constant for amount of items per page 2015-03-12 15:37:00 -07:00
Dmitriy Zaporozhets 0414b2ae98 Remove projects page from dashboard 2015-03-10 16:03:37 -07:00
Dmitriy Zaporozhets 83f7e98d9a Add project filter by visibility and tag to explore page 2015-03-10 15:59:14 -07:00
Dmitriy Zaporozhets 7fd4dc1e11 Remove group rendering from dashboard page 2015-03-10 13:17:16 -07:00
Dmitriy Zaporozhets 65105ff3bb Improve projects list
* Add search filtering for group projects
* Show all user projects on dashboard
* Refactor projects list into one view
* Hide big list of projects with 'Show all' button
2015-03-04 17:22:55 -08:00
Dmitriy Zaporozhets 643afcbe00 Reduce amount of sql queries on dashboard projects page 2015-03-02 14:02:09 -08:00
Dmitriy Zaporozhets 63f11a68c5 Fix event loading with associations 2015-02-18 09:38:46 -08:00
Dmitriy Zaporozhets a8a328b151 DB performance improvements to GitLab 2015-02-18 00:16:42 -08:00
Dmitriy Zaporozhets bbca6a0abd Refactor sorting in project 2015-02-05 19:15:05 -08:00
Dmitriy Zaporozhets 016981c009
Refactor issuable list pages
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-24 11:04:33 +02:00
Dmitriy Zaporozhets 47634e392f
Refactor issues and merge requests lists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-23 18:49:39 +02:00
Dmitriy Zaporozhets 6fb9badcae
Replace project labels with tags to prevent name conflict with GitLab labels
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-29 18:23:18 +03:00
Ciro Santillli 548f070f0e Show link to public projects for new users. 2014-03-17 13:02:04 +01:00
Dmitriy Zaporozhets 645e8d4705
Move services for collecting items to Finders
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-25 19:15:08 +02:00
Dmitriy Zaporozhets 0f47367492
Fix mr preload assoc
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-25 18:15:11 +02:00
Dmitriy Zaporozhets a1b9b1d83f
Use rails preload for Dashboard issues, mr
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-25 17:42:22 +02:00
Jason Hollingsworth 2f69213e3f Allow access to groups with public projects.
Fixed Group avatars to only display when user has read
permissions to at least one project in the group.
2014-02-20 09:26:38 -06:00
Dmitriy Zaporozhets 56f989e53e
Fix wrong issues appears at Dashboard#issues page
Filtering service used klass instead of passed items.
Because of this you see list of all issues intead of authorized ones.
This commit fixes it so people see only issues they are authorized to
see.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-10 15:04:52 +02:00
skv a3f645ef51 Remove deprecated finders 2014-01-19 23:39:56 +04:00
Dmitriy Zaporozhets 6153aa1360
Use FilteringService for Dashboard, Group pages
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-15 16:16:45 +02:00
Dmitriy Zaporozhets 611c5f1d7c
Sort dropdown for Dashboard#projects page
Be default it sorts by name now
Respect filters like scope, label, visibility when do sort or another
filter

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-29 12:58:00 +02:00