Commit Graph
8955 Commits
Author SHA1 Message Date
Douwe Maan 7d2b34bd61 Satisfy Rubocop. 2015-03-17 16:00:32 +01:00
Douwe Maan 9c7fffb655 Delete deploy key when last connection to a project is destroyed. 2015-03-17 14:55:43 +01:00
Douwe Maan e4ac6bbf82 Merge branch 'atom-xhtml-squashed' into 'master'
Fix invalid Atom feeds when using emoji, horizontal rules, or images

This is a fix for issues #880, #723, #1113.

Markdown must be rendered to XHTML, not HTML, when generating summary content for Atom feeds. Otherwise, content-less tags like *img* and *hr* are not terminated and make the Atom XML invalid. Such tags are generated when issue descriptions, merge request descriptions, comments, or commit messages use emoji, horizontal rules, or images.

To pass this option through from the relevant Haml templates to the proper place in the `gfm()` method, a new method `gfm_with_options()` is introduced. It reuses the options dictionary passed to `markdown()` and interprets options `xhtml` and `parse_tasks` from it (the latter was a convenient replacement for `gfm_with_tasks()`). `xhtml` is already interpreted by Redcarpet::Render::HTML, but that alone was not sufficient, because the post-processing in `gfm()` would convert its XHTML tags back to HTML.

I found no way of passing additional optional options to the existing `gfm()` method without requiring updates to existing callers and without getting in the way of the existing optional arguments, but maybe someone who knows more about Ruby than I can think of one.

Thorough review appreciated since this is the first time I have used Ruby.

See merge request !344
2015-03-17 08:38:38 +00:00
Dmitriy Zaporozhets 409097bd7e Properly align save user profile button 2015-03-17 00:06:25 -07:00
Dmitriy Zaporozhets 84edc020b2 Fix button color inside alert 2015-03-16 23:44:30 -07:00
Dmitriy Zaporozhets 39772a0164 Merge branch 'fix-null-visibility' into 'master'
Handle null restricted_visibility_levels setting

Fix a 500 error when the `restricted_visibility_levels` setting is null in the database - see #2134.

See merge request !1705
2015-03-17 00:03:55 +00:00
Christian Walther 90aa870c36 Fix invalid Atom feeds when using emoji, horizontal rules, or images.
Fixes issues #880, #723, #1113: Markdown must be rendered to XHTML, not HTML, when generating summary content for Atom feeds. Otherwise, content-less tags like <img> and <hr>, generated when issue descriptions, merge request descriptions, comments, or commit messages use emoji, horizontal rules, or images, are not terminated and make the Atom XML invalid.
2015-03-16 22:05:52 +01:00
Dmitriy Zaporozhets 8eebb6e566 Fix editor UI bug 2015-03-16 13:13:02 -07:00
Vinnie Okada 2e672c39a0 Fix restricted visibility bugs
Check for nil values in the restricted_visibility_level validation
method, and set the restricted visibility request parameter to `[]` when
it's missing from the request.
2015-03-16 13:59:50 -06:00
Valery Sizov 1b437ec349 tests 2015-03-16 21:38:41 +02:00
Vinnie Okada 7c3c836d3b Handle null restricted_visibility_levels setting
Fix a 500 error when the `restricted_visibility_levels` setting is null
in the database.
2015-03-16 13:29:27 -06:00
Dmitriy Zaporozhets cba6d797d7 Remove ugly highlight styles 2015-03-16 11:12:44 -07:00
Dmitriy Zaporozhets 998f990714 Merge branch 'post-receive-base64' into 'master'
Prevent gitlab-shell character encoding issues by receiving its changes as raw data.

Depends on gitlab/gitlab-shell!65.

Fixes:

- https://github.com/gitlabhq/gitlabhq/issues/7486
- https://gitlab.com/gitlab-org/gitlab-ce/issues/858
- https://gitlab.com/gitlab-org/gitlab-ce/issues/877
- https://gitlab.com/gitlab-org/gitlab-ce/issues/965

See merge request !1701
2015-03-16 17:53:26 +00:00
Dmitriy Zaporozhets 648f38cd98 Merge branch 'fix-restricted-visibility' into 'master'
Restricted visibility levels - bug fix and new feature

This allows admin users to override restricted visibility settings when creating and updating projects and snippets, and moves the restricted visibility configuration from gitlab.yml to the web UI.  See #1903.

## Move configuration location

I added a new section to the application settings page for restricted visibility levels.  Each level has a checkbox, styled with Bootstrap to look like a toggle button.  A checked box means that the level is restricted.  I added a glowing text shadow and changed the background color for checked buttons because the default styles made it hard to distinguish between checked and unchecked.  This image shows the new section with the "Public" box checked:

