Commit Graph

222 Commits

Author SHA1 Message Date
Phil Hughes d705537634 Added redirect_to_referer to login link on issues
Closes #19968
2016-07-19 13:27:11 +01:00
Douwe Maan 3999b80e4e Merge branch 'quick-start-ci-route' into 'master'
Make "Get started with Builds" Help Page link work properly

`help_page_path('ci/quick_start', 'README')` causes a link to `https://gitlab.com/help/ci%2Fquick_start/README` which in turn breaks every relative link on the page. This remedies the problem.

That said, this is probably a horrible way of fixing this issue, *but* it does work. I can’t find much information on linking this deeply with Rails routes.

If anyone has suggestions as to a better way of handling this, I'll gladly take them. I tried a few different things, but none of them really worked.

Resolves #14872.

cc: @axil @rspeicher @elstamey

See merge request !3561
2016-07-12 00:46:29 +00:00
Jacob Schatz f76596380f Merge branch 'remove-pinto-from-flash' into 'master'
Remove pinTo from Flash

## What does this MR do?

- replace `pinTo` of `Flash` by `parent` parameter in constructor
- move positioning of layout containers from CoffeeScript to layout files
- adjust styling of inline flash messages

## Are there points in the code the reviewer needs to double check?

- display of flash messages in general

## Why was this MR needed?

