Commit Graph

131 Commits

Author SHA1 Message Date
Robert Speicher 901d4d2ca5 Remove `url_for_new_issue` helper
Now we link to the standard `IssuesController#new` action, and let it
redirect if we're using an external tracker.
2016-08-01 18:23:12 -07:00
Robert Speicher a70431f874 Redirect to external issue tracker from `/issues`
Prior, in order to display the correct link to "Issues" in the project
navigation, we were performing a check against the project to see if it
used an external issue tracker, and if so, we used that URL. This was
inefficient.

Now, we simply _always_ link to `namespace_project_issues_path`, and
then in the controller we redirect to the external tracker if it's
present.

This also removes the need for the url_for_issue helper. Bonus! 🎉
2016-08-01 16:59:44 -07:00
zs 84a3225b0c State specific default sort order for issuables
Provide more sensible default sort order for issues and merge requests
based on the following table:

| type           | state  | default sort order |
|----------------|--------|--------------------|
| issues         | open   | last created       |
| issues         | closed | last updated       |
| issues         | all    | last created       |
| merge requests | open   | last created       |
| merge requests | merged | last updated       |
| merge requests | closed | last updated       |
| merge requests | all    | last created       |
2016-08-01 11:28:56 +02:00
Douwe Maan f6063baed4 Merge branch 'akismet-ui-check' into 'master'
Submit new issues created via the WebUI or API to Akismet for spam check on public projects.

## What does this MR do?

Submit new issues created via the WebUI by non project members to Akismet for spam check.

## Why was this MR needed?

Support for Akismet was added only to the API with !2266. This MR builds on that functionality to also check issues submitted via the WebUI for spam.

## What are the relevant issue numbers?

Related to:

- #5573 
- #5932 
- gitlab-com/infrastructure#14
- gitlab-com/support#61
- !2266

cc @stanhu @MrChrisW 

See merge request !5333
2016-07-27 19:36:43 +00:00
Patricio Cano f01fce7f46 Refactor spam validation to a concern that can be easily reused and improve legibility in `SpamCheckService` 2016-07-26 19:29:16 -05:00
Stan Hu 871723da7f Incorporate review comments 2016-07-26 16:53:39 -07:00
Stan Hu d1ea2bca61 Optimize maximum user access level lookup in loading of notes
NotesHelper#note_editable? and ProjectTeam#human_max_access currently
take about 16% of the load time of an issue page. This MR preloads
the maximum access level of users for all notes in issues and merge
requests with several queries instead of one per user and caches
the result in RequestStore.
2016-07-26 15:33:05 -07:00
Patricio Cano 8f04cf0ead Refactor `SpamCheckService` to make it cleaner and clearer. 2016-07-26 15:18:07 -05:00
Patricio Cano f7807c5b68 Submit all issues on public projects to Akismet if enabled. 2016-07-26 15:17:52 -05:00
Patricio Cano 9c34fafb8b Submit new issues created via the WebUI by non project members to Akismet for spam check. 2016-07-26 15:17:41 -05:00
Douwe Maan aba558a4a8 Merge branch 'caironoleto/gitlab-ce-cn-issue-19747' 2016-07-18 15:44:58 -06:00
Cairo Noleto 36dc4a5ce7 Allow bulk (un)subscription from issues in issue index
fixies #19747
2016-07-14 19:36:19 -03:00
Stan Hu d7c5919158 Revert "Optimistic locking for Issue and Merge Requests"
This reverts commit c39356998b.
2016-07-13 19:17:17 -07:00
Valery Sizov c39356998b Optimistic locking for Issue and Merge Requests 2016-07-12 19:52:14 +03:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Felipe Artur bade71ba5a Add specs and improve coffescript sortable binding function 2016-06-24 15:24:59 -03:00
Felipe Artur c391a72c18 Fix issue being ordered twice and callback when moving between states 2016-06-24 15:23:33 -03:00
Yorick Peterse d470f3d195
Support for rendering/redacting multiple documents
This commit changes the way certain documents are rendered (currently
only Notes) and how documents are redacted. Previously both rendering
and redacting would run on a per document basis. The result of this was
that for every document we'd have to run countless queries just to
figure out if we could display a set of links or not.

This commit changes things around so that redacting Markdown documents
is no longer tied into the html-pipeline Gem. This in turn allows it to
redact multiple documents in a single pass, thus reducing the number of
queries needed.

In turn rendering issue/merge request notes has been adjusted to take
advantage of this new setup. Instead of rendering Markdown somewhere
deep down in a view the Markdown is rendered and redacted in the
controller (taking the current user and all that into account). This has
been done in such a way that the "markdown()" helper method can still be
used on its own.

This particular commit also paves the way for caching rendered HTML on
object level. Right now there's an accessor method Note#note_html which
is used for setting/getting the rendered HTML. Once we cache HTML on row
level we can simply change this field to be a column and call a "save"
whenever needed and we're pretty much done.
2016-06-24 11:46:39 +02:00
Alfredo Sumaran 812ae973db Respond to .json only 2016-06-03 17:14:23 -05:00
Sean McGivern 81a21c945e WIP: allow adding and removing labels in bulk 2016-06-03 17:11:41 -05:00
Alfredo Sumaran da29ad4b9d Add label_ids to bulk_update_params 2016-06-03 17:10:20 -05:00
Alfredo Sumaran dbccacdb82 Ability to assign a label to multiple issues 2016-06-03 17:10:20 -05:00
Zeger-Jan van de Weg 7e6dcf9cd0 Merge branch 'master' into awardables 2016-05-11 08:47:04 +02:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Grzegorz Bizon c9577711ce Handle issue move access instead of raising error
Closes #15533
2016-04-30 21:28:40 +02:00
Yorick Peterse 0426647069 Load the "New Branch" button asynchronously
This button depends on Issue#can_be_worked_on? which in turn depends on
Issue#related_branches. By rendering this button asynchronously we can
finally remove all usages of Issue#related_branches and
Issue#referenced_merge_requests from the issues "show" page.
2016-04-28 16:13:48 -04:00
Phil Hughes 32be8bd2b1 Fixed issue with assignee object not being returned
Closes #15515
2016-04-22 13:30:58 +01:00
Robert Speicher aea9799197 Merge branch 'label-text-color-sidebar' into 'master'
Fixes text color on labels in sidebar

