Commit Graph

137 Commits

Author SHA1 Message Date
Stan Hu f6c7e38040 Make it harder to delete issuables accidentally
Previously submitting a DELETE request to an issuable URL would be
enough to destroy it, but this should require human confirmation.  We
now require that the `destroy_confirm` parameter is set to a truthy
value before this can complete.

In addition, we log a Sentry error if a deletion arrived without
confirmation.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62387
2019-08-29 12:54:19 -07:00
Luke Duncalfe 926bf71e51 Improve specs for Issues and Notes controllers
This adds test that Todos are completed.

https://gitlab.com/gitlab-org/gitlab-ce/issues/63372
2019-08-21 11:39:41 +12:00
Luke Duncalfe 6ba99cf8b5 Rewrite issues show spec as a feature spec
This spec needs to run as a request-style spec in order to invoke the
Rails router.

A controller-style spec matches the wrong route, and
`session['user_return_to']` becomes incorrect.
2019-08-05 16:36:44 +12:00
Patrick Derichs 0e99daae4a Use NotesFinder in IssuableActions module
Remove project from NotesFinder constructor

Add project parameter to specs

Also look for methods in private scope

Fix specs to match new NotesFinder constructor
2019-08-01 10:42:42 +02:00
Stan Hu c41788fe54 Revert "Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'"
This reverts merge request !29733
2019-07-27 04:28:56 +00:00
Patrick Derichs 355a2df560 Use NotesFinder in module IssuableActions
Add spec for concern IssuableActions

Add shared samples for discussions endpoint

Add schema validations for discussions

Fix rubocop style issue

Make target assignable

Use new possibility to provide target
2019-07-26 09:10:36 +02:00
Peter Leitzen 7b87ed1499 Cleanup usages of `JSON.parse` in specs
Prefer `json_response` where applicable.
2019-07-16 08:03:49 +00:00
Patrick Bajao ac3de494bd Support branch creation from confidential issue
Accept a `confidential_issue_project_id` param which will
be used for the system note target.

This also includes some refactoring on the spec to use
shared examples.
2019-06-29 00:22:09 +08:00
Brett Walker 4a85e263b4 Add reorder action to Project IssuesController
to support manual sorting on the frontend
2019-06-21 07:05:42 -05:00
Brett Walker 40b67a4f6a Allow issues to be sorted by relative_position
- adding a "Manual" option to the dropdown
- show 100 issues list when manually sorting
2019-05-28 11:36:10 -05:00
gfyoung 93a44e135b Add some frozen string to spec/**/*.rb
Adds frozen string to the following:

* spec/bin/**/*.rb
* spec/config/**/*.rb
* spec/controllers/**/*.rb

xref https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-04-15 10:17:05 +00:00
Imre Farkas 9bc5ed14fe Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-09 15:38:58 +00:00
Andreas Brandl 46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
2019-04-05 13:02:56 +00:00
Imre Farkas d9d7237d2e Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-05 11:45:47 +00:00
Sean McGivern 70b92fb380 Merge branch '19745-forms-with-task-lists-can-be-overwritten-when-editing-simultaneously' into 'master'
Forms with task lists can be overwritten when editing simultaneously

See merge request gitlab-org/gitlab-ce!23938
2019-02-04 08:52:22 +00:00
Heinrich Lee Yu 65eb988dae
Use common error for unauthenticated users
Removes special error message when creating new issues
2019-01-31 16:51:17 +01:00
Brett Walker 968e35a692
Specs for caching and issue controller changes 2019-01-30 23:18:17 +01:00
Andrew Newdigate ff0b2cc61f Re-enable MethodCallWithoutArgsParentheses Cop
Re-enables and autocorrects all instances of the
Style/MethodCallWithoutArgsParentheses rule
2019-01-29 21:05:30 +02:00
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
Fatih Acet fc67614164 Merge branch 'ce-issue_7526' into 'master'
[EE Backport] Add notes filters for epics

See merge request gitlab-org/gitlab-ce!24372
2019-01-18 14:02:19 +00:00
Sean McGivern f598daf284 Merge branch 'remove-issues-import-csv-feature-flag' into 'master'
Remove import_issues_csv feature flag

See merge request gitlab-org/gitlab-ce!24324
2019-01-17 10:21:35 +00:00
Felipe Artur d99d6494f9 [EE Backport] Add notes filters for epics 2019-01-14 17:20:11 -02:00
Jasper Maes 4361c92b6a Update gitlab-styles to 2.5.1 2019-01-11 23:59:35 +01:00
Heinrich Lee Yu 993cff046d Remove import_issues_csv feature flag
Also remove test for the feature flag
2019-01-11 22:11:18 +08:00
Heinrich Lee Yu 3c02697114 Import CSV Backend
Process CSV uploads async using a worker then email results
2019-01-07 11:16:58 +08:00
Jasper Maes bebc526e3e Remove deprecated xhr from specs 2018-12-19 23:29:51 +01:00
blackst0ne b44a2c801a Update specs to rails5 format
Updates specs to use new rails5 format.