- allow finding and positioning flash message containers within layout files
- allow adding different CSS classes to flash containers within layout files (necessary for fixing #18908)
- allow multiple flash messages to be displayed at different places at the same time
- make inline flash messages look nicer

## What are the relevant issue numbers?

closes #18908, closes part of #18897

## Screenshots

### Inline flash message (before)
![before](/uploads/c5b3cc05140eaeb9d14e481fa506ebbf/before.png)
![before-mobile](/uploads/004b1f2b9510bd97f4f8a7a6e56f17ef/before-mobile.png)

### Inline flash message (after)
![inline-flash-message](/uploads/fe2a23b63623612b696d529e81fa459e/inline-flash-message.png)
![inline-flash-mobile](/uploads/6207604acfebcf7402d77d5638c89ca8/inline-flash-mobile.png)

### Other flash messages (after)

![flash-message-issue](/uploads/d7e12bd0da68cfa333471ed102428cec/flash-message-issue.png)
---
![flash-new-project](/uploads/3465967dba83296068f154f149d26f64/flash-new-project.png)
---
![flash-sign-in](/uploads/4a5b317d5a369034f43343031607a0c2/flash-sign-in.png)
---
![flash-file-comment](/uploads/488a1119374be7e2173c0a590cfd8821/flash-file-comment.png)
---
![flash-fork](/uploads/f41964e8b910801e03eef3d7649e5009/flash-fork.png)
---
![flash-update-profile](/uploads/9fd972d6c6609fbbf86afcd99d343b5f/flash-update-profile.png)
---

### This is possible now

![flashs-everywhere](/uploads/07f425534511fb4ecaa1d7e2a9870787/flashs-everywhere.png)


See merge request !4854
2016-07-11 21:04:43 +00:00
Connor Shea 3358afa758
Update the help_page_path route to accept paths directly instead of using parameters. 2016-07-11 12:55:25 -06:00
Douwe Maan 29d574868a Display new diff notes and allow creation through the web interface 2016-07-06 18:51:00 -04:00
Douwe Maan a27462a5c6 Extract parts of LegacyDiffNote into DiffOnNote concern and move part of responsibility to other classes 2016-07-06 18:50:59 -04:00
Douwe Maan 375193455a Style diff and blob file headers the same way 2016-07-06 18:50:59 -04:00
Douwe Maan 4c1bf77c7f Remove unneeded div 2016-07-06 18:50:58 -04:00
winniehell 2886ebfb13 Remove `pinTo` from `Flash` and make inline flash messages look nicer (!4854) 2016-06-30 23:53:22 +02:00
Stan Hu 8c29b0b065 Memoize the maximum access level for the author of notes
In #19273, we saw that retrieving ProjectTeam#human_max_access for each
note takes the bulk of the time when rendering certain issues or merge requests.
We observe that most of the comments in an issue are typically done by the
same users. This MR memoizes the max access level by user ID.
2016-06-29 06:26:00 -07: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
Jacob Schatz 681a3acf97 Merge branch 'note-emoji-system-note' into 'master'
Hides award emoji & access level on system notes

## What does this MR do?

Hides award emoji & access level on system notes as they aren't applicable to them notes.

## Screenshots (if relevant)

![Screen_Shot_2016-06-13_at_16.14.03](/uploads/c105c37d0f140dea7480b56242c14ed9/Screen_Shot_2016-06-13_at_16.14.03.png)

See merge request !4629
2016-06-20 19:14:35 +00:00
Jacob Schatz a0aaa6a0b8 Merge branch 'markdowner' into 'master'
POC: Markdown shortcut buttons

## What does this MR do?
Adds markdown shortcut buttons to text area for comments. 

## Are there points in the code the reviewer needs to double check?
Because changing `textarea.val('something')` kills the natural browser undo stack, I had to implement a custom undo stack using state. You can't use the "undoable" state undo pattern because you need to go back to a previous state regardless of cursor position. The undo also adds an undo history item once you delete stuff or press enter.

You can also edit multiple textareas at once and it will keep an undo history for each textarea individually, so the undo state should not collide between textareas.

## Why was this MR needed?
It has been requested multiple times and the competition has it. https://gitlab.com/gitlab-org/gitlab-ce/issues/17185#note_12073433

Libraries are available that already implement this functionality but they are enormous and bloaty. I implemented this in very few lines of code and kept it very simple and as minimal as possible. This was also some competitions approach. I believe so as to not include too much JS. 

Adding extra buttons with new functionality **should only need new HTML and no new JS**.

Only extra complex thing was adding a overridden undo stack, which was made as simple as possible as well.

## What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/17185#note_12073433

## Screenshots (if relevant)

**NOTE:** One thing you cannot see in this screenshot is that I am pressing <kbd>Cmd</kbd><kbd>Z</kbd> to undo and <kbd>Cmd</kbd><kbd>Shift</kbd><kbd>Z</kbd> to redo which is the undo/redo stack I implemented. <kbd>Ctrl</kbd><kbd>Y</kbd> also works for redo. 
![markdown-editor](/uploads/2517bfb1a7b4269da7fcc4003c88b7f6/markdown-editor.gif)

cc @dzaporozhets for UI

cc @iamphill @alfredo1 for JS review

cc @JobV if you like the idea.

Fixes: #17185

See merge request !4305
2016-06-20 17:18:13 +00:00
Jacob Schatz 7717cb727f Move buttons to upper right. 2016-06-17 11:52:22 +01:00
Jacob Schatz 0fd56975ea Initial markdown ez buttons 2016-06-17 11:52:22 +01:00
Phil Hughes b52cbab4a2 Fixed alignment of buttons in note forms 2016-06-17 11:43:59 +01:00
Phil Hughes 59b5bfff6d Uses not when checking for system note 2016-06-17 10:01:57 +01:00
Phil Hughes ad57a94a09 Hides award emoji & access level on system notes 2016-06-13 16:13:16 +01:00
Connor Shea bdc995bf00
Shows award emoji for comments to all users who are logged in. 2016-06-08 17:09:48 -06:00
Jacob Schatz 37afdb076f Merge branch 'edit-mobile' into 'master'
Shows the edit comment button on mobile

## What does this MR do?

Shows the edit comment button on mobile.

## What are the relevant issue numbers?

Closes #17214 

## Screenshots (if relevant)

![Screen_Shot_2016-06-01_at_12.33.13](/uploads/d46b800c175a53821ea8e8af49c07641/Screen_Shot_2016-06-01_at_12.33.13.png)

See merge request !4402
2016-06-06 19:05:51 +00:00
Fatih Acet f1d74ccc8c Some design related tweaks. 2016-06-06 11:10:10 +02:00
Fatih Acet f261be0949 Award emoji implementation for notes. 2016-06-06 11:07:22 +02:00
Fatih Acet eaff5afc9b Show emoji menu in notes. 2016-06-06 11:03:39 +02:00
Phil Hughes 855ff6423b Shows the edit comment button on mobile
Closes #17214
2016-06-02 09:10:29 +01:00
Yorick Peterse 25c08d11bb
Added author to various Markdown calls in views
This ensures all these calls have an author set, allowing the use of
"all" mentions where possible.
2016-05-26 17:14:06 +02:00
Douwe Maan 876dc7bacb Rename diff_with_notes partial. 2016-05-13 17:31:59 -05:00
Douwe Maan e0bb169ae3 "the outdated diff" -> "an outdated diff" 2016-05-13 17:31:58 -05:00
Douwe Maan 7848d54f5b Clean up LegacyDiffNote somewhat 2016-05-13 17:31:58 -05:00
Douwe Maan 99d3e21f19 Extract LegacyDiffNote out of Note 2016-05-13 17:31:43 -05:00
Phil Hughes 04c992f3cf Removed commented text from system notes 2016-04-20 14:48:53 +01:00
Jacob Schatz d337d27e1c Merge branch 'print-style' into 'master'
Print style

[test.pdf](/uploads/0dab5c1b2d0c4d0cd7e8930e9b660a9f/test.pdf)

Closes #14201

See merge request !3784
2016-04-18 13:29:13 +00:00
Jacob Schatz 4d5d619457 Merge branch 'discussion-notes' into 'master'
Discussion notes update

- At the moment discussion notes are rendered in a list but arent actually a list item and that can cause overflow issues
- Moved the dates to be in the header like other notes
- Fixed overlapping issue on mobile

See merge request !3720
2016-04-18 13:03:24 +00:00
Phil Hughes 1a57601d8c Updated print style
Closes #14201
2016-04-18 12:00:20 +01:00
Jacob Schatz f2d94c5d86 Scroll to the last comment I made and edit it. 2016-04-15 16:05:37 -04:00
Annabel Dunstone 80d8f8b876 Syntax & style updates 2016-04-14 12:33:29 -05:00
Phil Hughes 038e623042 Fixed tests 2016-04-14 17:26:32 +01:00
Annabel Dunstone 82d0221b63 Add line type conditional to diff line helper 2016-04-14 09:10:40 -05:00
Annabel Dunstone d176f873e1 Add content attributes to discussion diffs; change styling of add-note icon to prevent white spaces in paste 2016-04-14 09:10:40 -05:00
Phil Hughes e490a54105 Discussion notes update
At the moment discussion notes are rendered in a list but arent actually a list item and that can cause overflow issues
Moved the dates to be in the header like other notes
Fixed overlapping issue on mobile
2016-04-14 14:50:48 +01:00
Phil Hughes 094cafcaa7 Removed GL Actions class 2016-04-14 10:28:05 +01:00
Phil Hughes 3de09d1475 Updated all GFM forms to use new GLForm class 2016-04-14 10:28:05 +01:00
Phil Hughes 82164a9f77 Notes form JS update
Updated the JS to have a standard class with standard actions for each form
Created ability to have toolbar buttons that insert different prefixes dependant upon the data-prefix attribute
2016-04-14 10:28:05 +01:00
Jacob Schatz c52c192249 Merge branch 'member-access-note-row' into 'master'
Fixed issue with member access not being visible on notes

This happened because the `note-actions`, which houses the access, was wrapped in a `can_edit` if statement

![Screen_Shot_2016-04-08_at_16.02.47](/uploads/40bffe9bb53c015f30ffa93bb018552b/Screen_Shot_2016-04-08_at_16.02.47.png)

Fixes #15049

See merge request !3618
2016-04-12 17:21:12 +00:00
Phil Hughes 6dacf0fd6d Fixed issue with member access not being visible on notes
Fixes #15049
2016-04-08 16:02:13 +01:00
Annabel Dunstone e65bccfcc3 Remove comment count & icon from side by side view 2016-04-07 15:33:18 -07:00
Annabel Dunstone 04e798a515 Remove comment count & icon 2016-04-07 15:33:18 -07:00
Annabel Dunstone de63de18d7 Update diff colors and icons 2016-04-07 15:33:18 -07:00
Phil Hughes 4d463c3b0f Fixed delete comment button color 2016-04-06 09:54:49 +01:00
Phil Hughes 4d9d06ec50 Removed emoji button from notes form 2016-04-05 09:12:26 +01:00
Phil Hughes 3b4c4dd7b3 Logged out box 2016-04-04 10:48:49 +01:00