Previously the labels in the sidebar would just have `#FFF` text color which could cause problems with a light background color.

With this, the text color comes from the JSON.

See merge request !3846
2016-04-21 23:13:38 +00:00
Yorick Peterse d35dde0129 Merge branch 'remove-update-files' into 'master'
Removed JS update templates

See merge request !3814
2016-04-21 22:23:41 +00:00
Phil Hughes 7f23e0b8c0 Fixes text color on labels in sidebar 2016-04-21 08:50:15 +01:00
Mehmet Beydogan 3afd08170d Add due_date:time field to Issue model
Add due_date text field to sidebar issue#show
Add ability sorting issues by due date ASC and DESC
Add ability to filtering issues by No Due Date, Any Due Date, Due to tomorrow, Due in this week options
Add handling issue due_date field for MergeRequest
Update CHANGELOG
Fix ambigous match for issues#show sidebar
Fix SCREAMING_SNAKE_CASE offenses for due date contants
Add specs for due date sorting and filtering on issues
2016-04-20 15:42:09 -04:00
Jacob Schatz 692c35e6f4 Merge branch 'multi-filter-labels' into 'master'
Mutliple label filter

Fixes #989 

See merge request !3438
2016-04-20 19:18:32 +00:00
Phil Hughes 75626d5f01 Label text color comes from JSON
Created issuable singleton to house the filtering
2016-04-20 17:00:12 +01:00
Robert Speicher 18a8844fa0 Merge branch '14566-confidential-issue-branches' into 'master'
Sanitize branch names for confidential issues

- When creating new branches for confidential issues, prefer a branch name like `issue-15` to `some-sensitive-issue-title-15`.
- The behaviour for non-confidential issues stays the same.

Closes #14566

See merge request !3671
2016-04-19 16:15:50 +00:00
Phil Hughes 136887da4b Removed JS update templates 2016-04-19 10:54:27 +01:00
Timothy Andrew aa396ae5ee Remove unused variable in `IssuesController`. 2016-04-18 13:01:23 +05:30
Jacob Schatz bb59a1f98e Merge branch 'assign-to-issuable-opener' into 'master'
Issuable can be assigned to author

Closes #9014

The only difference with #9014 is that I thoughed the author should also be
able to assign the issue. If this is unwanted behavior Ill revert it.

/cc @DouweM

See merge request !2765
2016-04-15 15:43:26 +00:00
Timothy Andrew 953bafff90 Merge remote-tracking branch 'origin/master' into 14566-confidential-issue-branches 2016-04-15 09:50:53 +05:30
Jacob Schatz 42e0625dfb Filter by multiple labels with little animation. 2016-04-13 16:10:49 -04:00
Yorick Peterse 31e28ebceb
Load related MRs/branches asynchronously
Currently this works by loading the HAML partials via XHR. While this is
not the nicest setup it _is_ the easiest setup using the tools we
currently have.

Loading this data asynchronously doesn't make loading the related
MRs/branches itself faster, it merely ensures that loading the issue
itself is not slowed down.

Fixes gitlab-org/gitlab-ce#14949
2016-04-13 17:24:21 +02:00
Timothy Andrew 5d88de092f Refactor `Issue#related_branches`
- Previously, the controller held the logic to calculate
  related branches, which was:

  `<branches ending with `issue.iid`> - <branches with a merge request referenced in the current issue>`

- This logic belongs in the `related_branches` method, not in the
  controller. This commit makes this change.

- This means that `Issue#related_branches` now needs to take a `User`.
  When we find the branches that have a merge request referenced in the
  current issue, this is limited to merge requests that the current user
  has access to.

- This is not directly related to #14566, but is a related refactoring.
2016-04-12 11:43:15 +05:30
Zeger-Jan van de Weg 3339513ca6 Merge branch 'master' into assign-to-issuable-opener 2016-03-29 17:26:59 +02:00
Jacob Schatz 53a831124e Edit button leaves modal open
Add user avatar to user selection
2016-03-25 09:54:05 -04:00
Alfredo Sumaran deee55f0bb Remove unnecessary sentence 2016-03-25 08:10:25 -04:00
Jacob Schatz e8d8411016 Adds new dropdown ajax to user selection 2016-03-25 08:07:57 -04:00
Jacob Schatz 3753ace9ba Add labels as proper POST arrays using new dropdown 2016-03-25 08:07:57 -04:00
Jacob Schatz 024dc8073e Add milestone sidebar update via JSON 2016-03-25 08:04:57 -04:00
Jacob Schatz a76ee508fb Ajax call to milestones via new dropdowns 2016-03-25 08:04:57 -04:00
Jacob Schatz ff86138d76 Sidebar milestone updatable via JSON 2016-03-25 08:04:57 -04:00
Jacob Schatz 16ba5eb4d8 Updates sidebar milestone to use new dropdowns 2016-03-25 08:03:16 -04:00