The old format:
`get :show, { some: params }, { some: headers }`

The new format:
`get :show, params: { some: params }, headers: { some: headers }`
2018-12-19 10:04:31 +11:00
Felipe Artur b80dca82f5 Do not save user preferences on read-only mode 2018-12-12 16:15:58 +00: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
Oswaldo Ferreira 86ead874e2 Resolve "Filter discussion (tab) by comments or activity in issues and merge requests" 2018-10-23 09:49:45 +00:00
Sean McGivern c1667dea04 Fix issues controller N+1 failure
EE needs :request_store to cache license queries - otherwise we will
blow past the query limit just with `SELECT * FROM licenses` over and
over.
2018-10-05 11:55:34 +01:00
Mario de la Ossa 7cb2755617
Banzai project ref- share context more aggresively
Changes `Banzai::CrossProjectReference#parent_from_ref` to return the
project in the context if the project's `full_path` matches the ref
we're looking for, as it makes no sense to go to the database to find a
Project we already have loaded.
2018-10-04 10:12:18 -06:00
Bob Van Landuyt f1d3ea63cf Show the status of a user in interactions
The status is shown for
- The author of a commit when viewing a commit
- Notes on a commit (regular/diff)
- The user that triggered a pipeline when viewing a pipeline
- The author of a merge request when viewing a merge request
- The author of notes on a merge request (regular/diff)
- The author of an issue when viewing an issue
- The author of notes on an issue
- The author of a snippet when viewing a snippet
- The author of notes on a snippet
- A user's profile page
- The list of members of a group/user
2018-07-30 15:01:26 +02:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Felipe Artur 3e66795ef1 Changes tab VUE refactoring 2018-06-21 12:22:40 +00:00
Rémy Coutable ab36cf05c8
Reduce CE/EE diff in spec/controllers/projects/issues_controller_spec.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-05-24 19:29:30 +02:00
Bob Van Landuyt eae2ed3366 Spec improvements for speed, reliability and readability 2018-04-12 18:05:50 +02:00
Bob Van Landuyt 71ccfde322 Correct permissions for creating merge requests from issues
This could only be possible for users that can create merge requests
within a project.

So they need to be a allowed to create a branch and create a merge request.
2018-04-11 10:51:17 +02:00
Jan Provaznik 65664c2eae Refactor discussions/notes code 2018-04-03 16:03:00 +00:00
Fatih Acet 059ab73b8e Render MR Notes with Vue with behind a cookie 2018-02-28 00:10:43 +00:00
Jan Provaznik b02a6bed85 Make pagination optional for issuables
On epics roadmap page we list all epics in the given time frame
without pagination (at least for the first iteration), in this
case it would be nice to use the existing issuables index logic
except pagination (see MR gitlab-ee!4281). For this reason this
patch allows to easily disable pagination.

Related gitlab-ee!4281
2018-01-30 15:43:44 +01:00
Jan Provaznik 4b6b8ecced Return last edited time instead of update time
For issuable models we keep two timestamps:
updated_at which is updated whenever any model attribute is changed,
last_edited_at which is changed when only title or description is
changed.

In UI bellow description we display who and when updated the item. But
last_edited_by (used for 'who') is mistakenly combined with updated_at
(when), last_edited_at should be used instead.

Closes #41247
2018-01-18 12:27:02 +01:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Douwe Maan c90415085d Merge branch '40871-todo-notification-count-shows-notification-without-having-a-todo' into 'master'
Resolve "Todo notification count shows notification without having a todo"

Closes #40871

See merge request gitlab-org/gitlab-ce!15807
2017-12-18 15:08:34 +00:00
Sean McGivern ef454f68e8 Reset todo counters when the target is deleted
When the target is deleted, todos are destroyed, but we did not reset the todo
cache for users with todos on the deleted target. This would only update after
the next time the todo cache was updated for that user.
2017-12-18 12:23:00 +00:00
Luke Bennett 1a3b292d35 Resolve "No feedback when checking on checklist if potential spam was detected" 2017-12-08 12:26:39 +00:00
Jarka Kadlecova 906d2f03d1 Refactor issuable destroy action 2017-11-06 13:02:50 +01:00
Jarka Kadlecova 064c8949bd CE port of code changed for epics 2017-11-02 07:14:35 +01:00
Sean McGivern 17b4367045 Revert "Merge branch '36670-remove-edit-form' into 'master'"
This reverts commit 915e35a299, reversing
changes made to 9533786f52.
2017-10-26 15:53:55 +01:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00