![restricted_visibility_settings](https://dev.gitlab.org/Okada/gitlabhq/uploads/629562e4313f89b795e81c3bb0f95893/restricted_visibility_settings.png)

## Allow admins to override

To allow admin users to override the restricted visibility levels, I had to remove the `visibility_level` validation from the `Project` class.  The model doesn't know about the `current_user`, which should determine whether the restrictions can be overridden.  We could use the creator in the validation, but that wouldn't work correctly for projects where a non-admin user is the creator and an admin tries to change the project to a restricted visibility level.

The `Project::UpdateService` and `Project::CreateService` classes already had code to determine whether the current user is allowed to use a given visibility level; now all visibility level validation is done in those classes.  Currently, when a non-admin tries to create or update a project using a restricted level, these classes silently set the visibility level to the global default (create) or the project's existing value (update).  I changed this behavior to be more like an Active Model validation, where using a restricted level causes the entire request to be rejected.

Project and personal snippets didn't have service classes, and restricted visibility levels weren't being enforced in the model or the controllers.  The UI disabled radio buttons for restricted levels, but that wouldn't be difficult to circumvent.  I created the `CreateSnippetService` and `UpdateSnippetService` classes to do the same restricted visibility check that the project classes do.  And since I was dealing with snippet visibility levels, I updated the API endpoints for project snippets to allow users to set and update the visibility level.

## TODO

* [x] Add more tests for restricted visibility functionality

cc @sytse @dzaporozhets

See merge request !1655
2015-03-16 17:49:46 +00:00
Valery Sizov f53683e67f fix specs 2015-03-16 16:51:49 +02:00
Valery Sizov 410d25c8ca rename table subscribe; make it polymorfic 2015-03-16 15:22:50 +02:00
Valery Sizov 09ef69b7c8 code folding fix 2015-03-16 13:52:55 +02:00
Dmitriy Zaporozhets bacb05c554 Small improvements to group/project member rows 2015-03-15 23:50:55 -07:00
Valery Sizov 9698b36c1c Subscription 2015-03-15 19:44:59 +02:00
Douwe Maan 3b1d5a1dff Prevent gitlab-shell character encoding issues by receiving its changes as raw data. 2015-03-15 16:52:22 +01:00
Douwe Maan e88d06c892 Update button class. 2015-03-15 13:56:32 +01:00
Douwe Maan 5ad35bbe02 Use same layout and interactivity for project members as group members. 2015-03-15 13:55:57 +01:00
Douwe Maan 84371de01f Move group leave action from dashboard/groups to groups/group_members. 2015-03-15 13:52:28 +01:00
Douwe Maan 224187ffb9 Move group members index from /members to /group_members. 2015-03-15 13:51:11 +01:00
Douwe Maan 75aff0f79c Move project members index from /team to /project_members 2015-03-15 13:51:11 +01:00
Douwe Maan e97cdb042d Remove old team scopes. 2015-03-15 13:50:38 +01:00
Douwe Maan bbdf23261c Use member instead of tm. 2015-03-15 13:50:38 +01:00
Douwe Maan 31fc73f0a9 Use project_member instead of team_member. 2015-03-15 13:50:38 +01:00
Douwe Maan 99f995755e Use group_member instead of users_group or membership. 2015-03-15 13:49:41 +01:00
Vinnie Okada d7f357a386 Use pre-wrap for diff code in discussion view 2015-03-14 12:30:36 -06:00
Vinnie Okada ad0ca0499a Merge branch 'master' into fix-restricted-visibility
Conflicts:
	db/schema.rb
2015-03-14 10:49:11 -06:00
Vinnie Okada 5710c1aaf8 Update snippet authorization
Allow authors and admins to update the visibility level of personal and
project snippets.
2015-03-14 10:30:48 -06:00
Dmitriy Zaporozhets 19e0dafbef Merge branch 'more-flatly' 2015-03-14 01:48:13 -07:00
Dmitriy Zaporozhets 9b445c6836 Return some merge widget styles and make it more compact 2015-03-14 01:47:19 -07:00
Dmitriy Zaporozhets 9c7faac040 Merge branch 'resetyle-import' into 'master'
Restyle import

Render import providers in one line and make it buttons

See merge request !1699
2015-03-14 08:17:08 +00:00
Dmitriy Zaporozhets f311e189d5 Improve compare switch button 2015-03-14 00:33:26 -07:00
Dmitriy Zaporozhets 30ca451fd4 Refactor buttons 2015-03-14 00:29:32 -07:00
Dmitriy Zaporozhets abf90611cb Improve import buttons on new project page 2015-03-14 00:13:15 -07:00
Dmitriy Zaporozhets dffa2fa9e9 Use sass variabled for backgroung and border colors 2015-03-13 23:40:46 -07:00
Dmitriy Zaporozhets 2da2720584 Improve css for file actions 2015-03-13 19:20:25 -07:00
Dmitriy Zaporozhets 309f588d56 Merge branch 'fix-encoding' into 'master'
Minor cleanup around UTF-8 encoding.

Minor cleanup to be merged after https://dev.gitlab.org/gitlab/gitlab_git/merge_requests/24 is merged in.

See merge request !1642
2015-03-13 16:50:53 +00:00
Dmitriy Zaporozhets b8f5e23f27 Merge branch 'tag-branch-hooks' into 'master'
Execute hooks and services when branch or tag is created or deleted through web interface.

Fixes #2095.

Split up into commits to make it easier to see why what was changed :)

See merge request !1692
2015-03-13 16:42:01 +00:00
Douwe Maan 12b779e70b Move tag deletion to service and execute hooks and services. 2015-03-13 16:07:08 +01:00
Douwe Maan 10421674af Ecevute hooks and services when branches are created/deleted through web. 2015-03-13 16:07:02 +01:00
Douwe Maan f2024b1e06 More consistent method naming. 2015-03-13 16:07:02 +01:00
Douwe Maan 84d28209b6 Use PushDataBuilder where applicable. 2015-03-13 16:06:56 +01:00
Douwe Maan 09791774a5 Use custom LDAP label in LDAP signin form. 2015-03-13 15:42:31 +01:00
Douwe Maan 4e49f21b14 Set push data object kind in PushDataBuilder. 2015-03-13 14:51:48 +01:00
Douwe Maan 7f4cffd88b Reuse blob object fetched by Gitlab::Git::Blame. 2015-03-13 13:49:27 +01:00
Douwe Maan f96dc6295a Everything from gitlab_git is already UTF-8. 2015-03-13 13:49:27 +01:00