From fdba7449867ab49aed7cb39449ac41af4bc2d234 Mon Sep 17 00:00:00 2001 From: Alexander Randa Date: Fri, 21 Apr 2017 15:31:18 +0000 Subject: Fix long urls in the title of commit --- app/models/commit.rb | 27 ++++++++++-------------- changelogs/unreleased/12614-fix-long-message.yml | 4 ++++ spec/models/commit_spec.rb | 26 +++++++++++++++++++++-- 3 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 changelogs/unreleased/12614-fix-long-message.yml diff --git a/app/models/commit.rb b/app/models/commit.rb index 8b8b3f00202..f21ef76fafc 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -114,16 +114,16 @@ class Commit # # Usually, the commit title is the first line of the commit message. # In case this first line is longer than 100 characters, it is cut off - # after 80 characters and ellipses (`&hellp;`) are appended. + # after 80 characters + `...` def title - full_title.length > 100 ? full_title[0..79] << "…" : full_title + return full_title if full_title.length < 100 + + full_title.truncate(81, separator: ' ', omission: '…') end # Returns the full commits title def full_title - return @full_title if @full_title - - @full_title = + @full_title ||= if safe_message.blank? no_commit_message else @@ -131,19 +131,14 @@ class Commit end end - # Returns the commits description - # - # cut off, ellipses (`&hellp;`) are prepended to the commit message. + # Returns full commit message if title is truncated (greater than 99 characters) + # otherwise returns commit message without first line def description - title_end = safe_message.index("\n") - @description ||= - if (!title_end && safe_message.length > 100) || (title_end && title_end > 100) - "…" << safe_message[80..-1] - else - safe_message.split("\n", 2)[1].try(:chomp) - end - end + return safe_message if full_title.length >= 100 + safe_message.split("\n", 2)[1].try(:chomp) + end + def description? description.present? end diff --git a/changelogs/unreleased/12614-fix-long-message.yml b/changelogs/unreleased/12614-fix-long-message.yml new file mode 100644 index 00000000000..94f8127c3c1 --- /dev/null +++ b/changelogs/unreleased/12614-fix-long-message.yml @@ -0,0 +1,4 @@ +--- +title: Fix long urls in the title of commit +merge_request: 10938 +author: Alexander Randa diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index ce31c8ed94c..3a76e207b0d 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -67,11 +67,11 @@ describe Commit, models: true do expect(commit.title).to eq("--no commit message") end - it "truncates a message without a newline at 80 characters" do + it 'truncates a message without a newline at natural break to 80 characters' do message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.' allow(commit).to receive(:safe_message).and_return(message) - expect(commit.title).to eq("#{message[0..79]}…") + expect(commit.title).to eq('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis…') end it "truncates a message with a newline before 80 characters at the newline" do @@ -113,6 +113,28 @@ eos end end + describe 'description' do + it 'returns description of commit message if title less than 100 characters' do + message = < Date: Fri, 19 May 2017 11:10:08 +0200 Subject: Add docs for protected branches deletion feature Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/32218 --- doc/user/project/img/protected_branches_delete.png | Bin 0 -> 21510 bytes doc/user/project/protected_branches.md | 27 +++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 doc/user/project/img/protected_branches_delete.png diff --git a/doc/user/project/img/protected_branches_delete.png b/doc/user/project/img/protected_branches_delete.png new file mode 100644 index 00000000000..cfdfe6c6c29 Binary files /dev/null and b/doc/user/project/img/protected_branches_delete.png differ diff --git a/doc/user/project/protected_branches.md b/doc/user/project/protected_branches.md index f7a686d2ccf..6024052a869 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -97,8 +97,33 @@ all matching branches: ![Protected branch matches](img/protected_branches_matches.png) +## Deleting a protected branch + +> [Introduced][ce-21393] in GitLab 9.3. + +From time to time, it may be required to delete or clean up branches that are +protected. + +User with [Master permissions][perm] and up can manually delete protected +branches via GitLab's web interface: + +1. Visit **Repository > Branches** +1. Click on the delete icon next to the branch you wish to delete +1. In order to prevent accidental deletion, an additional confirmation is + required + + ![Delete protected branches](img/protected_branches_delete.png) + +Deleting a protected branch is only allowed via the web interface, not via Git. +This means that you can't accidentally delete a protected branch from your +command line or a Git client application. + ## Changelog +**9.2** + +- Allow deletion of protected branches via the web interface [gitlab-org/gitlab-ce#21393][ce-21393] + **8.11** - Allow creating protected branches that can't be pushed to [gitlab-org/gitlab-ce!5081][ce-5081] @@ -113,4 +138,6 @@ all matching branches: [ce-4665]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4665 "Allow specifying protected branches using wildcards" [ce-4892]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4892 "Allow developers to merge into a protected branch without having push access" [ce-5081]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5081 "Allow creating protected branches that can't be pushed to" +[ce-21393]: https://gitlab.com/gitlab-org/gitlab-ce/issues/21393 [ee-restrict]: http://docs.gitlab.com/ee/user/project/protected_branches.html#restricting-push-and-merge-access-to-certain-users +[perm]: ../permissions.md -- cgit v1.2.1 From dc2ac9937a378f4351ba34bb6fab93558f93d611 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Thu, 25 May 2017 14:32:14 +0100 Subject: Escapes html content before appending it to the DOM --- app/assets/javascripts/notes.js | 4 +-- changelogs/unreleased/32908-edit-comment.yml | 4 +++ spec/javascripts/notes_spec.js | 39 ++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/32908-edit-comment.yml diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index b0b1cfd6c8a..702915c516f 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -1398,7 +1398,7 @@ const normalizeNewlines = function(str) { const cachedNoteBodyText = $noteBodyText.html(); // Show updated comment content temporarily - $noteBodyText.html(formContent); + $noteBodyText.html(_.escape(formContent)); $editingNote.removeClass('is-editing fade-in-full').addClass('being-posted fade-in-half'); $editingNote.find('.note-headline-meta a').html(''); @@ -1411,7 +1411,7 @@ const normalizeNewlines = function(str) { }) .fail(() => { // Submission failed, revert back to original note - $noteBodyText.html(cachedNoteBodyText); + $noteBodyText.html(_.escape(cachedNoteBodyText)); $editingNote.removeClass('being-posted fade-in'); $editingNote.find('.fa.fa-spinner').remove(); diff --git a/changelogs/unreleased/32908-edit-comment.yml b/changelogs/unreleased/32908-edit-comment.yml new file mode 100644 index 00000000000..5237dceed11 --- /dev/null +++ b/changelogs/unreleased/32908-edit-comment.yml @@ -0,0 +1,4 @@ +--- +title: Escapes html content before appending it to the DOM +merge_request: +author: diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js index 025f08ee332..ccd703b5b4b 100644 --- a/spec/javascripts/notes_spec.js +++ b/spec/javascripts/notes_spec.js @@ -443,6 +443,45 @@ import '~/notes'; }); }); + describe('update comment with script tags', () => { + const sampleComment = ''; + const updatedComment = ''; + const note = { + id: 1234, + html: `
  • +
    ${sampleComment}
    +
  • `, + note: sampleComment, + valid: true + }; + let $form; + let $notesContainer; + + beforeEach(() => { + this.notes = new Notes('', []); + window.gon.current_username = 'root'; + window.gon.current_user_fullname = 'Administrator'; + $form = $('form.js-main-target-form'); + $notesContainer = $('ul.main-notes-list'); + $form.find('textarea.js-note-text').html(sampleComment); + }); + + it('should not render a script tag', () => { + const deferred = $.Deferred(); + spyOn($, 'ajax').and.returnValue(deferred.promise()); + $('.js-comment-button').click(); + + deferred.resolve(note); + const $noteEl = $notesContainer.find(`#note_${note.id}`); + $noteEl.find('.js-note-edit').click(); + $noteEl.find('textarea.js-note-text').html(updatedComment); + $noteEl.find('.js-comment-save-button').click(); + + const $updatedNoteEl = $notesContainer.find(`#note_${note.id}`).find('.js-task-list-container'); + expect($updatedNoteEl.find('.note-text').text().trim()).toEqual(''); + }); + }); + describe('getFormData', () => { it('should return form metadata object from form reference', () => { this.notes = new Notes('', []); -- cgit v1.2.1 From acb026f9a95b1328cfcf9fdf91e8184b608a9cd7 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Thu, 25 May 2017 18:22:14 +0000 Subject: Revert "Merge branch '32908-edit-comment' into 'master'" This reverts merge request !2105 --- app/assets/javascripts/notes.js | 4 +-- changelogs/unreleased/32908-edit-comment.yml | 4 --- spec/javascripts/notes_spec.js | 39 ---------------------------- 3 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 changelogs/unreleased/32908-edit-comment.yml diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 702915c516f..b0b1cfd6c8a 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -1398,7 +1398,7 @@ const normalizeNewlines = function(str) { const cachedNoteBodyText = $noteBodyText.html(); // Show updated comment content temporarily - $noteBodyText.html(_.escape(formContent)); + $noteBodyText.html(formContent); $editingNote.removeClass('is-editing fade-in-full').addClass('being-posted fade-in-half'); $editingNote.find('.note-headline-meta a').html(''); @@ -1411,7 +1411,7 @@ const normalizeNewlines = function(str) { }) .fail(() => { // Submission failed, revert back to original note - $noteBodyText.html(_.escape(cachedNoteBodyText)); + $noteBodyText.html(cachedNoteBodyText); $editingNote.removeClass('being-posted fade-in'); $editingNote.find('.fa.fa-spinner').remove(); diff --git a/changelogs/unreleased/32908-edit-comment.yml b/changelogs/unreleased/32908-edit-comment.yml deleted file mode 100644 index 5237dceed11..00000000000 --- a/changelogs/unreleased/32908-edit-comment.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Escapes html content before appending it to the DOM -merge_request: -author: diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js index ccd703b5b4b..025f08ee332 100644 --- a/spec/javascripts/notes_spec.js +++ b/spec/javascripts/notes_spec.js @@ -443,45 +443,6 @@ import '~/notes'; }); }); - describe('update comment with script tags', () => { - const sampleComment = ''; - const updatedComment = ''; - const note = { - id: 1234, - html: `
  • -
    ${sampleComment}
    -
  • `, - note: sampleComment, - valid: true - }; - let $form; - let $notesContainer; - - beforeEach(() => { - this.notes = new Notes('', []); - window.gon.current_username = 'root'; - window.gon.current_user_fullname = 'Administrator'; - $form = $('form.js-main-target-form'); - $notesContainer = $('ul.main-notes-list'); - $form.find('textarea.js-note-text').html(sampleComment); - }); - - it('should not render a script tag', () => { - const deferred = $.Deferred(); - spyOn($, 'ajax').and.returnValue(deferred.promise()); - $('.js-comment-button').click(); - - deferred.resolve(note); - const $noteEl = $notesContainer.find(`#note_${note.id}`); - $noteEl.find('.js-note-edit').click(); - $noteEl.find('textarea.js-note-text').html(updatedComment); - $noteEl.find('.js-comment-save-button').click(); - - const $updatedNoteEl = $notesContainer.find(`#note_${note.id}`).find('.js-task-list-container'); - expect($updatedNoteEl.find('.note-text').text().trim()).toEqual(''); - }); - }); - describe('getFormData', () => { it('should return form metadata object from form reference', () => { this.notes = new Notes('', []); -- cgit v1.2.1 From b2ec774c235fdae10ae08335d3cad2aea9f2987e Mon Sep 17 00:00:00 2001 From: Regis Date: Thu, 25 May 2017 16:47:35 -0600 Subject: Update CHANGELOG.md for 9.2.2 [ci skip] --- CHANGELOG.md | 5 +++++ changelogs/unreleased/32715-fix-note-padding.yml | 4 ---- changelogs/unreleased/zj-fix-pipeline-etag.yml | 4 ---- 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 changelogs/unreleased/32715-fix-note-padding.yml delete mode 100644 changelogs/unreleased/zj-fix-pipeline-etag.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e6d8d398a5..c27d4c20d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 9.2.2 (2017-05-25) + +- Fix issue where real time pipelines were not cached. !11615 +- Make all notes use equal padding. + ## 9.2.1 (2017-05-23) - Fix placement of note emoji on hover. diff --git a/changelogs/unreleased/32715-fix-note-padding.yml b/changelogs/unreleased/32715-fix-note-padding.yml deleted file mode 100644 index 867ed7eb171..00000000000 --- a/changelogs/unreleased/32715-fix-note-padding.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Make all notes use equal padding -merge_request: -author: diff --git a/changelogs/unreleased/zj-fix-pipeline-etag.yml b/changelogs/unreleased/zj-fix-pipeline-etag.yml deleted file mode 100644 index 03ebef8c575..00000000000 --- a/changelogs/unreleased/zj-fix-pipeline-etag.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Fix issue where real time pipelines were not cached -merge_request: 11615 -author: -- cgit v1.2.1 From d30982956d2d227987a429c14e02d134b567c0d3 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:07:09 +0200 Subject: Added Dropdown + Options --- app/views/layouts/header/_default.html.haml | 46 ++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 9db98451f1d..00d143f4fb0 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,10 +36,48 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - - if current_user.can_create_project? - %li - = link_to new_project_path, title: 'New project', aria: { label: "New project" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('plus fw') + %li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + + - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) + %li + .bold This group + - if can?(current_user, :create_projects, @group) + %li + = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } + - if can?(current_user, :create_subgroup, @group) + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path, aria: { label: "New project" } + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path, aria: { label: "New group" } + %li + = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } + + - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', -- cgit v1.2.1 From 75131472062aa785443da8dd8ab628cd11e9f483 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:58:03 +0200 Subject: Enabled Tooltips --- app/views/layouts/header/_default.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 00d143f4fb0..88fff245356 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -37,7 +37,7 @@ = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right -- cgit v1.2.1 From c5d3b723544cf2bbf2af95487f8ed5b72cbc0552 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 17:59:45 +0200 Subject: Seperated Dropdown in new partial Fixed different issues from discussion Fixed a Spinach Test which had now 2 New buttons --- app/views/layouts/header/_default.html.haml | 49 +++-------------------------- app/views/layouts/header/_new_dropdown.haml | 42 +++++++++++++++++++++++++ features/steps/project/fork.rb | 4 ++- 3 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 app/views/layouts/header/_new_dropdown.haml diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 88fff245356..249253f4906 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,48 +36,7 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do - = icon('plus fw') - = icon('caret-down') - .dropdown-menu-nav.dropdown-menu-align-right - %ul - - - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) - %li - .bold This group - - if can?(current_user, :create_projects, @group) - %li - = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } - - if can?(current_user, :create_subgroup, @group) - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } - - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } - - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } - - if @group || @project - %li.divider - %li - .bold GitLab - - if current_user.can_create_project? - %li - = link_to 'New project', new_project_path, aria: { label: "New project" } - - if current_user.can_create_group? - %li - = link_to 'New group', new_group_path, aria: { label: "New group" } - %li - = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } - - + = render 'layouts/header/new_dropdown' - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', @@ -112,12 +71,12 @@ @#{current_user.username} %li.divider %li - = link_to "Profile", current_user, class: 'profile-link', aria: { label: "Profile" }, data: { user: current_user.username } + = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li - = link_to "Settings", profile_path, aria: { label: "Settings" } + = link_to "Settings", profile_path %li.divider %li - = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", aria: { label: "Sign out" } + = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" - else %li %div diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml new file mode 100644 index 00000000000..931c02b7268 --- /dev/null +++ b/app/views/layouts/header/_new_dropdown.haml @@ -0,0 +1,42 @@ +%li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if @group && (create_group_project || create_group_subgroup) + %li + .bold This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path + %li + = link_to 'New snippet', new_snippet_path diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 7591e7d5612..7297cb85bf0 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -42,7 +42,9 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I click link "New merge request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see the new merge request page for my namespace' do -- cgit v1.2.1 From e8a305170b33f06012def2afa80326c55257128a Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 10:24:53 +0200 Subject: Externalised Dropdown Checks for creating new issue Styling of .dropdown-bold-header Fixed Spinach Tests to limit them to the main content area for clicking 'New Project' etc. so that they don't click the dropdown menu --- app/assets/stylesheets/framework/dropdowns.scss | 8 +++- app/views/layouts/header/_new_dropdown.haml | 55 +++++++++++++------------ features/steps/dashboard/new_project.rb | 2 +- features/steps/project/create.rb | 4 +- features/steps/project/forked_merge_requests.rb | 4 +- features/steps/project/issues/issues.rb | 4 +- 6 files changed, 46 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 5ab48b6c874..9613006d021 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -261,7 +261,13 @@ text-transform: capitalize; } - .separator + .dropdown-header { + .dropdown-bold-header { + font-weight: 600; + line-height: 22px; + padding: 0 16px; + } + + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 931c02b7268..e9d45802bac 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,35 +3,38 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul - - create_group_project = can?(current_user, :create_projects, @group) - - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if @group && (create_group_project || create_group_subgroup) - %li - .bold This group - - if create_group_project - %li - = link_to 'New project', new_project_path(namespace_id: @group.id) - - if create_group_subgroup - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %ul + - if @group + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if (create_group_project || create_group_subgroup) + %li.dropdown-bold-header This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %li.divider + %li.dropdown-bold-header GitLab - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) - - if @group || @project - %li.divider - %li - .bold GitLab + - create_project_snippet = can?(current_user, :create_project_snippet, @project) + - if (create_project_issue || create_project_mr || create_project_snippet) + %li.dropdown-bold-header This project + - if create_project_issue + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if create_project_snippet + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + %li.divider + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 4fb16d3bb57..766aa9b0468 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -4,7 +4,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps include SharedProject step 'I click "New project" link' do - page.within('.content') do + page.within '#content-body' do click_link "New project" end end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 5f5f806df36..28be9c6df5b 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -5,7 +5,9 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps step 'fill project form with valid data' do fill_in 'project_path', with: 'Empty' - click_button "Create project" + page.within '#content-body' do + click_button "Create project" + end end step 'I should see project page' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 25514eb9ef2..2d9d3efd9d4 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -17,7 +17,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see merge request "Merge Request On Forked Project"' do diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 637e6568267..b376c5049c1 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -62,7 +62,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "New issue"' do - page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + page.within '#content-body' do + page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + end end step 'I click "author" dropdown' do -- cgit v1.2.1 From e4e6b34e5ee682807fc11f7091310d0ea4dae91c Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 11:28:20 +0200 Subject: Check for Merge Request fixed Fixed couple of spinach test --- app/assets/stylesheets/framework/dropdowns.scss | 3 ++- app/views/layouts/header/_new_dropdown.haml | 2 +- features/steps/project/merge_requests.rb | 4 +++- features/steps/project/snippets.rb | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 9613006d021..2ee95483040 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,8 @@ padding: 0 16px; } - .separator + .dropdown-header, .separator + .dropdown-bold-header { + .separator + .dropdown-header, + .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index e9d45802bac..ac8c9070f7d 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -22,7 +22,7 @@ - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || create_project_mr || create_project_snippet) + - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - if create_project_issue %li diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 54b6352c952..17d190711f5 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -14,7 +14,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I click link "Bug NS-04"' do diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index e3f5e9e3ef3..dd49701a3d9 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -23,7 +23,9 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - first(:link, "New snippet").click + page.within '#content-body' do + first(:link, "New snippet").click + end end step 'I click link "Snippet one"' do -- cgit v1.2.1 From bce6536134ceef28ad4caed03b95639ec39d4ac2 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 17:23:48 +0200 Subject: Fixing more broken unscoped tests --- app/views/layouts/header/_new_dropdown.haml | 6 +++--- spec/features/admin/admin_groups_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index ac8c9070f7d..9b9719a26dd 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,7 +3,7 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul + %ul - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) @@ -18,13 +18,13 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project + - if @project && @project.namespace - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - - if create_project_issue + - if create_project_issue %li = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) - if merge_project diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index d5f595894d6..cf9d7bca255 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -24,7 +24,9 @@ feature 'Admin Groups', feature: true do it 'creates new group' do visit admin_groups_path - click_link "New group" + page.within '#content-body' do + click_link "New group" + end path_component = 'gitlab' group_name = 'GitLab group name' group_description = 'Description of group for GitLab' -- cgit v1.2.1 From 6ce73dc5d0889638e0e46b9bfefdd518e293a8c6 Mon Sep 17 00:00:00 2001 From: Regis Date: Wed, 31 May 2017 11:10:00 -0600 Subject: Update CHANGELOG.md for 9.2.3 [ci skip] --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c27d4c20d76..2ff4648620c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 9.2.3 (2017-05-31) + +- Move uploads from 'public/uploads' to 'public/uploads/system'. +- Escapes html content before appending it to the DOM. +- Restrict API X-Frame-Options to same origin. +- Allow users autocomplete by author_id only for authenticated users. + ## 9.2.2 (2017-05-25) - Fix issue where real time pipelines were not cached. !11615 -- cgit v1.2.1 From f217006856d66f633376bbab151e7403e6605118 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 23:02:56 +0200 Subject: Fix for linting problem --- app/assets/stylesheets/framework/dropdowns.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 2ee95483040..6cb11ea4ccf 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,7 @@ padding: 0 16px; } - .separator + .dropdown-header, + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } -- cgit v1.2.1 From 24fa70589a82012aed5e324c7473cbc28073f86b Mon Sep 17 00:00:00 2001 From: Regis Date: Wed, 31 May 2017 16:46:32 -0600 Subject: Update CHANGELOG.md for 9.1.5 [ci skip] --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ff4648620c..f114da997f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -219,6 +219,12 @@ entry. - Fix preemptive scroll bar on user activity calendar. - Pipeline chat notifications convert seconds to minutes and hours. +## 9.1.5 (2017-05-31) + +- Move uploads from 'public/uploads' to 'public/uploads/system'. +- Restrict API X-Frame-Options to same origin. +- Allow users autocomplete by author_id only for authenticated users. + ## 9.1.4 (2017-05-12) - Fix error on CI/CD Settings page related to invalid pipeline trigger. !10948 (dosuken123) -- cgit v1.2.1 From f4ebf930c629fa267884841c1790f6411f8a1de7 Mon Sep 17 00:00:00 2001 From: Regis Date: Wed, 31 May 2017 16:49:34 -0600 Subject: Update CHANGELOG.md for 9.0.8 [ci skip] --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f114da997f0..b1fa9e7c562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -523,6 +523,12 @@ entry. - Only send chat notifications for the default branch. - Don't fill in the default kubernetes namespace. +## 9.0.8 (2017-05-31) + +- Move uploads from 'public/uploads' to 'public/uploads/system'. +- Restrict API X-Frame-Options to same origin. +- Allow users autocomplete by author_id only for authenticated users. + ## 9.0.7 (2017-05-05) - Enforce project features when searching blobs and wikis. -- cgit v1.2.1 From 11b741c5f05d167788efa79411e9df2f1736aa3b Mon Sep 17 00:00:00 2001 From: Regis Date: Fri, 2 Jun 2017 17:08:34 -0600 Subject: Update CHANGELOG.md for 9.2.4 [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1fa9e7c562..04e3f8ae6a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 9.2.4 (2017-06-02) + +- Fix visibility when referencing snippets. + ## 9.2.3 (2017-05-31) - Move uploads from 'public/uploads' to 'public/uploads/system'. -- cgit v1.2.1 From d83a9b42b6aa293b1333dbd17dc9aa15a57db136 Mon Sep 17 00:00:00 2001 From: Regis Date: Fri, 2 Jun 2017 17:49:09 -0600 Subject: Update CHANGELOG.md for 9.0.9 [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04e3f8ae6a6..224b0341da3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -527,6 +527,10 @@ entry. - Only send chat notifications for the default branch. - Don't fill in the default kubernetes namespace. +## 9.0.9 (2017-06-02) + +- Fix visibility when referencing snippets. + ## 9.0.8 (2017-05-31) - Move uploads from 'public/uploads' to 'public/uploads/system'. -- cgit v1.2.1 From fd496b8513c0b7c48870e5330a5e12b95728e61c Mon Sep 17 00:00:00 2001 From: Regis Date: Fri, 2 Jun 2017 22:14:58 -0600 Subject: Update CHANGELOG.md for 9.1.6 [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 224b0341da3..75e354b2c25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -223,6 +223,10 @@ entry. - Fix preemptive scroll bar on user activity calendar. - Pipeline chat notifications convert seconds to minutes and hours. +## 9.1.6 (2017-06-02) + +- Fix visibility when referencing snippets. + ## 9.1.5 (2017-05-31) - Move uploads from 'public/uploads' to 'public/uploads/system'. -- cgit v1.2.1 From 00bc07a90f3b49231f7caac407028883aafff751 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 5 Jun 2017 14:56:16 +0200 Subject: Should fix problem if you have an project without a project ID (Test in new_project_spec.rb) --- app/views/layouts/header/_new_dropdown.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 9b9719a26dd..b220b40d6e3 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -18,7 +18,7 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace + - if @project && @project.namespace && :project_id - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) -- cgit v1.2.1 From 8e9084df220d13d2974d910711dfc7617590a43f Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:07:09 +0200 Subject: Added Dropdown + Options --- app/views/layouts/header/_default.html.haml | 46 ++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 9db98451f1d..00d143f4fb0 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,10 +36,48 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - - if current_user.can_create_project? - %li - = link_to new_project_path, title: 'New project', aria: { label: "New project" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('plus fw') + %li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + + - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) + %li + .bold This group + - if can?(current_user, :create_projects, @group) + %li + = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } + - if can?(current_user, :create_subgroup, @group) + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path, aria: { label: "New project" } + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path, aria: { label: "New group" } + %li + = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } + + - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', -- cgit v1.2.1 From 6ef57fb95ba2a74de134bb5a3ba86d226b1623e6 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:58:03 +0200 Subject: Enabled Tooltips --- app/views/layouts/header/_default.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 00d143f4fb0..88fff245356 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -37,7 +37,7 @@ = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right -- cgit v1.2.1 From 0b99806be1afbd6afa4ba0fb8a25c2715b9358c6 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 17:59:45 +0200 Subject: Seperated Dropdown in new partial Fixed different issues from discussion Fixed a Spinach Test which had now 2 New buttons --- app/views/layouts/header/_default.html.haml | 49 +++-------------------------- app/views/layouts/header/_new_dropdown.haml | 42 +++++++++++++++++++++++++ features/steps/project/fork.rb | 4 ++- 3 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 app/views/layouts/header/_new_dropdown.haml diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 88fff245356..249253f4906 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,48 +36,7 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do - = icon('plus fw') - = icon('caret-down') - .dropdown-menu-nav.dropdown-menu-align-right - %ul - - - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) - %li - .bold This group - - if can?(current_user, :create_projects, @group) - %li - = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } - - if can?(current_user, :create_subgroup, @group) - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } - - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } - - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } - - if @group || @project - %li.divider - %li - .bold GitLab - - if current_user.can_create_project? - %li - = link_to 'New project', new_project_path, aria: { label: "New project" } - - if current_user.can_create_group? - %li - = link_to 'New group', new_group_path, aria: { label: "New group" } - %li - = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } - - + = render 'layouts/header/new_dropdown' - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', @@ -112,12 +71,12 @@ @#{current_user.username} %li.divider %li - = link_to "Profile", current_user, class: 'profile-link', aria: { label: "Profile" }, data: { user: current_user.username } + = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li - = link_to "Settings", profile_path, aria: { label: "Settings" } + = link_to "Settings", profile_path %li.divider %li - = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", aria: { label: "Sign out" } + = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" - else %li %div diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml new file mode 100644 index 00000000000..931c02b7268 --- /dev/null +++ b/app/views/layouts/header/_new_dropdown.haml @@ -0,0 +1,42 @@ +%li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if @group && (create_group_project || create_group_subgroup) + %li + .bold This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path + %li + = link_to 'New snippet', new_snippet_path diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 7591e7d5612..7297cb85bf0 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -42,7 +42,9 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I click link "New merge request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see the new merge request page for my namespace' do -- cgit v1.2.1 From e84ea7adcce95123faac13594523f96523d9f1fb Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 10:24:53 +0200 Subject: Externalised Dropdown Checks for creating new issue Styling of .dropdown-bold-header Fixed Spinach Tests to limit them to the main content area for clicking 'New Project' etc. so that they don't click the dropdown menu --- app/assets/stylesheets/framework/dropdowns.scss | 8 +++- app/views/layouts/header/_new_dropdown.haml | 55 +++++++++++++------------ features/steps/dashboard/new_project.rb | 2 +- features/steps/project/create.rb | 4 +- features/steps/project/forked_merge_requests.rb | 4 +- features/steps/project/issues/issues.rb | 4 +- 6 files changed, 46 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 5ab48b6c874..9613006d021 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -261,7 +261,13 @@ text-transform: capitalize; } - .separator + .dropdown-header { + .dropdown-bold-header { + font-weight: 600; + line-height: 22px; + padding: 0 16px; + } + + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 931c02b7268..e9d45802bac 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,35 +3,38 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul - - create_group_project = can?(current_user, :create_projects, @group) - - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if @group && (create_group_project || create_group_subgroup) - %li - .bold This group - - if create_group_project - %li - = link_to 'New project', new_project_path(namespace_id: @group.id) - - if create_group_subgroup - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %ul + - if @group + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if (create_group_project || create_group_subgroup) + %li.dropdown-bold-header This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %li.divider + %li.dropdown-bold-header GitLab - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) - - if @group || @project - %li.divider - %li - .bold GitLab + - create_project_snippet = can?(current_user, :create_project_snippet, @project) + - if (create_project_issue || create_project_mr || create_project_snippet) + %li.dropdown-bold-header This project + - if create_project_issue + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if create_project_snippet + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + %li.divider + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 4fb16d3bb57..766aa9b0468 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -4,7 +4,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps include SharedProject step 'I click "New project" link' do - page.within('.content') do + page.within '#content-body' do click_link "New project" end end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 5f5f806df36..28be9c6df5b 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -5,7 +5,9 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps step 'fill project form with valid data' do fill_in 'project_path', with: 'Empty' - click_button "Create project" + page.within '#content-body' do + click_button "Create project" + end end step 'I should see project page' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 25514eb9ef2..2d9d3efd9d4 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -17,7 +17,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see merge request "Merge Request On Forked Project"' do diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 637e6568267..b376c5049c1 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -62,7 +62,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "New issue"' do - page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + page.within '#content-body' do + page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + end end step 'I click "author" dropdown' do -- cgit v1.2.1 From fbe0186a14732d2a8165085d28ccffe487e65bce Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 11:28:20 +0200 Subject: Check for Merge Request fixed Fixed couple of spinach test --- app/assets/stylesheets/framework/dropdowns.scss | 3 ++- app/views/layouts/header/_new_dropdown.haml | 2 +- features/steps/project/merge_requests.rb | 4 +++- features/steps/project/snippets.rb | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 9613006d021..2ee95483040 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,8 @@ padding: 0 16px; } - .separator + .dropdown-header, .separator + .dropdown-bold-header { + .separator + .dropdown-header, + .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index e9d45802bac..ac8c9070f7d 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -22,7 +22,7 @@ - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || create_project_mr || create_project_snippet) + - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - if create_project_issue %li diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 54b6352c952..17d190711f5 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -14,7 +14,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I click link "Bug NS-04"' do diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index e3f5e9e3ef3..dd49701a3d9 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -23,7 +23,9 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - first(:link, "New snippet").click + page.within '#content-body' do + first(:link, "New snippet").click + end end step 'I click link "Snippet one"' do -- cgit v1.2.1 From c9d46fa8388118b969291bbd6830d14ecdf71ee5 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 17:23:48 +0200 Subject: Fixing more broken unscoped tests --- app/views/layouts/header/_new_dropdown.haml | 6 +++--- spec/features/admin/admin_groups_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index ac8c9070f7d..9b9719a26dd 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,7 +3,7 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul + %ul - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) @@ -18,13 +18,13 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project + - if @project && @project.namespace - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - - if create_project_issue + - if create_project_issue %li = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) - if merge_project diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index d5f595894d6..cf9d7bca255 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -24,7 +24,9 @@ feature 'Admin Groups', feature: true do it 'creates new group' do visit admin_groups_path - click_link "New group" + page.within '#content-body' do + click_link "New group" + end path_component = 'gitlab' group_name = 'GitLab group name' group_description = 'Description of group for GitLab' -- cgit v1.2.1 From 9ea6cc189518e05336ff84c9157bd04e4d1c4a0f Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 23:02:56 +0200 Subject: Fix for linting problem --- app/assets/stylesheets/framework/dropdowns.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 2ee95483040..6cb11ea4ccf 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,7 @@ padding: 0 16px; } - .separator + .dropdown-header, + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } -- cgit v1.2.1 From adc13a03cc6dc892d087424dab89f835dbd446ed Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 5 Jun 2017 14:56:16 +0200 Subject: Should fix problem if you have an project without a project ID (Test in new_project_spec.rb) --- app/views/layouts/header/_new_dropdown.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 9b9719a26dd..b220b40d6e3 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -18,7 +18,7 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace + - if @project && @project.namespace && :project_id - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) -- cgit v1.2.1 From 9512419d730588ccd144bd2c756b1142159b08e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 6 Jun 2017 11:38:28 +0800 Subject: add portuguese brazil translation of cycle analytics page Fix #33334 --- app/assets/javascripts/locale/pt_BR/app.js | 1 + lib/gitlab/i18n.rb | 1 + locale/pt_BR/gitlab.po | 260 +++++++++++++++++++++++++++++ locale/pt_BR/gitlab.po.time_stamp | 0 4 files changed, 262 insertions(+) create mode 100644 app/assets/javascripts/locale/pt_BR/app.js create mode 100644 locale/pt_BR/gitlab.po create mode 100644 locale/pt_BR/gitlab.po.time_stamp diff --git a/app/assets/javascripts/locale/pt_BR/app.js b/app/assets/javascripts/locale/pt_BR/app.js new file mode 100644 index 00000000000..f2eed3da064 --- /dev/null +++ b/app/assets/javascripts/locale/pt_BR/app.js @@ -0,0 +1 @@ +var locales = locales || {}; locales['pt_BR'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","POT-Creation-Date":"2017-05-04 19:24-0500","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","PO-Revision-Date":"2017-06-05 03:29-0400","Last-Translator":"Alexandre Alencar ","Language-Team":"Portuguese (Brazil)","Language":"pt-BR","X-Generator":"Zanata 3.9.6","Plural-Forms":"nplurals=2; plural=(n != 1)","lang":"pt_BR","domain":"app","plural_forms":"nplurals=2; plural=(n != 1)"},"ByAuthor|by":["por"],"Commit":["Commit","Commits"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["A Análise de Ciclo fornece uma visão geral de quanto tempo uma ideia demora para ir para produção em seu projeto."],"CycleAnalyticsStage|Code":["Código"],"CycleAnalyticsStage|Issue":["Tarefa"],"CycleAnalyticsStage|Plan":["Plano"],"CycleAnalyticsStage|Production":["Produção"],"CycleAnalyticsStage|Review":["Revisão"],"CycleAnalyticsStage|Staging":["Homologação"],"CycleAnalyticsStage|Test":["Teste"],"Deploy":["Implantação","Implantações"],"FirstPushedBy|First":["Primeiro"],"FirstPushedBy|pushed by":["publicado por"],"From issue creation until deploy to production":["Da criação de tarefas até a implantação para a produção"],"From merge request merge until deploy to production":["Da incorporação do merge request até a implantação em produção"],"Introducing Cycle Analytics":["Apresentando a Análise de Ciclo"],"Last %d day":["Último %d dia","Últimos %d dias"],"Limited to showing %d event at most":["Limitado a mostrar %d evento no máximo","Limitado a mostrar %d eventos no máximo"],"Median":["Mediana"],"New Issue":["Nova Tarefa","Novas Tarefas"],"Not available":["Não disponível"],"Not enough data":["Dados insuficientes"],"OpenedNDaysAgo|Opened":["Aberto"],"Pipeline Health":["Saúde da Pipeline"],"ProjectLifecycle|Stage":["Etapa"],"Read more":["Ler mais"],"Related Commits":["Commits Relacionados"],"Related Deployed Jobs":["Jobs Relacionados Incorporados"],"Related Issues":["Tarefas Relacionadas"],"Related Jobs":["Jobs Relacionados"],"Related Merge Requests":["Merge Requests Relacionados"],"Related Merged Requests":["Merge Requests Relacionados"],"Showing %d event":["Mostrando %d evento","Mostrando %d eventos"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["O estágio de codificação mostra o tempo desde o primeiro commit até a criação do merge request. \\nOs dados serão automaticamente adicionados aqui uma vez que você tenha criado seu primeiro merge request."],"The collection of events added to the data gathered for that stage.":["A coleção de eventos adicionados aos dados coletados para esse estágio."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["O estágio em questão mostra o tempo que leva desde a criação de uma tarefa até a sua assinatura para um milestone, ou a sua adição para a lista no seu Painel de Tarefas. Comece a criar tarefas para ver dados para esta etapa."],"The phase of the development lifecycle.":["A fase do ciclo de vida do desenvolvimento."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["A fase de planejamento mostra o tempo do passo anterior até empurrar o seu primeiro commit. Este tempo será adicionado automaticamente assim que você realizar seu primeiro commit."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["O estágio de produção mostra o tempo total que leva entre criar uma tarefa e implantar o código na produção. Os dados serão adicionados automaticamente até que você complete todo o ciclo de produção."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["A etapa de revisão mostra o tempo de criação de um merge request até que o merge seja feito. Os dados serão automaticamente adicionados depois que você fizer seu primeiro merge request."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["O estágio de estágio mostra o tempo entre a fusão do MR e o código de implantação para o ambiente de produção. Os dados serão automaticamente adicionados depois de implantar na produção pela primeira vez."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["A fase de teste mostra o tempo que o GitLab CI leva para executar cada pipeline para o merge request relacionado. Os dados serão automaticamente adicionados após a conclusão do primeiro pipeline."],"The time taken by each data entry gathered by that stage.":["O tempo necessário para cada entrada de dados reunida por essa etapa."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["O valor situado no ponto médio de uma série de valores observados. Ex., entre 3, 5, 9, a mediana é 5. Entre 3, 5, 7, 8, a mediana é (5 + 7) / 2 = 6."],"Time before an issue gets scheduled":["Tempo até que uma tarefa seja planejada"],"Time before an issue starts implementation":["Tempo até que uma tarefa comece a ser implementada"],"Time between merge request creation and merge/close":["Tempo entre a criação do merge request e o merge/fechamento"],"Time until first merge request":["Tempo até o primeiro merge request"],"Time|hr":["h","hs"],"Time|min":["min","mins"],"Time|s":["s"],"Total Time":["Tempo Total"],"Total test time for all commits/merges":["Tempo de teste total para todos os commits/merges"],"Want to see the data? Please ask an administrator for access.":["Precisa visualizar os dados? Solicite acesso ao administrador."],"We don't have enough data to show this stage.":["Não temos dados suficientes para mostrar esta fase."],"You need permission.":["Você precisa de permissão."],"day":["dia","dias"]}}}; \ No newline at end of file diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index f7ac48f7dbd..6a8f9418df3 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -6,6 +6,7 @@ module Gitlab 'en' => 'English', 'es' => 'Español', 'de' => 'Deutsch', + 'pt_BR' => 'Português(Brasil)', 'zh_CN' => '简体中文', 'zh_HK' => '繁體中文(香港)', 'zh_TW' => '繁體中文(臺灣)' diff --git a/locale/pt_BR/gitlab.po b/locale/pt_BR/gitlab.po new file mode 100644 index 00000000000..5ad41f92b64 --- /dev/null +++ b/locale/pt_BR/gitlab.po @@ -0,0 +1,260 @@ +# Alexandre Alencar , 2017. #zanata +# Fabio Beneditto , 2017. #zanata +# Leandro Nunes dos Santos , 2017. #zanata +msgid "" +msgstr "" +"Project-Id-Version: gitlab 1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-04 19:24-0500\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-06-05 03:29-0400\n" +"Last-Translator: Alexandre Alencar \n" +"Language-Team: Portuguese (Brazil)\n" +"Language: pt-BR\n" +"X-Generator: Zanata 3.9.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +msgid "ByAuthor|by" +msgstr "por" + +msgid "Commit" +msgid_plural "Commits" +msgstr[0] "Commit" +msgstr[1] "Commits" + +msgid "" +"Cycle Analytics gives an overview of how much time it takes to go from idea " +"to production in your project." +msgstr "" +"A Análise de Ciclo fornece uma visão geral de quanto tempo uma ideia demora " +"para ir para produção em seu projeto." + +msgid "CycleAnalyticsStage|Code" +msgstr "Código" + +msgid "CycleAnalyticsStage|Issue" +msgstr "Tarefa" + +msgid "CycleAnalyticsStage|Plan" +msgstr "Plano" + +msgid "CycleAnalyticsStage|Production" +msgstr "Produção" + +msgid "CycleAnalyticsStage|Review" +msgstr "Revisão" + +msgid "CycleAnalyticsStage|Staging" +msgstr "Homologação" + +msgid "CycleAnalyticsStage|Test" +msgstr "Teste" + +msgid "Deploy" +msgid_plural "Deploys" +msgstr[0] "Implantação" +msgstr[1] "Implantações" + +msgid "FirstPushedBy|First" +msgstr "Primeiro" + +msgid "FirstPushedBy|pushed by" +msgstr "publicado por" + +msgid "From issue creation until deploy to production" +msgstr "Da criação de tarefas até a implantação para a produção" + +msgid "From merge request merge until deploy to production" +msgstr "Da incorporação do merge request até a implantação em produção" + +msgid "Introducing Cycle Analytics" +msgstr "Apresentando a Análise de Ciclo" + +msgid "Last %d day" +msgid_plural "Last %d days" +msgstr[0] "Último %d dia" +msgstr[1] "Últimos %d dias" + +msgid "Limited to showing %d event at most" +msgid_plural "Limited to showing %d events at most" +msgstr[0] "Limitado a mostrar %d evento no máximo" +msgstr[1] "Limitado a mostrar %d eventos no máximo" + +msgid "Median" +msgstr "Mediana" + +msgid "New Issue" +msgid_plural "New Issues" +msgstr[0] "Nova Tarefa" +msgstr[1] "Novas Tarefas" + +msgid "Not available" +msgstr "Não disponível" + +msgid "Not enough data" +msgstr "Dados insuficientes" + +msgid "OpenedNDaysAgo|Opened" +msgstr "Aberto" + +msgid "Pipeline Health" +msgstr "Saúde da Pipeline" + +msgid "ProjectLifecycle|Stage" +msgstr "Etapa" + +msgid "Read more" +msgstr "Ler mais" + +msgid "Related Commits" +msgstr "Commits Relacionados" + +msgid "Related Deployed Jobs" +msgstr "Jobs Relacionados Incorporados" + +msgid "Related Issues" +msgstr "Tarefas Relacionadas" + +msgid "Related Jobs" +msgstr "Jobs Relacionados" + +msgid "Related Merge Requests" +msgstr "Merge Requests Relacionados" + +msgid "Related Merged Requests" +msgstr "Merge Requests Relacionados" + +msgid "Showing %d event" +msgid_plural "Showing %d events" +msgstr[0] "Mostrando %d evento" +msgstr[1] "Mostrando %d eventos" + +msgid "" +"The coding stage shows the time from the first commit to creating the merge " +"request. The data will automatically be added here once you create your " +"first merge request." +msgstr "" +"O estágio de codificação mostra o tempo desde o primeiro commit até a " +"criação do merge request. \n" +"Os dados serão automaticamente adicionados aqui uma vez que você tenha " +"criado seu primeiro merge request." + +msgid "The collection of events added to the data gathered for that stage." +msgstr "" +"A coleção de eventos adicionados aos dados coletados para esse estágio." + +msgid "" +"The issue stage shows the time it takes from creating an issue to assigning " +"the issue to a milestone, or add the issue to a list on your Issue Board. " +"Begin creating issues to see data for this stage." +msgstr "" +"O estágio em questão mostra o tempo que leva desde a criação de uma tarefa " +"até a sua assinatura para um milestone, ou a sua adição para a lista no seu " +"Painel de Tarefas. Comece a criar tarefas para ver dados para esta etapa." + +msgid "The phase of the development lifecycle." +msgstr "A fase do ciclo de vida do desenvolvimento." + +msgid "" +"The planning stage shows the time from the previous step to pushing your " +"first commit. This time will be added automatically once you push your first " +"commit." +msgstr "" +"A fase de planejamento mostra o tempo do passo anterior até empurrar o seu " +"primeiro commit. Este tempo será adicionado automaticamente assim que você " +"realizar seu primeiro commit." + +msgid "" +"The production stage shows the total time it takes between creating an issue " +"and deploying the code to production. The data will be automatically added " +"once you have completed the full idea to production cycle." +msgstr "" +"O estágio de produção mostra o tempo total que leva entre criar uma tarefa e " +"implantar o código na produção. Os dados serão adicionados automaticamente " +"até que você complete todo o ciclo de produção." + +msgid "" +"The review stage shows the time from creating the merge request to merging " +"it. The data will automatically be added after you merge your first merge " +"request." +msgstr "" +"A etapa de revisão mostra o tempo de criação de um merge request até que o " +"merge seja feito. Os dados serão automaticamente adicionados depois que você " +"fizer seu primeiro merge request." + +msgid "" +"The staging stage shows the time between merging the MR and deploying code " +"to the production environment. The data will be automatically added once you " +"deploy to production for the first time." +msgstr "" +"O estágio de estágio mostra o tempo entre a fusão do MR e o código de " +"implantação para o ambiente de produção. Os dados serão automaticamente " +"adicionados depois de implantar na produção pela primeira vez." + +msgid "" +"The testing stage shows the time GitLab CI takes to run every pipeline for " +"the related merge request. The data will automatically be added after your " +"first pipeline finishes running." +msgstr "" +"A fase de teste mostra o tempo que o GitLab CI leva para executar cada " +"pipeline para o merge request relacionado. Os dados serão automaticamente " +"adicionados após a conclusão do primeiro pipeline." + +msgid "The time taken by each data entry gathered by that stage." +msgstr "O tempo necessário para cada entrada de dados reunida por essa etapa." + +msgid "" +"The value lying at the midpoint of a series of observed values. E.g., " +"between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 =" +" 6." +msgstr "" +"O valor situado no ponto médio de uma série de valores observados. Ex., " +"entre 3, 5, 9, a mediana é 5. Entre 3, 5, 7, 8, a mediana é (5 + 7) / 2 = 6." + +msgid "Time before an issue gets scheduled" +msgstr "Tempo até que uma tarefa seja planejada" + +msgid "Time before an issue starts implementation" +msgstr "Tempo até que uma tarefa comece a ser implementada" + +msgid "Time between merge request creation and merge/close" +msgstr "Tempo entre a criação do merge request e o merge/fechamento" + +msgid "Time until first merge request" +msgstr "Tempo até o primeiro merge request" + +msgid "Time|hr" +msgid_plural "Time|hrs" +msgstr[0] "h" +msgstr[1] "hs" + +msgid "Time|min" +msgid_plural "Time|mins" +msgstr[0] "min" +msgstr[1] "mins" + +msgid "Time|s" +msgstr "s" + +msgid "Total Time" +msgstr "Tempo Total" + +msgid "Total test time for all commits/merges" +msgstr "Tempo de teste total para todos os commits/merges" + +msgid "Want to see the data? Please ask an administrator for access." +msgstr "Precisa visualizar os dados? Solicite acesso ao administrador." + +msgid "We don't have enough data to show this stage." +msgstr "Não temos dados suficientes para mostrar esta fase." + +msgid "You need permission." +msgstr "Você precisa de permissão." + +msgid "day" +msgid_plural "days" +msgstr[0] "dia" +msgstr[1] "dias" + diff --git a/locale/pt_BR/gitlab.po.time_stamp b/locale/pt_BR/gitlab.po.time_stamp new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.1 From 417a24de988e06177ccedf2b3367bf71c72a920b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 6 Jun 2017 11:44:28 +0800 Subject: added changelog for Portuguese Brazil translations --- .../33334-portuguese_brazil_translation_of_cycle_analytics_page.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml diff --git a/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml b/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml new file mode 100644 index 00000000000..a0e0458da16 --- /dev/null +++ b/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml @@ -0,0 +1,4 @@ +--- +title: Add Portuguese Brazil of Cycle Analytics Page to I18N +merge_request: 11920 +author:Huang Tao -- cgit v1.2.1 From 5b8bc13c8fb613caa75e1bb87b930e14f997b966 Mon Sep 17 00:00:00 2001 From: Huang Tao Date: Tue, 6 Jun 2017 04:59:55 +0000 Subject: Update i18n.rb style --- lib/gitlab/i18n.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index 6a8f9418df3..541235cf911 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -6,7 +6,7 @@ module Gitlab 'en' => 'English', 'es' => 'Español', 'de' => 'Deutsch', - 'pt_BR' => 'Português(Brasil)', + 'pt_BR' => 'Português(Brasil)', 'zh_CN' => '简体中文', 'zh_HK' => '繁體中文(香港)', 'zh_TW' => '繁體中文(臺灣)' -- cgit v1.2.1 From 0917ad7269084ef92a6d1bfc940530fca28303d8 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 12:02:50 +0200 Subject: FIxes based on MR --- app/views/layouts/header/_new_dropdown.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index b220b40d6e3..ecc5a518687 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -7,7 +7,7 @@ - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if (create_group_project || create_group_subgroup) + - if create_group_project || create_group_subgroup %li.dropdown-bold-header This group - if create_group_project %li @@ -18,11 +18,11 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace && :project_id + - if @project && @project.persisted? - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || merge_project || create_project_snippet) + - if create_project_issue || merge_project || create_project_snippet %li.dropdown-bold-header This project - if create_project_issue %li @@ -34,7 +34,7 @@ %li = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) %li.divider - %li.dropdown-bold-header GitLab + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path -- cgit v1.2.1 From 6e3ec3efb6f3a8a05e62ec4b447d4d263bcf033e Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 12:10:00 +0200 Subject: Added Changelog for functionality --- .../23603-add-extra-functionality-for-the-top-right-button.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml diff --git a/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml b/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml new file mode 100644 index 00000000000..77f8e31e16e --- /dev/null +++ b/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml @@ -0,0 +1,4 @@ +--- +title: Add extra context-sensitive functionality for the top right menu button +merge_request: 11632 +author: -- cgit v1.2.1 From cff037fd25a8f94af0ccdc179bb7171411dc1369 Mon Sep 17 00:00:00 2001 From: Mark Fletcher Date: Tue, 6 Jun 2017 18:28:36 +0800 Subject: Confirm Project forking behaviour via the API * It's unclear that the forking operation can still be ongoing * `import_status` is available in Project Entity to determine status --- ...-forking-and-configuring-project-via-api-works-very-unreliable.yml | 4 ++++ doc/api/projects.md | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 changelogs/unreleased/28607-forking-and-configuring-project-via-api-works-very-unreliable.yml diff --git a/changelogs/unreleased/28607-forking-and-configuring-project-via-api-works-very-unreliable.yml b/changelogs/unreleased/28607-forking-and-configuring-project-via-api-works-very-unreliable.yml new file mode 100644 index 00000000000..9cf8d745f92 --- /dev/null +++ b/changelogs/unreleased/28607-forking-and-configuring-project-via-api-works-very-unreliable.yml @@ -0,0 +1,4 @@ +--- +title: Confirm Project forking behaviour via the API +merge_request: +author: diff --git a/doc/api/projects.md b/doc/api/projects.md index 70cad8a6025..19dd795b337 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -551,6 +551,8 @@ Parameters: Forks a project into the user namespace of the authenticated user or the one provided. +The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately. To determine whether the fork of the project has completed, query the `import_status` for the new project. + ``` POST /projects/:id/fork ``` -- cgit v1.2.1 From 4ef728e6153224ef08d055ba235c1f76d1c4f1f1 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 16:46:30 +0200 Subject: Added First Test for top right menu --- features/dashboard/new_project_menu.feature | 11 +++++++++++ features/steps/dashboard/new_project.rb | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 features/dashboard/new_project_menu.feature diff --git a/features/dashboard/new_project_menu.feature b/features/dashboard/new_project_menu.feature new file mode 100644 index 00000000000..c339fb0e897 --- /dev/null +++ b/features/dashboard/new_project_menu.feature @@ -0,0 +1,11 @@ +@dashboard +Feature: New Project through top menu +Background: + Given I sign in as a user + And I own project "Shop" + And I visit dashboard page + And I click "New project" in top right menu + + @javascript + Scenario: I should see New Projects page + Then I see "New Project" page diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 766aa9b0468..530fd6f7bdb 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -9,6 +9,12 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps end end + step 'I click "New project" in top right menu' do + page.within '.header-content' do + click_link "New project" + end + end + step 'I see "New Project" page' do expect(page).to have_content('Project path') expect(page).to have_content('Project name') -- cgit v1.2.1 From f952957cf3c0d26274ad13b6d03bde1d2a183a7b Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:07:09 +0200 Subject: Added Dropdown + Options --- app/views/layouts/header/_default.html.haml | 46 ++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 9db98451f1d..00d143f4fb0 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,10 +36,48 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - - if current_user.can_create_project? - %li - = link_to new_project_path, title: 'New project', aria: { label: "New project" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('plus fw') + %li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + + - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) + %li + .bold This group + - if can?(current_user, :create_projects, @group) + %li + = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } + - if can?(current_user, :create_subgroup, @group) + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path, aria: { label: "New project" } + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path, aria: { label: "New group" } + %li + = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } + + - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', -- cgit v1.2.1 From f55b041fb6068673f5fdf9f892066ed0d131ada9 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:58:03 +0200 Subject: Enabled Tooltips --- app/views/layouts/header/_default.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 00d143f4fb0..88fff245356 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -37,7 +37,7 @@ = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right -- cgit v1.2.1 From 9387dd5f86e47641c455fb6f92c1d293828d88a7 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 17:59:45 +0200 Subject: Seperated Dropdown in new partial Fixed different issues from discussion Fixed a Spinach Test which had now 2 New buttons --- app/views/layouts/header/_default.html.haml | 49 +++-------------------------- app/views/layouts/header/_new_dropdown.haml | 42 +++++++++++++++++++++++++ features/steps/project/fork.rb | 4 ++- 3 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 app/views/layouts/header/_new_dropdown.haml diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 88fff245356..249253f4906 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,48 +36,7 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do - = icon('plus fw') - = icon('caret-down') - .dropdown-menu-nav.dropdown-menu-align-right - %ul - - - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) - %li - .bold This group - - if can?(current_user, :create_projects, @group) - %li - = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } - - if can?(current_user, :create_subgroup, @group) - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } - - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } - - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } - - if @group || @project - %li.divider - %li - .bold GitLab - - if current_user.can_create_project? - %li - = link_to 'New project', new_project_path, aria: { label: "New project" } - - if current_user.can_create_group? - %li - = link_to 'New group', new_group_path, aria: { label: "New group" } - %li - = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } - - + = render 'layouts/header/new_dropdown' - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', @@ -112,12 +71,12 @@ @#{current_user.username} %li.divider %li - = link_to "Profile", current_user, class: 'profile-link', aria: { label: "Profile" }, data: { user: current_user.username } + = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li - = link_to "Settings", profile_path, aria: { label: "Settings" } + = link_to "Settings", profile_path %li.divider %li - = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", aria: { label: "Sign out" } + = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" - else %li %div diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml new file mode 100644 index 00000000000..931c02b7268 --- /dev/null +++ b/app/views/layouts/header/_new_dropdown.haml @@ -0,0 +1,42 @@ +%li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if @group && (create_group_project || create_group_subgroup) + %li + .bold This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path + %li + = link_to 'New snippet', new_snippet_path diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 14932491daa..35df403a85f 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -42,7 +42,9 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I click link "New merge request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see the new merge request page for my namespace' do -- cgit v1.2.1 From 4b6ab497796972ac7c3af8668f2e238f5190f059 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 10:24:53 +0200 Subject: Externalised Dropdown Checks for creating new issue Styling of .dropdown-bold-header Fixed Spinach Tests to limit them to the main content area for clicking 'New Project' etc. so that they don't click the dropdown menu --- app/assets/stylesheets/framework/dropdowns.scss | 8 +++- app/views/layouts/header/_new_dropdown.haml | 55 +++++++++++++------------ features/steps/dashboard/new_project.rb | 2 +- features/steps/project/create.rb | 4 +- features/steps/project/forked_merge_requests.rb | 4 +- features/steps/project/issues/issues.rb | 4 +- 6 files changed, 46 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 5ab48b6c874..9613006d021 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -261,7 +261,13 @@ text-transform: capitalize; } - .separator + .dropdown-header { + .dropdown-bold-header { + font-weight: 600; + line-height: 22px; + padding: 0 16px; + } + + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 931c02b7268..e9d45802bac 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,35 +3,38 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul - - create_group_project = can?(current_user, :create_projects, @group) - - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if @group && (create_group_project || create_group_subgroup) - %li - .bold This group - - if create_group_project - %li - = link_to 'New project', new_project_path(namespace_id: @group.id) - - if create_group_subgroup - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %ul + - if @group + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if (create_group_project || create_group_subgroup) + %li.dropdown-bold-header This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %li.divider + %li.dropdown-bold-header GitLab - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) - - if @group || @project - %li.divider - %li - .bold GitLab + - create_project_snippet = can?(current_user, :create_project_snippet, @project) + - if (create_project_issue || create_project_mr || create_project_snippet) + %li.dropdown-bold-header This project + - if create_project_issue + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if create_project_snippet + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + %li.divider + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 4fb16d3bb57..766aa9b0468 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -4,7 +4,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps include SharedProject step 'I click "New project" link' do - page.within('.content') do + page.within '#content-body' do click_link "New project" end end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 5f5f806df36..28be9c6df5b 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -5,7 +5,9 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps step 'fill project form with valid data' do fill_in 'project_path', with: 'Empty' - click_button "Create project" + page.within '#content-body' do + click_button "Create project" + end end step 'I should see project page' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 25514eb9ef2..2d9d3efd9d4 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -17,7 +17,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see merge request "Merge Request On Forked Project"' do diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 637e6568267..b376c5049c1 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -62,7 +62,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "New issue"' do - page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + page.within '#content-body' do + page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + end end step 'I click "author" dropdown' do -- cgit v1.2.1 From 73b64f1f5b040e8f8f3e421e685acde5219d5b99 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 11:28:20 +0200 Subject: Check for Merge Request fixed Fixed couple of spinach test --- app/assets/stylesheets/framework/dropdowns.scss | 3 ++- app/views/layouts/header/_new_dropdown.haml | 2 +- features/steps/project/merge_requests.rb | 4 +++- features/steps/project/snippets.rb | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 9613006d021..2ee95483040 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,8 @@ padding: 0 16px; } - .separator + .dropdown-header, .separator + .dropdown-bold-header { + .separator + .dropdown-header, + .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index e9d45802bac..ac8c9070f7d 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -22,7 +22,7 @@ - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || create_project_mr || create_project_snippet) + - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - if create_project_issue %li diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 54b6352c952..17d190711f5 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -14,7 +14,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I click link "Bug NS-04"' do diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index e3f5e9e3ef3..dd49701a3d9 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -23,7 +23,9 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - first(:link, "New snippet").click + page.within '#content-body' do + first(:link, "New snippet").click + end end step 'I click link "Snippet one"' do -- cgit v1.2.1 From 19950d601105a53dba7549135b05c3907075cdce Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 17:23:48 +0200 Subject: Fixing more broken unscoped tests --- app/views/layouts/header/_new_dropdown.haml | 6 +++--- spec/features/admin/admin_groups_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index ac8c9070f7d..9b9719a26dd 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,7 +3,7 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul + %ul - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) @@ -18,13 +18,13 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project + - if @project && @project.namespace - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - - if create_project_issue + - if create_project_issue %li = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) - if merge_project diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index d5f595894d6..cf9d7bca255 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -24,7 +24,9 @@ feature 'Admin Groups', feature: true do it 'creates new group' do visit admin_groups_path - click_link "New group" + page.within '#content-body' do + click_link "New group" + end path_component = 'gitlab' group_name = 'GitLab group name' group_description = 'Description of group for GitLab' -- cgit v1.2.1 From 696a43e0832c982465718d557fcbdadc6d67e370 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 23:02:56 +0200 Subject: Fix for linting problem --- app/assets/stylesheets/framework/dropdowns.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 2ee95483040..6cb11ea4ccf 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,7 @@ padding: 0 16px; } - .separator + .dropdown-header, + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } -- cgit v1.2.1 From 028266089a9aa6d90aa90c72493706cfdad0b2f7 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 5 Jun 2017 14:56:16 +0200 Subject: Should fix problem if you have an project without a project ID (Test in new_project_spec.rb) --- app/views/layouts/header/_new_dropdown.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 9b9719a26dd..b220b40d6e3 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -18,7 +18,7 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace + - if @project && @project.namespace && :project_id - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) -- cgit v1.2.1 From d81d940fa2979e3de8391187e0cbc7eed6d24969 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 12:02:50 +0200 Subject: FIxes based on MR --- app/views/layouts/header/_new_dropdown.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index b220b40d6e3..ecc5a518687 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -7,7 +7,7 @@ - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if (create_group_project || create_group_subgroup) + - if create_group_project || create_group_subgroup %li.dropdown-bold-header This group - if create_group_project %li @@ -18,11 +18,11 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace && :project_id + - if @project && @project.persisted? - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || merge_project || create_project_snippet) + - if create_project_issue || merge_project || create_project_snippet %li.dropdown-bold-header This project - if create_project_issue %li @@ -34,7 +34,7 @@ %li = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) %li.divider - %li.dropdown-bold-header GitLab + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path -- cgit v1.2.1 From 2d87b79a497a13244057e416ed116d0d8754e36b Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 12:10:00 +0200 Subject: Added Changelog for functionality --- .../23603-add-extra-functionality-for-the-top-right-button.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml diff --git a/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml b/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml new file mode 100644 index 00000000000..77f8e31e16e --- /dev/null +++ b/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml @@ -0,0 +1,4 @@ +--- +title: Add extra context-sensitive functionality for the top right menu button +merge_request: 11632 +author: -- cgit v1.2.1 From fd01aeda887520af068bf8719d8d729855bf59fd Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 16:46:30 +0200 Subject: Added First Test for top right menu --- features/dashboard/new_project_menu.feature | 11 +++++++++++ features/steps/dashboard/new_project.rb | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 features/dashboard/new_project_menu.feature diff --git a/features/dashboard/new_project_menu.feature b/features/dashboard/new_project_menu.feature new file mode 100644 index 00000000000..c339fb0e897 --- /dev/null +++ b/features/dashboard/new_project_menu.feature @@ -0,0 +1,11 @@ +@dashboard +Feature: New Project through top menu +Background: + Given I sign in as a user + And I own project "Shop" + And I visit dashboard page + And I click "New project" in top right menu + + @javascript + Scenario: I should see New Projects page + Then I see "New Project" page diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 766aa9b0468..530fd6f7bdb 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -9,6 +9,12 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps end end + step 'I click "New project" in top right menu' do + page.within '.header-content' do + click_link "New project" + end + end + step 'I see "New Project" page' do expect(page).to have_content('Project path') expect(page).to have_content('Project name') -- cgit v1.2.1 From b4bef24b462e8cd3ca39cfc64694008130b446c6 Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Fri, 2 Jun 2017 16:06:29 -0700 Subject: 32720 Create equal padding for emoji on comments and emoji-block --- app/assets/stylesheets/framework/awards.scss | 3 +-- app/assets/stylesheets/pages/issuable.scss | 2 +- app/assets/stylesheets/pages/issues.scss | 19 ++++++++++++------- changelogs/unreleased/32720-emoji-spacing.yml | 4 ++++ 4 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 changelogs/unreleased/32720-emoji-spacing.yml diff --git a/app/assets/stylesheets/framework/awards.scss b/app/assets/stylesheets/framework/awards.scss index 75907c35b7e..b4069a6d8e3 100644 --- a/app/assets/stylesheets/framework/awards.scss +++ b/app/assets/stylesheets/framework/awards.scss @@ -100,7 +100,6 @@ .award-menu-holder { display: inline-block; - position: absolute; .tooltip { white-space: nowrap; @@ -108,7 +107,7 @@ } .award-control { - margin: 0 5px 6px 0; + margin: 4px 8px 4px 0; outline: 0; position: relative; diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index c2346f2f1c3..4abad3f2697 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -58,7 +58,7 @@ } .emoji-block { - padding: 10px 0 4px; + padding: 10px 0; } } diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss index 702e7662527..f923a1104a9 100644 --- a/app/assets/stylesheets/pages/issues.scss +++ b/app/assets/stylesheets/pages/issues.scss @@ -249,14 +249,19 @@ ul.related-merge-requests > li { } @media (min-width: $screen-sm-min) { - .new-branch-col { - padding-top: 0; - text-align: right; - } + .emoji-block .row { + display: flex; - .create-mr-dropdown-wrap { - .btn-group:not(.hide) { - display: inline-block; + .new-branch-col { + padding-top: 0; + text-align: right; + align-self: center; + } + + .create-mr-dropdown-wrap { + .btn-group:not(.hide) { + display: inline-block; + } } } } diff --git a/changelogs/unreleased/32720-emoji-spacing.yml b/changelogs/unreleased/32720-emoji-spacing.yml new file mode 100644 index 00000000000..da3df0f9093 --- /dev/null +++ b/changelogs/unreleased/32720-emoji-spacing.yml @@ -0,0 +1,4 @@ +--- +title: Create equal padding for emoji +merge_request: +author: -- cgit v1.2.1 From efce25590126d8093ce66b7541938d24a859f1d8 Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Tue, 6 Jun 2017 16:27:50 -0700 Subject: 33308 Use pre-wrap for commit messages to keep lists indented --- app/assets/stylesheets/pages/commits.scss | 2 +- changelogs/unreleased/33308-use-pre-wrap-for-commit-messages.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/33308-use-pre-wrap-for-commit-messages.yml diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index bb72f453d1b..9db0f2075cb 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -228,7 +228,7 @@ margin: 10px 0; background: $gray-light; display: none; - white-space: pre-line; + white-space: pre-wrap; word-break: normal; pre { diff --git a/changelogs/unreleased/33308-use-pre-wrap-for-commit-messages.yml b/changelogs/unreleased/33308-use-pre-wrap-for-commit-messages.yml new file mode 100644 index 00000000000..43e8f242947 --- /dev/null +++ b/changelogs/unreleased/33308-use-pre-wrap-for-commit-messages.yml @@ -0,0 +1,4 @@ +--- +title: Use pre-wrap for commit messages to keep lists indented +merge_request: +author: -- cgit v1.2.1 From d2bfd329e942d43bfdc6bcbb46ee4faf48055522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 6 Jun 2017 11:38:28 +0800 Subject: add portuguese brazil translation of cycle analytics page Fix #33334 --- app/assets/javascripts/locale/pt_BR/app.js | 1 + lib/gitlab/i18n.rb | 1 + locale/pt_BR/gitlab.po | 260 +++++++++++++++++++++++++++++ locale/pt_BR/gitlab.po.time_stamp | 0 4 files changed, 262 insertions(+) create mode 100644 app/assets/javascripts/locale/pt_BR/app.js create mode 100644 locale/pt_BR/gitlab.po create mode 100644 locale/pt_BR/gitlab.po.time_stamp diff --git a/app/assets/javascripts/locale/pt_BR/app.js b/app/assets/javascripts/locale/pt_BR/app.js new file mode 100644 index 00000000000..f2eed3da064 --- /dev/null +++ b/app/assets/javascripts/locale/pt_BR/app.js @@ -0,0 +1 @@ +var locales = locales || {}; locales['pt_BR'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","POT-Creation-Date":"2017-05-04 19:24-0500","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","PO-Revision-Date":"2017-06-05 03:29-0400","Last-Translator":"Alexandre Alencar ","Language-Team":"Portuguese (Brazil)","Language":"pt-BR","X-Generator":"Zanata 3.9.6","Plural-Forms":"nplurals=2; plural=(n != 1)","lang":"pt_BR","domain":"app","plural_forms":"nplurals=2; plural=(n != 1)"},"ByAuthor|by":["por"],"Commit":["Commit","Commits"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["A Análise de Ciclo fornece uma visão geral de quanto tempo uma ideia demora para ir para produção em seu projeto."],"CycleAnalyticsStage|Code":["Código"],"CycleAnalyticsStage|Issue":["Tarefa"],"CycleAnalyticsStage|Plan":["Plano"],"CycleAnalyticsStage|Production":["Produção"],"CycleAnalyticsStage|Review":["Revisão"],"CycleAnalyticsStage|Staging":["Homologação"],"CycleAnalyticsStage|Test":["Teste"],"Deploy":["Implantação","Implantações"],"FirstPushedBy|First":["Primeiro"],"FirstPushedBy|pushed by":["publicado por"],"From issue creation until deploy to production":["Da criação de tarefas até a implantação para a produção"],"From merge request merge until deploy to production":["Da incorporação do merge request até a implantação em produção"],"Introducing Cycle Analytics":["Apresentando a Análise de Ciclo"],"Last %d day":["Último %d dia","Últimos %d dias"],"Limited to showing %d event at most":["Limitado a mostrar %d evento no máximo","Limitado a mostrar %d eventos no máximo"],"Median":["Mediana"],"New Issue":["Nova Tarefa","Novas Tarefas"],"Not available":["Não disponível"],"Not enough data":["Dados insuficientes"],"OpenedNDaysAgo|Opened":["Aberto"],"Pipeline Health":["Saúde da Pipeline"],"ProjectLifecycle|Stage":["Etapa"],"Read more":["Ler mais"],"Related Commits":["Commits Relacionados"],"Related Deployed Jobs":["Jobs Relacionados Incorporados"],"Related Issues":["Tarefas Relacionadas"],"Related Jobs":["Jobs Relacionados"],"Related Merge Requests":["Merge Requests Relacionados"],"Related Merged Requests":["Merge Requests Relacionados"],"Showing %d event":["Mostrando %d evento","Mostrando %d eventos"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["O estágio de codificação mostra o tempo desde o primeiro commit até a criação do merge request. \\nOs dados serão automaticamente adicionados aqui uma vez que você tenha criado seu primeiro merge request."],"The collection of events added to the data gathered for that stage.":["A coleção de eventos adicionados aos dados coletados para esse estágio."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["O estágio em questão mostra o tempo que leva desde a criação de uma tarefa até a sua assinatura para um milestone, ou a sua adição para a lista no seu Painel de Tarefas. Comece a criar tarefas para ver dados para esta etapa."],"The phase of the development lifecycle.":["A fase do ciclo de vida do desenvolvimento."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["A fase de planejamento mostra o tempo do passo anterior até empurrar o seu primeiro commit. Este tempo será adicionado automaticamente assim que você realizar seu primeiro commit."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["O estágio de produção mostra o tempo total que leva entre criar uma tarefa e implantar o código na produção. Os dados serão adicionados automaticamente até que você complete todo o ciclo de produção."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["A etapa de revisão mostra o tempo de criação de um merge request até que o merge seja feito. Os dados serão automaticamente adicionados depois que você fizer seu primeiro merge request."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["O estágio de estágio mostra o tempo entre a fusão do MR e o código de implantação para o ambiente de produção. Os dados serão automaticamente adicionados depois de implantar na produção pela primeira vez."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["A fase de teste mostra o tempo que o GitLab CI leva para executar cada pipeline para o merge request relacionado. Os dados serão automaticamente adicionados após a conclusão do primeiro pipeline."],"The time taken by each data entry gathered by that stage.":["O tempo necessário para cada entrada de dados reunida por essa etapa."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["O valor situado no ponto médio de uma série de valores observados. Ex., entre 3, 5, 9, a mediana é 5. Entre 3, 5, 7, 8, a mediana é (5 + 7) / 2 = 6."],"Time before an issue gets scheduled":["Tempo até que uma tarefa seja planejada"],"Time before an issue starts implementation":["Tempo até que uma tarefa comece a ser implementada"],"Time between merge request creation and merge/close":["Tempo entre a criação do merge request e o merge/fechamento"],"Time until first merge request":["Tempo até o primeiro merge request"],"Time|hr":["h","hs"],"Time|min":["min","mins"],"Time|s":["s"],"Total Time":["Tempo Total"],"Total test time for all commits/merges":["Tempo de teste total para todos os commits/merges"],"Want to see the data? Please ask an administrator for access.":["Precisa visualizar os dados? Solicite acesso ao administrador."],"We don't have enough data to show this stage.":["Não temos dados suficientes para mostrar esta fase."],"You need permission.":["Você precisa de permissão."],"day":["dia","dias"]}}}; \ No newline at end of file diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index f7ac48f7dbd..6a8f9418df3 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -6,6 +6,7 @@ module Gitlab 'en' => 'English', 'es' => 'Español', 'de' => 'Deutsch', + 'pt_BR' => 'Português(Brasil)', 'zh_CN' => '简体中文', 'zh_HK' => '繁體中文(香港)', 'zh_TW' => '繁體中文(臺灣)' diff --git a/locale/pt_BR/gitlab.po b/locale/pt_BR/gitlab.po new file mode 100644 index 00000000000..5ad41f92b64 --- /dev/null +++ b/locale/pt_BR/gitlab.po @@ -0,0 +1,260 @@ +# Alexandre Alencar , 2017. #zanata +# Fabio Beneditto , 2017. #zanata +# Leandro Nunes dos Santos , 2017. #zanata +msgid "" +msgstr "" +"Project-Id-Version: gitlab 1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-04 19:24-0500\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-06-05 03:29-0400\n" +"Last-Translator: Alexandre Alencar \n" +"Language-Team: Portuguese (Brazil)\n" +"Language: pt-BR\n" +"X-Generator: Zanata 3.9.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +msgid "ByAuthor|by" +msgstr "por" + +msgid "Commit" +msgid_plural "Commits" +msgstr[0] "Commit" +msgstr[1] "Commits" + +msgid "" +"Cycle Analytics gives an overview of how much time it takes to go from idea " +"to production in your project." +msgstr "" +"A Análise de Ciclo fornece uma visão geral de quanto tempo uma ideia demora " +"para ir para produção em seu projeto." + +msgid "CycleAnalyticsStage|Code" +msgstr "Código" + +msgid "CycleAnalyticsStage|Issue" +msgstr "Tarefa" + +msgid "CycleAnalyticsStage|Plan" +msgstr "Plano" + +msgid "CycleAnalyticsStage|Production" +msgstr "Produção" + +msgid "CycleAnalyticsStage|Review" +msgstr "Revisão" + +msgid "CycleAnalyticsStage|Staging" +msgstr "Homologação" + +msgid "CycleAnalyticsStage|Test" +msgstr "Teste" + +msgid "Deploy" +msgid_plural "Deploys" +msgstr[0] "Implantação" +msgstr[1] "Implantações" + +msgid "FirstPushedBy|First" +msgstr "Primeiro" + +msgid "FirstPushedBy|pushed by" +msgstr "publicado por" + +msgid "From issue creation until deploy to production" +msgstr "Da criação de tarefas até a implantação para a produção" + +msgid "From merge request merge until deploy to production" +msgstr "Da incorporação do merge request até a implantação em produção" + +msgid "Introducing Cycle Analytics" +msgstr "Apresentando a Análise de Ciclo" + +msgid "Last %d day" +msgid_plural "Last %d days" +msgstr[0] "Último %d dia" +msgstr[1] "Últimos %d dias" + +msgid "Limited to showing %d event at most" +msgid_plural "Limited to showing %d events at most" +msgstr[0] "Limitado a mostrar %d evento no máximo" +msgstr[1] "Limitado a mostrar %d eventos no máximo" + +msgid "Median" +msgstr "Mediana" + +msgid "New Issue" +msgid_plural "New Issues" +msgstr[0] "Nova Tarefa" +msgstr[1] "Novas Tarefas" + +msgid "Not available" +msgstr "Não disponível" + +msgid "Not enough data" +msgstr "Dados insuficientes" + +msgid "OpenedNDaysAgo|Opened" +msgstr "Aberto" + +msgid "Pipeline Health" +msgstr "Saúde da Pipeline" + +msgid "ProjectLifecycle|Stage" +msgstr "Etapa" + +msgid "Read more" +msgstr "Ler mais" + +msgid "Related Commits" +msgstr "Commits Relacionados" + +msgid "Related Deployed Jobs" +msgstr "Jobs Relacionados Incorporados" + +msgid "Related Issues" +msgstr "Tarefas Relacionadas" + +msgid "Related Jobs" +msgstr "Jobs Relacionados" + +msgid "Related Merge Requests" +msgstr "Merge Requests Relacionados" + +msgid "Related Merged Requests" +msgstr "Merge Requests Relacionados" + +msgid "Showing %d event" +msgid_plural "Showing %d events" +msgstr[0] "Mostrando %d evento" +msgstr[1] "Mostrando %d eventos" + +msgid "" +"The coding stage shows the time from the first commit to creating the merge " +"request. The data will automatically be added here once you create your " +"first merge request." +msgstr "" +"O estágio de codificação mostra o tempo desde o primeiro commit até a " +"criação do merge request. \n" +"Os dados serão automaticamente adicionados aqui uma vez que você tenha " +"criado seu primeiro merge request." + +msgid "The collection of events added to the data gathered for that stage." +msgstr "" +"A coleção de eventos adicionados aos dados coletados para esse estágio." + +msgid "" +"The issue stage shows the time it takes from creating an issue to assigning " +"the issue to a milestone, or add the issue to a list on your Issue Board. " +"Begin creating issues to see data for this stage." +msgstr "" +"O estágio em questão mostra o tempo que leva desde a criação de uma tarefa " +"até a sua assinatura para um milestone, ou a sua adição para a lista no seu " +"Painel de Tarefas. Comece a criar tarefas para ver dados para esta etapa." + +msgid "The phase of the development lifecycle." +msgstr "A fase do ciclo de vida do desenvolvimento." + +msgid "" +"The planning stage shows the time from the previous step to pushing your " +"first commit. This time will be added automatically once you push your first " +"commit." +msgstr "" +"A fase de planejamento mostra o tempo do passo anterior até empurrar o seu " +"primeiro commit. Este tempo será adicionado automaticamente assim que você " +"realizar seu primeiro commit." + +msgid "" +"The production stage shows the total time it takes between creating an issue " +"and deploying the code to production. The data will be automatically added " +"once you have completed the full idea to production cycle." +msgstr "" +"O estágio de produção mostra o tempo total que leva entre criar uma tarefa e " +"implantar o código na produção. Os dados serão adicionados automaticamente " +"até que você complete todo o ciclo de produção." + +msgid "" +"The review stage shows the time from creating the merge request to merging " +"it. The data will automatically be added after you merge your first merge " +"request." +msgstr "" +"A etapa de revisão mostra o tempo de criação de um merge request até que o " +"merge seja feito. Os dados serão automaticamente adicionados depois que você " +"fizer seu primeiro merge request." + +msgid "" +"The staging stage shows the time between merging the MR and deploying code " +"to the production environment. The data will be automatically added once you " +"deploy to production for the first time." +msgstr "" +"O estágio de estágio mostra o tempo entre a fusão do MR e o código de " +"implantação para o ambiente de produção. Os dados serão automaticamente " +"adicionados depois de implantar na produção pela primeira vez." + +msgid "" +"The testing stage shows the time GitLab CI takes to run every pipeline for " +"the related merge request. The data will automatically be added after your " +"first pipeline finishes running." +msgstr "" +"A fase de teste mostra o tempo que o GitLab CI leva para executar cada " +"pipeline para o merge request relacionado. Os dados serão automaticamente " +"adicionados após a conclusão do primeiro pipeline." + +msgid "The time taken by each data entry gathered by that stage." +msgstr "O tempo necessário para cada entrada de dados reunida por essa etapa." + +msgid "" +"The value lying at the midpoint of a series of observed values. E.g., " +"between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 =" +" 6." +msgstr "" +"O valor situado no ponto médio de uma série de valores observados. Ex., " +"entre 3, 5, 9, a mediana é 5. Entre 3, 5, 7, 8, a mediana é (5 + 7) / 2 = 6." + +msgid "Time before an issue gets scheduled" +msgstr "Tempo até que uma tarefa seja planejada" + +msgid "Time before an issue starts implementation" +msgstr "Tempo até que uma tarefa comece a ser implementada" + +msgid "Time between merge request creation and merge/close" +msgstr "Tempo entre a criação do merge request e o merge/fechamento" + +msgid "Time until first merge request" +msgstr "Tempo até o primeiro merge request" + +msgid "Time|hr" +msgid_plural "Time|hrs" +msgstr[0] "h" +msgstr[1] "hs" + +msgid "Time|min" +msgid_plural "Time|mins" +msgstr[0] "min" +msgstr[1] "mins" + +msgid "Time|s" +msgstr "s" + +msgid "Total Time" +msgstr "Tempo Total" + +msgid "Total test time for all commits/merges" +msgstr "Tempo de teste total para todos os commits/merges" + +msgid "Want to see the data? Please ask an administrator for access." +msgstr "Precisa visualizar os dados? Solicite acesso ao administrador." + +msgid "We don't have enough data to show this stage." +msgstr "Não temos dados suficientes para mostrar esta fase." + +msgid "You need permission." +msgstr "Você precisa de permissão." + +msgid "day" +msgid_plural "days" +msgstr[0] "dia" +msgstr[1] "dias" + diff --git a/locale/pt_BR/gitlab.po.time_stamp b/locale/pt_BR/gitlab.po.time_stamp new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.1 From 4d5c7912b173f82f76e7e71b8a40108e3000974f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 6 Jun 2017 11:44:28 +0800 Subject: added changelog for Portuguese Brazil translations --- .../33334-portuguese_brazil_translation_of_cycle_analytics_page.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml diff --git a/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml b/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml new file mode 100644 index 00000000000..a0e0458da16 --- /dev/null +++ b/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml @@ -0,0 +1,4 @@ +--- +title: Add Portuguese Brazil of Cycle Analytics Page to I18N +merge_request: 11920 +author:Huang Tao -- cgit v1.2.1 From da474692f6e3b7ff8612ab6f2078db7eb910cf5c Mon Sep 17 00:00:00 2001 From: Huang Tao Date: Tue, 6 Jun 2017 04:59:55 +0000 Subject: Update i18n.rb style --- lib/gitlab/i18n.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index 6a8f9418df3..541235cf911 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -6,7 +6,7 @@ module Gitlab 'en' => 'English', 'es' => 'Español', 'de' => 'Deutsch', - 'pt_BR' => 'Português(Brasil)', + 'pt_BR' => 'Português(Brasil)', 'zh_CN' => '简体中文', 'zh_HK' => '繁體中文(香港)', 'zh_TW' => '繁體中文(臺灣)' -- cgit v1.2.1 From 20afb35d68ff6a0cbe29ca6f2976ae442b78b2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Wed, 7 Jun 2017 10:10:49 +0800 Subject: add bulgarian translation of cycle analytics page to I18N Fix #33383 --- app/assets/javascripts/locale/bg/app.js | 1 + lib/gitlab/i18n.rb | 3 +- locale/bg/gitlab.po | 260 ++++++++++++++++++++++++++++++++ locale/bg/gitlab.po.time_stamp | 0 4 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/locale/bg/app.js create mode 100644 locale/bg/gitlab.po create mode 100644 locale/bg/gitlab.po.time_stamp diff --git a/app/assets/javascripts/locale/bg/app.js b/app/assets/javascripts/locale/bg/app.js new file mode 100644 index 00000000000..ba56c0bea25 --- /dev/null +++ b/app/assets/javascripts/locale/bg/app.js @@ -0,0 +1 @@ +var locales = locales || {}; locales['bg'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","POT-Creation-Date":"2017-05-04 19:24-0500","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","PO-Revision-Date":"2017-06-05 09:40-0400","Last-Translator":"Lyubomir Vasilev ","Language-Team":"Bulgarian","Language":"bg","X-Generator":"Zanata 3.9.6","Plural-Forms":"nplurals=2; plural=(n != 1)","lang":"bg","domain":"app","plural_forms":"nplurals=2; plural=(n != 1)"},"ByAuthor|by":["от"],"Commit":["Подаване","Подавания"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["Анализът на циклите дава общ поглед върху това колко време е нужно на една идея да се превърне в завършена функционалност в проекта."],"CycleAnalyticsStage|Code":["Програмиране"],"CycleAnalyticsStage|Issue":["Проблем"],"CycleAnalyticsStage|Plan":["Планиране"],"CycleAnalyticsStage|Production":["Издаване"],"CycleAnalyticsStage|Review":["Преглед и одобрение"],"CycleAnalyticsStage|Staging":["Подготовка за издаване"],"CycleAnalyticsStage|Test":["Тестване"],"Deploy":["Внедряване","Внедрявания"],"FirstPushedBy|First":["Първо"],"FirstPushedBy|pushed by":["изпращане на промени от"],"From issue creation until deploy to production":["От създаването на проблема до внедряването в крайната версия"],"From merge request merge until deploy to production":["От прилагането на заявката за сливане до внедряването в крайната версия"],"Introducing Cycle Analytics":["Представяме Ви анализът на циклите"],"Last %d day":["Последния %d ден","Последните %d дни"],"Limited to showing %d event at most":["Ограничено до показване на последното %d събитие","Ограничено до показване на последните %d събития"],"Median":["Медиана"],"New Issue":["Нов проблем","Нови проблема"],"Not available":["Не е налично"],"Not enough data":["Няма достатъчно данни"],"OpenedNDaysAgo|Opened":["Отворен"],"Pipeline Health":["Състояние"],"ProjectLifecycle|Stage":["Етап"],"Read more":["Прочетете повече"],"Related Commits":["Свързани подавания"],"Related Deployed Jobs":["Свързани задачи за внедряване"],"Related Issues":["Свързани проблеми"],"Related Jobs":["Свързани задачи"],"Related Merge Requests":["Свързани заявки за сливане"],"Related Merged Requests":["Свързани приложени заявки за сливане"],"Showing %d event":["Показване на %d събитие","Показване на %d събития"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["Етапът на програмиране показва времето от първото подаване до създаването на заявката за сливане. Данните ще бъдат добавени тук автоматично след като бъде създадена първата заявка за сливане."],"The collection of events added to the data gathered for that stage.":["Съвкупността от събития добавени към данните събрани за този етап."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["Етапът на проблемите показва колко е времето от създаването на проблем до определянето на целеви етап на проекта за него, или до добавянето му в списък на дъската за проблеми. Започнете да добавяте проблеми, за да видите данните за този етап."],"The phase of the development lifecycle.":["Етапът от цикъла на разработка"],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["Етапът на планиране показва колко е времето от преходната стъпка до изпращането на първото подаване. Това време ще бъде добавено автоматично след като изпратите първото си подаване."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["Етапът на издаване показва общото време, което е нужно от създаването на проблем до внедряването на кода в крайната версия."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["Етапът на преглед и одобрение показва времето от създаването на заявката за сливане до прилагането ѝ. Данните ще бъдат добавени автоматично след като приложите първата си заявка за сливане."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["Етапът на подготовка за издаване показва времето между прилагането на заявката за сливане и внедряването на кода в средата на работещата крайна версия. Данните ще бъдат добавени автоматично след като направите първото си внедряване в крайната версия."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["Етапът на тестване показва времето, което е нужно на „Gitlab CI“ да изпълни всички задачи за свързаната заявка за сливане. Данните ще бъдат добавени автоматично след като приключи изпълнените на първата Ви такава задача."],"The time taken by each data entry gathered by that stage.":["Времето, което отнема всеки запис от данни за съответния етап."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["Стойността, която се намира в средата на последователността от наблюдавани данни. Например: медианата на 3, 5 и 9 е 5, а медианата на 3, 5, 7 и 8 е (5+7)/2 = 6."],"Time before an issue gets scheduled":["Време преди един проблем да бъде планиран за работа"],"Time before an issue starts implementation":["Време преди работата по проблем да започне"],"Time between merge request creation and merge/close":["Време между създаване на заявка за сливане и прилагането/отхвърлянето ѝ"],"Time until first merge request":["Време преди първата заявка за сливане"],"Time|hr":["час","часа"],"Time|min":["мин","мин"],"Time|s":["сек"],"Total Time":["Общо време"],"Total test time for all commits/merges":["Общо време за тестване на всички подавания/сливания"],"Want to see the data? Please ask an administrator for access.":["Искате ли да видите данните? Помолете администратор за достъп."],"We don't have enough data to show this stage.":["Няма достатъчно данни за този етап."],"You need permission.":["Нуждаете се от разрешение."],"day":["ден","дни"]}}}; \ No newline at end of file diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index f7ac48f7dbd..cb97cfde4ce 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -8,7 +8,8 @@ module Gitlab 'de' => 'Deutsch', 'zh_CN' => '简体中文', 'zh_HK' => '繁體中文(香港)', - 'zh_TW' => '繁體中文(臺灣)' + 'zh_TW' => '繁體中文(臺灣)', + 'bg' => 'български' }.freeze def available_locales diff --git a/locale/bg/gitlab.po b/locale/bg/gitlab.po new file mode 100644 index 00000000000..e6caf83252d --- /dev/null +++ b/locale/bg/gitlab.po @@ -0,0 +1,260 @@ +# Lyubomir Vasilev , 2017. #zanata +msgid "" +msgstr "" +"Project-Id-Version: gitlab 1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-04 19:24-0500\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-06-05 09:40-0400\n" +"Last-Translator: Lyubomir Vasilev \n" +"Language-Team: Bulgarian\n" +"Language: bg\n" +"X-Generator: Zanata 3.9.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +msgid "ByAuthor|by" +msgstr "от" + +msgid "Commit" +msgid_plural "Commits" +msgstr[0] "Подаване" +msgstr[1] "Подавания" + +msgid "" +"Cycle Analytics gives an overview of how much time it takes to go from idea " +"to production in your project." +msgstr "" +"Анализът на циклите дава общ поглед върху това колко време е нужно на една " +"идея да се превърне в завършена функционалност в проекта." + +msgid "CycleAnalyticsStage|Code" +msgstr "Програмиране" + +msgid "CycleAnalyticsStage|Issue" +msgstr "Проблем" + +msgid "CycleAnalyticsStage|Plan" +msgstr "Планиране" + +msgid "CycleAnalyticsStage|Production" +msgstr "Издаване" + +msgid "CycleAnalyticsStage|Review" +msgstr "Преглед и одобрение" + +msgid "CycleAnalyticsStage|Staging" +msgstr "Подготовка за издаване" + +msgid "CycleAnalyticsStage|Test" +msgstr "Тестване" + +msgid "Deploy" +msgid_plural "Deploys" +msgstr[0] "Внедряване" +msgstr[1] "Внедрявания" + +msgid "FirstPushedBy|First" +msgstr "Първо" + +msgid "FirstPushedBy|pushed by" +msgstr "изпращане на промени от" + +msgid "From issue creation until deploy to production" +msgstr "От създаването на проблема до внедряването в крайната версия" + +msgid "From merge request merge until deploy to production" +msgstr "" +"От прилагането на заявката за сливане до внедряването в крайната версия" + +msgid "Introducing Cycle Analytics" +msgstr "Представяме Ви анализът на циклите" + +msgid "Last %d day" +msgid_plural "Last %d days" +msgstr[0] "Последния %d ден" +msgstr[1] "Последните %d дни" + +msgid "Limited to showing %d event at most" +msgid_plural "Limited to showing %d events at most" +msgstr[0] "Ограничено до показване на последното %d събитие" +msgstr[1] "Ограничено до показване на последните %d събития" + +msgid "Median" +msgstr "Медиана" + +msgid "New Issue" +msgid_plural "New Issues" +msgstr[0] "Нов проблем" +msgstr[1] "Нови проблема" + +msgid "Not available" +msgstr "Не е налично" + +msgid "Not enough data" +msgstr "Няма достатъчно данни" + +msgid "OpenedNDaysAgo|Opened" +msgstr "Отворен" + +msgid "Pipeline Health" +msgstr "Състояние" + +msgid "ProjectLifecycle|Stage" +msgstr "Етап" + +msgid "Read more" +msgstr "Прочетете повече" + +msgid "Related Commits" +msgstr "Свързани подавания" + +msgid "Related Deployed Jobs" +msgstr "Свързани задачи за внедряване" + +msgid "Related Issues" +msgstr "Свързани проблеми" + +msgid "Related Jobs" +msgstr "Свързани задачи" + +msgid "Related Merge Requests" +msgstr "Свързани заявки за сливане" + +msgid "Related Merged Requests" +msgstr "Свързани приложени заявки за сливане" + +msgid "Showing %d event" +msgid_plural "Showing %d events" +msgstr[0] "Показване на %d събитие" +msgstr[1] "Показване на %d събития" + +msgid "" +"The coding stage shows the time from the first commit to creating the merge " +"request. The data will automatically be added here once you create your " +"first merge request." +msgstr "" +"Етапът на програмиране показва времето от първото подаване до създаването на " +"заявката за сливане. Данните ще бъдат добавени тук автоматично след като " +"бъде създадена първата заявка за сливане." + +msgid "The collection of events added to the data gathered for that stage." +msgstr "Съвкупността от събития добавени към данните събрани за този етап." + +msgid "" +"The issue stage shows the time it takes from creating an issue to assigning " +"the issue to a milestone, or add the issue to a list on your Issue Board. " +"Begin creating issues to see data for this stage." +msgstr "" +"Етапът на проблемите показва колко е времето от създаването на проблем до " +"определянето на целеви етап на проекта за него, или до добавянето му в " +"списък на дъската за проблеми. Започнете да добавяте проблеми, за да видите " +"данните за този етап." + +msgid "The phase of the development lifecycle." +msgstr "Етапът от цикъла на разработка" + +msgid "" +"The planning stage shows the time from the previous step to pushing your " +"first commit. This time will be added automatically once you push your first " +"commit." +msgstr "" +"Етапът на планиране показва колко е времето от преходната стъпка до " +"изпращането на първото подаване. Това време ще бъде добавено автоматично " +"след като изпратите първото си подаване." + +msgid "" +"The production stage shows the total time it takes between creating an issue " +"and deploying the code to production. The data will be automatically added " +"once you have completed the full idea to production cycle." +msgstr "" +"Етапът на издаване показва общото време, което е нужно от създаването на " +"проблем до внедряването на кода в крайната версия." + +msgid "" +"The review stage shows the time from creating the merge request to merging " +"it. The data will automatically be added after you merge your first merge " +"request." +msgstr "" +"Етапът на преглед и одобрение показва времето от създаването на заявката за " +"сливане до прилагането ѝ. Данните ще бъдат добавени автоматично след като " +"приложите първата си заявка за сливане." + +msgid "" +"The staging stage shows the time between merging the MR and deploying code " +"to the production environment. The data will be automatically added once you " +"deploy to production for the first time." +msgstr "" +"Етапът на подготовка за издаване показва времето между прилагането на " +"заявката за сливане и внедряването на кода в средата на работещата крайна " +"версия. Данните ще бъдат добавени автоматично след като направите първото си " +"внедряване в крайната версия." + +msgid "" +"The testing stage shows the time GitLab CI takes to run every pipeline for " +"the related merge request. The data will automatically be added after your " +"first pipeline finishes running." +msgstr "" +"Етапът на тестване показва времето, което е нужно на „Gitlab CI“ да изпълни " +"всички задачи за свързаната заявка за сливане. Данните ще бъдат добавени " +"автоматично след като приключи изпълнените на първата Ви такава задача." + +msgid "The time taken by each data entry gathered by that stage." +msgstr "Времето, което отнема всеки запис от данни за съответния етап." + +msgid "" +"The value lying at the midpoint of a series of observed values. E.g., " +"between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 =" +" 6." +msgstr "" +"Стойността, която се намира в средата на последователността от наблюдавани " +"данни. Например: медианата на 3, 5 и 9 е 5, а медианата на 3, 5, 7 и 8 е " +"(5+7)/2 = 6." + +msgid "Time before an issue gets scheduled" +msgstr "Време преди един проблем да бъде планиран за работа" + +msgid "Time before an issue starts implementation" +msgstr "Време преди работата по проблем да започне" + +msgid "Time between merge request creation and merge/close" +msgstr "" +"Време между създаване на заявка за сливане и прилагането/отхвърлянето ѝ" + +msgid "Time until first merge request" +msgstr "Време преди първата заявка за сливане" + +msgid "Time|hr" +msgid_plural "Time|hrs" +msgstr[0] "час" +msgstr[1] "часа" + +msgid "Time|min" +msgid_plural "Time|mins" +msgstr[0] "мин" +msgstr[1] "мин" + +msgid "Time|s" +msgstr "сек" + +msgid "Total Time" +msgstr "Общо време" + +msgid "Total test time for all commits/merges" +msgstr "Общо време за тестване на всички подавания/сливания" + +msgid "Want to see the data? Please ask an administrator for access." +msgstr "Искате ли да видите данните? Помолете администратор за достъп." + +msgid "We don't have enough data to show this stage." +msgstr "Няма достатъчно данни за този етап." + +msgid "You need permission." +msgstr "Нуждаете се от разрешение." + +msgid "day" +msgid_plural "days" +msgstr[0] "ден" +msgstr[1] "дни" + diff --git a/locale/bg/gitlab.po.time_stamp b/locale/bg/gitlab.po.time_stamp new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.1 From a81814ad60903ca65c071f72faf82e279d5c35fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Wed, 7 Jun 2017 10:18:24 +0800 Subject: added changelog for Bulgarian translations --- .../33383-bulgarian_translation_of_cycle_analytics_page.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml diff --git a/changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml b/changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml new file mode 100644 index 00000000000..71bd5505be7 --- /dev/null +++ b/changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml @@ -0,0 +1,4 @@ +--- +title: add bulgarian translation of cycle analytics page to I18N +merge_request: 11958 +author: Lyubomir Vasilev -- cgit v1.2.1 From 0dbc5cd87b611a80c55bb46a1ca40e21a7ecf760 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:07:09 +0200 Subject: Added Dropdown + Options --- app/views/layouts/header/_default.html.haml | 46 ++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 9db98451f1d..00d143f4fb0 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,10 +36,48 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - - if current_user.can_create_project? - %li - = link_to new_project_path, title: 'New project', aria: { label: "New project" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('plus fw') + %li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + + - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) + %li + .bold This group + - if can?(current_user, :create_projects, @group) + %li + = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } + - if can?(current_user, :create_subgroup, @group) + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path, aria: { label: "New project" } + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path, aria: { label: "New group" } + %li + = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } + + - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', -- cgit v1.2.1 From f51e78715f77846f3326a0cad18a826f138f2dff Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 12:58:03 +0200 Subject: Enabled Tooltips --- app/views/layouts/header/_default.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 00d143f4fb0..88fff245356 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -37,7 +37,7 @@ = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right -- cgit v1.2.1 From 5677cb0114de78559bb626aa3b0bb456271429df Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 26 May 2017 17:59:45 +0200 Subject: Seperated Dropdown in new partial Fixed different issues from discussion Fixed a Spinach Test which had now 2 New buttons --- app/views/layouts/header/_default.html.haml | 49 +++-------------------------- app/views/layouts/header/_new_dropdown.haml | 42 +++++++++++++++++++++++++ features/steps/project/fork.rb | 4 ++- 3 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 app/views/layouts/header/_new_dropdown.haml diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 88fff245356..249253f4906 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,48 +36,7 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - %li.header-new.dropdown - = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do - = icon('plus fw') - = icon('caret-down') - .dropdown-menu-nav.dropdown-menu-align-right - %ul - - - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) - %li - .bold This group - - if can?(current_user, :create_projects, @group) - %li - = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } - - if can?(current_user, :create_subgroup, @group) - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } - - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } - - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } - - if @group || @project - %li.divider - %li - .bold GitLab - - if current_user.can_create_project? - %li - = link_to 'New project', new_project_path, aria: { label: "New project" } - - if current_user.can_create_group? - %li - = link_to 'New group', new_group_path, aria: { label: "New group" } - %li - = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } - - + = render 'layouts/header/new_dropdown' - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', @@ -112,12 +71,12 @@ @#{current_user.username} %li.divider %li - = link_to "Profile", current_user, class: 'profile-link', aria: { label: "Profile" }, data: { user: current_user.username } + = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li - = link_to "Settings", profile_path, aria: { label: "Settings" } + = link_to "Settings", profile_path %li.divider %li - = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", aria: { label: "Sign out" } + = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" - else %li %div diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml new file mode 100644 index 00000000000..931c02b7268 --- /dev/null +++ b/app/views/layouts/header/_new_dropdown.haml @@ -0,0 +1,42 @@ +%li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if @group && (create_group_project || create_group_subgroup) + %li + .bold This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path + %li + = link_to 'New snippet', new_snippet_path diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 14932491daa..35df403a85f 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -42,7 +42,9 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I click link "New merge request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see the new merge request page for my namespace' do -- cgit v1.2.1 From 6709e65cfc9fcfbe90427645cd1cf679a28ebddd Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 10:24:53 +0200 Subject: Externalised Dropdown Checks for creating new issue Styling of .dropdown-bold-header Fixed Spinach Tests to limit them to the main content area for clicking 'New Project' etc. so that they don't click the dropdown menu --- app/assets/stylesheets/framework/dropdowns.scss | 8 +++- app/views/layouts/header/_new_dropdown.haml | 55 +++++++++++++------------ features/steps/dashboard/new_project.rb | 2 +- features/steps/project/create.rb | 4 +- features/steps/project/forked_merge_requests.rb | 4 +- features/steps/project/issues/issues.rb | 4 +- 6 files changed, 46 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 5ab48b6c874..9613006d021 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -261,7 +261,13 @@ text-transform: capitalize; } - .separator + .dropdown-header { + .dropdown-bold-header { + font-weight: 600; + line-height: 22px; + padding: 0 16px; + } + + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 931c02b7268..e9d45802bac 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,35 +3,38 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul - - create_group_project = can?(current_user, :create_projects, @group) - - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if @group && (create_group_project || create_group_subgroup) - %li - .bold This group - - if create_group_project - %li - = link_to 'New project', new_project_path(namespace_id: @group.id) - - if create_group_subgroup - %li - = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %ul + - if @group + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if (create_group_project || create_group_subgroup) + %li.dropdown-bold-header This group + - if create_group_project + %li + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %li.divider + %li.dropdown-bold-header GitLab - if @project - %li - .bold This project - %li - = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - %li - = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) - - if can?(current_user, :create_project_snippet, @project) - %li - = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) - - if @group || @project - %li.divider - %li - .bold GitLab + - create_project_snippet = can?(current_user, :create_project_snippet, @project) + - if (create_project_issue || create_project_mr || create_project_snippet) + %li.dropdown-bold-header This project + - if create_project_issue + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if create_project_snippet + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + %li.divider + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 4fb16d3bb57..766aa9b0468 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -4,7 +4,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps include SharedProject step 'I click "New project" link' do - page.within('.content') do + page.within '#content-body' do click_link "New project" end end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 5f5f806df36..28be9c6df5b 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -5,7 +5,9 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps step 'fill project form with valid data' do fill_in 'project_path', with: 'Empty' - click_button "Create project" + page.within '#content-body' do + click_button "Create project" + end end step 'I should see project page' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 25514eb9ef2..2d9d3efd9d4 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -17,7 +17,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see merge request "Merge Request On Forked Project"' do diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 637e6568267..b376c5049c1 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -62,7 +62,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "New issue"' do - page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + page.within '#content-body' do + page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + end end step 'I click "author" dropdown' do -- cgit v1.2.1 From 33748960716916f0e6c6bbc168d4ad7f76120102 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 29 May 2017 11:28:20 +0200 Subject: Check for Merge Request fixed Fixed couple of spinach test --- app/assets/stylesheets/framework/dropdowns.scss | 3 ++- app/views/layouts/header/_new_dropdown.haml | 2 +- features/steps/project/merge_requests.rb | 4 +++- features/steps/project/snippets.rb | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 9613006d021..2ee95483040 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,8 @@ padding: 0 16px; } - .separator + .dropdown-header, .separator + .dropdown-bold-header { + .separator + .dropdown-header, + .separator + .dropdown-bold-header { padding-top: 2px; } diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index e9d45802bac..ac8c9070f7d 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -22,7 +22,7 @@ - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || create_project_mr || create_project_snippet) + - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - if create_project_issue %li diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 54b6352c952..17d190711f5 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -14,7 +14,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I click link "Bug NS-04"' do diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index e3f5e9e3ef3..dd49701a3d9 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -23,7 +23,9 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - first(:link, "New snippet").click + page.within '#content-body' do + first(:link, "New snippet").click + end end step 'I click link "Snippet one"' do -- cgit v1.2.1 From c61d598b3ae02cabc2e9406a1f8d6363a6273e9c Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 17:23:48 +0200 Subject: Fixing more broken unscoped tests --- app/views/layouts/header/_new_dropdown.haml | 6 +++--- spec/features/admin/admin_groups_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index ac8c9070f7d..9b9719a26dd 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -3,7 +3,7 @@ = icon('plus fw') = icon('caret-down') .dropdown-menu-nav.dropdown-menu-align-right - %ul + %ul - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) @@ -18,13 +18,13 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project + - if @project && @project.namespace - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - if (create_project_issue || merge_project || create_project_snippet) %li.dropdown-bold-header This project - - if create_project_issue + - if create_project_issue %li = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) - if merge_project diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index d5f595894d6..cf9d7bca255 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -24,7 +24,9 @@ feature 'Admin Groups', feature: true do it 'creates new group' do visit admin_groups_path - click_link "New group" + page.within '#content-body' do + click_link "New group" + end path_component = 'gitlab' group_name = 'GitLab group name' group_description = 'Description of group for GitLab' -- cgit v1.2.1 From 4e2f5eac1b1834fc0ce60f7742c5bc556411db2d Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 31 May 2017 23:02:56 +0200 Subject: Fix for linting problem --- app/assets/stylesheets/framework/dropdowns.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 2ee95483040..6cb11ea4ccf 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -267,7 +267,7 @@ padding: 0 16px; } - .separator + .dropdown-header, + .separator + .dropdown-header, .separator + .dropdown-bold-header { padding-top: 2px; } -- cgit v1.2.1 From 1e4fb1f8fdc42e2e9d0cd2098821b4901f4023be Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Mon, 5 Jun 2017 14:56:16 +0200 Subject: Should fix problem if you have an project without a project ID (Test in new_project_spec.rb) --- app/views/layouts/header/_new_dropdown.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index 9b9719a26dd..b220b40d6e3 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -18,7 +18,7 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace + - if @project && @project.namespace && :project_id - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) -- cgit v1.2.1 From 1707c79d0bf9b390f17a163fe846410b76e4a215 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 12:02:50 +0200 Subject: FIxes based on MR --- app/views/layouts/header/_new_dropdown.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index b220b40d6e3..ecc5a518687 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -7,7 +7,7 @@ - if @group - create_group_project = can?(current_user, :create_projects, @group) - create_group_subgroup = can?(current_user, :create_subgroup, @group) - - if (create_group_project || create_group_subgroup) + - if create_group_project || create_group_subgroup %li.dropdown-bold-header This group - if create_group_project %li @@ -18,11 +18,11 @@ %li.divider %li.dropdown-bold-header GitLab - - if @project && @project.namespace && :project_id + - if @project && @project.persisted? - create_project_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - create_project_snippet = can?(current_user, :create_project_snippet, @project) - - if (create_project_issue || merge_project || create_project_snippet) + - if create_project_issue || merge_project || create_project_snippet %li.dropdown-bold-header This project - if create_project_issue %li @@ -34,7 +34,7 @@ %li = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) %li.divider - %li.dropdown-bold-header GitLab + %li.dropdown-bold-header GitLab - if current_user.can_create_project? %li = link_to 'New project', new_project_path -- cgit v1.2.1 From e05e530fe6f77b207adc9d4541955c952a291aa6 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 12:10:00 +0200 Subject: Added Changelog for functionality --- .../23603-add-extra-functionality-for-the-top-right-button.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml diff --git a/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml b/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml new file mode 100644 index 00000000000..77f8e31e16e --- /dev/null +++ b/changelogs/unreleased/23603-add-extra-functionality-for-the-top-right-button.yml @@ -0,0 +1,4 @@ +--- +title: Add extra context-sensitive functionality for the top right menu button +merge_request: 11632 +author: -- cgit v1.2.1 From 288b2e71c28ddff1ae6372bc8256d9f972aa6c27 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 6 Jun 2017 16:46:30 +0200 Subject: Added First Test for top right menu --- features/dashboard/new_project_menu.feature | 11 +++++++++++ features/steps/dashboard/new_project.rb | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 features/dashboard/new_project_menu.feature diff --git a/features/dashboard/new_project_menu.feature b/features/dashboard/new_project_menu.feature new file mode 100644 index 00000000000..c339fb0e897 --- /dev/null +++ b/features/dashboard/new_project_menu.feature @@ -0,0 +1,11 @@ +@dashboard +Feature: New Project through top menu +Background: + Given I sign in as a user + And I own project "Shop" + And I visit dashboard page + And I click "New project" in top right menu + + @javascript + Scenario: I should see New Projects page + Then I see "New Project" page diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 766aa9b0468..530fd6f7bdb 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -9,6 +9,12 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps end end + step 'I click "New project" in top right menu' do + page.within '.header-content' do + click_link "New project" + end + end + step 'I see "New Project" page' do expect(page).to have_content('Project path') expect(page).to have_content('Project name') -- cgit v1.2.1 From ebd0767fc76c820088efce236a57e36619f08b6d Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 11:49:41 +0200 Subject: Fixed New Project Top Menu Test --- features/dashboard/new_project_menu.feature | 2 +- features/steps/dashboard/new_project_top_menu.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 features/steps/dashboard/new_project_top_menu.rb diff --git a/features/dashboard/new_project_menu.feature b/features/dashboard/new_project_menu.feature index c339fb0e897..5456c9fd4dd 100644 --- a/features/dashboard/new_project_menu.feature +++ b/features/dashboard/new_project_menu.feature @@ -1,5 +1,5 @@ @dashboard -Feature: New Project through top menu +Feature: New Project top menu Background: Given I sign in as a user And I own project "Shop" diff --git a/features/steps/dashboard/new_project_top_menu.rb b/features/steps/dashboard/new_project_top_menu.rb new file mode 100644 index 00000000000..364be964efd --- /dev/null +++ b/features/steps/dashboard/new_project_top_menu.rb @@ -0,0 +1,17 @@ +class Spinach::Features::NewProjectTopMenu < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedProject + + step 'I click "New project" in top right menu' do + page.within '.header-content' do + click_link "New project" + end + end + + step 'I see "New Project" page' do + expect(page).to have_content('Project path') + expect(page).to have_content('Project name') + end + +end -- cgit v1.2.1 From 4871cb7aeed1939fb54563633ffee60e4c1eb46b Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 15:39:39 +0200 Subject: New ... Menu Feature Tests --- features/dashboard/new_project_menu.feature | 11 ---- features/explore/new_menu.feature | 42 ++++++++++++++ features/steps/dashboard/new_project_top_menu.rb | 17 ------ features/steps/explore/new_menu.rb | 71 ++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 28 deletions(-) delete mode 100644 features/dashboard/new_project_menu.feature create mode 100644 features/explore/new_menu.feature delete mode 100644 features/steps/dashboard/new_project_top_menu.rb create mode 100644 features/steps/explore/new_menu.rb diff --git a/features/dashboard/new_project_menu.feature b/features/dashboard/new_project_menu.feature deleted file mode 100644 index 5456c9fd4dd..00000000000 --- a/features/dashboard/new_project_menu.feature +++ /dev/null @@ -1,11 +0,0 @@ -@dashboard -Feature: New Project top menu -Background: - Given I sign in as a user - And I own project "Shop" - And I visit dashboard page - And I click "New project" in top right menu - - @javascript - Scenario: I should see New Projects page - Then I see "New Project" page diff --git a/features/explore/new_menu.feature b/features/explore/new_menu.feature new file mode 100644 index 00000000000..9eddc8de132 --- /dev/null +++ b/features/explore/new_menu.feature @@ -0,0 +1,42 @@ +@explore +Feature: New Menu +Background: + Given I sign in as a user + And I own project "Shop" + And I visit dashboard page + + @javascript + Scenario: I should see New Projects page + When I visit dashboard page + And I click "New project" in top right menu + Then I see "New Project" page + + @javascript + Scenario: I should see New Group page + When I visit dashboard page + And I click "New group" in top right menu + Then I see "New Group" page + + @javascript + Scenario: I should see New Snippet page + When I visit dashboard page + And I click "New snippet" in top right menu + Then I see "New Snippet" page + + @javascript + Scenario: I should see New Issue page + When I visit project "Shop" page + And I click "New issue" in top right menu + Then I see "New Issue" page + + @javascript + Scenario: I should see New Merge Request page + When I visit project "Shop" page + And I click "New merge request" in top right menu + Then I see "New Merge Request" page + + @javascript + Scenario: I should see New Project Snippet page + When I visit project "Shop" page + And I click "New snippet" in top right menu + Then I see "New Snippet" page diff --git a/features/steps/dashboard/new_project_top_menu.rb b/features/steps/dashboard/new_project_top_menu.rb deleted file mode 100644 index 364be964efd..00000000000 --- a/features/steps/dashboard/new_project_top_menu.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Spinach::Features::NewProjectTopMenu < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click "New project" in top right menu' do - page.within '.header-content' do - click_link "New project" - end - end - - step 'I see "New Project" page' do - expect(page).to have_content('Project path') - expect(page).to have_content('Project name') - end - -end diff --git a/features/steps/explore/new_menu.rb b/features/steps/explore/new_menu.rb new file mode 100644 index 00000000000..a480a4705e0 --- /dev/null +++ b/features/steps/explore/new_menu.rb @@ -0,0 +1,71 @@ +class Spinach::Features::NewMenu < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedProject + + step 'I click "New project" in top right menu' do + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link "New project" + end + end + + step 'I click "New group" in top right menu' do + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link "New group" + end + end + + step 'I click "New snippet" in top right menu' do + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link "New snippet" + end + end + + step 'I click "New issue" in top right menu' do + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link "New issue" + end + end + + step 'I click "New merge request" in top right menu' do + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link "New merge request" + end + end + + step 'I see "New Project" page' do + expect(page).to have_content('Project path') + expect(page).to have_content('Project name') + end + + step 'I see "New Group" page' do + expect(page).to have_content('Group path') + expect(page).to have_content('Group name') + end + + step 'I see "New Snippet" page' do + expect(page).to have_content('New Snippet') + expect(page).to have_content('Title') + end + + step 'I see "New Issue" page' do + expect(page).to have_content('New Issue') + expect(page).to have_content('Title') + end + + step 'I see "New Merge Request" page' do + expect(page).to have_content('New Merge Request') + expect(page).to have_content('Source branch') + expect(page).to have_content('Target branch') + end +end -- cgit v1.2.1 From e717c7358a714ad90eea6e9fecdce88c24d99767 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 6 Jun 2017 18:56:30 +0200 Subject: Refactor Runners docs - Update overall documentation - Update images - Add information about fair usage --- doc/ci/runners/README.md | 214 ++++++++++++++++++---------- doc/ci/runners/img/shared_runners_admin.png | Bin 0 -> 29192 bytes doc/ci/runners/project_specific.png | Bin 30196 -> 0 bytes doc/ci/runners/shared_runner.png | Bin 17797 -> 0 bytes 4 files changed, 136 insertions(+), 78 deletions(-) create mode 100644 doc/ci/runners/img/shared_runners_admin.png delete mode 100644 doc/ci/runners/project_specific.png delete mode 100644 doc/ci/runners/shared_runner.png diff --git a/doc/ci/runners/README.md b/doc/ci/runners/README.md index 1bd1ee93ac5..73aee3c3f56 100644 --- a/doc/ci/runners/README.md +++ b/doc/ci/runners/README.md @@ -1,124 +1,168 @@ # Runners -In GitLab CI, Runners run your [yaml](../yaml/README.md). -A Runner is an isolated (virtual) machine that picks up jobs -through the coordinator API of GitLab CI. +In GitLab CI, Runners run the code defined in [`.gitlab-ci.yml`](../yaml/README.md). +They are isolated (virtual) machines that pick up jobs through the coordinator +API of GitLab CI. A Runner can be specific to a certain project or serve any project in GitLab CI. A Runner that serves all projects is called a shared Runner. -Ideally, GitLab Runner should not be installed on the same machine as GitLab. +Ideally, the GitLab Runner should not be installed on the same machine as GitLab. Read the [requirements documentation](../../install/requirements.md#gitlab-runner) for more information. -## Shared vs. Specific Runners - -A Runner that is specific only runs for the specified project. A shared Runner -can run jobs for every project that has enabled the option **Allow shared Runners**. - -**Shared Runners** are useful for jobs that have similar requirements, -between multiple projects. Rather than having multiple Runners idling for -many projects, you can have a single or a small number of Runners that handle -multiple projects. This makes it easier to maintain and update Runners. - -**Specific Runners** are useful for jobs that have special requirements or for -projects with a specific demand. If a job has certain requirements, you can set -up the specific Runner with this in mind, while not having to do this for all -Runners. For example, if you want to deploy a certain project, you can setup -a specific Runner to have the right credentials for this. - -Projects with high demand of CI activity can also benefit from using specific Runners. -By having dedicated Runners you are guaranteed that the Runner is not being held -up by another project's jobs. +## Shared vs specific Runners + +After [installing the Runner][install], you can either register it as shared or +specific. You can only register a shared Runner if you have admin access to +the GitLab instance. The main differences between a shared and a specific Runner +are: + +- **Shared Runners** are useful for jobs that have similar requirements, + between multiple projects. Rather than having multiple Runners idling for + many projects, you can have a single or a small number of Runners that handle + multiple projects. This makes it easier to maintain and update them. + Shared Runners process jobs using a [fair usage queue](#how-shared-runners-pick-jobs). + In contrast to specific Runners that use a FIFO queue, this prevents + cases where projects create hundreds of jobs which can lead to eating all + available shared Runners resources. +- **Specific Runners** are useful for jobs that have special requirements or for + projects with a specific demand. If a job has certain requirements, you can set + up the specific Runner with this in mind, while not having to do this for all + Runners. For example, if you want to deploy a certain project, you can setup + a specific Runner to have the right credentials for this. The [usage of tags](#using-tags) + may be useful in this case. Specific Runners process jobs using a [FIFO] queue. + +A Runner that is specific only runs for the specified project(s). A shared Runner +can run jobs for every project that has enabled the option **Allow shared Runners** +under **Settings ➔ Pipelines**. + +Projects with high demand of CI activity can also benefit from using specific +Runners. By having dedicated Runners you are guaranteed that the Runner is not +being held up by another project's jobs. You can set up a specific Runner to be used by multiple projects. The difference with a shared Runner is that you have to enable each project explicitly for the Runner to be able to run its jobs. Specific Runners do not get shared with forked projects automatically. -A fork does copy the CI settings (jobs, allow shared, etc) of the cloned repository. - -# Creating and Registering a Runner - -There are several ways to create a Runner. Only after creation, upon -registration its status as Shared or Specific is determined. - -[See the documentation for](https://docs.gitlab.com/runner/install) -the different methods of installing a Runner instance. +A fork does copy the CI settings (jobs, allow shared, etc) of the cloned +repository. -After installing the Runner, you can either register it as `Shared` or as `Specific`. -You can only register a Shared Runner if you have admin access to the GitLab instance. +## Registering a shared Runner -## Registering a Shared Runner +You can only register a shared Runner if you are an admin of the GitLab instance. -You can only register a shared Runner if you are an admin on the linked -GitLab instance. +1. Grab the shared-Runner token on the `admin/runners` page -Grab the shared-Runner token on the `admin/runners` page of your GitLab CI -instance. + ![Shared Runners admin area](img/shared_runners_admin.png) -![shared token](shared_runner.png) +1. [Register the Runner][register] -Now simply register the Runner as any Runner: +Shared Runners are enabled by default as of GitLab 8.2, but can be disabled +with the **Disable shared Runners** button which is present under each project's +**Settings ➔ Pipelines** page. Previous versions of GitLab defaulted shared +Runners to disabled. -``` -sudo gitlab-ci-multi-runner register -``` - -Shared Runners are enabled by default as of GitLab 8.2, but can be disabled with the -`DISABLE SHARED RUNNERS` button. Previous versions of GitLab defaulted shared Runners to -disabled. - -## Registering a Specific Runner +## Registering a specific Runner Registering a specific can be done in two ways: 1. Creating a Runner with the project registration token 1. Converting a shared Runner into a specific Runner (one-way, admin only) -There are several ways to create a Runner instance. The steps below only -concern registering the Runner on GitLab CI. - -### Registering a Specific Runner with a Project Registration token +### Registering a specific Runner with a project registration token To create a specific Runner without having admin rights to the GitLab instance, -visit the project you want to make the Runner work for in GitLab CI. +visit the project you want to make the Runner work for in GitLab: -Click on the Runner tab and use the registration token you find there to -setup a specific Runner for this project. +1. Go to **Settings ➔ Pipelines** to obtain the token +1. [Register the Runner][register] -![project Runners in GitLab CI](project_specific.png) +### Making an existing shared Runner specific -To register the Runner, run the command below and follow instructions: +If you are an admin on your GitLab instance, you can turn any shared Runner into +a specific one, but not the other way around. Keep in mind that this is a one +way transition. -``` -sudo gitlab-ci-multi-runner register -``` +1. Go to the Runners in the admin area **Overview ➔ Runners** (`/admin/runners`) + and find your Runner +1. Enable any projects under **Restrict projects for this Runner** to be used + with the Runner -### Lock a specific Runner from being enabled for other projects +From now on, the shared Runner will be specific to those projects. + +## Locking a specific Runner from being enabled for other projects You can configure a Runner to assign it exclusively to a project. When a Runner is locked this way, it can no longer be enabled for other projects. -This setting is available on each Runner in *Project Settings* > *Runners*. +This setting can be enabled the first time you [register a Runner][register] and +can be changed afterwards under each Runner's settings. + +To lock/unlock a Runner: + +1. Visit your project's **Settings ➔ Pipelines** +1. Find the Runner you wish to lock/unlock and make sure it's enabled +1. Click the pencil button +1. Check the **Lock to current projects** option +1. Click **Save changes** for the changes to take effect -### Making an existing Shared Runner Specific +## How shared Runners pick jobs -If you are an admin on your GitLab instance, -you can make any shared Runner a specific Runner, _but you can not -make a specific Runner a shared Runner_. +Shared Runners abide to a process queue we call fair usage. The fair usage +algorithm tries to assign jobs to shared Runners from projects that have the +lowest number of jobs currently running on shared Runners. -To make a shared Runner specific, go to the Runner page (`/admin/runners`) -and find your Runner. Add any projects on the left to make this Runner -run exclusively for these projects, therefore making it a specific Runner. +**Example 1** -![making a shared Runner specific](shared_to_specific_admin.png) +We have following jobs in queue: -## Using Shared Runners Effectively +- job 1 for project 1 +- job 2 for project 1 +- job 3 for project 1 +- job 4 for project 2 +- job 5 for project 2 +- job 6 for project 3 + +With the fair usage algorithm jobs are assigned in following order: + +1. We choose job 1, because project 1 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 4, because project 2 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 6, because project 3 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 2, because project 1 as other it runs 1 job +1. We choose job 5, because project 2 runs 1 job, where project 1 runs 2 jobs now +1. We choose job 3, because project 1 and runs 2 jobs + +--- + +**Example 2** + +We have following jobs in queue: + +- job 1 for project 1 +- job 2 for project 1 +- job 3 for project 1 +- job 4 for project 2 +- job 5 for project 2 +- job 6 for project 3 + +With the fair usage algorithm jobs are assigned in following order: + +1. We choose job 1, because project 1 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We finish job 1 +1. We choose job 2, because project 1 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 4, because project 2 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We finish job 4 +1. We choose job 5, because project 2 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 6, because project 3 doesn't run currently any jobs +1. We choose job 3, because project 1, 2 and 3 runs exactly one job now + +## Using shared Runners effectively If you are planning to use shared Runners, there are several things you should keep in mind. -### Use Tags +### Using tags You must setup a Runner to be able to run all the different types of jobs that it may encounter on the projects it's shared over. This would be @@ -130,17 +174,27 @@ shared Runners will only run the jobs they are equipped to run. For instance, at GitLab we have Runners tagged with "rails" if they contain the appropriate dependencies to run Rails test suites. -### Prevent Runner with tags from picking jobs without tags +### Preventing Runners with tags from picking jobs without tags You can configure a Runner to prevent it from picking jobs with tags when -the Runner does not have tags assigned. This setting is available on each -Runner in *Project Settings* > *Runners*. +the Runner does not have tags assigned. This setting can be enabled the first +time you [register a Runner][register] and can be changed afterwards under +each Runner's settings. + +To make a Runner pick tagged/untagged jobs: + +1. Visit your project's **Settings ➔ Pipelines** +1. Find the Runner you wish and make sure it's enabled +1. Click the pencil button +1. Check the **Run untagged jobs** option +1. Click **Save changes** for the changes to take effect ### Be careful with sensitive information If you can run a job on a Runner, you can get access to any code it runs and get the token of the Runner. With shared Runners, this means that anyone -that runs jobs on the Runner, can access anyone else's code that runs on the Runner. +that runs jobs on the Runner, can access anyone else's code that runs on the +Runner. In addition, because you can get access to the Runner token, it is possible to create a clone of a Runner and submit false jobs, for example. @@ -160,3 +214,7 @@ project. Mentioned briefly earlier, but the following things of Runners can be exploited. We're always looking for contributions that can mitigate these [Security Considerations](https://docs.gitlab.com/runner/security/). + +[install]: http://docs.gitlab.com/runner/install/ +[fifo]: https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics) +[register]: http://docs.gitlab.com/runner/register/ diff --git a/doc/ci/runners/img/shared_runners_admin.png b/doc/ci/runners/img/shared_runners_admin.png new file mode 100644 index 00000000000..e049b339b36 Binary files /dev/null and b/doc/ci/runners/img/shared_runners_admin.png differ diff --git a/doc/ci/runners/project_specific.png b/doc/ci/runners/project_specific.png deleted file mode 100644 index c812defa67b..00000000000 Binary files a/doc/ci/runners/project_specific.png and /dev/null differ diff --git a/doc/ci/runners/shared_runner.png b/doc/ci/runners/shared_runner.png deleted file mode 100644 index 31574a17764..00000000000 Binary files a/doc/ci/runners/shared_runner.png and /dev/null differ -- cgit v1.2.1 From 4fa71584a325965327a312682530b246d78fec13 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Wed, 7 Jun 2017 17:12:23 +0200 Subject: Add prometheus metrics on pipeline creation --- app/services/ci/create_pipeline_service.rb | 6 ++++++ changelogs/unreleased/zj-prom-pipeline-count.yml | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/unreleased/zj-prom-pipeline-count.yml diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index bffec216819..769749c9925 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -57,6 +57,8 @@ module Ci cancel_pending_pipelines if project.auto_cancel_pending_pipelines? + pipeline_created_counter.increment(source: source) + pipeline.tap(&:process!) end @@ -131,5 +133,9 @@ module Ci pipeline.drop if save pipeline end + + def pipeline_created_counter + @pipeline_created_counter ||= Gitlab::Metrics.counter(:pipelines_created_count, "Pipelines created count") + end end end diff --git a/changelogs/unreleased/zj-prom-pipeline-count.yml b/changelogs/unreleased/zj-prom-pipeline-count.yml new file mode 100644 index 00000000000..191e4f2f949 --- /dev/null +++ b/changelogs/unreleased/zj-prom-pipeline-count.yml @@ -0,0 +1,4 @@ +--- +title: Add prometheus metrics on pipeline creation +merge_request: +author: -- cgit v1.2.1 From beb41aac383dbe525403b418841c55fbb13d7440 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 17:29:39 +0200 Subject: Added additional classes for easier identifaction during tests Greenfield Tests for Dropdown Menu finished --- app/views/layouts/header/_new_dropdown.haml | 4 +-- features/explore/new_menu.feature | 17 ++++++++++-- features/steps/explore/new_menu.rb | 42 +++++++++++++++++------------ 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml index ecc5a518687..c7302414386 100644 --- a/app/views/layouts/header/_new_dropdown.haml +++ b/app/views/layouts/header/_new_dropdown.haml @@ -10,7 +10,7 @@ - if create_group_project || create_group_subgroup %li.dropdown-bold-header This group - if create_group_project - %li + %li.header-new-group-project = link_to 'New project', new_project_path(namespace_id: @group.id) - if create_group_subgroup %li @@ -31,7 +31,7 @@ %li = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) - if create_project_snippet - %li + %li.header-new-project-snippet = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) %li.divider %li.dropdown-bold-header GitLab diff --git a/features/explore/new_menu.feature b/features/explore/new_menu.feature index 9eddc8de132..b920a319b80 100644 --- a/features/explore/new_menu.feature +++ b/features/explore/new_menu.feature @@ -1,7 +1,8 @@ @explore Feature: New Menu Background: - Given I sign in as a user + Given I sign in as "John Doe" + And "John Doe" is owner of group "Owned" And I own project "Shop" And I visit dashboard page @@ -38,5 +39,17 @@ Background: @javascript Scenario: I should see New Project Snippet page When I visit project "Shop" page - And I click "New snippet" in top right menu + And I click "New project snippet" in top right menu Then I see "New Snippet" page + + @javascript + Scenario: I should see New Group Project page + When I visit group "Owned" page + And I click "New group project" in top right menu + Then I see "New Project" page + + @javascript + Scenario: I should see New Subgroup page + When I visit group "Owned" page + And I click "New subgroup" in top right menu + Then I see "New Group" page diff --git a/features/steps/explore/new_menu.rb b/features/steps/explore/new_menu.rb index a480a4705e0..bcb6e1eb708 100644 --- a/features/steps/explore/new_menu.rb +++ b/features/steps/explore/new_menu.rb @@ -4,42 +4,42 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps include SharedProject step 'I click "New project" in top right menu' do - page.within '.header-content' do - find('.header-new-dropdown-toggle').trigger('click') - expect(page).to have_selector('.header-new.dropdown.open', count: 1) - click_link "New project" - end + click_topmenuitem("New project") end step 'I click "New group" in top right menu' do - page.within '.header-content' do - find('.header-new-dropdown-toggle').trigger('click') - expect(page).to have_selector('.header-new.dropdown.open', count: 1) - click_link "New group" - end + click_topmenuitem("New group") end step 'I click "New snippet" in top right menu' do + click_topmenuitem("New snippet") + end + + step 'I click "New project snippet" in top right menu' do page.within '.header-content' do find('.header-new-dropdown-toggle').trigger('click') expect(page).to have_selector('.header-new.dropdown.open', count: 1) - click_link "New snippet" + find('.header-new-project-snippet a').trigger('click') end end step 'I click "New issue" in top right menu' do - page.within '.header-content' do - find('.header-new-dropdown-toggle').trigger('click') - expect(page).to have_selector('.header-new.dropdown.open', count: 1) - click_link "New issue" - end + click_topmenuitem("New issue") end step 'I click "New merge request" in top right menu' do + click_topmenuitem("New merge request") + end + + step 'I click "New subgroup" in top right menu' do + click_topmenuitem("New subgroup") + end + + step 'I click "New group project" in top right menu' do page.within '.header-content' do find('.header-new-dropdown-toggle').trigger('click') expect(page).to have_selector('.header-new.dropdown.open', count: 1) - click_link "New merge request" + find('.header-new-group-project a').trigger('click') end end @@ -68,4 +68,12 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps expect(page).to have_content('Source branch') expect(page).to have_content('Target branch') end + + def click_topmenuitem(item_name) + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link item_name + end + end end -- cgit v1.2.1 From 6c8e72b4108e5c671970a3965b214c8b1dda53ae Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Thu, 1 Jun 2017 11:58:34 +0200 Subject: Add 'schedules' keyword to 'only' and 'except' --- doc/ci/yaml/README.md | 5 ++-- lib/ci/gitlab_ci_yaml_processor.rb | 29 +++++++++--------- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 44 ++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 16 deletions(-) diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index fc813694ff2..7c085bf77c9 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -393,7 +393,7 @@ There are a few rules that apply to the usage of refs policy: * `only` and `except` are inclusive. If both `only` and `except` are defined in a job specification, the ref is filtered by `only` and `except`. * `only` and `except` allow the use of regular expressions. -* `only` and `except` allow the use of special keywords: `branches`, `tags`, and `triggers`. +* `only` and `except` allow the use of special keywords: `branches`, `tags`, `triggers` and `schedules`. * `only` and `except` allow to specify a repository path to filter jobs for forks. @@ -411,7 +411,7 @@ job: ``` In this example, `job` will run only for refs that are tagged, or if a build is -explicitly requested via an API trigger. +explicitly requested via an API trigger or a Pipeline Schedule. ```yaml job: @@ -419,6 +419,7 @@ job: only: - tags - triggers + - schedules ``` The repository path can be used to have jobs executed only for the parent diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 22af2671b18..b941a54c85a 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -20,26 +20,26 @@ module Ci raise ValidationError, e.message end - def jobs_for_ref(ref, tag = false, trigger_request = nil) + def jobs_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) @jobs.select do |_, job| - process?(job[:only], job[:except], ref, tag, trigger_request) + process?(job[:only], job[:except], ref, tag, trigger_request, pipeline_schedule) end end - def jobs_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil) - jobs_for_ref(ref, tag, trigger_request).select do |_, job| + def jobs_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).select do |_, job| job[:stage] == stage end end - def builds_for_ref(ref, tag = false, trigger_request = nil) - jobs_for_ref(ref, tag, trigger_request).map do |name, _| + def builds_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).map do |name, _| build_attributes(name) end end - def builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil) - jobs_for_stage_and_ref(stage, ref, tag, trigger_request).map do |name, _| + def builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + jobs_for_stage_and_ref(stage, ref, tag, trigger_request, pipeline_schedule).map do |name, _| build_attributes(name) end end @@ -193,30 +193,31 @@ module Ci end end - def process?(only_params, except_params, ref, tag, trigger_request) + def process?(only_params, except_params, ref, tag, trigger_request, pipeline_schedule) if only_params.present? - return false unless matching?(only_params, ref, tag, trigger_request) + return false unless matching?(only_params, ref, tag, trigger_request, pipeline_schedule) end if except_params.present? - return false if matching?(except_params, ref, tag, trigger_request) + return false if matching?(except_params, ref, tag, trigger_request, pipeline_schedule) end true end - def matching?(patterns, ref, tag, trigger_request) + def matching?(patterns, ref, tag, trigger_request, pipeline_schedule) patterns.any? do |pattern| - match_ref?(pattern, ref, tag, trigger_request) + match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) end end - def match_ref?(pattern, ref, tag, trigger_request) + def match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) pattern, path = pattern.split('@', 2) return false if path && path != self.path return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' return true if trigger_request.present? && pattern == 'triggers' + return true if pipeline_schedule.present? && pattern == 'schedules' if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 72b9cde10e7..83085f61b37 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -230,6 +230,17 @@ module Ci expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, true).size).to eq(1) end + it "returns builds if only has a schedules keyword specified and a schedule is provided" do + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, only: ["schedules"] } + }) + + config_processor = GitlabCiYamlProcessor.new(config, path) + + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, false, true).size).to eq(1) + end + it "does not return builds if only has a triggers keyword specified and no trigger is provided" do config = YAML.dump({ before_script: ["pwd"], @@ -241,6 +252,17 @@ module Ci expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(0) end + it "does not return builds if only has a schedules keyword specified and no schedule is provided" do + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, only: ["schedules"] } + }) + + config_processor = GitlabCiYamlProcessor.new(config, path) + + expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(0) + end + it "returns builds if only has current repository path" do config = YAML.dump({ before_script: ["pwd"], @@ -386,6 +408,17 @@ module Ci expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, true).size).to eq(0) end + it "does not return builds if except has a schedules keyword specified and a schedule is provided" do + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, except: ["schedules"] } + }) + + config_processor = GitlabCiYamlProcessor.new(config, path) + + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, false, true).size).to eq(0) + end + it "returns builds if except has a triggers keyword specified and no trigger is provided" do config = YAML.dump({ before_script: ["pwd"], @@ -397,6 +430,17 @@ module Ci expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1) end + it "returns builds if except has a schedules keyword specified and no schedule is provided" do + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, except: ["schedules"] } + }) + + config_processor = GitlabCiYamlProcessor.new(config, path) + + expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1) + end + it "does not return builds if except has current repository path" do config = YAML.dump({ before_script: ["pwd"], -- cgit v1.2.1 From fe9b78d673965db2adb954725317fe1a1b76728d Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Thu, 1 Jun 2017 12:30:52 +0200 Subject: Add changelog --- changelogs/unreleased/32955-schedule-keyword.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/32955-schedule-keyword.yml diff --git a/changelogs/unreleased/32955-schedule-keyword.yml b/changelogs/unreleased/32955-schedule-keyword.yml new file mode 100644 index 00000000000..fe07b3a2263 --- /dev/null +++ b/changelogs/unreleased/32955-schedule-keyword.yml @@ -0,0 +1,4 @@ +--- +title: Add 'schedules' keyword to 'only' and 'except' +merge_request: 11844 +author: Filip Krakowski -- cgit v1.2.1 From 8db63b26284d949000316a38676ef6fad970f657 Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Thu, 1 Jun 2017 21:55:57 +0200 Subject: Use pipeline.source to determine what triggered a pipeline --- doc/ci/yaml/README.md | 2 +- lib/ci/gitlab_ci_yaml_processor.rb | 32 ++++++++++++++-------------- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 8 +++---- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 7c085bf77c9..52ded37c2a7 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -411,7 +411,7 @@ job: ``` In this example, `job` will run only for refs that are tagged, or if a build is -explicitly requested via an API trigger or a Pipeline Schedule. +explicitly requested via an API trigger or a [Pipeline Schedule](../../user/project/pipelines/schedules.md). ```yaml job: diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index b941a54c85a..98600a48d0f 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -20,26 +20,26 @@ module Ci raise ValidationError, e.message end - def jobs_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + def jobs_for_ref(ref, tag = false, source = nil) @jobs.select do |_, job| - process?(job[:only], job[:except], ref, tag, trigger_request, pipeline_schedule) + process?(job[:only], job[:except], ref, tag, source) end end - def jobs_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) - jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).select do |_, job| + def jobs_for_stage_and_ref(stage, ref, tag = false, source = nil) + jobs_for_ref(ref, tag, source).select do |_, job| job[:stage] == stage end end - def builds_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) - jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).map do |name, _| + def builds_for_ref(ref, tag = false, source = nil) + jobs_for_ref(ref, tag, source).map do |name, _| build_attributes(name) end end - def builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) - jobs_for_stage_and_ref(stage, ref, tag, trigger_request, pipeline_schedule).map do |name, _| + def builds_for_stage_and_ref(stage, ref, tag = false, source = nil) + jobs_for_stage_and_ref(stage, ref, tag, source).map do |name, _| build_attributes(name) end end @@ -193,31 +193,31 @@ module Ci end end - def process?(only_params, except_params, ref, tag, trigger_request, pipeline_schedule) + def process?(only_params, except_params, ref, tag, source) if only_params.present? - return false unless matching?(only_params, ref, tag, trigger_request, pipeline_schedule) + return false unless matching?(only_params, ref, tag, source) end if except_params.present? - return false if matching?(except_params, ref, tag, trigger_request, pipeline_schedule) + return false if matching?(except_params, ref, tag, source) end true end - def matching?(patterns, ref, tag, trigger_request, pipeline_schedule) + def matching?(patterns, ref, tag, source) patterns.any? do |pattern| - match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) + match_ref?(pattern, ref, tag, source) end end - def match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) + def match_ref?(pattern, ref, tag, source) pattern, path = pattern.split('@', 2) return false if path && path != self.path return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' - return true if trigger_request.present? && pattern == 'triggers' - return true if pipeline_schedule.present? && pattern == 'schedules' + return true if source == 'trigger' && pattern == 'triggers' + return true if source == 'schedule' && pattern == 'schedules' if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 83085f61b37..aa281301faf 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -227,7 +227,7 @@ module Ci config_processor = GitlabCiYamlProcessor.new(config, path) - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, true).size).to eq(1) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'trigger').size).to eq(1) end it "returns builds if only has a schedules keyword specified and a schedule is provided" do @@ -238,7 +238,7 @@ module Ci config_processor = GitlabCiYamlProcessor.new(config, path) - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, false, true).size).to eq(1) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'schedule').size).to eq(1) end it "does not return builds if only has a triggers keyword specified and no trigger is provided" do @@ -405,7 +405,7 @@ module Ci config_processor = GitlabCiYamlProcessor.new(config, path) - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, true).size).to eq(0) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'trigger').size).to eq(0) end it "does not return builds if except has a schedules keyword specified and a schedule is provided" do @@ -416,7 +416,7 @@ module Ci config_processor = GitlabCiYamlProcessor.new(config, path) - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, false, true).size).to eq(0) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'schedule').size).to eq(0) end it "returns builds if except has a triggers keyword specified and no trigger is provided" do -- cgit v1.2.1 From ecb54cddd164fbf83288d7903c4692df462bae5e Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 19:02:56 +0200 Subject: Add all sources as special keywords for only and except --- doc/ci/yaml/README.md | 3 +- lib/ci/gitlab_ci_yaml_processor.rb | 15 ++- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 134 +++++++++++++-------------- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 52ded37c2a7..8a0662db6fd 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -393,7 +393,8 @@ There are a few rules that apply to the usage of refs policy: * `only` and `except` are inclusive. If both `only` and `except` are defined in a job specification, the ref is filtered by `only` and `except`. * `only` and `except` allow the use of regular expressions. -* `only` and `except` allow the use of special keywords: `branches`, `tags`, `triggers` and `schedules`. +* `only` and `except` allow the use of special keywords: +`api`, `branches`, `external`, `tags`, `pushes`, `schedules`, `triggers`, and `web` * `only` and `except` allow to specify a repository path to filter jobs for forks. diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 98600a48d0f..0b362921b06 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -207,17 +207,15 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| - match_ref?(pattern, ref, tag, source) + match_ref?(pattern, ref, tag) || match_source?(pattern, source) end end - def match_ref?(pattern, ref, tag, source) + def match_ref?(pattern, ref, tag) pattern, path = pattern.split('@', 2) return false if path && path != self.path return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' - return true if source == 'trigger' && pattern == 'triggers' - return true if source == 'schedule' && pattern == 'schedules' if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref @@ -225,5 +223,14 @@ module Ci pattern == ref end end + + def match_source?(pattern, source) + return source_to_pattern(source) == pattern + end + + def source_to_pattern(source) + return source if ['api', 'external', 'web'].include? source + return source.pluralize + end end end diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index aa281301faf..79ed1366336 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -219,48 +219,44 @@ module Ci expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(0) end - it "returns builds if only has a triggers keyword specified and a trigger is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, only: ["triggers"] } - }) - - config_processor = GitlabCiYamlProcessor.new(config, path) - - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'trigger').size).to eq(1) - end - - it "returns builds if only has a schedules keyword specified and a schedule is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, only: ["schedules"] } - }) - - config_processor = GitlabCiYamlProcessor.new(config, path) - - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'schedule').size).to eq(1) + it "returns builds if only has special keywords specified and source matches" do + possibilities = [{keyword: 'pushes', source: 'push'}, + {keyword: 'web', source: 'web'}, + {keyword: 'triggers', source: 'trigger'}, + {keyword: 'schedules', source: 'schedule'}, + {keyword: 'api', source: 'api'}, + {keyword: 'external', source: 'external'}] + + possibilities.each do |possibility| + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, only: [possibility[:keyword]] } + }) + + config_processor = GitlabCiYamlProcessor.new(config, path) + + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, possibility[:source]).size).to eq(1) + end end - it "does not return builds if only has a triggers keyword specified and no trigger is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, only: ["triggers"] } - }) - - config_processor = GitlabCiYamlProcessor.new(config, path) - - expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(0) - end + it "does not return builds if only has special keywords specified and source doesn't match" do + possibilities = [{keyword: 'pushes', source: 'web'}, + {keyword: 'web', source: 'push'}, + {keyword: 'triggers', source: 'schedule'}, + {keyword: 'schedules', source: 'external'}, + {keyword: 'api', source: 'trigger'}, + {keyword: 'external', source: 'api'}] - it "does not return builds if only has a schedules keyword specified and no schedule is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, only: ["schedules"] } - }) + possibilities.each do |possibility| + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, only: [possibility[:keyword]] } + }) - config_processor = GitlabCiYamlProcessor.new(config, path) + config_processor = GitlabCiYamlProcessor.new(config, path) - expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(0) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, possibility[:source]).size).to eq(0) + end end it "returns builds if only has current repository path" do @@ -397,48 +393,44 @@ module Ci expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1) end - it "does not return builds if except has a triggers keyword specified and a trigger is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, except: ["triggers"] } - }) - - config_processor = GitlabCiYamlProcessor.new(config, path) - - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'trigger').size).to eq(0) - end + it "does not return builds if except has special keywords specified and source matches" do + possibilities = [{keyword: 'pushes', source: 'push'}, + {keyword: 'web', source: 'web'}, + {keyword: 'triggers', source: 'trigger'}, + {keyword: 'schedules', source: 'schedule'}, + {keyword: 'api', source: 'api'}, + {keyword: 'external', source: 'external'}] - it "does not return builds if except has a schedules keyword specified and a schedule is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, except: ["schedules"] } - }) + possibilities.each do |possibility| + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, except: [possibility[:keyword]] } + }) - config_processor = GitlabCiYamlProcessor.new(config, path) + config_processor = GitlabCiYamlProcessor.new(config, path) - expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, 'schedule').size).to eq(0) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, possibility[:source]).size).to eq(0) + end end - it "returns builds if except has a triggers keyword specified and no trigger is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, except: ["triggers"] } - }) + it "returns builds if except has special keywords specified and source doesn't match" do + possibilities = [{keyword: 'pushes', source: 'web'}, + {keyword: 'web', source: 'push'}, + {keyword: 'triggers', source: 'schedule'}, + {keyword: 'schedules', source: 'external'}, + {keyword: 'api', source: 'trigger'}, + {keyword: 'external', source: 'api'}] - config_processor = GitlabCiYamlProcessor.new(config, path) + possibilities.each do |possibility| + config = YAML.dump({ + before_script: ["pwd"], + rspec: { script: "rspec", type: type, only: [possibility[:keyword]] } + }) - expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1) - end + config_processor = GitlabCiYamlProcessor.new(config, path) - it "returns builds if except has a schedules keyword specified and no schedule is provided" do - config = YAML.dump({ - before_script: ["pwd"], - rspec: { script: "rspec", type: type, except: ["schedules"] } - }) - - config_processor = GitlabCiYamlProcessor.new(config, path) - - expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1) + expect(config_processor.builds_for_stage_and_ref(type, "deploy", false, possibility[:source]).size).to eq(1) + end end it "does not return builds if except has current repository path" do -- cgit v1.2.1 From 1dd054e1788fa7b308a9088f3bb35808a027e76d Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 19:58:20 +0200 Subject: Fix static-analysis offenses --- lib/ci/gitlab_ci_yaml_processor.rb | 2 +- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 0b362921b06..d236c42929a 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -229,7 +229,7 @@ module Ci end def source_to_pattern(source) - return source if ['api', 'external', 'web'].include? source + return source if %w(api external web).include? source return source.pluralize end end diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 79ed1366336..fef2d992aaa 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -394,12 +394,12 @@ module Ci end it "does not return builds if except has special keywords specified and source matches" do - possibilities = [{keyword: 'pushes', source: 'push'}, - {keyword: 'web', source: 'web'}, - {keyword: 'triggers', source: 'trigger'}, - {keyword: 'schedules', source: 'schedule'}, - {keyword: 'api', source: 'api'}, - {keyword: 'external', source: 'external'}] + possibilities = [{ keyword: 'pushes', source: 'push' }, + { keyword: 'web', source: 'web' }, + { keyword: 'triggers', source: 'trigger' }, + { keyword: 'schedules', source: 'schedule' }, + { keyword: 'api', source: 'api' }, + { keyword: 'external', source: 'external' }] possibilities.each do |possibility| config = YAML.dump({ -- cgit v1.2.1 From 7457d076ceb0078e6e9b6cbd9559564bff27b7d0 Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 20:12:44 +0200 Subject: Check if source is nil --- lib/ci/gitlab_ci_yaml_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index d236c42929a..feac7c87466 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -229,7 +229,7 @@ module Ci end def source_to_pattern(source) - return source if %w(api external web).include? source + return source if %w(api external web).include?(source) || source.nil? return source.pluralize end end -- cgit v1.2.1 From 449bc26de9c9c6dd146cf15b9176d1311f94555f Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 20:39:36 +0200 Subject: Change changelog entry --- changelogs/unreleased/32955-schedule-keyword.yml | 4 ---- changelogs/unreleased/32955-special-keywords.yml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 changelogs/unreleased/32955-schedule-keyword.yml create mode 100644 changelogs/unreleased/32955-special-keywords.yml diff --git a/changelogs/unreleased/32955-schedule-keyword.yml b/changelogs/unreleased/32955-schedule-keyword.yml deleted file mode 100644 index fe07b3a2263..00000000000 --- a/changelogs/unreleased/32955-schedule-keyword.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Add 'schedules' keyword to 'only' and 'except' -merge_request: 11844 -author: Filip Krakowski diff --git a/changelogs/unreleased/32955-special-keywords.yml b/changelogs/unreleased/32955-special-keywords.yml new file mode 100644 index 00000000000..0f9939ced8c --- /dev/null +++ b/changelogs/unreleased/32955-special-keywords.yml @@ -0,0 +1,4 @@ +--- +title: Add all pipeline sources as special keywords to 'only' and 'except' +merge_request: 11844 +author: Filip Krakowski -- cgit v1.2.1 From cd0c472711a0283ba82517d31e678380251e6401 Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 21:11:04 +0200 Subject: Fix static-analysis offenses (again) --- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index fef2d992aaa..af102198068 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -220,12 +220,12 @@ module Ci end it "returns builds if only has special keywords specified and source matches" do - possibilities = [{keyword: 'pushes', source: 'push'}, - {keyword: 'web', source: 'web'}, - {keyword: 'triggers', source: 'trigger'}, - {keyword: 'schedules', source: 'schedule'}, - {keyword: 'api', source: 'api'}, - {keyword: 'external', source: 'external'}] + possibilities = [{ keyword: 'pushes', source: 'push' }, + { keyword: 'web', source: 'web' }, + { keyword: 'triggers', source: 'trigger' }, + { keyword: 'schedules', source: 'schedule' }, + { keyword: 'api', source: 'api' }, + { keyword: 'external', source: 'external' }] possibilities.each do |possibility| config = YAML.dump({ @@ -240,12 +240,12 @@ module Ci end it "does not return builds if only has special keywords specified and source doesn't match" do - possibilities = [{keyword: 'pushes', source: 'web'}, - {keyword: 'web', source: 'push'}, - {keyword: 'triggers', source: 'schedule'}, - {keyword: 'schedules', source: 'external'}, - {keyword: 'api', source: 'trigger'}, - {keyword: 'external', source: 'api'}] + possibilities = [{ keyword: 'pushes', source: 'web' }, + { keyword: 'web', source: 'push' }, + { keyword: 'triggers', source: 'schedule' }, + { keyword: 'schedules', source: 'external' }, + { keyword: 'api', source: 'trigger' }, + { keyword: 'external', source: 'api' }] possibilities.each do |possibility| config = YAML.dump({ @@ -414,12 +414,12 @@ module Ci end it "returns builds if except has special keywords specified and source doesn't match" do - possibilities = [{keyword: 'pushes', source: 'web'}, - {keyword: 'web', source: 'push'}, - {keyword: 'triggers', source: 'schedule'}, - {keyword: 'schedules', source: 'external'}, - {keyword: 'api', source: 'trigger'}, - {keyword: 'external', source: 'api'}] + possibilities = [{ keyword: 'pushes', source: 'web' }, + { keyword: 'web', source: 'push' }, + { keyword: 'triggers', source: 'schedule' }, + { keyword: 'schedules', source: 'external' }, + { keyword: 'api', source: 'trigger' }, + { keyword: 'external', source: 'api' }] possibilities.each do |possibility| config = YAML.dump({ -- cgit v1.2.1 From 7d16f698d575c5988820699e8ec164638b701b50 Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 21:52:23 +0200 Subject: Fix typo in test --- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index af102198068..2a3196616fa 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -424,7 +424,7 @@ module Ci possibilities.each do |possibility| config = YAML.dump({ before_script: ["pwd"], - rspec: { script: "rspec", type: type, only: [possibility[:keyword]] } + rspec: { script: "rspec", type: type, except: [possibility[:keyword]] } }) config_processor = GitlabCiYamlProcessor.new(config, path) -- cgit v1.2.1 From 1736a2dab6bcab8bb5632e211525bd806bef003a Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Mon, 5 Jun 2017 17:15:15 +0200 Subject: Fix change in behavior --- lib/ci/gitlab_ci_yaml_processor.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index feac7c87466..a58af73debb 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -207,15 +207,19 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| - match_ref?(pattern, ref, tag) || match_source?(pattern, source) + pattern, path = pattern.split('@', 2) + match_path?(path) && match_pattern?(pattern, ref, tag, source) end end - def match_ref?(pattern, ref, tag) - pattern, path = pattern.split('@', 2) - return false if path && path != self.path + def match_path?(path) + return !(path && path != self.path) + end + + def match_pattern?(pattern, ref, tag, source) return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' + return true if source_to_pattern(source) == pattern if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref @@ -224,10 +228,6 @@ module Ci end end - def match_source?(pattern, source) - return source_to_pattern(source) == pattern - end - def source_to_pattern(source) return source if %w(api external web).include?(source) || source.nil? return source.pluralize -- cgit v1.2.1 From 431d7972b6d0f492bd82004b80d426f2e2cff6a5 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:14:36 +0900 Subject: Fix unmatches_path --- lib/ci/gitlab_ci_yaml_processor.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index a58af73debb..738ff474596 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -208,15 +208,15 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| pattern, path = pattern.split('@', 2) - match_path?(path) && match_pattern?(pattern, ref, tag, source) + unmatches_path?(path) && matches_pattern?(pattern, ref, tag, source) end end - def match_path?(path) - return !(path && path != self.path) + def unmatches_path?(path) + path && path != self.path end - def match_pattern?(pattern, ref, tag, source) + def matches_pattern?(pattern, ref, tag, source) return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' return true if source_to_pattern(source) == pattern @@ -229,8 +229,11 @@ module Ci end def source_to_pattern(source) - return source if %w(api external web).include?(source) || source.nil? - return source.pluralize + if %w(api external web).include?(source) || source.nil? + source + else + source.pluralize + end end end end -- cgit v1.2.1 From 465e5de5107da7e280902de581ee29c6f0cd1abc Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:24:11 +0900 Subject: Fix condition --- lib/ci/gitlab_ci_yaml_processor.rb | 8 +++++--- lib/gitlab/gitaly_client.rb | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 738ff474596..bd3ce40ca4b 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -208,12 +208,14 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| pattern, path = pattern.split('@', 2) - unmatches_path?(path) && matches_pattern?(pattern, ref, tag, source) + matches_path?(path) && matches_pattern?(pattern, ref, tag, source) end end - def unmatches_path?(path) - path && path != self.path + def matches_path?(path) + return true unless path + + path == self.path end def matches_pattern?(pattern, ref, tag, source) diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index 2343446bf22..598f642415a 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -49,7 +49,8 @@ module Gitlab end def self.enabled? - Gitlab.config.gitaly.enabled + # Gitlab.config.gitaly.enabled + false end def self.feature_enabled?(feature, status: MigrationStatus::OPT_IN) -- cgit v1.2.1 From 835f97a7e26ae7b199d886f35e33255016538134 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:26:04 +0900 Subject: Remove source.nil --- lib/ci/gitlab_ci_yaml_processor.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index bd3ce40ca4b..c3fa875bfe6 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -214,7 +214,7 @@ module Ci def matches_path?(path) return true unless path - + path == self.path end @@ -231,10 +231,10 @@ module Ci end def source_to_pattern(source) - if %w(api external web).include?(source) || source.nil? + if %w(api external web).include?(source) source else - source.pluralize + source&.pluralize end end end -- cgit v1.2.1 From 451b684d8474d5c16007d69f462f08f2191820f2 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:45:24 +0900 Subject: Use source instead of trigger_requests in stage_seeds --- lib/ci/gitlab_ci_yaml_processor.rb | 4 +--- lib/gitlab/gitaly_client.rb | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index c3fa875bfe6..9a681c65d4b 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -51,11 +51,9 @@ module Ci end def stage_seeds(pipeline) - trigger_request = pipeline.trigger_requests.first - seeds = @stages.uniq.map do |stage| builds = builds_for_stage_and_ref( - stage, pipeline.ref, pipeline.tag?, trigger_request) + stage, pipeline.ref, pipeline.tag?, pipeline.source) Gitlab::Ci::Stage::Seed.new(pipeline, stage, builds) if builds.any? end diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index 598f642415a..2343446bf22 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -49,8 +49,7 @@ module Gitlab end def self.enabled? - # Gitlab.config.gitaly.enabled - false + Gitlab.config.gitaly.enabled end def self.feature_enabled?(feature, status: MigrationStatus::OPT_IN) -- cgit v1.2.1 From 32bfa48ad0b2d930d3a95656774982afed7489f0 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:59:06 +0900 Subject: use squre bracket --- lib/ci/gitlab_ci_yaml_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 9a681c65d4b..56ad2c77c7d 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -229,7 +229,7 @@ module Ci end def source_to_pattern(source) - if %w(api external web).include?(source) + if %w[api external web].include?(source) source else source&.pluralize -- cgit v1.2.1 From ecd9c30930f4391b5cdfa631b8920d660c750058 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Thu, 8 Jun 2017 00:34:46 +0900 Subject: Add source policy spec --- spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 2a3196616fa..2ca0773ad1d 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -123,6 +123,25 @@ module Ci expect(seeds.first.builds.dig(0, :name)).to eq 'spinach' end end + + context 'when source policy is specified' do + let(:config) do + YAML.dump(production: { stage: 'deploy', script: 'cap prod', only: ['triggers'] }, + spinach: { stage: 'test', script: 'spinach', only: ['schedules'] }) + end + + let(:pipeline) do + create(:ci_empty_pipeline, source: :schedule) + end + + it 'returns stage seeds only assigned to schedules' do + seeds = subject.stage_seeds(pipeline) + + expect(seeds.size).to eq 1 + expect(seeds.first.stage[:name]).to eq 'test' + expect(seeds.first.builds.dig(0, :name)).to eq 'spinach' + end + end end describe "#builds_for_ref" do -- cgit v1.2.1 From 44d65c36dbe2f38eacb1858a99996c025b755937 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 8 May 2017 13:36:20 +0200 Subject: Document not using polymorphic associations Instead of using polymorphic associations a developer should use separate tables. --- doc/development/README.md | 1 + doc/development/polymorphic_associations.md | 146 ++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 doc/development/polymorphic_associations.md diff --git a/doc/development/README.md b/doc/development/README.md index af4131c4a8f..83eef9dadc3 100644 --- a/doc/development/README.md +++ b/doc/development/README.md @@ -51,6 +51,7 @@ - [Post Deployment Migrations](post_deployment_migrations.md) - [Foreign Keys & Associations](foreign_keys.md) - [Serializing Data](serializing_data.md) +- [Polymorphic Associations](polymorphic_associations.md) ## i18n diff --git a/doc/development/polymorphic_associations.md b/doc/development/polymorphic_associations.md new file mode 100644 index 00000000000..d63b9fb115f --- /dev/null +++ b/doc/development/polymorphic_associations.md @@ -0,0 +1,146 @@ +# Polymorphic Associations + +**Summary:** always use separate tables instead of polymorphic associations. + +Rails makes it possible to define so called "polymorphic associations". This +usually works by adding two columns to a table: a target type column, and a +target id. For example, at the time of writing we have such a setup for +`members` with the following columns: + +* `source_type`: a string defining the model to use, can be either `Project` or + `Namespace`. +* `source_id`: the ID of the row to retrieve based on `source_type`. For + example, when `source_type` is `Project` then `source_id` will contain a + project ID. + +While such a setup may appear to be useful, it comes with many drawbacks; enough +that you should avoid this at all costs. + +## Space Wasted + +Because this setup relies on string values to determine the model to use it will +end up wasting a lot of space. For example, for `Project` and `Namespace` the +maximum size is 9 bytes, plus 1 extra byte for every string when using +PostgreSQL. While this may only be 10 bytes per row, given enough tables and +rows using such a setup we can end up wasting quite a bit of disk space and +memory (for any indexes). + +## Indexes + +Because our associations are broken up into two columns this may result in +requiring composite indexes for queries to be performed efficiently. While +composite indexes are not wrong at all, they can be tricky to set up as the +ordering of columns in these indexes is important to ensure optimal performance. + +## Consistency + +One really big problem with polymorphic associations is being unable to enforce +data consistency on the database level using foreign keys. For consistency to be +enforced on the database level one would have to write their own foreign key +logic to support polymorphic associations. + +Enforcing consistency on the database level is absolutely crucial for +maintaining a healthy environment, and thus is another reason to avoid +polymorphic associations. + +## Query Overhead + +When using polymorphic associations you always need to filter using both +columns. For example, you may end up writing a query like this: + +```sql +SELECT * +FROM members +WHERE source_type = 'Project' +AND source_id = 13083; +``` + +Here PostgreSQL can perform the query quite efficiently if both columns are +indexed, but as the query gets more complex it may not be able to use these +indexes efficiently. + +## Mixed Responsibilities + +Similar to functions and classes a table should have a single responsibility: +storing data with a certain set of pre-defined columns. When using polymorphic +associations you are instead storing different types of data (possibly with +different columns set) in the same table. + +## The Solution + +Fortunately there is a very simple solution to these problems: simply use a +separate table for every type you would otherwise store in the same table. Using +a separate table allows you to use everything a database may provide to ensure +consistency and query data efficiently, without any additional application logic +being necessary. + +Let's say you have a `members` table storing both approved and pending members, +for both projects and groups, and the pending state is determined by the column +`requested_at` being set or not. Schema wise such a setup can lead to various +columns only being set for certain rows, wasting space. It's also possible that +certain indexes will only be set for certain rows, again wasting space. Finally, +querying such a table requires less than ideal queries. For example: + +```sql +SELECT * +FROM members +WHERE requested_at IS NULL +AND source_type = 'GroupMember' +AND source_id = 4 +``` + +Instead such a table should be broken up into separate tables. For example, you +may end up with 4 tables in this case: + +* project_members +* group_members +* pending_project_members +* pending_group_members + +This makes querying data trivial. For example, to get the members of a group +you'd run: + +```sql +SELECT * +FROM group_members +WHERE group_id = 4 +``` + +To get all the pending members of a group in turn you'd run: + +```sql +SELECT * +FROM pending_group_members +WHERE group_id = 4 +``` + +If you want to get both you can use a UNION, though you need to be explicit +about what columns you want to SELECT as otherwise the result set will use the +columns of the first query. For example: + +```sql +SELECT id, 'Group' AS target_type, group_id AS target_id +FROM group_members + +UNION ALL + +SELECT id, 'Project' AS target_type, project_id AS target_id +FROM project_members +``` + +The above example is perhaps a bit silly, but it shows that there's nothing +stopping you from merging the data together and presenting it on the same page. +Selecting columns explicitly can also speed up queries as the database has to do +less work to get the data (compared to selecting all columns, even ones you're +not using). + +Our schema also becomes easier. No longer do we need to both store and index the +`source_type` column, we can define foreign keys easily, and we don't need to +filter rows using the `IS NULL` condition. + +To summarize: using separate tables allows us to use foreign keys effectively, +create indexes only where necessary, conserve space, query data more +efficiently, and scale these tables more easily (e.g. by storing them on +separate disks). A nice side effect of this is that code can also become easier +as you won't end up with a single model having to handle different kinds of +data. -- cgit v1.2.1 From 5819ca1a249d1daf3b4feb655c217c98a1b70225 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 2 Jun 2017 14:29:30 +0200 Subject: Added Cop to blacklist polymorphic associations One should really use a separate table instead of using polymorphic associations. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11168 for more information. --- app/models/award_emoji.rb | 2 +- app/models/deployment.rb | 2 +- app/models/event.rb | 2 +- app/models/label_link.rb | 2 +- app/models/member.rb | 2 +- app/models/note.rb | 2 +- app/models/notification_setting.rb | 2 +- app/models/redirect_route.rb | 2 +- app/models/route.rb | 2 +- app/models/sent_notification.rb | 2 +- app/models/subscription.rb | 2 +- app/models/todo.rb | 2 +- app/models/upload.rb | 2 +- app/models/user_agent_detail.rb | 2 +- rubocop/cop/activerecord_serialize.rb | 16 ++++------- rubocop/cop/polymorphic_associations.rb | 23 ++++++++++++++++ rubocop/model_helpers.rb | 11 ++++++++ rubocop/rubocop.rb | 1 + spec/rubocop/cop/activerecord_serialize_spec.rb | 4 +-- spec/rubocop/cop/polymorphic_associations_spec.rb | 33 +++++++++++++++++++++++ 20 files changed, 89 insertions(+), 27 deletions(-) create mode 100644 rubocop/cop/polymorphic_associations.rb create mode 100644 rubocop/model_helpers.rb create mode 100644 spec/rubocop/cop/polymorphic_associations_spec.rb diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb index 6ada6fae4eb..ebe60441603 100644 --- a/app/models/award_emoji.rb +++ b/app/models/award_emoji.rb @@ -5,7 +5,7 @@ class AwardEmoji < ActiveRecord::Base include Participable include GhostUser - belongs_to :awardable, polymorphic: true + belongs_to :awardable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :user validates :awardable, :user, presence: true diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 304179c0a97..85e7901dfee 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -4,7 +4,7 @@ class Deployment < ActiveRecord::Base belongs_to :project, required: true, validate: true belongs_to :environment, required: true, validate: true belongs_to :user - belongs_to :deployable, polymorphic: true + belongs_to :deployable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations validates :sha, presence: true validates :ref, presence: true diff --git a/app/models/event.rb b/app/models/event.rb index d6d39473774..fad6ff03927 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -47,7 +47,7 @@ class Event < ActiveRecord::Base belongs_to :author, class_name: "User" belongs_to :project - belongs_to :target, polymorphic: true + belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations # For Hash only serialize :data # rubocop:disable Cop/ActiverecordSerialize diff --git a/app/models/label_link.rb b/app/models/label_link.rb index 51b5c2b1f4c..d68e1f54317 100644 --- a/app/models/label_link.rb +++ b/app/models/label_link.rb @@ -1,7 +1,7 @@ class LabelLink < ActiveRecord::Base include Importable - belongs_to :target, polymorphic: true + belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :label validates :target, presence: true, unless: :importing? diff --git a/app/models/member.rb b/app/models/member.rb index 29f9d61e870..788a32dd8e3 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -8,7 +8,7 @@ class Member < ActiveRecord::Base belongs_to :created_by, class_name: "User" belongs_to :user - belongs_to :source, polymorphic: true + belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations delegate :name, :username, :email, to: :user, prefix: true diff --git a/app/models/note.rb b/app/models/note.rb index 563af47f314..244bf169c29 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -41,7 +41,7 @@ class Note < ActiveRecord::Base participant :author belongs_to :project - belongs_to :noteable, polymorphic: true, touch: true + belongs_to :noteable, polymorphic: true, touch: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :author, class_name: "User" belongs_to :updated_by, class_name: "User" belongs_to :last_edited_by, class_name: 'User' diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb index e4726e62e93..42412a9a44b 100644 --- a/app/models/notification_setting.rb +++ b/app/models/notification_setting.rb @@ -4,7 +4,7 @@ class NotificationSetting < ActiveRecord::Base default_value_for :level, NotificationSetting.levels[:global] belongs_to :user - belongs_to :source, polymorphic: true + belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :project, foreign_key: 'source_id' validates :user, presence: true diff --git a/app/models/redirect_route.rb b/app/models/redirect_route.rb index 99812bcde53..964175ddab8 100644 --- a/app/models/redirect_route.rb +++ b/app/models/redirect_route.rb @@ -1,5 +1,5 @@ class RedirectRoute < ActiveRecord::Base - belongs_to :source, polymorphic: true + belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations validates :source, presence: true diff --git a/app/models/route.rb b/app/models/route.rb index be77b8b51a5..97e8a6ad9e9 100644 --- a/app/models/route.rb +++ b/app/models/route.rb @@ -1,5 +1,5 @@ class Route < ActiveRecord::Base - belongs_to :source, polymorphic: true + belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations validates :source, presence: true diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index eed3ca7e179..edde7bedbab 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -2,7 +2,7 @@ class SentNotification < ActiveRecord::Base serialize :position, Gitlab::Diff::Position # rubocop:disable Cop/ActiverecordSerialize belongs_to :project - belongs_to :noteable, polymorphic: true + belongs_to :noteable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :recipient, class_name: "User" validates :project, :recipient, presence: true diff --git a/app/models/subscription.rb b/app/models/subscription.rb index 17869c8bac2..2f0c9640744 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -1,7 +1,7 @@ class Subscription < ActiveRecord::Base belongs_to :user belongs_to :project - belongs_to :subscribable, polymorphic: true + belongs_to :subscribable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations validates :user, :subscribable, presence: true diff --git a/app/models/todo.rb b/app/models/todo.rb index b011001b235..696d139af74 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -22,7 +22,7 @@ class Todo < ActiveRecord::Base belongs_to :author, class_name: "User" belongs_to :note belongs_to :project - belongs_to :target, polymorphic: true, touch: true + belongs_to :target, polymorphic: true, touch: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :user delegate :name, :email, to: :author, prefix: true, allow_nil: true diff --git a/app/models/upload.rb b/app/models/upload.rb index 13987931b05..f194d7bdb80 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -2,7 +2,7 @@ class Upload < ActiveRecord::Base # Upper limit for foreground checksum processing CHECKSUM_THRESHOLD = 100.megabytes - belongs_to :model, polymorphic: true + belongs_to :model, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations validates :size, presence: true validates :path, presence: true diff --git a/app/models/user_agent_detail.rb b/app/models/user_agent_detail.rb index 0949c6ef083..2d05fdd3e54 100644 --- a/app/models/user_agent_detail.rb +++ b/app/models/user_agent_detail.rb @@ -1,5 +1,5 @@ class UserAgentDetail < ActiveRecord::Base - belongs_to :subject, polymorphic: true + belongs_to :subject, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations validates :user_agent, :ip_address, :subject_id, :subject_type, presence: true diff --git a/rubocop/cop/activerecord_serialize.rb b/rubocop/cop/activerecord_serialize.rb index bfa0cff9a67..9bdcc3b4c34 100644 --- a/rubocop/cop/activerecord_serialize.rb +++ b/rubocop/cop/activerecord_serialize.rb @@ -1,24 +1,18 @@ +require_relative '../model_helpers' + module RuboCop module Cop # Cop that prevents the use of `serialize` in ActiveRecord models. class ActiverecordSerialize < RuboCop::Cop::Cop + include ModelHelpers + MSG = 'Do not store serialized data in the database, use separate columns and/or tables instead'.freeze def on_send(node) - return unless in_models?(node) + return unless in_model?(node) add_offense(node, :selector) if node.children[1] == :serialize end - - def models_path - File.join(Dir.pwd, 'app', 'models') - end - - def in_models?(node) - path = node.location.expression.source_buffer.name - - path.start_with?(models_path) - end end end end diff --git a/rubocop/cop/polymorphic_associations.rb b/rubocop/cop/polymorphic_associations.rb new file mode 100644 index 00000000000..7d554704550 --- /dev/null +++ b/rubocop/cop/polymorphic_associations.rb @@ -0,0 +1,23 @@ +require_relative '../model_helpers' + +module RuboCop + module Cop + # Cop that prevents the use of polymorphic associations + class PolymorphicAssociations < RuboCop::Cop::Cop + include ModelHelpers + + MSG = 'Do not use polymorphic associations, use separate tables instead'.freeze + + def on_send(node) + return unless in_model?(node) + return unless node.children[1] == :belongs_to + + node.children.last.each_node(:pair) do |pair| + key_name = pair.children[0].children[0] + + add_offense(pair, :expression) if key_name == :polymorphic + end + end + end + end +end diff --git a/rubocop/model_helpers.rb b/rubocop/model_helpers.rb new file mode 100644 index 00000000000..309723dc34c --- /dev/null +++ b/rubocop/model_helpers.rb @@ -0,0 +1,11 @@ +module RuboCop + module ModelHelpers + # Returns true if the given node originated from the models directory. + def in_model?(node) + path = node.location.expression.source_buffer.name + models_path = File.join(Dir.pwd, 'app', 'models') + + path.start_with?(models_path) + end + end +end diff --git a/rubocop/rubocop.rb b/rubocop/rubocop.rb index 22815090508..dae30969abf 100644 --- a/rubocop/rubocop.rb +++ b/rubocop/rubocop.rb @@ -2,6 +2,7 @@ require_relative 'cop/custom_error_class' require_relative 'cop/gem_fetcher' require_relative 'cop/activerecord_serialize' require_relative 'cop/redirect_with_status' +require_relative 'cop/polymorphic_associations' require_relative 'cop/migration/add_column' require_relative 'cop/migration/add_column_with_default_to_large_table' require_relative 'cop/migration/add_concurrent_foreign_key' diff --git a/spec/rubocop/cop/activerecord_serialize_spec.rb b/spec/rubocop/cop/activerecord_serialize_spec.rb index a303b16d264..5bd7e5fa926 100644 --- a/spec/rubocop/cop/activerecord_serialize_spec.rb +++ b/spec/rubocop/cop/activerecord_serialize_spec.rb @@ -10,7 +10,7 @@ describe RuboCop::Cop::ActiverecordSerialize do context 'inside the app/models directory' do it 'registers an offense when serialize is used' do - allow(cop).to receive(:in_models?).and_return(true) + allow(cop).to receive(:in_model?).and_return(true) inspect_source(cop, 'serialize :foo') @@ -23,7 +23,7 @@ describe RuboCop::Cop::ActiverecordSerialize do context 'outside the app/models directory' do it 'does nothing' do - allow(cop).to receive(:in_models?).and_return(false) + allow(cop).to receive(:in_model?).and_return(false) inspect_source(cop, 'serialize :foo') diff --git a/spec/rubocop/cop/polymorphic_associations_spec.rb b/spec/rubocop/cop/polymorphic_associations_spec.rb new file mode 100644 index 00000000000..49959aa6419 --- /dev/null +++ b/spec/rubocop/cop/polymorphic_associations_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' +require 'rubocop' +require 'rubocop/rspec/support' +require_relative '../../../rubocop/cop/polymorphic_associations' + +describe RuboCop::Cop::PolymorphicAssociations do + include CopHelper + + subject(:cop) { described_class.new } + + context 'inside the app/models directory' do + it 'registers an offense when polymorphic: true is used' do + allow(cop).to receive(:in_model?).and_return(true) + + inspect_source(cop, 'belongs_to :foo, polymorphic: true') + + aggregate_failures do + expect(cop.offenses.size).to eq(1) + expect(cop.offenses.map(&:line)).to eq([1]) + end + end + end + + context 'outside the app/models directory' do + it 'does nothing' do + allow(cop).to receive(:in_model?).and_return(false) + + inspect_source(cop, 'belongs_to :foo, polymorphic: true') + + expect(cop.offenses).to be_empty + end + end +end -- cgit v1.2.1 From 4ff1aaedc29c65fca49d93fb781e3cc7d7006fba Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 2 Jun 2017 14:34:26 +0200 Subject: Document not using STI --- doc/development/README.md | 1 + doc/development/single_table_inheritance.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 doc/development/single_table_inheritance.md diff --git a/doc/development/README.md b/doc/development/README.md index 83eef9dadc3..40addfd8a4c 100644 --- a/doc/development/README.md +++ b/doc/development/README.md @@ -52,6 +52,7 @@ - [Foreign Keys & Associations](foreign_keys.md) - [Serializing Data](serializing_data.md) - [Polymorphic Associations](polymorphic_associations.md) +- [Single Table Inheritance](single_table_inheritance.md) ## i18n diff --git a/doc/development/single_table_inheritance.md b/doc/development/single_table_inheritance.md new file mode 100644 index 00000000000..27c3c4f3199 --- /dev/null +++ b/doc/development/single_table_inheritance.md @@ -0,0 +1,18 @@ +# Single Table Inheritance + +**Summary:** don't use Single Table Inheritance (STI), use separate tables +instead. + +Rails makes it possible to have multiple models stored in the same table and map +these rows to the correct models using a `type` column. This can be used to for +example store two different types of SSH keys in the same table. + +While tempting to use one should avoid this at all costs for the same reasons as +outlined in the document ["Polymorphic Associations"](polymorphic_associations.md). + +## Solution + +The solution is very simple: just use a separate table for every type you'd +otherwise store in the same table. For example, instead of having a `keys` table +with `type` set to either `Key` or `DeployKey` you'd have two separate tables: +`keys` and `deploy_keys`. -- cgit v1.2.1 From f20337ca8ef39bf9907a09e23111262d0dfa4e49 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 18:38:37 +0200 Subject: Fix for Login Test Problem --- features/steps/explore/new_menu.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/steps/explore/new_menu.rb b/features/steps/explore/new_menu.rb index bcb6e1eb708..17fd3a9a8ce 100644 --- a/features/steps/explore/new_menu.rb +++ b/features/steps/explore/new_menu.rb @@ -2,6 +2,8 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps include SharedAuthentication include SharedPaths include SharedProject + include SharedGroup + include SharedUser step 'I click "New project" in top right menu' do click_topmenuitem("New project") -- cgit v1.2.1 From dbffaaa97e7a195dc5421237392788a03a6b763a Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 6 Jun 2017 16:20:24 -0500 Subject: =?UTF-8?q?Blob#load=5Fall=5Fdata!=20doesn=E2=80=99t=20need=20an?= =?UTF-8?q?=20argument?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects/blob_controller.rb | 6 +++--- app/models/blob.rb | 4 ++++ app/models/blob_viewer/server_side.rb | 4 +--- app/models/repository.rb | 2 +- app/views/projects/diffs/viewers/_text.html.haml | 2 +- lib/api/files.rb | 2 +- lib/api/v3/files.rb | 2 +- lib/gitlab/blame.rb | 2 +- lib/gitlab/highlight.rb | 2 +- spec/requests/git_http_spec.rb | 2 +- 10 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 7025c7a1de6..4f53929a308 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -55,7 +55,7 @@ class Projects::BlobController < Projects::ApplicationController def edit if can_collaborate_with_project? - blob.load_all_data!(@repository) + blob.load_all_data! else redirect_to action: 'show' end @@ -74,7 +74,7 @@ class Projects::BlobController < Projects::ApplicationController def preview @content = params[:content] - @blob.load_all_data!(@repository) + @blob.load_all_data! diffy = Diffy::Diff.new(@blob.data, @content, diff: '-U 3', include_diff_info: true) diff_lines = diffy.diff.scan(/.*\n/)[2..-1] diff_lines = Gitlab::Diff::Parser.new.parse(diff_lines) @@ -111,7 +111,7 @@ class Projects::BlobController < Projects::ApplicationController private def blob - @blob ||= Blob.decorate(@repository.blob_at(@commit.id, @path), @project) + @blob ||= @repository.blob_at(@commit.id, @path) if @blob @blob diff --git a/app/models/blob.rb b/app/models/blob.rb index 6a42a12891c..fd95a1b299b 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -94,6 +94,10 @@ class Blob < SimpleDelegator end end + def load_all_data! + super(project.repository) if project + end + def no_highlighting? raw_size && raw_size > MAXIMUM_TEXT_HIGHLIGHT_SIZE end diff --git a/app/models/blob_viewer/server_side.rb b/app/models/blob_viewer/server_side.rb index 05a3dd7d913..e6bcacf7f70 100644 --- a/app/models/blob_viewer/server_side.rb +++ b/app/models/blob_viewer/server_side.rb @@ -9,9 +9,7 @@ module BlobViewer end def prepare! - if blob.project - blob.load_all_data!(blob.project.repository) - end + blob.load_all_data! end def render_error diff --git a/app/models/repository.rb b/app/models/repository.rb index 07e0b3bae4f..981cb8f2e53 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1102,7 +1102,7 @@ class Repository blob = blob_at(sha, path) return unless blob - blob.load_all_data!(self) + blob.load_all_data! blob.data end diff --git a/app/views/projects/diffs/viewers/_text.html.haml b/app/views/projects/diffs/viewers/_text.html.haml index e4b89671724..120d3540223 100644 --- a/app/views/projects/diffs/viewers/_text.html.haml +++ b/app/views/projects/diffs/viewers/_text.html.haml @@ -1,5 +1,5 @@ - blob = diff_file.blob -- blob.load_all_data!(diff_file.repository) +- blob.load_all_data! - total_lines = blob.lines.size - total_lines -= 1 if total_lines > 0 && blob.lines.last.blank? - if diff_view == :parallel diff --git a/lib/api/files.rb b/lib/api/files.rb index 25b0968a271..521287ee2b4 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -25,7 +25,7 @@ module API @blob = @repo.blob_at(@commit.sha, params[:file_path]) not_found!('File') unless @blob - @blob.load_all_data!(@repo) + @blob.load_all_data! end def commit_response(attrs) diff --git a/lib/api/v3/files.rb b/lib/api/v3/files.rb index c76acc86504..7b4b3448b6d 100644 --- a/lib/api/v3/files.rb +++ b/lib/api/v3/files.rb @@ -56,7 +56,7 @@ module API blob = repo.blob_at(commit.sha, params[:file_path]) not_found!('File') unless blob - blob.load_all_data!(repo) + blob.load_all_data! status(200) { diff --git a/lib/gitlab/blame.rb b/lib/gitlab/blame.rb index d62bc50ce78..169aac79854 100644 --- a/lib/gitlab/blame.rb +++ b/lib/gitlab/blame.rb @@ -40,7 +40,7 @@ module Gitlab end def highlighted_lines - @blob.load_all_data!(repository) + @blob.load_all_data! @highlighted_lines ||= Gitlab::Highlight.highlight(@blob.path, @blob.data, repository: repository).lines end diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb index 83bc230df3e..23bc2f63c8e 100644 --- a/lib/gitlab/highlight.rb +++ b/lib/gitlab/highlight.rb @@ -9,7 +9,7 @@ module Gitlab blob = repository.blob_at(ref, file_name) return [] unless blob - blob.load_all_data!(repository) + blob.load_all_data! highlight(file_name, blob.data, repository: repository).lines.map!(&:html_safe) end diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index f018b48ceb2..c09be0ce1b9 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -648,7 +648,7 @@ describe 'Git HTTP requests', lib: true do # Provide a dummy file in its place allow_any_instance_of(Repository).to receive(:blob_at).and_call_original allow_any_instance_of(Repository).to receive(:blob_at).with('b83d6e391c22777fca1ed3012fce84f633d7fed0', 'info/refs') do - Gitlab::Git::Blob.find(project.repository, 'master', 'bar/branch-test.txt') + Blob.decorate(Gitlab::Git::Blob.find(project.repository, 'master', 'bar/branch-test.txt'), project) end get "/#{project.path_with_namespace}/blob/master/info/refs" -- cgit v1.2.1 From ad27e799b737f9d6aeef703315e4a32ba7925d8f Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Wed, 7 Jun 2017 08:58:48 -0700 Subject: remove extra space on thumbs emoji buttons --- app/assets/stylesheets/framework/awards.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/framework/awards.scss b/app/assets/stylesheets/framework/awards.scss index b4069a6d8e3..19166757e64 100644 --- a/app/assets/stylesheets/framework/awards.scss +++ b/app/assets/stylesheets/framework/awards.scss @@ -1,4 +1,7 @@ .awards { + display: flex; + flex-wrap: wrap; + .emoji-icon { width: 20px; height: 20px; @@ -110,6 +113,8 @@ margin: 4px 8px 4px 0; outline: 0; position: relative; + display: block; + float: left; &.disabled { cursor: default; -- cgit v1.2.1 From c7bf2bfdaaa2f1aaff0cb1118260db744abb5633 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 22:11:43 +0200 Subject: Converting Tests to Spec Tests --- spec/features/explore/new_menu_spec.rb | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 spec/features/explore/new_menu_spec.rb diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb new file mode 100644 index 00000000000..8fc8d0e8975 --- /dev/null +++ b/spec/features/explore/new_menu_spec.rb @@ -0,0 +1,58 @@ +require 'spec_helper' + +describe 'Top Plus Menu', :js, :feature do + let!(:user) { create :user } + let!(:group) { create(:group) } + let!(:public_group) { create(:group, :public) } + let!(:private_group) { create(:group, :private) } + let!(:empty_project) { create(:empty_project, group: public_group) } + + before do + group.add_owner(user) + + login_as(user) + + visit explore_groups_path + end + + context 'used by full user' do + before do + login_as :user + end + + scenario 'click on New project shows new project page' + visit root_dashboard_path + + click_topmenuitem("New project") + + expect(page).to have_content('Project path') + expect(page).to have_content('Project name') + end + + scenario 'click on New group shows new group page' + visit root_dashboard_path + + click_topmenuitem("New group") + + expect(page).to have_content('Group path') + expect(page).to have_content('Group name') + end + + scenario 'click on New group shows new group page' + visit root_dashboard_path + + click_topmenuitem("New snippet") + + expect(page).to have_content('New Snippet') + expect(page).to have_content('Title') + end + end + + def click_topmenuitem(item_name) + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link item_name + end + end +end -- cgit v1.2.1 From bdebe849b8251f390378dd446d9022fca1b2d55c Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 7 Jun 2017 20:13:44 +0000 Subject: Translate project & repository pages --- .../javascripts/lib/utils/datetime_utility.js | 64 ++- app/assets/javascripts/locale/de/app.js | 2 +- app/assets/javascripts/locale/en/app.js | 2 +- app/assets/javascripts/locale/es/app.js | 2 +- app/controllers/projects_controller.rb | 26 +- app/helpers/button_helper.rb | 4 +- app/helpers/ci_status_helper.rb | 39 +- app/helpers/notifications_helper.rb | 39 +- app/helpers/projects_helper.rb | 35 +- app/helpers/visibility_level_helper.rb | 10 +- app/views/layouts/_head.html.haml | 1 + app/views/projects/_find_file_link.html.haml | 2 +- app/views/projects/_head.html.haml | 15 +- app/views/projects/_home_panel.html.haml | 2 +- app/views/projects/_last_push.html.haml | 2 +- app/views/projects/blob/_new_dir.html.haml | 8 +- app/views/projects/buttons/_download.html.haml | 19 +- app/views/projects/buttons/_dropdown.html.haml | 16 +- app/views/projects/buttons/_fork.html.haml | 8 +- app/views/projects/buttons/_koding.html.haml | 2 +- app/views/projects/buttons/_star.html.haml | 8 +- app/views/projects/commits/_commit.html.haml | 4 +- app/views/projects/commits/_head.html.haml | 16 +- app/views/projects/cycle_analytics/show.html.haml | 1 - app/views/projects/find_file/show.html.haml | 2 +- app/views/projects/no_repo.html.haml | 12 +- app/views/projects/show.html.haml | 32 +- app/views/projects/tree/_tree_content.html.haml | 8 +- app/views/projects/tree/_tree_header.html.haml | 20 +- app/views/projects/tree/show.html.haml | 2 +- app/views/shared/_clone_panel.html.haml | 2 +- app/views/shared/_no_password.html.haml | 8 +- app/views/shared/_no_ssh.html.haml | 9 +- app/views/shared/_ref_switcher.html.haml | 6 +- .../members/_access_request_buttons.html.haml | 7 +- .../notifications/_custom_notifications.html.haml | 11 +- .../unreleased/bvl-translate-project-pages.yml | 4 + config/webpack.config.js | 10 +- lib/gitlab/ci/status/canceled.rb | 4 +- lib/gitlab/ci/status/created.rb | 4 +- lib/gitlab/ci/status/failed.rb | 4 +- lib/gitlab/ci/status/manual.rb | 4 +- lib/gitlab/ci/status/pending.rb | 4 +- lib/gitlab/ci/status/pipeline/blocked.rb | 4 +- lib/gitlab/ci/status/running.rb | 4 +- lib/gitlab/ci/status/skipped.rb | 4 +- lib/gitlab/ci/status/success.rb | 4 +- lib/gitlab/ci/status/success_warning.rb | 4 +- lib/gitlab/visibility_level.rb | 6 +- locale/de/gitlab.po | 619 +++++++++++++++++++- locale/en/gitlab.po | 619 +++++++++++++++++++- locale/es/gitlab.po | 623 ++++++++++++++++++++- locale/gitlab.pot | 617 +++++++++++++++++++- spec/features/projects/new_project_spec.rb | 4 +- spec/helpers/notifications_helper_spec.rb | 6 + spec/javascripts/build_spec.js | 2 +- spec/javascripts/datetime_utility_spec.js | 20 + spec/services/projects/create_service_spec.rb | 2 +- 58 files changed, 2776 insertions(+), 242 deletions(-) create mode 100644 changelogs/unreleased/bvl-translate-project-pages.yml diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index b2f48049bb4..40eadd9396c 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -3,6 +3,11 @@ import timeago from 'timeago.js'; import dateFormat from 'vendor/date.format'; +import { + lang, + s__, +} from '../../locale'; + window.timeago = timeago; window.dateFormat = dateFormat; @@ -48,26 +53,45 @@ window.dateFormat = dateFormat; var locale; if (!timeagoInstance) { + const localeRemaining = function(number, index) { + return [ + [s__('Timeago|less than a minute ago'), s__('Timeago|a while')], + [s__('Timeago|less than a minute ago'), s__('Timeago|%s seconds remaining')], + [s__('Timeago|about a minute ago'), s__('Timeago|1 minute remaining')], + [s__('Timeago|%s minutes ago'), s__('Timeago|%s minutes remaining')], + [s__('Timeago|about an hour ago'), s__('Timeago|1 hour remaining')], + [s__('Timeago|about %s hours ago'), s__('Timeago|%s hours remaining')], + [s__('Timeago|a day ago'), s__('Timeago|1 day remaining')], + [s__('Timeago|%s days ago'), s__('Timeago|%s days remaining')], + [s__('Timeago|a week ago'), s__('Timeago|1 week remaining')], + [s__('Timeago|%s weeks ago'), s__('Timeago|%s weeks remaining')], + [s__('Timeago|a month ago'), s__('Timeago|1 month remaining')], + [s__('Timeago|%s months ago'), s__('Timeago|%s months remaining')], + [s__('Timeago|a year ago'), s__('Timeago|1 year remaining')], + [s__('Timeago|%s years ago'), s__('Timeago|%s years remaining')] + ][index]; + }; locale = function(number, index) { return [ - ['less than a minute ago', 'a while'], - ['less than a minute ago', 'in %s seconds'], - ['about a minute ago', 'in 1 minute'], - ['%s minutes ago', 'in %s minutes'], - ['about an hour ago', 'in 1 hour'], - ['about %s hours ago', 'in %s hours'], - ['a day ago', 'in 1 day'], - ['%s days ago', 'in %s days'], - ['a week ago', 'in 1 week'], - ['%s weeks ago', 'in %s weeks'], - ['a month ago', 'in 1 month'], - ['%s months ago', 'in %s months'], - ['a year ago', 'in 1 year'], - ['%s years ago', 'in %s years'] + [s__('Timeago|less than a minute ago'), s__('Timeago|a while')], + [s__('Timeago|less than a minute ago'), s__('Timeago|in %s seconds')], + [s__('Timeago|about a minute ago'), s__('Timeago|in 1 minute')], + [s__('Timeago|%s minutes ago'), s__('Timeago|in %s minutes')], + [s__('Timeago|about an hour ago'), s__('Timeago|in 1 hour')], + [s__('Timeago|about %s hours ago'), s__('Timeago|in %s hours')], + [s__('Timeago|a day ago'), s__('Timeago|in 1 day')], + [s__('Timeago|%s days ago'), s__('Timeago|in %s days')], + [s__('Timeago|a week ago'), s__('Timeago|in 1 week')], + [s__('Timeago|%s weeks ago'), s__('Timeago|in %s weeks')], + [s__('Timeago|a month ago'), s__('Timeago|in 1 month')], + [s__('Timeago|%s months ago'), s__('Timeago|in %s months')], + [s__('Timeago|a year ago'), s__('Timeago|in 1 year')], + [s__('Timeago|%s years ago'), s__('Timeago|in %s years')] ][index]; }; - timeago.register('gl_en', locale); + timeago.register(lang, locale); + timeago.register(`${lang}-remaining`, localeRemaining); timeagoInstance = timeago(); } @@ -79,13 +103,11 @@ window.dateFormat = dateFormat; if (!time) { return ''; } - suffix || (suffix = 'remaining'); - expiredLabel || (expiredLabel = 'Past due'); - timefor = gl.utils.getTimeago().format(time).replace('in', ''); - if (timefor.indexOf('ago') > -1) { + if (new Date(time) < new Date()) { + expiredLabel || (expiredLabel = s__('Timeago|Past due')); timefor = expiredLabel; } else { - timefor = timefor.trim() + ' ' + suffix; + timefor = gl.utils.getTimeago().format(time, `${lang}-remaining`).trim(); } return timefor; }; @@ -102,7 +124,7 @@ window.dateFormat = dateFormat; }; w.gl.utils.updateTimeagoText = function(el) { - const formattedDate = gl.utils.getTimeago().format(el.getAttribute('datetime'), 'gl_en'); + const formattedDate = gl.utils.getTimeago().format(el.getAttribute('datetime'), lang); if (el.textContent !== formattedDate) { el.textContent = formattedDate; diff --git a/app/assets/javascripts/locale/de/app.js b/app/assets/javascripts/locale/de/app.js index 9411f078ecf..960b8e5ecb3 100644 --- a/app/assets/javascripts/locale/de/app.js +++ b/app/assets/javascripts/locale/de/app.js @@ -1 +1 @@ -var locales = locales || {}; locales['de'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-05-09 13:44+0200","Language-Team":"German","Language":"de","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","Last-Translator":"","X-Generator":"Poedit 2.0.1","lang":"de","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"ByAuthor|by":["Von"],"Commit":["Commit","Commits"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["Cycle Analytics liefern einen Überblick darüber, wie viel Zeit in Ihrem Projekt von einer Idee bis zum Produktivdeployment vergeht."],"CycleAnalyticsStage|Code":["Code"],"CycleAnalyticsStage|Issue":["Issue"],"CycleAnalyticsStage|Plan":["Planung"],"CycleAnalyticsStage|Production":["Produktiv"],"CycleAnalyticsStage|Review":["Review"],"CycleAnalyticsStage|Staging":["Staging"],"CycleAnalyticsStage|Test":["Test"],"Deploy":["Deployment","Deployments"],"FirstPushedBy|First":["Erster"],"FirstPushedBy|pushed by":["gepusht von"],"From issue creation until deploy to production":["Vom Anlegen des Issues bis zum Produktivdeployment"],"From merge request merge until deploy to production":["Vom Merge Request bis zum Produktivdeployment"],"Introducing Cycle Analytics":["Was sind Cycle Analytics?"],"Last %d day":["Letzter %d Tag","Letzten %d Tage"],"Limited to showing %d event at most":["Eingeschränkt auf maximal %d Ereignis","Eingeschränkt auf maximal %d Ereignisse"],"Median":["Median"],"New Issue":["Neues Issue","Neue Issues"],"Not available":["Nicht verfügbar"],"Not enough data":["Nicht genügend Daten"],"OpenedNDaysAgo|Opened":["Erstellt"],"Pipeline Health":["Pipeline Kennzahlen"],"ProjectLifecycle|Stage":["Phase"],"Read more":["Mehr"],"Related Commits":["Zugehörige Commits"],"Related Deployed Jobs":["Zugehörige Deploymentjobs"],"Related Issues":["Zugehörige Issues"],"Related Jobs":["Zugehörige Jobs"],"Related Merge Requests":["Zugehörige Merge Requests"],"Related Merged Requests":["Zugehörige abgeschlossene Merge Requests"],"Showing %d event":["Zeige %d Ereignis","Zeige %d Ereignisse"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["Die Code-Phase stellt die Zeit vom ersten Commit bis zum Erstellen eines Merge Requests dar. Sobald Sie Ihren ersten Merge Request anlegen, werden dessen Daten automatisch ergänzt."],"The collection of events added to the data gathered for that stage.":["Ereignisse, die für diese Phase ausgewertet wurden."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["Die Issue-Phase stellt die Zeit vom Anlegen eines Issues bis zum Zuweisen eines Meilensteins oder Hinzufügen zum Issue Board dar. Erstellen Sie einen Issue, damit dessen Daten hier erscheinen."],"The phase of the development lifecycle.":["Die Phase im Entwicklungsprozess."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["Die Planungsphase stellt die Zeit von der vorherigen Phase bis zum Pushen des ersten Commits dar. Sobald Sie den ersten Commit pushen, werden dessen Daten hier erscheinen."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["Die Produktiv-Phase stellt die Gesamtzeit vom Anlegen eines Issues bis zum Deployment auf dem Produktivsystem dar. Sobald Sie den vollständigen Entwicklungszyklus von einer Idee bis zum Produktivdeployment durchlaufen haben, erscheinen die zugehörigen Daten hier."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["Die Review-Phase stellt die Zeit vom Anlegen eines Merge Requests bis zum Mergen dar. Sobald Sie Ihren ersten Merge Request abschließen, werden dessen Daten hier automatisch angezeigt."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["Die Staging-Phase stellt die Zeit zwischen Mergen eines Merge Requests und dem Produktivdeployment dar. Sobald Sie das erste Produktivdeployment durchgeführt haben, werden dessen Daten hier automatisch angezeigt."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["Die Test-Phase stellt die Zeit dar, die GitLab CI benötigt um die Pipelines von Merge Requests abzuarbeiten. Sobald die erste Pipeline abgeschlossen ist, werden deren Daten hier automatisch angezeigt."],"The time taken by each data entry gathered by that stage.":["Zeit die für das jeweilige Ereignis in der Phase ermittelt wurde."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["Der mittlere aller erfassten Werte. Zum Beispiel ist für 3, 5, 9 der Median 5. Bei 3, 5, 7, 8 ist der Median (5+7)/2 = 6."],"Time before an issue gets scheduled":["Zeit bis ein Issue geplant wird"],"Time before an issue starts implementation":["Zeit bis die Implementierung für ein Issue beginnt"],"Time between merge request creation and merge/close":["Zeit zwischen Anlegen und Mergen/Schließen eines Merge Requests"],"Time until first merge request":["Zeit bis zum ersten Merge Request"],"Time|hr":["h","h"],"Time|min":["min","min"],"Time|s":["s"],"Total Time":["Gesamtzeit"],"Total test time for all commits/merges":["Gesamte Testlaufzeit für alle Commits/Merges"],"Want to see the data? Please ask an administrator for access.":["Um diese Daten einsehen zu können, wenden Sie sich bitte an Ihren Administrator."],"We don't have enough data to show this stage.":["Es liegen nicht genügend Daten vor, um diese Phase anzuzeigen."],"You need permission.":["Sie benötigen Zugriffsrechte."],"day":["Tag","Tage"]}}}; \ No newline at end of file +var locales = locales || {}; locales['de'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-06-07 12:17+0200","Language-Team":"German","Language":"de","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","Last-Translator":"Bob Van Landuyt ","X-Generator":"Poedit 2.0.2","lang":"de","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"About auto deploy":[""],"Activity":[""],"Add Changelog":[""],"Add Contribution guide":[""],"Add License":[""],"Add an SSH key to your profile to pull or push via SSH.":[""],"Add new directory":[""],"Archived project! Repository is read-only":[""],"Branch":["",""],"Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}":[""],"Branches":[""],"ByAuthor|by":["Von"],"CI configuration":[""],"Changelog":[""],"Charts":[""],"CiStatusLabel|canceled":[""],"CiStatusLabel|created":[""],"CiStatusLabel|failed":[""],"CiStatusLabel|manual action":[""],"CiStatusLabel|passed":[""],"CiStatusLabel|passed with warnings":[""],"CiStatusLabel|pending":[""],"CiStatusLabel|skipped":[""],"CiStatusLabel|waiting for manual action":[""],"CiStatusText|blocked":[""],"CiStatusText|canceled":[""],"CiStatusText|created":[""],"CiStatusText|failed":[""],"CiStatusText|manual":[""],"CiStatusText|passed":[""],"CiStatusText|pending":[""],"CiStatusText|skipped":[""],"CiStatus|running":[""],"Commit":["Commit","Commits"],"CommitMessage|Add %{file_name}":[""],"Commits":["Commits"],"Commits|History":["Commits"],"Compare":[""],"Contribution guide":[""],"Contributors":[""],"Copy URL to clipboard":[""],"Copy commit SHA to clipboard":[""],"Create New Directory":[""],"Create directory":[""],"Create empty bare repository":[""],"Create merge request":[""],"CreateNewFork|Fork":[""],"Custom notification events":[""],"Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}.":[""],"Cycle Analytics":[""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["Cycle Analytics liefern einen Überblick darüber, wie viel Zeit in Ihrem Projekt von einer Idee bis zum Produktivdeployment vergeht."],"CycleAnalyticsStage|Code":["Code"],"CycleAnalyticsStage|Issue":["Issue"],"CycleAnalyticsStage|Plan":["Planung"],"CycleAnalyticsStage|Production":["Produktiv"],"CycleAnalyticsStage|Review":["Review"],"CycleAnalyticsStage|Staging":["Staging"],"CycleAnalyticsStage|Test":["Test"],"Deploy":["Deployment","Deployments"],"Directory name":[""],"Don't show again":[""],"Download tar":[""],"Download tar.bz2":[""],"Download tar.gz":[""],"Download zip":[""],"DownloadArtifacts|Download":[""],"DownloadSource|Download":[""],"Files":[""],"Find by path":[""],"Find file":[""],"FirstPushedBy|First":["Erster"],"FirstPushedBy|pushed by":["gepusht von"],"ForkedFromProjectPath|Forked from":[""],"Forks":[""],"From issue creation until deploy to production":["Vom Anlegen des Issues bis zum Produktivdeployment"],"From merge request merge until deploy to production":["Vom Merge Request bis zum Produktivdeployment"],"Go to your fork":[""],"GoToYourFork|Fork":[""],"Home":[""],"Housekeeping successfully started":[""],"Import repository":[""],"Introducing Cycle Analytics":["Was sind Cycle Analytics?"],"LFSStatus|Disabled":[""],"LFSStatus|Enabled":[""],"Last %d day":["Letzter %d Tag","Letzten %d Tage"],"Last Update":[""],"Last commit":[""],"Leave group":[""],"Leave project":[""],"Limited to showing %d event at most":["Eingeschränkt auf maximal %d Ereignis","Eingeschränkt auf maximal %d Ereignisse"],"Median":["Median"],"MissingSSHKeyWarningLink|add an SSH key":[""],"New Issue":["Neues Issue","Neue Issues"],"New branch":[""],"New directory":[""],"New file":[""],"New issue":["Neues Issue"],"New merge request":[""],"New snippet":[""],"New tag":[""],"No repository":[""],"Not available":["Nicht verfügbar"],"Not enough data":["Nicht genügend Daten"],"Notification events":[""],"NotificationEvent|Close issue":[""],"NotificationEvent|Close merge request":[""],"NotificationEvent|Failed pipeline":[""],"NotificationEvent|Merge merge request":[""],"NotificationEvent|New issue":[""],"NotificationEvent|New merge request":[""],"NotificationEvent|New note":[""],"NotificationEvent|Reassign issue":[""],"NotificationEvent|Reassign merge request":[""],"NotificationEvent|Reopen issue":[""],"NotificationEvent|Successful pipeline":[""],"NotificationLevel|Custom":[""],"NotificationLevel|Disabled":[""],"NotificationLevel|Global":[""],"NotificationLevel|On mention":[""],"NotificationLevel|Participate":[""],"NotificationLevel|Watch":[""],"OpenedNDaysAgo|Opened":["Erstellt"],"Pipeline Health":["Pipeline Kennzahlen"],"Project '%{project_name}' queued for deletion.":[""],"Project '%{project_name}' was successfully created.":[""],"Project '%{project_name}' was successfully updated.":[""],"Project '%{project_name}' will be deleted.":[""],"Project access must be granted explicitly to each user.":[""],"Project export could not be deleted.":[""],"Project export has been deleted.":[""],"Project export link has expired. Please generate a new export from your project settings.":[""],"Project export started. A download link will be sent by email.":[""],"Project home":[""],"ProjectFeature|Disabled":[""],"ProjectFeature|Everyone with access":[""],"ProjectFeature|Only team members":[""],"ProjectFileTree|Name":[""],"ProjectLastActivity|Never":[""],"ProjectLifecycle|Stage":["Phase"],"ProjectNetworkGraph|Graph":[""],"Read more":["Mehr"],"Readme":[""],"RefSwitcher|Branches":[""],"RefSwitcher|Tags":[""],"Related Commits":["Zugehörige Commits"],"Related Deployed Jobs":["Zugehörige Deploymentjobs"],"Related Issues":["Zugehörige Issues"],"Related Jobs":["Zugehörige Jobs"],"Related Merge Requests":["Zugehörige Merge Requests"],"Related Merged Requests":["Zugehörige abgeschlossene Merge Requests"],"Remind later":[""],"Remove project":[""],"Request Access":[""],"Search branches and tags":[""],"Select Archive Format":[""],"Set a password on your account to pull or push via %{protocol}":[""],"Set up CI":[""],"Set up Koding":[""],"Set up auto deploy":[""],"SetPasswordToCloneLink|set a password":[""],"Showing %d event":["Zeige %d Ereignis","Zeige %d Ereignisse"],"Source code":[""],"StarProject|Star":[""],"Switch branch/tag":[""],"Tag":["",""],"Tags":[""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["Die Code-Phase stellt die Zeit vom ersten Commit bis zum Erstellen eines Merge Requests dar. Sobald Sie Ihren ersten Merge Request anlegen, werden dessen Daten automatisch ergänzt."],"The collection of events added to the data gathered for that stage.":["Ereignisse, die für diese Phase ausgewertet wurden."],"The fork relationship has been removed.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["Die Issue-Phase stellt die Zeit vom Anlegen eines Issues bis zum Zuweisen eines Meilensteins oder Hinzufügen zum Issue Board dar. Erstellen Sie einen Issue, damit dessen Daten hier erscheinen."],"The phase of the development lifecycle.":["Die Phase im Entwicklungsprozess."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["Die Planungsphase stellt die Zeit von der vorherigen Phase bis zum Pushen des ersten Commits dar. Sobald Sie den ersten Commit pushen, werden dessen Daten hier erscheinen."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["Die Produktiv-Phase stellt die Gesamtzeit vom Anlegen eines Issues bis zum Deployment auf dem Produktivsystem dar. Sobald Sie den vollständigen Entwicklungszyklus von einer Idee bis zum Produktivdeployment durchlaufen haben, erscheinen die zugehörigen Daten hier."],"The project can be accessed by any logged in user.":[""],"The project can be accessed without any authentication.":[""],"The repository for this project does not exist.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["Die Review-Phase stellt die Zeit vom Anlegen eines Merge Requests bis zum Mergen dar. Sobald Sie Ihren ersten Merge Request abschließen, werden dessen Daten hier automatisch angezeigt."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["Die Staging-Phase stellt die Zeit zwischen Mergen eines Merge Requests und dem Produktivdeployment dar. Sobald Sie das erste Produktivdeployment durchgeführt haben, werden dessen Daten hier automatisch angezeigt."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["Die Test-Phase stellt die Zeit dar, die GitLab CI benötigt um die Pipelines von Merge Requests abzuarbeiten. Sobald die erste Pipeline abgeschlossen ist, werden deren Daten hier automatisch angezeigt."],"The time taken by each data entry gathered by that stage.":["Zeit die für das jeweilige Ereignis in der Phase ermittelt wurde."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["Der mittlere aller erfassten Werte. Zum Beispiel ist für 3, 5, 9 der Median 5. Bei 3, 5, 7, 8 ist der Median (5+7)/2 = 6."],"This means you can not push code until you create an empty repository or import existing one.":[""],"Time before an issue gets scheduled":["Zeit bis ein Issue geplant wird"],"Time before an issue starts implementation":["Zeit bis die Implementierung für ein Issue beginnt"],"Time between merge request creation and merge/close":["Zeit zwischen Anlegen und Mergen/Schließen eines Merge Requests"],"Time until first merge request":["Zeit bis zum ersten Merge Request"],"Timeago|%s days ago":[""],"Timeago|%s days remaining":[""],"Timeago|%s hours remaining":[""],"Timeago|%s minutes ago":[""],"Timeago|%s minutes remaining":[""],"Timeago|%s months ago":[""],"Timeago|%s months remaining":[""],"Timeago|%s seconds remaining":[""],"Timeago|%s weeks ago":[""],"Timeago|%s weeks remaining":[""],"Timeago|%s years ago":[""],"Timeago|%s years remaining":[""],"Timeago|1 day remaining":[""],"Timeago|1 hour remaining":[""],"Timeago|1 minute remaining":[""],"Timeago|1 month remaining":[""],"Timeago|1 week remaining":[""],"Timeago|1 year remaining":[""],"Timeago|Past due":[""],"Timeago|a day ago":[""],"Timeago|a month ago":[""],"Timeago|a week ago":[""],"Timeago|a while":[""],"Timeago|a year ago":[""],"Timeago|about %s hours ago":[""],"Timeago|about a minute ago":[""],"Timeago|about an hour ago":[""],"Timeago|in %s days":[""],"Timeago|in %s hours":[""],"Timeago|in %s minutes":[""],"Timeago|in %s months":[""],"Timeago|in %s seconds":[""],"Timeago|in %s weeks":[""],"Timeago|in %s years":[""],"Timeago|in 1 day":[""],"Timeago|in 1 hour":[""],"Timeago|in 1 minute":[""],"Timeago|in 1 month":[""],"Timeago|in 1 week":[""],"Timeago|in 1 year":[""],"Timeago|less than a minute ago":[""],"Time|hr":["h","h"],"Time|min":["min","min"],"Time|s":["s"],"Total Time":["Gesamtzeit"],"Total test time for all commits/merges":["Gesamte Testlaufzeit für alle Commits/Merges"],"Unstar":[""],"Upload New File":[""],"Upload file":[""],"Use your global notification setting":[""],"VisibilityLevel|Internal":[""],"VisibilityLevel|Private":[""],"VisibilityLevel|Public":[""],"Want to see the data? Please ask an administrator for access.":["Um diese Daten einsehen zu können, wenden Sie sich bitte an Ihren Administrator."],"We don't have enough data to show this stage.":["Es liegen nicht genügend Daten vor, um diese Phase anzuzeigen."],"Withdraw Access Request":[""],"You are going to remove %{project_name_with_namespace}.\\nRemoved project CANNOT be restored!\\nAre you ABSOLUTELY sure?":[""],"You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?":[""],"You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?":[""],"You can only add files when you are on a branch":[""],"You must sign in to star a project":[""],"You need permission.":["Sie benötigen Zugriffsrechte."],"You will not get any notifications via email":[""],"You will only receive notifications for the events you choose":[""],"You will only receive notifications for threads you have participated in":[""],"You will receive notifications for any activity":[""],"You will receive notifications only for comments in which you were @mentioned":[""],"You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account":[""],"You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile":[""],"Your name":[""],"committed":[""],"day":["Tag","Tage"],"notification emails":[""]}}}; \ No newline at end of file diff --git a/app/assets/javascripts/locale/en/app.js b/app/assets/javascripts/locale/en/app.js index ade9b667b3c..80203308b00 100644 --- a/app/assets/javascripts/locale/en/app.js +++ b/app/assets/javascripts/locale/en/app.js @@ -1 +1 @@ -var locales = locales || {}; locales['en'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-04-12 22:36-0500","Last-Translator":"FULL NAME ","Language-Team":"English","Language":"en","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","lang":"en","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"ByAuthor|by":[""],"Commit":["",""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":[""],"CycleAnalyticsStage|Code":[""],"CycleAnalyticsStage|Issue":[""],"CycleAnalyticsStage|Plan":[""],"CycleAnalyticsStage|Production":[""],"CycleAnalyticsStage|Review":[""],"CycleAnalyticsStage|Staging":[""],"CycleAnalyticsStage|Test":[""],"Deploy":["",""],"FirstPushedBy|First":[""],"FirstPushedBy|pushed by":[""],"From issue creation until deploy to production":[""],"From merge request merge until deploy to production":[""],"Introducing Cycle Analytics":[""],"Last %d day":["",""],"Limited to showing %d event at most":["",""],"Median":[""],"New Issue":["",""],"Not available":[""],"Not enough data":[""],"OpenedNDaysAgo|Opened":[""],"Pipeline Health":[""],"ProjectLifecycle|Stage":[""],"Read more":[""],"Related Commits":[""],"Related Deployed Jobs":[""],"Related Issues":[""],"Related Jobs":[""],"Related Merge Requests":[""],"Related Merged Requests":[""],"Showing %d event":["",""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":[""],"The collection of events added to the data gathered for that stage.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":[""],"The phase of the development lifecycle.":[""],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":[""],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":[""],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":[""],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":[""],"The time taken by each data entry gathered by that stage.":[""],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":[""],"Time before an issue gets scheduled":[""],"Time before an issue starts implementation":[""],"Time between merge request creation and merge/close":[""],"Time until first merge request":[""],"Time|hr":["",""],"Time|min":["",""],"Time|s":[""],"Total Time":[""],"Total test time for all commits/merges":[""],"Want to see the data? Please ask an administrator for access.":[""],"We don't have enough data to show this stage.":[""],"You need permission.":[""],"day":["",""]}}}; \ No newline at end of file +var locales = locales || {}; locales['en'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-06-07 12:14+0200","Language-Team":"English","Language":"en","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","Last-Translator":"Bob Van Landuyt ","X-Generator":"Poedit 2.0.2","lang":"en","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"About auto deploy":[""],"Activity":[""],"Add Changelog":[""],"Add Contribution guide":[""],"Add License":[""],"Add an SSH key to your profile to pull or push via SSH.":[""],"Add new directory":[""],"Archived project! Repository is read-only":[""],"Branch":["",""],"Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}":[""],"Branches":[""],"ByAuthor|by":[""],"CI configuration":[""],"Changelog":[""],"Charts":[""],"CiStatusLabel|canceled":[""],"CiStatusLabel|created":[""],"CiStatusLabel|failed":[""],"CiStatusLabel|manual action":[""],"CiStatusLabel|passed":[""],"CiStatusLabel|passed with warnings":[""],"CiStatusLabel|pending":[""],"CiStatusLabel|skipped":[""],"CiStatusLabel|waiting for manual action":[""],"CiStatusText|blocked":[""],"CiStatusText|canceled":[""],"CiStatusText|created":[""],"CiStatusText|failed":[""],"CiStatusText|manual":[""],"CiStatusText|passed":[""],"CiStatusText|pending":[""],"CiStatusText|skipped":[""],"CiStatus|running":[""],"Commit":["",""],"CommitMessage|Add %{file_name}":[""],"Commits":[""],"Commits|History":[""],"Compare":[""],"Contribution guide":[""],"Contributors":[""],"Copy URL to clipboard":[""],"Copy commit SHA to clipboard":[""],"Create New Directory":[""],"Create directory":[""],"Create empty bare repository":[""],"Create merge request":[""],"CreateNewFork|Fork":[""],"Custom notification events":[""],"Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}.":[""],"Cycle Analytics":[""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":[""],"CycleAnalyticsStage|Code":[""],"CycleAnalyticsStage|Issue":[""],"CycleAnalyticsStage|Plan":[""],"CycleAnalyticsStage|Production":[""],"CycleAnalyticsStage|Review":[""],"CycleAnalyticsStage|Staging":[""],"CycleAnalyticsStage|Test":[""],"Deploy":["",""],"Directory name":[""],"Don't show again":[""],"Download tar":[""],"Download tar.bz2":[""],"Download tar.gz":[""],"Download zip":[""],"DownloadArtifacts|Download":[""],"DownloadSource|Download":[""],"Files":[""],"Find by path":[""],"Find file":[""],"FirstPushedBy|First":[""],"FirstPushedBy|pushed by":[""],"ForkedFromProjectPath|Forked from":[""],"Forks":[""],"From issue creation until deploy to production":[""],"From merge request merge until deploy to production":[""],"Go to your fork":[""],"GoToYourFork|Fork":[""],"Home":[""],"Housekeeping successfully started":[""],"Import repository":[""],"Introducing Cycle Analytics":[""],"LFSStatus|Disabled":[""],"LFSStatus|Enabled":[""],"Last %d day":["",""],"Last Update":[""],"Last commit":[""],"Leave group":[""],"Leave project":[""],"Limited to showing %d event at most":["",""],"Median":[""],"MissingSSHKeyWarningLink|add an SSH key":[""],"New Issue":["",""],"New branch":[""],"New directory":[""],"New file":[""],"New issue":[""],"New merge request":[""],"New snippet":[""],"New tag":[""],"No repository":[""],"Not available":[""],"Not enough data":[""],"Notification events":[""],"NotificationEvent|Close issue":[""],"NotificationEvent|Close merge request":[""],"NotificationEvent|Failed pipeline":[""],"NotificationEvent|Merge merge request":[""],"NotificationEvent|New issue":[""],"NotificationEvent|New merge request":[""],"NotificationEvent|New note":[""],"NotificationEvent|Reassign issue":[""],"NotificationEvent|Reassign merge request":[""],"NotificationEvent|Reopen issue":[""],"NotificationEvent|Successful pipeline":[""],"NotificationLevel|Custom":[""],"NotificationLevel|Disabled":[""],"NotificationLevel|Global":[""],"NotificationLevel|On mention":[""],"NotificationLevel|Participate":[""],"NotificationLevel|Watch":[""],"OpenedNDaysAgo|Opened":[""],"Pipeline Health":[""],"Project '%{project_name}' queued for deletion.":[""],"Project '%{project_name}' was successfully created.":[""],"Project '%{project_name}' was successfully updated.":[""],"Project '%{project_name}' will be deleted.":[""],"Project access must be granted explicitly to each user.":[""],"Project export could not be deleted.":[""],"Project export has been deleted.":[""],"Project export link has expired. Please generate a new export from your project settings.":[""],"Project export started. A download link will be sent by email.":[""],"Project home":[""],"ProjectFeature|Disabled":[""],"ProjectFeature|Everyone with access":[""],"ProjectFeature|Only team members":[""],"ProjectFileTree|Name":[""],"ProjectLastActivity|Never":[""],"ProjectLifecycle|Stage":[""],"ProjectNetworkGraph|Graph":[""],"Read more":[""],"Readme":[""],"RefSwitcher|Branches":[""],"RefSwitcher|Tags":[""],"Related Commits":[""],"Related Deployed Jobs":[""],"Related Issues":[""],"Related Jobs":[""],"Related Merge Requests":[""],"Related Merged Requests":[""],"Remind later":[""],"Remove project":[""],"Request Access":[""],"Search branches and tags":[""],"Select Archive Format":[""],"Set a password on your account to pull or push via %{protocol}":[""],"Set up CI":[""],"Set up Koding":[""],"Set up auto deploy":[""],"SetPasswordToCloneLink|set a password":[""],"Showing %d event":["",""],"Source code":[""],"StarProject|Star":[""],"Switch branch/tag":[""],"Tag":["",""],"Tags":[""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":[""],"The collection of events added to the data gathered for that stage.":[""],"The fork relationship has been removed.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":[""],"The phase of the development lifecycle.":[""],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":[""],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":[""],"The project can be accessed by any logged in user.":[""],"The project can be accessed without any authentication.":[""],"The repository for this project does not exist.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":[""],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":[""],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":[""],"The time taken by each data entry gathered by that stage.":[""],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":[""],"This means you can not push code until you create an empty repository or import existing one.":[""],"Time before an issue gets scheduled":[""],"Time before an issue starts implementation":[""],"Time between merge request creation and merge/close":[""],"Time until first merge request":[""],"Timeago|%s days ago":[""],"Timeago|%s days remaining":[""],"Timeago|%s hours remaining":[""],"Timeago|%s minutes ago":[""],"Timeago|%s minutes remaining":[""],"Timeago|%s months ago":[""],"Timeago|%s months remaining":[""],"Timeago|%s seconds remaining":[""],"Timeago|%s weeks ago":[""],"Timeago|%s weeks remaining":[""],"Timeago|%s years ago":[""],"Timeago|%s years remaining":[""],"Timeago|1 day remaining":[""],"Timeago|1 hour remaining":[""],"Timeago|1 minute remaining":[""],"Timeago|1 month remaining":[""],"Timeago|1 week remaining":[""],"Timeago|1 year remaining":[""],"Timeago|Past due":[""],"Timeago|a day ago":[""],"Timeago|a month ago":[""],"Timeago|a week ago":[""],"Timeago|a while":[""],"Timeago|a year ago":[""],"Timeago|about %s hours ago":[""],"Timeago|about a minute ago":[""],"Timeago|about an hour ago":[""],"Timeago|in %s days":[""],"Timeago|in %s hours":[""],"Timeago|in %s minutes":[""],"Timeago|in %s months":[""],"Timeago|in %s seconds":[""],"Timeago|in %s weeks":[""],"Timeago|in %s years":[""],"Timeago|in 1 day":[""],"Timeago|in 1 hour":[""],"Timeago|in 1 minute":[""],"Timeago|in 1 month":[""],"Timeago|in 1 week":[""],"Timeago|in 1 year":[""],"Timeago|less than a minute ago":[""],"Time|hr":["",""],"Time|min":["",""],"Time|s":[""],"Total Time":[""],"Total test time for all commits/merges":[""],"Unstar":[""],"Upload New File":[""],"Upload file":[""],"Use your global notification setting":[""],"VisibilityLevel|Internal":[""],"VisibilityLevel|Private":[""],"VisibilityLevel|Public":[""],"Want to see the data? Please ask an administrator for access.":[""],"We don't have enough data to show this stage.":[""],"Withdraw Access Request":[""],"You are going to remove %{project_name_with_namespace}.\\nRemoved project CANNOT be restored!\\nAre you ABSOLUTELY sure?":[""],"You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?":[""],"You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?":[""],"You can only add files when you are on a branch":[""],"You must sign in to star a project":[""],"You need permission.":[""],"You will not get any notifications via email":[""],"You will only receive notifications for the events you choose":[""],"You will only receive notifications for threads you have participated in":[""],"You will receive notifications for any activity":[""],"You will receive notifications only for comments in which you were @mentioned":[""],"You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account":[""],"You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile":[""],"Your name":[""],"committed":[""],"day":["",""],"notification emails":[""]}}}; \ No newline at end of file diff --git a/app/assets/javascripts/locale/es/app.js b/app/assets/javascripts/locale/es/app.js index f5f510d7c2b..6977625f4d8 100644 --- a/app/assets/javascripts/locale/es/app.js +++ b/app/assets/javascripts/locale/es/app.js @@ -1 +1 @@ -var locales = locales || {}; locales['es'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-05-20 22:37-0500","Language-Team":"Spanish","Language":"es","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","Last-Translator":"","X-Generator":"Poedit 2.0.1","lang":"es","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"ByAuthor|by":["por"],"Commit":["Cambio","Cambios"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["Cycle Analytics ofrece una visión general de cuánto tiempo tarda en pasar de idea a producción en su proyecto."],"CycleAnalyticsStage|Code":["Código"],"CycleAnalyticsStage|Issue":["Incidencia"],"CycleAnalyticsStage|Plan":["Planificación"],"CycleAnalyticsStage|Production":["Producción"],"CycleAnalyticsStage|Review":["Revisión"],"CycleAnalyticsStage|Staging":["Puesta en escena"],"CycleAnalyticsStage|Test":["Pruebas"],"Deploy":["Despliegue","Despliegues"],"FirstPushedBy|First":["Primer"],"FirstPushedBy|pushed by":["enviado por"],"From issue creation until deploy to production":["Desde la creación de la incidencia hasta el despliegue a producción"],"From merge request merge until deploy to production":["Desde la integración de la solicitud de fusión hasta el despliegue a producción"],"Introducing Cycle Analytics":["Introducción a Cycle Analytics"],"Last %d day":["Último %d día","Últimos %d días"],"Limited to showing %d event at most":["Limitado a mostrar máximo %d evento","Limitado a mostrar máximo %d eventos"],"Median":["Mediana"],"New Issue":["Nueva incidencia","Nuevas incidencias"],"Not available":["No disponible"],"Not enough data":["No hay suficientes datos"],"OpenedNDaysAgo|Opened":["Abierto"],"Pipeline Health":["Estado del Pipeline"],"ProjectLifecycle|Stage":["Etapa"],"Read more":["Leer más"],"Related Commits":["Cambios Relacionados"],"Related Deployed Jobs":["Trabajos Desplegados Relacionados"],"Related Issues":["Incidencias Relacionadas"],"Related Jobs":["Trabajos Relacionados"],"Related Merge Requests":["Solicitudes de fusión Relacionadas"],"Related Merged Requests":["Solicitudes de fusión Relacionadas"],"Showing %d event":["Mostrando %d evento","Mostrando %d eventos"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["La etapa de desarrollo muestra el tiempo desde el primer cambio hasta la creación de la solicitud de fusión. Los datos serán automáticamente incorporados aquí una vez creada tu primera solicitud de fusión."],"The collection of events added to the data gathered for that stage.":["La colección de eventos agregados a los datos recopilados para esa etapa."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["La etapa de incidencia muestra el tiempo que toma desde la creación de un tema hasta asignar el tema a un hito, o añadir el tema a una lista en el panel de temas. Empieza a crear temas para ver los datos de esta etapa."],"The phase of the development lifecycle.":["La etapa del ciclo de vida de desarrollo."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["La etapa de planificación muestra el tiempo desde el paso anterior hasta el envío de tu primera confirmación. Este tiempo se añadirá automáticamente una vez que usted envíe el primer cambio."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["La etapa de producción muestra el tiempo total que tarda entre la creación de una incidencia y el despliegue del código a producción. Los datos se añadirán automáticamente una vez haya finalizado por completo el ciclo de idea a producción."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["La etapa de revisión muestra el tiempo desde la creación de la solicitud de fusión hasta que los cambios se fusionaron. Los datos se añadirán automáticamente después de fusionar su primera solicitud de fusión."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["La etapa de puesta en escena muestra el tiempo entre la fusión y el despliegue de código en el entorno de producción. Los datos se añadirán automáticamente una vez que se despliega a producción por primera vez."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["La etapa de pruebas muestra el tiempo que GitLab CI toma para ejecutar cada pipeline para la solicitud de fusión relacionada. Los datos se añadirán automáticamente luego de que el primer pipeline termine de ejecutarse."],"The time taken by each data entry gathered by that stage.":["El tiempo utilizado por cada entrada de datos obtenido por esa etapa."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["El valor en el punto medio de una serie de valores observados. Por ejemplo, entre 3, 5, 9, la mediana es 5. Entre 3, 5, 7, 8, la mediana es (5 + 7) / 2 = 6."],"Time before an issue gets scheduled":["Tiempo antes de que una incidencia sea programada"],"Time before an issue starts implementation":["Tiempo antes de que empieze la implementación de una incidencia"],"Time between merge request creation and merge/close":["Tiempo entre la creación de la solicitud de fusión y la integración o cierre de ésta"],"Time until first merge request":["Tiempo hasta la primera solicitud de fusión"],"Time|hr":["hr","hrs"],"Time|min":["min","mins"],"Time|s":["s"],"Total Time":["Tiempo Total"],"Total test time for all commits/merges":["Tiempo total de pruebas para todos los cambios o integraciones"],"Want to see the data? Please ask an administrator for access.":["¿Quieres ver los datos? Por favor pide acceso al administrador."],"We don't have enough data to show this stage.":["No hay suficientes datos para mostrar en esta etapa."],"You need permission.":["Necesitas permisos."],"day":["día","días"]}}}; \ No newline at end of file +var locales = locales || {}; locales['es'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-06-07 12:29-0500","Language-Team":"Spanish","Language":"es","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","Last-Translator":"Bob Van Landuyt ","X-Generator":"Poedit 2.0.2","lang":"es","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"About auto deploy":["Acerca del auto despliegue"],"Activity":["Actividad"],"Add Changelog":["Agregar Changelog"],"Add Contribution guide":["Agregar guía de contribución"],"Add License":["Agregar Licencia"],"Add an SSH key to your profile to pull or push via SSH.":["Agregar una clave SSH a tu perfil para actualizar o enviar a través de SSH."],"Add new directory":["Agregar nuevo directorio"],"Archived project! Repository is read-only":["¡Proyecto archivado! El repositorio es de sólo lectura"],"Branch":["Rama","Ramas"],"Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}":["La rama %{branch_name} fue creada. Para configurar el auto despliegue, escoge una plantilla Yaml para GitLab CI y envía tus cambios. %{link_to_autodeploy_doc}"],"Branches":["Ramas"],"ByAuthor|by":["por"],"CI configuration":["Configuración de CI"],"Changelog":["Changelog"],"Charts":["Gráficos"],"CiStatusLabel|canceled":["cancelado"],"CiStatusLabel|created":["creado"],"CiStatusLabel|failed":["fallado"],"CiStatusLabel|manual action":["acción manual"],"CiStatusLabel|passed":["pasó"],"CiStatusLabel|passed with warnings":["pasó con advertencias"],"CiStatusLabel|pending":["pendiente"],"CiStatusLabel|skipped":["omitido"],"CiStatusLabel|waiting for manual action":["esperando acción manual"],"CiStatusText|blocked":["bloqueado"],"CiStatusText|canceled":["cancelado"],"CiStatusText|created":["creado"],"CiStatusText|failed":["fallado"],"CiStatusText|manual":["manual"],"CiStatusText|passed":["pasó"],"CiStatusText|pending":["pendiente"],"CiStatusText|skipped":["omitido"],"CiStatus|running":["en ejecución"],"Commit":["Cambio","Cambios"],"CommitMessage|Add %{file_name}":["Agregar %{file_name}"],"Commits":["Cambios"],"Commits|History":["Historial"],"Compare":["Comparar"],"Contribution guide":["Guía de contribución"],"Contributors":["Contribuidores"],"Copy URL to clipboard":["Copiar URL al portapapeles"],"Copy commit SHA to clipboard":["Copiar SHA del cambio al portapapeles"],"Create New Directory":["Crear Nuevo Directorio"],"Create directory":["Crear directorio"],"Create empty bare repository":["Crear repositorio vacío"],"Create merge request":["Crear solicitud de fusión"],"CreateNewFork|Fork":["Bifurcar"],"Custom notification events":["Eventos de notificaciones personalizadas"],"Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}.":["Los niveles de notificación personalizados son los mismos que los niveles participantes. Con los niveles de notificación personalizados, también recibirá notificaciones para eventos seleccionados. Para obtener más información, consulte %{notification_link}."],"Cycle Analytics":["Cycle Analytics"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["Cycle Analytics ofrece una visión general de cuánto tiempo tarda en pasar de idea a producción en su proyecto."],"CycleAnalyticsStage|Code":["Código"],"CycleAnalyticsStage|Issue":["Incidencia"],"CycleAnalyticsStage|Plan":["Planificación"],"CycleAnalyticsStage|Production":["Producción"],"CycleAnalyticsStage|Review":["Revisión"],"CycleAnalyticsStage|Staging":["Puesta en escena"],"CycleAnalyticsStage|Test":["Pruebas"],"Deploy":["Despliegue","Despliegues"],"Directory name":["Nombre del directorio"],"Don't show again":["No mostrar de nuevo"],"Download tar":["Descargar tar"],"Download tar.bz2":["Descargar tar.bz2"],"Download tar.gz":["Descargar tar.gz"],"Download zip":["Descargar zip"],"DownloadArtifacts|Download":["Descargar"],"DownloadSource|Download":["Descargar"],"Files":["Archivos"],"Find by path":["Buscar por ruta"],"Find file":["Buscar archivo"],"FirstPushedBy|First":["Primer"],"FirstPushedBy|pushed by":["enviado por"],"ForkedFromProjectPath|Forked from":["Bifurcado de"],"Forks":["Bifurcaciones"],"From issue creation until deploy to production":["Desde la creación de la incidencia hasta el despliegue a producción"],"From merge request merge until deploy to production":["Desde la integración de la solicitud de fusión hasta el despliegue a producción"],"Go to your fork":["Ir a tu bifurcación"],"GoToYourFork|Fork":["Bifurcación"],"Home":["Inicio"],"Housekeeping successfully started":["Servicio de limpieza iniciado con éxito"],"Import repository":["Importar repositorio"],"Introducing Cycle Analytics":["Introducción a Cycle Analytics"],"LFSStatus|Disabled":["Deshabilitado"],"LFSStatus|Enabled":["Habilitado"],"Last %d day":["Último %d día","Últimos %d días"],"Last Update":["Última actualización"],"Last commit":["Último cambio"],"Leave group":["Abandonar grupo"],"Leave project":["Abandonar proyecto"],"Limited to showing %d event at most":["Limitado a mostrar máximo %d evento","Limitado a mostrar máximo %d eventos"],"Median":["Mediana"],"MissingSSHKeyWarningLink|add an SSH key":["agregar una clave SSH"],"New Issue":["Nueva incidencia","Nuevas incidencias"],"New branch":["Nueva rama"],"New directory":["Nuevo directorio"],"New file":["Nuevo archivo"],"New issue":["Nueva incidencia"],"New merge request":["Nueva solicitud de fusión"],"New snippet":["Nuevo fragmento de código"],"New tag":["Nueva etiqueta"],"No repository":["No hay repositorio"],"Not available":["No disponible"],"Not enough data":["No hay suficientes datos"],"Notification events":["Eventos de notificación"],"NotificationEvent|Close issue":["Cerrar incidencia"],"NotificationEvent|Close merge request":["Cerrar solicitud de fusión"],"NotificationEvent|Failed pipeline":["Pipeline fallido"],"NotificationEvent|Merge merge request":["Integrar solicitud de fusión"],"NotificationEvent|New issue":["Nueva incidencia"],"NotificationEvent|New merge request":["Nueva solicitud de fusión"],"NotificationEvent|New note":["Nueva nota"],"NotificationEvent|Reassign issue":["Reasignar incidencia"],"NotificationEvent|Reassign merge request":["Reasignar solicitud de fusión"],"NotificationEvent|Reopen issue":["Reabrir incidencia"],"NotificationEvent|Successful pipeline":["Pipeline exitoso"],"NotificationLevel|Custom":["Personalizado"],"NotificationLevel|Disabled":["Deshabilitado"],"NotificationLevel|Global":["Global"],"NotificationLevel|On mention":["Cuando me mencionan"],"NotificationLevel|Participate":["Participación"],"NotificationLevel|Watch":["Vigilancia"],"OpenedNDaysAgo|Opened":["Abierto"],"Pipeline Health":["Estado del Pipeline"],"Project '%{project_name}' queued for deletion.":["Proyecto ‘%{project_name}’ en cola para eliminación."],"Project '%{project_name}' was successfully created.":["Proyecto ‘%{project_name}’ fue creado satisfactoriamente."],"Project '%{project_name}' was successfully updated.":["Proyecto ‘%{project_name}’ fue actualizado satisfactoriamente."],"Project '%{project_name}' will be deleted.":["Proyecto ‘%{project_name}’ será eliminado."],"Project access must be granted explicitly to each user.":["El acceso al proyecto debe concederse explícitamente a cada usuario."],"Project export could not be deleted.":["No se pudo eliminar la exportación del proyecto."],"Project export has been deleted.":["La exportación del proyecto ha sido eliminada."],"Project export link has expired. Please generate a new export from your project settings.":["El enlace de exportación del proyecto ha caducado. Por favor, genera una nueva exportación desde la configuración del proyecto."],"Project export started. A download link will be sent by email.":["Se inició la exportación del proyecto. Se enviará un enlace de descarga por correo electrónico."],"Project home":["Inicio del proyecto"],"ProjectFeature|Disabled":["Deshabilitada"],"ProjectFeature|Everyone with access":["Todos con acceso"],"ProjectFeature|Only team members":["Solo miembros del equipo"],"ProjectFileTree|Name":["Nombre"],"ProjectLastActivity|Never":["Nunca"],"ProjectLifecycle|Stage":["Etapa"],"ProjectNetworkGraph|Graph":["Historial gráfico"],"Read more":["Leer más"],"Readme":["Readme"],"RefSwitcher|Branches":["Ramas"],"RefSwitcher|Tags":["Etiquetas"],"Related Commits":["Cambios Relacionados"],"Related Deployed Jobs":["Trabajos Desplegados Relacionados"],"Related Issues":["Incidencias Relacionadas"],"Related Jobs":["Trabajos Relacionados"],"Related Merge Requests":["Solicitudes de fusión Relacionadas"],"Related Merged Requests":["Solicitudes de fusión Relacionadas"],"Remind later":["Recordar después"],"Remove project":["Eliminar proyecto"],"Request Access":["Solicitar acceso"],"Search branches and tags":["Buscar ramas y etiquetas"],"Select Archive Format":["Seleccionar formato de archivo"],"Set a password on your account to pull or push via %{protocol}":["Establezca una contraseña en su cuenta para actualizar o enviar a través de% {protocol}"],"Set up CI":["Configurar CI"],"Set up Koding":["Configurar Koding"],"Set up auto deploy":["Configurar auto despliegue"],"SetPasswordToCloneLink|set a password":["establecer una contraseña"],"Showing %d event":["Mostrando %d evento","Mostrando %d eventos"],"Source code":["Código fuente"],"StarProject|Star":["Destacar"],"Switch branch/tag":["Cambiar rama/etiqueta"],"Tag":["Etiqueta","Etiquetas"],"Tags":["Etiquetas"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["La etapa de desarrollo muestra el tiempo desde el primer cambio hasta la creación de la solicitud de fusión. Los datos serán automáticamente incorporados aquí una vez creada tu primera solicitud de fusión."],"The collection of events added to the data gathered for that stage.":["La colección de eventos agregados a los datos recopilados para esa etapa."],"The fork relationship has been removed.":["La relación con la bifurcación se ha eliminado."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["La etapa de incidencia muestra el tiempo que toma desde la creación de un tema hasta asignar el tema a un hito, o añadir el tema a una lista en el panel de temas. Empieza a crear temas para ver los datos de esta etapa."],"The phase of the development lifecycle.":["La etapa del ciclo de vida de desarrollo."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["La etapa de planificación muestra el tiempo desde el paso anterior hasta el envío de tu primera confirmación. Este tiempo se añadirá automáticamente una vez que usted envíe el primer cambio."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["La etapa de producción muestra el tiempo total que tarda entre la creación de una incidencia y el despliegue del código a producción. Los datos se añadirán automáticamente una vez haya finalizado por completo el ciclo de idea a producción."],"The project can be accessed by any logged in user.":["El proyecto puede ser accedido por cualquier usuario conectado."],"The project can be accessed without any authentication.":["El proyecto puede accederse sin ninguna autenticación."],"The repository for this project does not exist.":["El repositorio para este proyecto no existe."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["La etapa de revisión muestra el tiempo desde la creación de la solicitud de fusión hasta que los cambios se fusionaron. Los datos se añadirán automáticamente después de fusionar su primera solicitud de fusión."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["La etapa de puesta en escena muestra el tiempo entre la fusión y el despliegue de código en el entorno de producción. Los datos se añadirán automáticamente una vez que se despliega a producción por primera vez."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["La etapa de pruebas muestra el tiempo que GitLab CI toma para ejecutar cada pipeline para la solicitud de fusión relacionada. Los datos se añadirán automáticamente luego de que el primer pipeline termine de ejecutarse."],"The time taken by each data entry gathered by that stage.":["El tiempo utilizado por cada entrada de datos obtenido por esa etapa."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["El valor en el punto medio de una serie de valores observados. Por ejemplo, entre 3, 5, 9, la mediana es 5. Entre 3, 5, 7, 8, la mediana es (5 + 7) / 2 = 6."],"This means you can not push code until you create an empty repository or import existing one.":["Esto significa que no puede enviar código hasta que cree un repositorio vacío o importe uno existente."],"Time before an issue gets scheduled":["Tiempo antes de que una incidencia sea programada"],"Time before an issue starts implementation":["Tiempo antes de que empieze la implementación de una incidencia"],"Time between merge request creation and merge/close":["Tiempo entre la creación de la solicitud de fusión y la integración o cierre de ésta"],"Time until first merge request":["Tiempo hasta la primera solicitud de fusión"],"Timeago|%s days ago":["hace %s días"],"Timeago|%s days remaining":["%s días restantes"],"Timeago|%s hours remaining":["%s horas restantes"],"Timeago|%s minutes ago":["hace %s minutos"],"Timeago|%s minutes remaining":["%s minutos restantes"],"Timeago|%s months ago":["hace %s meses"],"Timeago|%s months remaining":["%s meses restantes"],"Timeago|%s seconds remaining":["%s segundos restantes"],"Timeago|%s weeks ago":["hace %s semanas"],"Timeago|%s weeks remaining":["%s semanas restantes"],"Timeago|%s years ago":["hace %s años"],"Timeago|%s years remaining":["%s años restantes"],"Timeago|1 day remaining":["1 día restante"],"Timeago|1 hour remaining":["1 hora restante"],"Timeago|1 minute remaining":["1 minuto restante"],"Timeago|1 month remaining":["1 mes restante"],"Timeago|1 week remaining":["1 semana restante"],"Timeago|1 year remaining":["1 año restante"],"Timeago|Past due":["Atrasado"],"Timeago|a day ago":["hace un día"],"Timeago|a month ago":["hace 1 mes"],"Timeago|a week ago":["hace 1 semana"],"Timeago|a while":["hace un momento"],"Timeago|a year ago":["hace 1 año"],"Timeago|about %s hours ago":["hace alrededor de %s horas"],"Timeago|about a minute ago":["hace alrededor de 1 minuto"],"Timeago|about an hour ago":["hace alrededor de 1 hora"],"Timeago|in %s days":["en %s días"],"Timeago|in %s hours":["en %s horas"],"Timeago|in %s minutes":["en %s minutos"],"Timeago|in %s months":["en %s meses"],"Timeago|in %s seconds":["en %s segundos"],"Timeago|in %s weeks":["en %s semanas"],"Timeago|in %s years":["en %s años"],"Timeago|in 1 day":["en 1 día"],"Timeago|in 1 hour":["en 1 hora"],"Timeago|in 1 minute":["en 1 minuto"],"Timeago|in 1 month":["en 1 mes"],"Timeago|in 1 week":["en 1 semana"],"Timeago|in 1 year":["en 1 año"],"Timeago|less than a minute ago":["hace menos de 1 minuto"],"Time|hr":["hr","hrs"],"Time|min":["min","mins"],"Time|s":["s"],"Total Time":["Tiempo Total"],"Total test time for all commits/merges":["Tiempo total de pruebas para todos los cambios o integraciones"],"Unstar":["No Destacar"],"Upload New File":["Subir nuevo archivo"],"Upload file":["Subir archivo"],"Use your global notification setting":["Utiliza tu configuración de notificación global"],"VisibilityLevel|Internal":["Interno"],"VisibilityLevel|Private":["Privado"],"VisibilityLevel|Public":["Público"],"Want to see the data? Please ask an administrator for access.":["¿Quieres ver los datos? Por favor pide acceso al administrador."],"We don't have enough data to show this stage.":["No hay suficientes datos para mostrar en esta etapa."],"Withdraw Access Request":["Retirar Solicitud de Acceso"],"You are going to remove %{project_name_with_namespace}.\\nRemoved project CANNOT be restored!\\nAre you ABSOLUTELY sure?":["Va a eliminar %{project_name_with_namespace}.\\n¡El proyecto eliminado NO puede ser restaurado!\\n¿Estás TOTALMENTE seguro?"],"You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?":["Vas a eliminar el enlace de la bifurcación con el proyecto original %{forked_from_project}. ¿Estás TOTALMENTE seguro?"],"You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?":["Vas a transferir %{project_name_with_namespace} a otro propietario. ¿Estás TOTALMENTE seguro?"],"You can only add files when you are on a branch":["Sólo puede agregar archivos cuando estas en una rama"],"You must sign in to star a project":["Debes iniciar sesión para destacar un proyecto"],"You need permission.":["Necesitas permisos."],"You will not get any notifications via email":["No recibirás ninguna notificación por correo electrónico"],"You will only receive notifications for the events you choose":["Solo recibirás notificaciones de los eventos que elijas"],"You will only receive notifications for threads you have participated in":["Solo recibirás notificaciones de los temas en los que has participado"],"You will receive notifications for any activity":["Recibirás notificaciones para cualquier actividad"],"You will receive notifications only for comments in which you were @mentioned":["Recibirás notificaciones sólo para los comentarios en los que se te mencionó"],"You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account":["No podrás actualizar o enviar código al proyecto a través de %{protocol} hasta que %{set_password_link} en tu cuenta"],"You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile":["No podrás actualizar o enviar código al proyecto a través de SSH hasta que %{add_ssh_key_link} en su perfil"],"Your name":["Tu nombre"],"committed":["cambió"],"day":["día","días"],"notification emails":["correos electrónicos de notificación"]}}}; \ No newline at end of file diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index aada031f117..38ed7d776a7 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -34,7 +34,7 @@ class ProjectsController < Projects::ApplicationController redirect_to( project_path(@project), - notice: "Project '#{@project.name}' was successfully created." + notice: _("Project '%{project_name}' was successfully created.") % { project_name: @project.name } ) else render 'new' @@ -49,7 +49,7 @@ class ProjectsController < Projects::ApplicationController respond_to do |format| if result[:status] == :success - flash[:notice] = "Project '#{@project.name}' was successfully updated." + flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name } format.html do redirect_to(edit_project_path(@project)) end @@ -76,7 +76,7 @@ class ProjectsController < Projects::ApplicationController return access_denied! unless can?(current_user, :remove_fork_project, @project) if ::Projects::UnlinkForkService.new(@project, current_user).execute - flash[:notice] = 'The fork relationship has been removed.' + flash[:notice] = _('The fork relationship has been removed.') end end @@ -97,7 +97,7 @@ class ProjectsController < Projects::ApplicationController end if @project.pending_delete? - flash[:alert] = "Project #{@project.name} queued for deletion." + flash[:alert] = _("Project '%{project_name}' queued for deletion.") % { project_name: @project.name } end respond_to do |format| @@ -117,7 +117,7 @@ class ProjectsController < Projects::ApplicationController return access_denied! unless can?(current_user, :remove_project, @project) ::Projects::DestroyService.new(@project, current_user, {}).async_execute - flash[:alert] = "Project '#{@project.name_with_namespace}' will be deleted." + flash[:alert] = _("Project '%{project_name}' will be deleted.") % { project_name: @project.name_with_namespace } redirect_to dashboard_projects_path, status: 302 rescue Projects::DestroyService::DestroyError => ex @@ -156,7 +156,7 @@ class ProjectsController < Projects::ApplicationController redirect_to( project_path(@project), - notice: "Housekeeping successfully started" + notice: _("Housekeeping successfully started") ) rescue ::Projects::HousekeepingService::LeaseTaken => ex redirect_to( @@ -170,7 +170,7 @@ class ProjectsController < Projects::ApplicationController redirect_to( edit_project_path(@project), - notice: "Project export started. A download link will be sent by email." + notice: _("Project export started. A download link will be sent by email.") ) end @@ -182,16 +182,16 @@ class ProjectsController < Projects::ApplicationController else redirect_to( edit_project_path(@project), - alert: "Project export link has expired. Please generate a new export from your project settings." + alert: _("Project export link has expired. Please generate a new export from your project settings.") ) end end def remove_export if @project.remove_exports - flash[:notice] = "Project export has been deleted." + flash[:notice] = _("Project export has been deleted.") else - flash[:alert] = "Project export could not be deleted." + flash[:alert] = _("Project export could not be deleted.") end redirect_to(edit_project_path(@project)) end @@ -202,7 +202,7 @@ class ProjectsController < Projects::ApplicationController else redirect_to( edit_project_path(@project), - alert: "Project export could not be deleted." + alert: _("Project export could not be deleted.") ) end end @@ -220,13 +220,13 @@ class ProjectsController < Projects::ApplicationController branches = BranchesFinder.new(@repository, params).execute.map(&:name) options = { - 'Branches' => branches.take(100) + s_('RefSwitcher|Branches') => branches.take(100) } unless @repository.tag_count.zero? tags = TagsFinder.new(@repository, params).execute.map(&:name) - options['Tags'] = tags.take(100) + options[s_('RefSwitcher|Tags')] = tags.take(100) end # If reference is commit id - we should add it to branch/tag selectbox diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 0081bbd92b3..00464810054 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -61,7 +61,7 @@ module ButtonHelper html: true, placement: placement, container: 'body', - title: "Set a password on your account
    to pull or push via #{protocol}" + title: _("Set a password on your account to pull or push via %{protocol}") % { protocol: protocol } } end @@ -76,7 +76,7 @@ module ButtonHelper html: true, placement: placement, container: 'body', - title: 'Add an SSH key to your profile
    to pull or push via SSH.' + title: _('Add an SSH key to your profile to pull or push via SSH.') } end end diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 32b1e7822af..21c0eb8b54c 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -16,16 +16,18 @@ module CiStatusHelper return status.label end - case status - when 'success' - 'passed' - when 'success_with_warnings' - 'passed with warnings' - when 'manual' - 'waiting for manual action' - else - status - end + label = case status + when 'success' + 'passed' + when 'success_with_warnings' + 'passed with warnings' + when 'manual' + 'waiting for manual action' + else + status + end + translation = "CiStatusLabel|#{label}" + s_(translation) end def ci_text_for_status(status) @@ -35,13 +37,22 @@ module CiStatusHelper case status when 'success' - 'passed' + s_('CiStatusText|passed') when 'success_with_warnings' - 'passed' + s_('CiStatusText|passed') when 'manual' - 'blocked' + s_('CiStatusText|blocked') else - status + # All states are already being translated inside the detailed statuses: + # :running => Gitlab::Ci::Status::Running + # :skipped => Gitlab::Ci::Status::Skipped + # :failed => Gitlab::Ci::Status::Failed + # :success => Gitlab::Ci::Status::Success + # :canceled => Gitlab::Ci::Status::Canceled + # The following states are customized above: + # :manual => Gitlab::Ci::Status::Manual + status_translation = "CiStatusText|#{status}" + s_(status_translation) end end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 03cc8f2b6bd..fde961e2da4 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -21,30 +21,36 @@ module NotificationsHelper end def notification_title(level) + # Can be anything in `NotificationSetting.level: case level.to_sym when :participating - 'Participate' + s_('NotificationLevel|Participate') when :mention - 'On mention' + s_('NotificationLevel|On mention') else - level.to_s.titlecase + N_('NotificationLevel|Global') + N_('NotificationLevel|Watch') + N_('NotificationLevel|Disabled') + N_('NotificationLevel|Custom') + level = "NotificationLevel|#{level.to_s.humanize}" + s_(level) end end def notification_description(level) case level.to_sym when :participating - 'You will only receive notifications for threads you have participated in' + _('You will only receive notifications for threads you have participated in') when :mention - 'You will receive notifications only for comments in which you were @mentioned' + _('You will receive notifications only for comments in which you were @mentioned') when :watch - 'You will receive notifications for any activity' + _('You will receive notifications for any activity') when :disabled - 'You will not get any notifications via email' + _('You will not get any notifications via email') when :global - 'Use your global notification setting' + _('Use your global notification setting') when :custom - 'You will only receive notifications for the events you choose' + _('You will only receive notifications for the events you choose') end end @@ -76,11 +82,22 @@ module NotificationsHelper end def notification_event_name(event) + # All values from NotificationSetting::EMAIL_EVENTS case event when :success_pipeline - 'Successful pipeline' + s_('NotificationEvent|Successful pipeline') else - event.to_s.humanize + N_('NotificationEvent|New note') + N_('NotificationEvent|New issue') + N_('NotificationEvent|Reopen issue') + N_('NotificationEvent|Close issue') + N_('NotificationEvent|Reassign issue') + N_('NotificationEvent|New merge request') + N_('NotificationEvent|Close merge request') + N_('NotificationEvent|Reassign merge request') + N_('NotificationEvent|Merge merge request') + N_('NotificationEvent|Failed pipeline') + s_(event.to_s.humanize) end end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index f74e61c9481..7441b58fddb 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -70,15 +70,18 @@ module ProjectsHelper end def remove_project_message(project) - "You are going to remove #{project.name_with_namespace}.\n Removed project CANNOT be restored!\n Are you ABSOLUTELY sure?" + _("You are going to remove %{project_name_with_namespace}.\nRemoved project CANNOT be restored!\nAre you ABSOLUTELY sure?") % + { project_name_with_namespace: project.name_with_namespace } end def transfer_project_message(project) - "You are going to transfer #{project.name_with_namespace} to another owner. Are you ABSOLUTELY sure?" + _("You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?") % + { project_name_with_namespace: project.name_with_namespace } end def remove_fork_project_message(project) - "You are going to remove the fork relationship to source project #{@project.forked_from_project.name_with_namespace}. Are you ABSOLUTELY sure?" + _("You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?") % + { forked_from_project: @project.forked_from_project.name_with_namespace } end def project_nav_tabs @@ -143,7 +146,7 @@ module ProjectsHelper end options = options_for_select( - options, + options.invert, selected: highest_available_option || @project.project_feature.public_send(field), disabled: disabled_option ) @@ -159,12 +162,13 @@ module ProjectsHelper end def link_to_autodeploy_doc - link_to 'About auto deploy', help_page_path('ci/autodeploy/index'), target: '_blank' + link_to _('About auto deploy'), help_page_path('ci/autodeploy/index'), target: '_blank' end def autodeploy_flash_notice(branch_name) - "Branch #{truncate(sanitize(branch_name))} was created. To set up auto deploy, \ - choose a GitLab CI Yaml template and commit your changes. #{link_to_autodeploy_doc}".html_safe + translation = _("Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}") % + { branch_name: truncate(sanitize(branch_name)), link_to_autodeploy_doc: link_to_autodeploy_doc } + translation.html_safe end def project_list_cache_key(project) @@ -250,11 +254,11 @@ module ProjectsHelper def project_lfs_status(project) if project.lfs_enabled? content_tag(:span, class: 'lfs-enabled') do - 'Enabled' + s_('LFSStatus|Enabled') end else content_tag(:span, class: 'lfs-disabled') do - 'Disabled' + s_('LFSStatus|Disabled') end end end @@ -263,7 +267,7 @@ module ProjectsHelper if current_user current_user.name else - "Your name" + _("Your name") end end @@ -300,17 +304,18 @@ module ProjectsHelper if project.last_activity_at time_ago_with_tooltip(project.last_activity_at, placement: 'bottom', html_class: 'last_activity_time_ago') else - "Never" + s_("ProjectLastActivity|Never") end end def add_special_file_path(project, file_name:, commit_message: nil, branch_name: nil, context: nil) + commit_message ||= s_("CommitMessage|Add %{file_name}") % { file_name: file_name.downcase } namespace_project_new_blob_path( project.namespace, project, project.default_branch || 'master', file_name: file_name, - commit_message: commit_message || "Add #{file_name.downcase}", + commit_message: commit_message, branch_name: branch_name, context: context ) @@ -447,9 +452,9 @@ module ProjectsHelper def project_feature_options { - 'Disabled' => ProjectFeature::DISABLED, - 'Only team members' => ProjectFeature::PRIVATE, - 'Everyone with access' => ProjectFeature::ENABLED + ProjectFeature::DISABLED => s_('ProjectFeature|Disabled'), + ProjectFeature::PRIVATE => s_('ProjectFeature|Only team members'), + ProjectFeature::ENABLED => s_('ProjectFeature|Everyone with access') } end diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 50757b01538..35755bc149b 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -29,11 +29,11 @@ module VisibilityLevelHelper def project_visibility_level_description(level) case level when Gitlab::VisibilityLevel::PRIVATE - "Project access must be granted explicitly to each user." + _("Project access must be granted explicitly to each user.") when Gitlab::VisibilityLevel::INTERNAL - "The project can be accessed by any logged in user." + _("The project can be accessed by any logged in user.") when Gitlab::VisibilityLevel::PUBLIC - "The project can be accessed without any authentication." + _("The project can be accessed without any authentication.") end end @@ -81,7 +81,9 @@ module VisibilityLevelHelper end def visibility_level_label(level) - Project.visibility_levels.key(level) + # The visibility level can be: + # 'VisibilityLevel|Private', 'VisibilityLevel|Internal', 'VisibilityLevel|Public' + s_(Project.visibility_levels.key(level)) end def restricted_visibility_levels(show_all = false) diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 9e354987401..1ef0d524dbb 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -33,6 +33,7 @@ = webpack_bundle_tag "runtime" = webpack_bundle_tag "common" + = webpack_bundle_tag "locale" = webpack_bundle_tag "main" = webpack_bundle_tag "raven" if current_application_settings.clientside_sentry_enabled = webpack_bundle_tag "test" if Rails.env.test? diff --git a/app/views/projects/_find_file_link.html.haml b/app/views/projects/_find_file_link.html.haml index 3feb11645a0..c748ccf65e6 100644 --- a/app/views/projects/_find_file_link.html.haml +++ b/app/views/projects/_find_file_link.html.haml @@ -1,3 +1,3 @@ = link_to namespace_project_find_file_path(@project.namespace, @project, @ref), class: 'btn btn-grouped shortcuts-find-file', rel: 'nofollow' do = icon('search') - %span Find file + %span= _('Find file') diff --git a/app/views/projects/_head.html.haml b/app/views/projects/_head.html.haml index db08b77c8e0..dba84838a52 100644 --- a/app/views/projects/_head.html.haml +++ b/app/views/projects/_head.html.haml @@ -4,17 +4,14 @@ .nav-links.sub-nav.scrolling-tabs %ul{ class: container_class } = nav_link(path: 'projects#show') do - = link_to project_path(@project), title: 'Project home', class: 'shortcuts-project' do - %span - Home + = link_to project_path(@project), title: _('Project home'), class: 'shortcuts-project' do + %span= _('Home') = nav_link(path: 'projects#activity') do - = link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do - %span - Activity + = link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do + %span= _('Activity') - if can?(current_user, :read_cycle_analytics, @project) = nav_link(path: 'cycle_analytics#show') do - = link_to project_cycle_analytics_path(@project), title: 'Cycle Analytics', class: 'shortcuts-project-cycle-analytics' do - %span - Cycle Analytics + = link_to project_cycle_analytics_path(@project), title: _('Cycle Analytics'), class: 'shortcuts-project-cycle-analytics' do + %span= _('Cycle Analytics') diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 9a9fca78df3..873b3045ea9 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -14,7 +14,7 @@ - if forked_from_project = @project.forked_from_project %p - Forked from + #{ s_('ForkedFromProjectPath|Forked from') } = link_to project_path(forked_from_project) do = forked_from_project.namespace.try(:name) diff --git a/app/views/projects/_last_push.html.haml b/app/views/projects/_last_push.html.haml index e8b1940af2d..f1ef50d2de2 100644 --- a/app/views/projects/_last_push.html.haml +++ b/app/views/projects/_last_push.html.haml @@ -15,4 +15,4 @@ .pull-right = link_to new_mr_path_from_push_event(event), title: "New merge request", class: "btn btn-info btn-sm" do - Create merge request + #{ _('Create merge request') } diff --git a/app/views/projects/blob/_new_dir.html.haml b/app/views/projects/blob/_new_dir.html.haml index 7f470b890ba..40978583e8b 100644 --- a/app/views/projects/blob/_new_dir.html.haml +++ b/app/views/projects/blob/_new_dir.html.haml @@ -3,18 +3,18 @@ .modal-content .modal-header %a.close{ href: "#", "data-dismiss" => "modal" } × - %h3.page-title Create New Directory + %h3.page-title= _('Create New Directory') .modal-body = form_tag namespace_project_create_dir_path(@project.namespace, @project, @id), method: :post, remote: false, class: 'form-horizontal js-create-dir-form js-quick-submit js-requires-input' do .form-group - = label_tag :dir_name, 'Directory name', class: 'control-label' + = label_tag :dir_name, _('Directory name'), class: 'control-label' .col-sm-10 = text_field_tag :dir_name, params[:dir_name], required: true, class: 'form-control' - = render 'shared/new_commit_form', placeholder: "Add new directory" + = render 'shared/new_commit_form', placeholder: _("Add new directory") .form-actions - = submit_tag "Create directory", class: 'btn btn-create' + = submit_tag _("Create directory"), class: 'btn btn-create' = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" - unless can?(current_user, :push_code, @project) diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml index e2bddee0d13..3cf91bf07f7 100644 --- a/app/views/projects/buttons/_download.html.haml +++ b/app/views/projects/buttons/_download.html.haml @@ -2,29 +2,29 @@ - if !project.empty_repo? && can?(current_user, :download_code, project) .project-action-button.dropdown.inline> - %button.btn.has-tooltip{ title: 'Download', 'data-toggle' => 'dropdown', 'aria-label' => 'Download' } + %button.btn.has-tooltip{ title: 'Download', 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download') } = icon('download') = icon("caret-down") - %span.sr-only - Select Archive Format + %span.sr-only= _('Select Archive Format') %ul.dropdown-menu.dropdown-menu-align-right{ role: 'menu' } - %li.dropdown-header Source code + %li.dropdown-header + #{ _('Source code') } %li = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'zip'), rel: 'nofollow', download: '' do %i.fa.fa-download - %span Download zip + %span= _('Download zip') %li = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar.gz'), rel: 'nofollow', download: '' do %i.fa.fa-download - %span Download tar.gz + %span= _('Download tar.gz') %li = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar.bz2'), rel: 'nofollow', download: '' do %i.fa.fa-download - %span Download tar.bz2 + %span= _('Download tar.bz2') %li = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar'), rel: 'nofollow', download: '' do %i.fa.fa-download - %span Download tar + %span= _('Download tar') - if pipeline - artifacts = pipeline.builds.latest.with_artifacts @@ -39,4 +39,5 @@ %li = link_to latest_succeeded_namespace_project_artifacts_path(project.namespace, project, "#{ref}/download", job: job.name), rel: 'nofollow', download: '' do %i.fa.fa-download - %span Download '#{job.name}' + %span + #{ s_('DownloadArtifacts|Download') } '#{job.name}' diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml index 76a2e720b68..312c349da3a 100644 --- a/app/views/projects/buttons/_dropdown.html.haml +++ b/app/views/projects/buttons/_dropdown.html.haml @@ -12,19 +12,19 @@ %li = link_to new_namespace_project_issue_path(@project.namespace, @project) do = icon('exclamation-circle fw') - New issue + #{ _('New issue') } - if merge_project %li = link_to new_namespace_project_merge_request_path(merge_project.namespace, merge_project) do = icon('tasks fw') - New merge request + #{ _('New merge request') } - if can_create_snippet %li = link_to new_namespace_project_snippet_path(@project.namespace, @project) do = icon('file-text-o fw') - New snippet + #{ _('New snippet') } - if can_create_issue || merge_project || can_create_snippet %li.divider @@ -33,20 +33,20 @@ %li = link_to namespace_project_new_blob_path(@project.namespace, @project, @project.default_branch || 'master') do = icon('file fw') - New file + #{ _('New file') } %li = link_to new_namespace_project_branch_path(@project.namespace, @project) do = icon('code-fork fw') - New branch + #{ _('New branch') } %li = link_to new_namespace_project_tag_path(@project.namespace, @project) do = icon('tags fw') - New tag + #{ _('New tag') } - elsif current_user && current_user.already_forked?(@project) %li = link_to namespace_project_new_blob_path(@project.namespace, @project, @project.default_branch || 'master') do = icon('file fw') - New file + #{ _('New file') } - elsif can?(current_user, :fork_project, @project) %li - continue_params = { to: namespace_project_new_blob_path(@project.namespace, @project, @project.default_branch || 'master'), @@ -56,4 +56,4 @@ continue: continue_params) = link_to fork_path, method: :post do = icon('file fw') - New file + #{ _('New file') } diff --git a/app/views/projects/buttons/_fork.html.haml b/app/views/projects/buttons/_fork.html.haml index 0935ca7fa44..7a08bb37494 100644 --- a/app/views/projects/buttons/_fork.html.haml +++ b/app/views/projects/buttons/_fork.html.haml @@ -1,14 +1,14 @@ - unless @project.empty_repo? - if current_user && can?(current_user, :fork_project, @project) - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 - = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn has-tooltip' do + = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: _('Go to your fork'), class: 'btn has-tooltip' do = custom_icon('icon_fork') - %span Fork + %span= s_('GoToYourFork|Fork') - else = link_to new_namespace_project_fork_path(@project.namespace, @project), class: 'btn' do = custom_icon('icon_fork') - %span Fork + %span= s_('CreateNewFork|Fork') .count-with-arrow %span.arrow - = link_to namespace_project_forks_path(@project.namespace, @project), title: 'Forks', class: 'count' do + = link_to namespace_project_forks_path(@project.namespace, @project), title: n_('Forks', @project.forks_count), class: 'count' do = @project.forks_count diff --git a/app/views/projects/buttons/_koding.html.haml b/app/views/projects/buttons/_koding.html.haml index a5a9e4d0621..de2d61d4aa3 100644 --- a/app/views/projects/buttons/_koding.html.haml +++ b/app/views/projects/buttons/_koding.html.haml @@ -1,3 +1,3 @@ - if koding_enabled? && current_user && @repository.koding_yml && can_push_branch?(@project, @project.default_branch) = link_to koding_project_url(@project), class: 'btn project-action-button inline', target: '_blank', rel: 'noopener noreferrer' do - Run in IDE (Koding) + _('Run in IDE (Koding)') diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index d57eb2cbfbc..58413e2fc52 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -2,19 +2,19 @@ = link_to toggle_star_namespace_project_path(@project.namespace, @project), { class: 'btn star-btn toggle-star', method: :post, remote: true } do - if current_user.starred?(@project) = icon('star') - %span.starred Unstar + %span.starred= _('Unstar') - else = icon('star-o') - %span Star + %span= s_('StarProject|Star') .count-with-arrow %span.arrow %span.count.star-count = @project.star_count - else - = link_to new_user_session_path, class: 'btn has-tooltip star-btn', title: 'You must sign in to star a project' do + = link_to new_user_session_path, class: 'btn has-tooltip star-btn', title: _('You must sign in to star a project') do = icon('star') - Star + #{ s_('StarProject|Star') } .count-with-arrow %span.arrow %span.count diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 3350a0ec152..7a03c3561af 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -31,12 +31,12 @@ = preserve(markdown(commit.description, pipeline: :single_line, author: commit.author)) .commiter = commit_author_link(commit, avatar: false, size: 24) - committed + #{ _('committed') } #{time_ago_with_tooltip(commit.committed_date)} .commit-actions.flex-row.hidden-xs - if commit.status(ref) = render_commit_status(commit, ref: ref) = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-sha btn btn-transparent" - = clipboard_button(text: commit.id, title: "Copy commit SHA to clipboard") + = clipboard_button(text: commit.id, title: _("Copy commit SHA to clipboard")) = link_to_browse_code(project, commit) diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index dd6797f10c0..ebeaab863bc 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -5,32 +5,32 @@ %ul{ class: (container_class) } = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file)) do = link_to project_files_path(@project) do - Files + #{ _('Files') } = nav_link(controller: [:commit, :commits]) do = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do - Commits + #{ _('Commits') } = nav_link(html_options: {class: branches_tab_class}) do = link_to namespace_project_branches_path(@project.namespace, @project) do - Branches + #{ _('Branches') } = nav_link(controller: [:tags, :releases]) do = link_to namespace_project_tags_path(@project.namespace, @project) do - Tags + #{ _('Tags') } = nav_link(path: 'graphs#show') do = link_to namespace_project_graph_path(@project.namespace, @project, current_ref) do - Contributors + #{ _('Contributors') } = nav_link(controller: %w(network)) do = link_to namespace_project_network_path(@project.namespace, @project, current_ref) do - Graph + #{ s_('ProjectNetworkGraph|Graph') } = nav_link(controller: :compare) do = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do - Compare + #{ _('Compare') } = nav_link(path: 'graphs#charts') do = link_to charts_namespace_project_graph_path(@project.namespace, @project, current_ref) do - Charts + #{ _('Charts') } diff --git a/app/views/projects/cycle_analytics/show.html.haml b/app/views/projects/cycle_analytics/show.html.haml index 74255167352..7000b289f75 100644 --- a/app/views/projects/cycle_analytics/show.html.haml +++ b/app/views/projects/cycle_analytics/show.html.haml @@ -2,7 +2,6 @@ - page_title "Cycle Analytics" - content_for :page_specific_javascripts do = page_specific_javascript_bundle_tag('common_vue') - = page_specific_javascript_bundle_tag('locale') = page_specific_javascript_bundle_tag('cycle_analytics') = render "projects/head" diff --git a/app/views/projects/find_file/show.html.haml b/app/views/projects/find_file/show.html.haml index be0462f91cd..8a409541fe5 100644 --- a/app/views/projects/find_file/show.html.haml +++ b/app/views/projects/find_file/show.html.haml @@ -10,7 +10,7 @@ = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do = @project.path %li.file-finder - %input#file_find.form-control.file-finder-input{ type: "text", placeholder: 'Find by path', autocomplete: 'off' } + %input#file_find.form-control.file-finder-input{ type: "text", placeholder: _('Find by path'), autocomplete: 'off' } .tree-content-holder .table-holder diff --git a/app/views/projects/no_repo.html.haml b/app/views/projects/no_repo.html.haml index 720957e8336..1cf286ddc40 100644 --- a/app/views/projects/no_repo.html.haml +++ b/app/views/projects/no_repo.html.haml @@ -1,22 +1,22 @@ %h2 %i.fa.fa-warning - No repository + #{ _('No repository') } %p.slead - The repository for this project does not exist. + #{ _('The repository for this project does not exist.') } %br - This means you can not push code until you create an empty repository or import existing one. + #{ _('This means you can not push code until you create an empty repository or import existing one.') } %hr .no-repo-actions = link_to namespace_project_repository_path(@project.namespace, @project), method: :post, class: 'btn btn-primary' do - Create empty bare repository + #{ _('Create empty bare repository') } %strong.prepend-left-10.append-right-10 or = link_to new_namespace_project_import_path(@project.namespace, @project), class: 'btn' do - Import repository + #{ _('Import repository') } - if can? current_user, :remove_project, @project .prepend-top-20 - = link_to 'Remove project', project_path(@project), data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right" + = link_to _('Remove project'), project_path(@project), data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right" diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 1ca464696ed..7447197ed89 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -17,24 +17,24 @@ %ul.nav %li = link_to project_files_path(@project) do - Files (#{storage_counter(@project.statistics.total_repository_size)}) + #{_('Files')} (#{storage_counter(@project.statistics.total_repository_size)}) %li = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do - #{'Commit'.pluralize(@project.statistics.commit_count)} (#{number_with_delimiter(@project.statistics.commit_count)}) - %li + #{n_('Commit', 'Commits', @project.statistics.commit_count)} (#{number_with_delimiter(@project.statistics.commit_count)}) + %l = link_to namespace_project_branches_path(@project.namespace, @project) do - #{'Branch'.pluralize(@repository.branch_count)} (#{number_with_delimiter(@repository.branch_count)}) + #{n_('Branch', 'Branches', @repository.branch_count)} (#{number_with_delimiter(@repository.branch_count)}) %li = link_to namespace_project_tags_path(@project.namespace, @project) do - #{'Tag'.pluralize(@repository.tag_count)} (#{number_with_delimiter(@repository.tag_count)}) + #{n_('Tag', 'Tags', @repository.tag_count)} (#{number_with_delimiter(@repository.tag_count)}) - if default_project_view != 'readme' && @repository.readme %li - = link_to 'Readme', readme_path(@project) + = link_to _('Readme'), readme_path(@project) - if @repository.changelog %li - = link_to 'Changelog', changelog_path(@project) + = link_to _('Changelog'), changelog_path(@project) - if @repository.license_blob %li @@ -42,43 +42,43 @@ - if @repository.contribution_guide %li - = link_to 'Contribution guide', contribution_guide_path(@project) + = link_to _('Contribution guide'), contribution_guide_path(@project) - if @repository.gitlab_ci_yml %li - = link_to 'CI configuration', ci_configuration_path(@project) + = link_to _('CI configuration'), ci_configuration_path(@project) - if current_user && can_push_branch?(@project, @project.default_branch) - unless @repository.changelog %li.missing = link_to add_special_file_path(@project, file_name: 'CHANGELOG') do - Add Changelog + #{ _('Add Changelog') } - unless @repository.license_blob %li.missing = link_to add_special_file_path(@project, file_name: 'LICENSE') do - Add License + #{ _('Add License') } - unless @repository.contribution_guide %li.missing = link_to add_special_file_path(@project, file_name: 'CONTRIBUTING.md', commit_message: 'Add contribution guide') do - Add Contribution guide + #{ _('Add Contribution guide') } - unless @repository.gitlab_ci_yml %li.missing = link_to add_special_file_path(@project, file_name: '.gitlab-ci.yml') do - Set up CI + #{ _('Set up CI') } - if koding_enabled? && @repository.koding_yml.blank? %li.missing - = link_to 'Set up Koding', add_koding_stack_path(@project) + = link_to _('Set up Koding'), add_koding_stack_path(@project) - if @repository.gitlab_ci_yml.blank? && @project.deployment_service.present? %li.missing = link_to add_special_file_path(@project, file_name: '.gitlab-ci.yml', commit_message: 'Set up auto deploy', branch_name: 'auto-deploy', context: 'autodeploy') do - Set up auto deploy + #{ _('Set up auto deploy') } %div{ class: container_class } - if @project.archived? .text-warning.center.prepend-top-20 %p = icon("exclamation-triangle fw") - Archived project! Repository is read-only + #{ _('Archived project! Repository is read-only') } - view_path = default_project_view diff --git a/app/views/projects/tree/_tree_content.html.haml b/app/views/projects/tree/_tree_content.html.haml index 2e34803b143..7854e1305db 100644 --- a/app/views/projects/tree/_tree_content.html.haml +++ b/app/views/projects/tree/_tree_content.html.haml @@ -3,10 +3,10 @@ %table.table#tree-slider{ class: "table_#{@hex_path} tree-table" } %thead %tr - %th Name + %th= s_('ProjectFileTree|Name') %th.hidden-xs - .pull-left Last commit - %th.text-right Last Update + .pull-left= _('Last commit') + %th.text-right= _('Last Update') - if @path.present? %tr.tree-item %td.tree-item-file-name @@ -20,7 +20,7 @@ = render "projects/tree/readme", readme: tree.readme - if can_edit_tree? - = render 'projects/blob/upload', title: 'Upload New File', placeholder: 'Upload new file', button_title: 'Upload file', form_path: namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post + = render 'projects/blob/upload', title: _('Upload New File'), placeholder: _('Upload New File'), button_title: _('Upload file'), form_path: namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post = render 'projects/blob/new_dir' :javascript diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml index e4d9e24f56e..abde2a48587 100644 --- a/app/views/projects/tree/_tree_header.html.haml +++ b/app/views/projects/tree/_tree_header.html.haml @@ -1,7 +1,7 @@ .tree-controls = render 'projects/find_file_link' - = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'btn btn-grouped' + = link_to s_('Commits|History'), namespace_project_commits_path(@project.namespace, @project, @id), class: 'btn btn-grouped' = render 'projects/buttons/download', project: @project, ref: @ref @@ -19,7 +19,7 @@ - if current_user %li - if !on_top_of_branch? - %span.btn.add-to-tree.disabled.has-tooltip{ title: "You can only add files when you are on a branch", data: { container: 'body' } } + %span.btn.add-to-tree.disabled.has-tooltip{ title: _("You can only add files when you are on a branch"), data: { container: 'body' } } = icon('plus') - else %span.dropdown @@ -30,15 +30,15 @@ %li = link_to namespace_project_new_blob_path(@project.namespace, @project, @id) do = icon('pencil fw') - New file + #{ _('New file') } %li = link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal' } do = icon('file fw') - Upload file + #{ _('Upload file') } %li = link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal' } do = icon('folder fw') - New directory + #{ _('New directory') } - elsif can?(current_user, :fork_project, @project) %li - continue_params = { to: namespace_project_new_blob_path(@project.namespace, @project, @id), @@ -48,7 +48,7 @@ continue: continue_params) = link_to fork_path, method: :post do = icon('pencil fw') - New file + #{ _('New file') } %li - continue_params = { to: request.fullpath, notice: edit_in_new_fork_notice + " Try to upload a file again.", @@ -57,7 +57,7 @@ continue: continue_params) = link_to fork_path, method: :post do = icon('file fw') - Upload file + #{ _('Upload file') } %li - continue_params = { to: request.fullpath, notice: edit_in_new_fork_notice + " Try to create a new directory again.", @@ -66,14 +66,14 @@ continue: continue_params) = link_to fork_path, method: :post do = icon('folder fw') - New directory + #{ _('New directory') } %li.divider %li = link_to new_namespace_project_branch_path(@project.namespace, @project) do = icon('code-fork fw') - New branch + #{ _('New branch') } %li = link_to new_namespace_project_tag_path(@project.namespace, @project) do = icon('tags fw') - New tag + #{ _('New tag') } diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index f7e410e27b8..96a08f9f8be 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -1,6 +1,6 @@ - @no_container = true -- page_title @path.presence || "Files", @ref +- page_title @path.presence || _("Files"), @ref = content_for :meta_tags do = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), title: "#{@project.name}:#{@ref} commits") = render "projects/commits/head" diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index 0992a65f7cd..0aad4d0714f 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -19,7 +19,7 @@ = text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: 'Project clone URL' } .input-group-btn - = clipboard_button(target: '#project_clone', title: "Copy URL to clipboard") + = clipboard_button(target: '#project_clone', title: _("Copy URL to clipboard")) :javascript $('ul.clone-options-dropdown a').on('click',function(e){ diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml index ed6fc76c61e..b561e6dc248 100644 --- a/app/views/shared/_no_password.html.haml +++ b/app/views/shared/_no_password.html.haml @@ -1,8 +1,10 @@ - if cookies[:hide_no_password_message].blank? && !current_user.hide_no_password && current_user.require_password? .no-password-message.alert.alert-warning - You won't be able to pull or push project code via #{gitlab_config.protocol.upcase} until you #{link_to 'set a password', edit_profile_password_path} on your account + - set_password_link = link_to s_('SetPasswordToCloneLink|set a password'), edit_profile_password_path + - translation_params = { protocol: gitlab_config.protocol.upcase, set_password_link: set_password_link } + - set_password_message = _("You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account") % translation_params .alert-link-group - = link_to "Don't show again", profile_path(user: {hide_no_password: true}), method: :put + = link_to _("Don't show again"), profile_path(user: {hide_no_password: true}), method: :put | - = link_to 'Remind later', '#', class: 'hide-no-password-message' + = link_to _('Remind later'), '#', class: 'hide-no-password-message' diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index d663fa13d10..e7815e28017 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -1,8 +1,9 @@ - if cookies[:hide_no_ssh_message].blank? && !current_user.hide_no_ssh_key && current_user.require_ssh_key? .no-ssh-key-message.alert.alert-warning - You won't be able to pull or push project code via SSH until you #{link_to 'add an SSH key', profile_keys_path, class: 'alert-link'} to your profile - + - add_ssh_key_link = link_to s_('MissingSSHKeyWarningLink|add an SSH key'), profile_keys_path, class: 'alert-link' + - ssh_message = _("You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile") % { add_ssh_key_link: add_ssh_key_link } + #{ ssh_message.html_safe } .alert-link-group - = link_to "Don't show again", profile_path(user: {hide_no_ssh_key: true}), method: :put, class: 'alert-link' + = link_to _("Don't show again"), profile_path(user: {hide_no_ssh_key: true}), method: :put, class: 'alert-link' | - = link_to 'Remind later', '#', class: 'hide-no-ssh-message alert-link' + = link_to _('Remind later'), '#', class: 'hide-no-ssh-message alert-link' diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml index 2029eb5824a..d52bb6b4dd7 100644 --- a/app/views/shared/_ref_switcher.html.haml +++ b/app/views/shared/_ref_switcher.html.haml @@ -6,9 +6,9 @@ - @options && @options.each do |key, value| = hidden_field_tag key, value, id: nil .dropdown - = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_namespace_project_path(@project.namespace, @project), field_name: 'ref', submit_form_on_click: true }, { toggle_class: "js-project-refs-dropdown git-revision-dropdown-toggle" } + = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_namespace_project_path(@project.namespace, @project), field_name: 'ref', submit_form_on_click: true }, { toggle_class: "js-project-refs-dropdown" } .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) } - = dropdown_title "Switch branch/tag" - = dropdown_filter "Search branches and tags" + = dropdown_title _("Switch branch/tag") + = dropdown_filter _("Search branches and tags") = dropdown_content = dropdown_loading diff --git a/app/views/shared/members/_access_request_buttons.html.haml b/app/views/shared/members/_access_request_buttons.html.haml index fb795ad1c72..d97fdf179d7 100644 --- a/app/views/shared/members/_access_request_buttons.html.haml +++ b/app/views/shared/members/_access_request_buttons.html.haml @@ -2,16 +2,17 @@ .project-action-button.inline - if can?(current_user, :"destroy_#{model_name}_member", source.members.find_by(user_id: current_user.id)) - = link_to "Leave #{model_name}", polymorphic_path([:leave, source, :members]), + - link_text = source.is_a?(Group) ? _('Leave group') : _('Leave project') + = link_to link_text, polymorphic_path([:leave, source, :members]), method: :delete, data: { confirm: leave_confirmation_message(source) }, class: 'btn' - elsif requester = source.requesters.find_by(user_id: current_user.id) - = link_to 'Withdraw Access Request', polymorphic_path([:leave, source, :members]), + = link_to _('Withdraw Access Request'), polymorphic_path([:leave, source, :members]), method: :delete, data: { confirm: remove_member_message(requester) }, class: 'btn' - elsif source.request_access_enabled && can?(current_user, :request_access, source) - = link_to 'Request Access', polymorphic_path([:request_access, source, :members]), + = link_to _('Request Access'), polymorphic_path([:request_access, source, :members]), method: :post, class: 'btn' diff --git a/app/views/shared/notifications/_custom_notifications.html.haml b/app/views/shared/notifications/_custom_notifications.html.haml index 183ed34fba1..752932e6045 100644 --- a/app/views/shared/notifications/_custom_notifications.html.haml +++ b/app/views/shared/notifications/_custom_notifications.html.haml @@ -5,7 +5,7 @@ %button.close{ type: "button", "aria-label": "close", data: { dismiss: "modal" } } %span{ "aria-hidden": "true" } } × %h4#custom-notifications-title.modal-title - Custom notification events + #{ _('Custom notification events') } .modal-body .container-fluid @@ -13,12 +13,11 @@ = hidden_setting_source_input(notification_setting) .row .col-lg-4 - %h4.prepend-top-0 - Notification events + %h4.prepend-top-0= _('Notification events') %p - Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out - = succeed "." do - %a{ href: help_page_path('workflow/notifications'), target: "_blank" } notification emails + - notification_link = link_to _('notification emails'), help_page_path('workflow/notifications'), target: '_blank' + - paragraph = _('Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}.') % { notification_link: notification_link.html_safe } + #{ paragraph.html_safe } .col-lg-8 - NotificationSetting::EMAIL_EVENTS.each_with_index do |event, index| - field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]" diff --git a/changelogs/unreleased/bvl-translate-project-pages.yml b/changelogs/unreleased/bvl-translate-project-pages.yml new file mode 100644 index 00000000000..fb90aba08b4 --- /dev/null +++ b/changelogs/unreleased/bvl-translate-project-pages.yml @@ -0,0 +1,4 @@ +--- +title: Translate backend for Project & Repository pages +merge_request: 11183 +author: diff --git a/config/webpack.config.js b/config/webpack.config.js index 61f1eaaacd1..cbcf5ce996d 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -183,15 +183,7 @@ var config = { // create cacheable common library bundles new webpack.optimize.CommonsChunkPlugin({ - names: ['main', 'common', 'runtime'], - }), - - // locale common library - new webpack.optimize.CommonsChunkPlugin({ - name: 'locale', - chunks: [ - 'cycle_analytics', - ], + names: ['main', 'locale', 'common', 'runtime'], }), ], diff --git a/lib/gitlab/ci/status/canceled.rb b/lib/gitlab/ci/status/canceled.rb index 97c121ce7b9..e5fdc1f8136 100644 --- a/lib/gitlab/ci/status/canceled.rb +++ b/lib/gitlab/ci/status/canceled.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Canceled < Status::Core def text - 'canceled' + s_('CiStatusText|canceled') end def label - 'canceled' + s_('CiStatusLabel|canceled') end def icon diff --git a/lib/gitlab/ci/status/created.rb b/lib/gitlab/ci/status/created.rb index 0721bf6ec7c..d188bd286a6 100644 --- a/lib/gitlab/ci/status/created.rb +++ b/lib/gitlab/ci/status/created.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Created < Status::Core def text - 'created' + s_('CiStatusText|created') end def label - 'created' + s_('CiStatusLabel|created') end def icon diff --git a/lib/gitlab/ci/status/failed.rb b/lib/gitlab/ci/status/failed.rb index cb75e9383a8..38e45714c22 100644 --- a/lib/gitlab/ci/status/failed.rb +++ b/lib/gitlab/ci/status/failed.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Failed < Status::Core def text - 'failed' + s_('CiStatusText|failed') end def label - 'failed' + s_('CiStatusLabel|failed') end def icon diff --git a/lib/gitlab/ci/status/manual.rb b/lib/gitlab/ci/status/manual.rb index f8f6c2903ba..a4a7edadac9 100644 --- a/lib/gitlab/ci/status/manual.rb +++ b/lib/gitlab/ci/status/manual.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Manual < Status::Core def text - 'manual' + s_('CiStatusText|manual') end def label - 'manual action' + s_('CiStatusLabel|manual action') end def icon diff --git a/lib/gitlab/ci/status/pending.rb b/lib/gitlab/ci/status/pending.rb index f40cc1314dc..5164260b861 100644 --- a/lib/gitlab/ci/status/pending.rb +++ b/lib/gitlab/ci/status/pending.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Pending < Status::Core def text - 'pending' + s_('CiStatusText|pending') end def label - 'pending' + s_('CiStatusLabel|pending') end def icon diff --git a/lib/gitlab/ci/status/pipeline/blocked.rb b/lib/gitlab/ci/status/pipeline/blocked.rb index 37dfe43fb62..bf7e484ee9b 100644 --- a/lib/gitlab/ci/status/pipeline/blocked.rb +++ b/lib/gitlab/ci/status/pipeline/blocked.rb @@ -4,11 +4,11 @@ module Gitlab module Pipeline class Blocked < Status::Extended def text - 'blocked' + s_('CiStatusText|blocked') end def label - 'waiting for manual action' + s_('CiStatusLabel|waiting for manual action') end def self.matches?(pipeline, user) diff --git a/lib/gitlab/ci/status/running.rb b/lib/gitlab/ci/status/running.rb index 1237cd47dc8..993937e98ca 100644 --- a/lib/gitlab/ci/status/running.rb +++ b/lib/gitlab/ci/status/running.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Running < Status::Core def text - 'running' + s_('CiStatus|running') end def label - 'running' + s_('CiStatus|running') end def icon diff --git a/lib/gitlab/ci/status/skipped.rb b/lib/gitlab/ci/status/skipped.rb index 28005d91503..0c942920b02 100644 --- a/lib/gitlab/ci/status/skipped.rb +++ b/lib/gitlab/ci/status/skipped.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Skipped < Status::Core def text - 'skipped' + s_('CiStatusText|skipped') end def label - 'skipped' + s_('CiStatusLabel|skipped') end def icon diff --git a/lib/gitlab/ci/status/success.rb b/lib/gitlab/ci/status/success.rb index 88f7758a270..d7af98857b0 100644 --- a/lib/gitlab/ci/status/success.rb +++ b/lib/gitlab/ci/status/success.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Success < Status::Core def text - 'passed' + s_('CiStatusText|passed') end def label - 'passed' + s_('CiStatusLabel|passed') end def icon diff --git a/lib/gitlab/ci/status/success_warning.rb b/lib/gitlab/ci/status/success_warning.rb index df6e76b0151..4d7d82e04cf 100644 --- a/lib/gitlab/ci/status/success_warning.rb +++ b/lib/gitlab/ci/status/success_warning.rb @@ -7,11 +7,11 @@ module Gitlab # class SuccessWarning < Status::Extended def text - 'passed' + s_('CiStatusText|passed') end def label - 'passed with warnings' + s_('CiStatusLabel|passed with warnings') end def icon diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index 85da4c8660b..2b53798e70f 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -41,9 +41,9 @@ module Gitlab def options { - 'Private' => PRIVATE, - 'Internal' => INTERNAL, - 'Public' => PUBLIC + N_('VisibilityLevel|Private') => PRIVATE, + N_('VisibilityLevel|Internal') => INTERNAL, + N_('VisibilityLevel|Public') => PUBLIC } end diff --git a/locale/de/gitlab.po b/locale/de/gitlab.po index 1c44ed4b77c..60a0c219e00 100644 --- a/locale/de/gitlab.po +++ b/locale/de/gitlab.po @@ -7,24 +7,170 @@ msgid "" msgstr "" "Project-Id-Version: gitlab 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2017-05-09 13:44+0200\n" +"PO-Revision-Date: 2017-06-07 12:17+0200\n" "Language-Team: German\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"Last-Translator: \n" -"X-Generator: Poedit 2.0.1\n" +"Last-Translator: Bob Van Landuyt \n" +"X-Generator: Poedit 2.0.2\n" + +msgid "About auto deploy" +msgstr "" + +msgid "Activity" +msgstr "" + +msgid "Add Changelog" +msgstr "" + +msgid "Add Contribution guide" +msgstr "" + +msgid "Add License" +msgstr "" + +msgid "Add an SSH key to your profile to pull or push via SSH." +msgstr "" + +msgid "Add new directory" +msgstr "" + +msgid "Archived project! Repository is read-only" +msgstr "" + +msgid "Branch" +msgid_plural "Branches" +msgstr[0] "" +msgstr[1] "" + +msgid "Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}" +msgstr "" + +msgid "Branches" +msgstr "" msgid "ByAuthor|by" msgstr "Von" +msgid "CI configuration" +msgstr "" + +msgid "Changelog" +msgstr "" + +msgid "Charts" +msgstr "" + +msgid "CiStatusLabel|canceled" +msgstr "" + +msgid "CiStatusLabel|created" +msgstr "" + +msgid "CiStatusLabel|failed" +msgstr "" + +msgid "CiStatusLabel|manual action" +msgstr "" + +msgid "CiStatusLabel|passed" +msgstr "" + +msgid "CiStatusLabel|passed with warnings" +msgstr "" + +msgid "CiStatusLabel|pending" +msgstr "" + +msgid "CiStatusLabel|skipped" +msgstr "" + +msgid "CiStatusLabel|waiting for manual action" +msgstr "" + +msgid "CiStatusText|blocked" +msgstr "" + +msgid "CiStatusText|canceled" +msgstr "" + +msgid "CiStatusText|created" +msgstr "" + +msgid "CiStatusText|failed" +msgstr "" + +msgid "CiStatusText|manual" +msgstr "" + +msgid "CiStatusText|passed" +msgstr "" + +msgid "CiStatusText|pending" +msgstr "" + +msgid "CiStatusText|skipped" +msgstr "" + +msgid "CiStatus|running" +msgstr "" + msgid "Commit" msgid_plural "Commits" msgstr[0] "Commit" msgstr[1] "Commits" +msgid "CommitMessage|Add %{file_name}" +msgstr "" + +msgid "Commits" +msgstr "Commits" + +msgid "Commits|History" +msgstr "Commits" + +msgid "Compare" +msgstr "" + +msgid "Contribution guide" +msgstr "" + +msgid "Contributors" +msgstr "" + +msgid "Copy URL to clipboard" +msgstr "" + +msgid "Copy commit SHA to clipboard" +msgstr "" + +msgid "Create New Directory" +msgstr "" + +msgid "Create directory" +msgstr "" + +msgid "Create empty bare repository" +msgstr "" + +msgid "Create merge request" +msgstr "" + +msgid "CreateNewFork|Fork" +msgstr "" + +msgid "Custom notification events" +msgstr "" + +msgid "Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}." +msgstr "" + +msgid "Cycle Analytics" +msgstr "" + msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgstr "Cycle Analytics liefern einen Überblick darüber, wie viel Zeit in Ihrem Projekt von einer Idee bis zum Produktivdeployment vergeht." @@ -54,26 +200,98 @@ msgid_plural "Deploys" msgstr[0] "Deployment" msgstr[1] "Deployments" +msgid "Directory name" +msgstr "" + +msgid "Don't show again" +msgstr "" + +msgid "Download tar" +msgstr "" + +msgid "Download tar.bz2" +msgstr "" + +msgid "Download tar.gz" +msgstr "" + +msgid "Download zip" +msgstr "" + +msgid "DownloadArtifacts|Download" +msgstr "" + +msgid "DownloadSource|Download" +msgstr "" + +msgid "Files" +msgstr "" + +msgid "Find by path" +msgstr "" + +msgid "Find file" +msgstr "" + msgid "FirstPushedBy|First" msgstr "Erster" msgid "FirstPushedBy|pushed by" msgstr "gepusht von" +msgid "ForkedFromProjectPath|Forked from" +msgstr "" + +msgid "Forks" +msgstr "" + msgid "From issue creation until deploy to production" msgstr "Vom Anlegen des Issues bis zum Produktivdeployment" msgid "From merge request merge until deploy to production" msgstr "Vom Merge Request bis zum Produktivdeployment" +msgid "Go to your fork" +msgstr "" + +msgid "GoToYourFork|Fork" +msgstr "" + +msgid "Home" +msgstr "" + +msgid "Housekeeping successfully started" +msgstr "" + +msgid "Import repository" +msgstr "" + msgid "Introducing Cycle Analytics" msgstr "Was sind Cycle Analytics?" +msgid "LFSStatus|Disabled" +msgstr "" + +msgid "LFSStatus|Enabled" +msgstr "" + msgid "Last %d day" msgid_plural "Last %d days" msgstr[0] "Letzter %d Tag" msgstr[1] "Letzten %d Tage" +msgid "Last Update" +msgstr "" + +msgid "Last commit" +msgstr "" + +msgid "Leave group" +msgstr "" + +msgid "Leave project" +msgstr "" + msgid "Limited to showing %d event at most" msgid_plural "Limited to showing %d events at most" msgstr[0] "Eingeschränkt auf maximal %d Ereignis" @@ -82,29 +300,167 @@ msgstr[1] "Eingeschränkt auf maximal %d Ereignisse" msgid "Median" msgstr "Median" +msgid "MissingSSHKeyWarningLink|add an SSH key" +msgstr "" + msgid "New Issue" msgid_plural "New Issues" msgstr[0] "Neues Issue" msgstr[1] "Neue Issues" +msgid "New branch" +msgstr "" + +msgid "New directory" +msgstr "" + +msgid "New file" +msgstr "" + +msgid "New issue" +msgstr "Neues Issue" + +msgid "New merge request" +msgstr "" + +msgid "New snippet" +msgstr "" + +msgid "New tag" +msgstr "" + +msgid "No repository" +msgstr "" + msgid "Not available" msgstr "Nicht verfügbar" msgid "Not enough data" msgstr "Nicht genügend Daten" +msgid "Notification events" +msgstr "" + +msgid "NotificationEvent|Close issue" +msgstr "" + +msgid "NotificationEvent|Close merge request" +msgstr "" + +msgid "NotificationEvent|Failed pipeline" +msgstr "" + +msgid "NotificationEvent|Merge merge request" +msgstr "" + +msgid "NotificationEvent|New issue" +msgstr "" + +msgid "NotificationEvent|New merge request" +msgstr "" + +msgid "NotificationEvent|New note" +msgstr "" + +msgid "NotificationEvent|Reassign issue" +msgstr "" + +msgid "NotificationEvent|Reassign merge request" +msgstr "" + +msgid "NotificationEvent|Reopen issue" +msgstr "" + +msgid "NotificationEvent|Successful pipeline" +msgstr "" + +msgid "NotificationLevel|Custom" +msgstr "" + +msgid "NotificationLevel|Disabled" +msgstr "" + +msgid "NotificationLevel|Global" +msgstr "" + +msgid "NotificationLevel|On mention" +msgstr "" + +msgid "NotificationLevel|Participate" +msgstr "" + +msgid "NotificationLevel|Watch" +msgstr "" + msgid "OpenedNDaysAgo|Opened" msgstr "Erstellt" msgid "Pipeline Health" msgstr "Pipeline Kennzahlen" +msgid "Project '%{project_name}' queued for deletion." +msgstr "" + +msgid "Project '%{project_name}' was successfully created." +msgstr "" + +msgid "Project '%{project_name}' was successfully updated." +msgstr "" + +msgid "Project '%{project_name}' will be deleted." +msgstr "" + +msgid "Project access must be granted explicitly to each user." +msgstr "" + +msgid "Project export could not be deleted." +msgstr "" + +msgid "Project export has been deleted." +msgstr "" + +msgid "Project export link has expired. Please generate a new export from your project settings." +msgstr "" + +msgid "Project export started. A download link will be sent by email." +msgstr "" + +msgid "Project home" +msgstr "" + +msgid "ProjectFeature|Disabled" +msgstr "" + +msgid "ProjectFeature|Everyone with access" +msgstr "" + +msgid "ProjectFeature|Only team members" +msgstr "" + +msgid "ProjectFileTree|Name" +msgstr "" + +msgid "ProjectLastActivity|Never" +msgstr "" + msgid "ProjectLifecycle|Stage" msgstr "Phase" +msgid "ProjectNetworkGraph|Graph" +msgstr "" + msgid "Read more" msgstr "Mehr" +msgid "Readme" +msgstr "" + +msgid "RefSwitcher|Branches" +msgstr "" + +msgid "RefSwitcher|Tags" +msgstr "" + msgid "Related Commits" msgstr "Zugehörige Commits" @@ -123,17 +479,67 @@ msgstr "Zugehörige Merge Requests" msgid "Related Merged Requests" msgstr "Zugehörige abgeschlossene Merge Requests" +msgid "Remind later" +msgstr "" + +msgid "Remove project" +msgstr "" + +msgid "Request Access" +msgstr "" + +msgid "Search branches and tags" +msgstr "" + +msgid "Select Archive Format" +msgstr "" + +msgid "Set a password on your account to pull or push via %{protocol}" +msgstr "" + +msgid "Set up CI" +msgstr "" + +msgid "Set up Koding" +msgstr "" + +msgid "Set up auto deploy" +msgstr "" + +msgid "SetPasswordToCloneLink|set a password" +msgstr "" + msgid "Showing %d event" msgid_plural "Showing %d events" msgstr[0] "Zeige %d Ereignis" msgstr[1] "Zeige %d Ereignisse" +msgid "Source code" +msgstr "" + +msgid "StarProject|Star" +msgstr "" + +msgid "Switch branch/tag" +msgstr "" + +msgid "Tag" +msgid_plural "Tags" +msgstr[0] "" +msgstr[1] "" + +msgid "Tags" +msgstr "" + msgid "The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request." msgstr "Die Code-Phase stellt die Zeit vom ersten Commit bis zum Erstellen eines Merge Requests dar. Sobald Sie Ihren ersten Merge Request anlegen, werden dessen Daten automatisch ergänzt." msgid "The collection of events added to the data gathered for that stage." msgstr "Ereignisse, die für diese Phase ausgewertet wurden." +msgid "The fork relationship has been removed." +msgstr "" + msgid "The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage." msgstr "Die Issue-Phase stellt die Zeit vom Anlegen eines Issues bis zum Zuweisen eines Meilensteins oder Hinzufügen zum Issue Board dar. Erstellen Sie einen Issue, damit dessen Daten hier erscheinen." @@ -146,6 +552,15 @@ msgstr "Die Planungsphase stellt die Zeit von der vorherigen Phase bis zum Pushe msgid "The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle." msgstr "Die Produktiv-Phase stellt die Gesamtzeit vom Anlegen eines Issues bis zum Deployment auf dem Produktivsystem dar. Sobald Sie den vollständigen Entwicklungszyklus von einer Idee bis zum Produktivdeployment durchlaufen haben, erscheinen die zugehörigen Daten hier." +msgid "The project can be accessed by any logged in user." +msgstr "" + +msgid "The project can be accessed without any authentication." +msgstr "" + +msgid "The repository for this project does not exist." +msgstr "" + msgid "The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request." msgstr "Die Review-Phase stellt die Zeit vom Anlegen eines Merge Requests bis zum Mergen dar. Sobald Sie Ihren ersten Merge Request abschließen, werden dessen Daten hier automatisch angezeigt." @@ -161,6 +576,9 @@ msgstr "Zeit die für das jeweilige Ereignis in der Phase ermittelt wurde." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgstr "Der mittlere aller erfassten Werte. Zum Beispiel ist für 3, 5, 9 der Median 5. Bei 3, 5, 7, 8 ist der Median (5+7)/2 = 6." +msgid "This means you can not push code until you create an empty repository or import existing one." +msgstr "" + msgid "Time before an issue gets scheduled" msgstr "Zeit bis ein Issue geplant wird" @@ -173,6 +591,129 @@ msgstr "Zeit zwischen Anlegen und Mergen/Schließen eines Merge Requests" msgid "Time until first merge request" msgstr "Zeit bis zum ersten Merge Request" +msgid "Timeago|%s days ago" +msgstr "" + +msgid "Timeago|%s days remaining" +msgstr "" + +msgid "Timeago|%s hours remaining" +msgstr "" + +msgid "Timeago|%s minutes ago" +msgstr "" + +msgid "Timeago|%s minutes remaining" +msgstr "" + +msgid "Timeago|%s months ago" +msgstr "" + +msgid "Timeago|%s months remaining" +msgstr "" + +msgid "Timeago|%s seconds remaining" +msgstr "" + +msgid "Timeago|%s weeks ago" +msgstr "" + +msgid "Timeago|%s weeks remaining" +msgstr "" + +msgid "Timeago|%s years ago" +msgstr "" + +msgid "Timeago|%s years remaining" +msgstr "" + +msgid "Timeago|1 day remaining" +msgstr "" + +msgid "Timeago|1 hour remaining" +msgstr "" + +msgid "Timeago|1 minute remaining" +msgstr "" + +msgid "Timeago|1 month remaining" +msgstr "" + +msgid "Timeago|1 week remaining" +msgstr "" + +msgid "Timeago|1 year remaining" +msgstr "" + +msgid "Timeago|Past due" +msgstr "" + +msgid "Timeago|a day ago" +msgstr "" + +msgid "Timeago|a month ago" +msgstr "" + +msgid "Timeago|a week ago" +msgstr "" + +msgid "Timeago|a while" +msgstr "" + +msgid "Timeago|a year ago" +msgstr "" + +msgid "Timeago|about %s hours ago" +msgstr "" + +msgid "Timeago|about a minute ago" +msgstr "" + +msgid "Timeago|about an hour ago" +msgstr "" + +msgid "Timeago|in %s days" +msgstr "" + +msgid "Timeago|in %s hours" +msgstr "" + +msgid "Timeago|in %s minutes" +msgstr "" + +msgid "Timeago|in %s months" +msgstr "" + +msgid "Timeago|in %s seconds" +msgstr "" + +msgid "Timeago|in %s weeks" +msgstr "" + +msgid "Timeago|in %s years" +msgstr "" + +msgid "Timeago|in 1 day" +msgstr "" + +msgid "Timeago|in 1 hour" +msgstr "" + +msgid "Timeago|in 1 minute" +msgstr "" + +msgid "Timeago|in 1 month" +msgstr "" + +msgid "Timeago|in 1 week" +msgstr "" + +msgid "Timeago|in 1 year" +msgstr "" + +msgid "Timeago|less than a minute ago" +msgstr "" + msgid "Time|hr" msgid_plural "Time|hrs" msgstr[0] "h" @@ -192,16 +733,88 @@ msgstr "Gesamtzeit" msgid "Total test time for all commits/merges" msgstr "Gesamte Testlaufzeit für alle Commits/Merges" +msgid "Unstar" +msgstr "" + +msgid "Upload New File" +msgstr "" + +msgid "Upload file" +msgstr "" + +msgid "Use your global notification setting" +msgstr "" + +msgid "VisibilityLevel|Internal" +msgstr "" + +msgid "VisibilityLevel|Private" +msgstr "" + +msgid "VisibilityLevel|Public" +msgstr "" + msgid "Want to see the data? Please ask an administrator for access." msgstr "Um diese Daten einsehen zu können, wenden Sie sich bitte an Ihren Administrator." msgid "We don't have enough data to show this stage." msgstr "Es liegen nicht genügend Daten vor, um diese Phase anzuzeigen." +msgid "Withdraw Access Request" +msgstr "" + +msgid "" +"You are going to remove %{project_name_with_namespace}.\n" +"Removed project CANNOT be restored!\n" +"Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You can only add files when you are on a branch" +msgstr "" + +msgid "You must sign in to star a project" +msgstr "" + msgid "You need permission." msgstr "Sie benötigen Zugriffsrechte." +msgid "You will not get any notifications via email" +msgstr "" + +msgid "You will only receive notifications for the events you choose" +msgstr "" + +msgid "You will only receive notifications for threads you have participated in" +msgstr "" + +msgid "You will receive notifications for any activity" +msgstr "" + +msgid "You will receive notifications only for comments in which you were @mentioned" +msgstr "" + +msgid "You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account" +msgstr "" + +msgid "You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile" +msgstr "" + +msgid "Your name" +msgstr "" + +msgid "committed" +msgstr "" + msgid "day" msgid_plural "days" msgstr[0] "Tag" msgstr[1] "Tage" + +msgid "notification emails" +msgstr "" diff --git a/locale/en/gitlab.po b/locale/en/gitlab.po index a43bafbbe28..fca2bc15b1f 100644 --- a/locale/en/gitlab.po +++ b/locale/en/gitlab.po @@ -7,24 +7,170 @@ msgid "" msgstr "" "Project-Id-Version: gitlab 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2017-04-12 22:36-0500\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2017-06-07 12:14+0200\n" "Language-Team: English\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"\n" +"Last-Translator: Bob Van Landuyt \n" +"X-Generator: Poedit 2.0.2\n" + +msgid "About auto deploy" +msgstr "" + +msgid "Activity" +msgstr "" + +msgid "Add Changelog" +msgstr "" + +msgid "Add Contribution guide" +msgstr "" + +msgid "Add License" +msgstr "" + +msgid "Add an SSH key to your profile to pull or push via SSH." +msgstr "" + +msgid "Add new directory" +msgstr "" + +msgid "Archived project! Repository is read-only" +msgstr "" + +msgid "Branch" +msgid_plural "Branches" +msgstr[0] "" +msgstr[1] "" + +msgid "Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}" +msgstr "" + +msgid "Branches" +msgstr "" msgid "ByAuthor|by" msgstr "" +msgid "CI configuration" +msgstr "" + +msgid "Changelog" +msgstr "" + +msgid "Charts" +msgstr "" + +msgid "CiStatusLabel|canceled" +msgstr "" + +msgid "CiStatusLabel|created" +msgstr "" + +msgid "CiStatusLabel|failed" +msgstr "" + +msgid "CiStatusLabel|manual action" +msgstr "" + +msgid "CiStatusLabel|passed" +msgstr "" + +msgid "CiStatusLabel|passed with warnings" +msgstr "" + +msgid "CiStatusLabel|pending" +msgstr "" + +msgid "CiStatusLabel|skipped" +msgstr "" + +msgid "CiStatusLabel|waiting for manual action" +msgstr "" + +msgid "CiStatusText|blocked" +msgstr "" + +msgid "CiStatusText|canceled" +msgstr "" + +msgid "CiStatusText|created" +msgstr "" + +msgid "CiStatusText|failed" +msgstr "" + +msgid "CiStatusText|manual" +msgstr "" + +msgid "CiStatusText|passed" +msgstr "" + +msgid "CiStatusText|pending" +msgstr "" + +msgid "CiStatusText|skipped" +msgstr "" + +msgid "CiStatus|running" +msgstr "" + msgid "Commit" msgid_plural "Commits" msgstr[0] "" msgstr[1] "" +msgid "CommitMessage|Add %{file_name}" +msgstr "" + +msgid "Commits" +msgstr "" + +msgid "Commits|History" +msgstr "" + +msgid "Compare" +msgstr "" + +msgid "Contribution guide" +msgstr "" + +msgid "Contributors" +msgstr "" + +msgid "Copy URL to clipboard" +msgstr "" + +msgid "Copy commit SHA to clipboard" +msgstr "" + +msgid "Create New Directory" +msgstr "" + +msgid "Create directory" +msgstr "" + +msgid "Create empty bare repository" +msgstr "" + +msgid "Create merge request" +msgstr "" + +msgid "CreateNewFork|Fork" +msgstr "" + +msgid "Custom notification events" +msgstr "" + +msgid "Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}." +msgstr "" + +msgid "Cycle Analytics" +msgstr "" + msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgstr "" @@ -54,26 +200,98 @@ msgid_plural "Deploys" msgstr[0] "" msgstr[1] "" +msgid "Directory name" +msgstr "" + +msgid "Don't show again" +msgstr "" + +msgid "Download tar" +msgstr "" + +msgid "Download tar.bz2" +msgstr "" + +msgid "Download tar.gz" +msgstr "" + +msgid "Download zip" +msgstr "" + +msgid "DownloadArtifacts|Download" +msgstr "" + +msgid "DownloadSource|Download" +msgstr "" + +msgid "Files" +msgstr "" + +msgid "Find by path" +msgstr "" + +msgid "Find file" +msgstr "" + msgid "FirstPushedBy|First" msgstr "" msgid "FirstPushedBy|pushed by" msgstr "" +msgid "ForkedFromProjectPath|Forked from" +msgstr "" + +msgid "Forks" +msgstr "" + msgid "From issue creation until deploy to production" msgstr "" msgid "From merge request merge until deploy to production" msgstr "" +msgid "Go to your fork" +msgstr "" + +msgid "GoToYourFork|Fork" +msgstr "" + +msgid "Home" +msgstr "" + +msgid "Housekeeping successfully started" +msgstr "" + +msgid "Import repository" +msgstr "" + msgid "Introducing Cycle Analytics" msgstr "" +msgid "LFSStatus|Disabled" +msgstr "" + +msgid "LFSStatus|Enabled" +msgstr "" + msgid "Last %d day" msgid_plural "Last %d days" msgstr[0] "" msgstr[1] "" +msgid "Last Update" +msgstr "" + +msgid "Last commit" +msgstr "" + +msgid "Leave group" +msgstr "" + +msgid "Leave project" +msgstr "" + msgid "Limited to showing %d event at most" msgid_plural "Limited to showing %d events at most" msgstr[0] "" @@ -82,29 +300,167 @@ msgstr[1] "" msgid "Median" msgstr "" +msgid "MissingSSHKeyWarningLink|add an SSH key" +msgstr "" + msgid "New Issue" msgid_plural "New Issues" msgstr[0] "" msgstr[1] "" +msgid "New branch" +msgstr "" + +msgid "New directory" +msgstr "" + +msgid "New file" +msgstr "" + +msgid "New issue" +msgstr "" + +msgid "New merge request" +msgstr "" + +msgid "New snippet" +msgstr "" + +msgid "New tag" +msgstr "" + +msgid "No repository" +msgstr "" + msgid "Not available" msgstr "" msgid "Not enough data" msgstr "" +msgid "Notification events" +msgstr "" + +msgid "NotificationEvent|Close issue" +msgstr "" + +msgid "NotificationEvent|Close merge request" +msgstr "" + +msgid "NotificationEvent|Failed pipeline" +msgstr "" + +msgid "NotificationEvent|Merge merge request" +msgstr "" + +msgid "NotificationEvent|New issue" +msgstr "" + +msgid "NotificationEvent|New merge request" +msgstr "" + +msgid "NotificationEvent|New note" +msgstr "" + +msgid "NotificationEvent|Reassign issue" +msgstr "" + +msgid "NotificationEvent|Reassign merge request" +msgstr "" + +msgid "NotificationEvent|Reopen issue" +msgstr "" + +msgid "NotificationEvent|Successful pipeline" +msgstr "" + +msgid "NotificationLevel|Custom" +msgstr "" + +msgid "NotificationLevel|Disabled" +msgstr "" + +msgid "NotificationLevel|Global" +msgstr "" + +msgid "NotificationLevel|On mention" +msgstr "" + +msgid "NotificationLevel|Participate" +msgstr "" + +msgid "NotificationLevel|Watch" +msgstr "" + msgid "OpenedNDaysAgo|Opened" msgstr "" msgid "Pipeline Health" msgstr "" +msgid "Project '%{project_name}' queued for deletion." +msgstr "" + +msgid "Project '%{project_name}' was successfully created." +msgstr "" + +msgid "Project '%{project_name}' was successfully updated." +msgstr "" + +msgid "Project '%{project_name}' will be deleted." +msgstr "" + +msgid "Project access must be granted explicitly to each user." +msgstr "" + +msgid "Project export could not be deleted." +msgstr "" + +msgid "Project export has been deleted." +msgstr "" + +msgid "Project export link has expired. Please generate a new export from your project settings." +msgstr "" + +msgid "Project export started. A download link will be sent by email." +msgstr "" + +msgid "Project home" +msgstr "" + +msgid "ProjectFeature|Disabled" +msgstr "" + +msgid "ProjectFeature|Everyone with access" +msgstr "" + +msgid "ProjectFeature|Only team members" +msgstr "" + +msgid "ProjectFileTree|Name" +msgstr "" + +msgid "ProjectLastActivity|Never" +msgstr "" + msgid "ProjectLifecycle|Stage" msgstr "" +msgid "ProjectNetworkGraph|Graph" +msgstr "" + msgid "Read more" msgstr "" +msgid "Readme" +msgstr "" + +msgid "RefSwitcher|Branches" +msgstr "" + +msgid "RefSwitcher|Tags" +msgstr "" + msgid "Related Commits" msgstr "" @@ -123,17 +479,67 @@ msgstr "" msgid "Related Merged Requests" msgstr "" +msgid "Remind later" +msgstr "" + +msgid "Remove project" +msgstr "" + +msgid "Request Access" +msgstr "" + +msgid "Search branches and tags" +msgstr "" + +msgid "Select Archive Format" +msgstr "" + +msgid "Set a password on your account to pull or push via %{protocol}" +msgstr "" + +msgid "Set up CI" +msgstr "" + +msgid "Set up Koding" +msgstr "" + +msgid "Set up auto deploy" +msgstr "" + +msgid "SetPasswordToCloneLink|set a password" +msgstr "" + msgid "Showing %d event" msgid_plural "Showing %d events" msgstr[0] "" msgstr[1] "" +msgid "Source code" +msgstr "" + +msgid "StarProject|Star" +msgstr "" + +msgid "Switch branch/tag" +msgstr "" + +msgid "Tag" +msgid_plural "Tags" +msgstr[0] "" +msgstr[1] "" + +msgid "Tags" +msgstr "" + msgid "The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request." msgstr "" msgid "The collection of events added to the data gathered for that stage." msgstr "" +msgid "The fork relationship has been removed." +msgstr "" + msgid "The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage." msgstr "" @@ -146,6 +552,15 @@ msgstr "" msgid "The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle." msgstr "" +msgid "The project can be accessed by any logged in user." +msgstr "" + +msgid "The project can be accessed without any authentication." +msgstr "" + +msgid "The repository for this project does not exist." +msgstr "" + msgid "The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request." msgstr "" @@ -161,6 +576,9 @@ msgstr "" msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgstr "" +msgid "This means you can not push code until you create an empty repository or import existing one." +msgstr "" + msgid "Time before an issue gets scheduled" msgstr "" @@ -173,6 +591,129 @@ msgstr "" msgid "Time until first merge request" msgstr "" +msgid "Timeago|%s days ago" +msgstr "" + +msgid "Timeago|%s days remaining" +msgstr "" + +msgid "Timeago|%s hours remaining" +msgstr "" + +msgid "Timeago|%s minutes ago" +msgstr "" + +msgid "Timeago|%s minutes remaining" +msgstr "" + +msgid "Timeago|%s months ago" +msgstr "" + +msgid "Timeago|%s months remaining" +msgstr "" + +msgid "Timeago|%s seconds remaining" +msgstr "" + +msgid "Timeago|%s weeks ago" +msgstr "" + +msgid "Timeago|%s weeks remaining" +msgstr "" + +msgid "Timeago|%s years ago" +msgstr "" + +msgid "Timeago|%s years remaining" +msgstr "" + +msgid "Timeago|1 day remaining" +msgstr "" + +msgid "Timeago|1 hour remaining" +msgstr "" + +msgid "Timeago|1 minute remaining" +msgstr "" + +msgid "Timeago|1 month remaining" +msgstr "" + +msgid "Timeago|1 week remaining" +msgstr "" + +msgid "Timeago|1 year remaining" +msgstr "" + +msgid "Timeago|Past due" +msgstr "" + +msgid "Timeago|a day ago" +msgstr "" + +msgid "Timeago|a month ago" +msgstr "" + +msgid "Timeago|a week ago" +msgstr "" + +msgid "Timeago|a while" +msgstr "" + +msgid "Timeago|a year ago" +msgstr "" + +msgid "Timeago|about %s hours ago" +msgstr "" + +msgid "Timeago|about a minute ago" +msgstr "" + +msgid "Timeago|about an hour ago" +msgstr "" + +msgid "Timeago|in %s days" +msgstr "" + +msgid "Timeago|in %s hours" +msgstr "" + +msgid "Timeago|in %s minutes" +msgstr "" + +msgid "Timeago|in %s months" +msgstr "" + +msgid "Timeago|in %s seconds" +msgstr "" + +msgid "Timeago|in %s weeks" +msgstr "" + +msgid "Timeago|in %s years" +msgstr "" + +msgid "Timeago|in 1 day" +msgstr "" + +msgid "Timeago|in 1 hour" +msgstr "" + +msgid "Timeago|in 1 minute" +msgstr "" + +msgid "Timeago|in 1 month" +msgstr "" + +msgid "Timeago|in 1 week" +msgstr "" + +msgid "Timeago|in 1 year" +msgstr "" + +msgid "Timeago|less than a minute ago" +msgstr "" + msgid "Time|hr" msgid_plural "Time|hrs" msgstr[0] "" @@ -192,16 +733,88 @@ msgstr "" msgid "Total test time for all commits/merges" msgstr "" +msgid "Unstar" +msgstr "" + +msgid "Upload New File" +msgstr "" + +msgid "Upload file" +msgstr "" + +msgid "Use your global notification setting" +msgstr "" + +msgid "VisibilityLevel|Internal" +msgstr "" + +msgid "VisibilityLevel|Private" +msgstr "" + +msgid "VisibilityLevel|Public" +msgstr "" + msgid "Want to see the data? Please ask an administrator for access." msgstr "" msgid "We don't have enough data to show this stage." msgstr "" +msgid "Withdraw Access Request" +msgstr "" + +msgid "" +"You are going to remove %{project_name_with_namespace}.\n" +"Removed project CANNOT be restored!\n" +"Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You can only add files when you are on a branch" +msgstr "" + +msgid "You must sign in to star a project" +msgstr "" + msgid "You need permission." msgstr "" +msgid "You will not get any notifications via email" +msgstr "" + +msgid "You will only receive notifications for the events you choose" +msgstr "" + +msgid "You will only receive notifications for threads you have participated in" +msgstr "" + +msgid "You will receive notifications for any activity" +msgstr "" + +msgid "You will receive notifications only for comments in which you were @mentioned" +msgstr "" + +msgid "You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account" +msgstr "" + +msgid "You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile" +msgstr "" + +msgid "Your name" +msgstr "" + +msgid "committed" +msgstr "" + msgid "day" msgid_plural "days" msgstr[0] "" msgstr[1] "" + +msgid "notification emails" +msgstr "" diff --git a/locale/es/gitlab.po b/locale/es/gitlab.po index b61846b9c7d..78d28d69885 100644 --- a/locale/es/gitlab.po +++ b/locale/es/gitlab.po @@ -7,24 +7,170 @@ msgid "" msgstr "" "Project-Id-Version: gitlab 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2017-05-20 22:37-0500\n" +"PO-Revision-Date: 2017-06-07 12:29-0500\n" "Language-Team: Spanish\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"Last-Translator: \n" -"X-Generator: Poedit 2.0.1\n" +"Last-Translator: Bob Van Landuyt \n" +"X-Generator: Poedit 2.0.2\n" + +msgid "About auto deploy" +msgstr "Acerca del auto despliegue" + +msgid "Activity" +msgstr "Actividad" + +msgid "Add Changelog" +msgstr "Agregar Changelog" + +msgid "Add Contribution guide" +msgstr "Agregar guía de contribución" + +msgid "Add License" +msgstr "Agregar Licencia" + +msgid "Add an SSH key to your profile to pull or push via SSH." +msgstr "Agregar una clave SSH a tu perfil para actualizar o enviar a través de SSH." + +msgid "Add new directory" +msgstr "Agregar nuevo directorio" + +msgid "Archived project! Repository is read-only" +msgstr "¡Proyecto archivado! El repositorio es de sólo lectura" + +msgid "Branch" +msgid_plural "Branches" +msgstr[0] "Rama" +msgstr[1] "Ramas" + +msgid "Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}" +msgstr "La rama %{branch_name} fue creada. Para configurar el auto despliegue, escoge una plantilla Yaml para GitLab CI y envía tus cambios. %{link_to_autodeploy_doc}" + +msgid "Branches" +msgstr "Ramas" msgid "ByAuthor|by" msgstr "por" +msgid "CI configuration" +msgstr "Configuración de CI" + +msgid "Changelog" +msgstr "Changelog" + +msgid "Charts" +msgstr "Gráficos" + +msgid "CiStatusLabel|canceled" +msgstr "cancelado" + +msgid "CiStatusLabel|created" +msgstr "creado" + +msgid "CiStatusLabel|failed" +msgstr "fallado" + +msgid "CiStatusLabel|manual action" +msgstr "acción manual" + +msgid "CiStatusLabel|passed" +msgstr "pasó" + +msgid "CiStatusLabel|passed with warnings" +msgstr "pasó con advertencias" + +msgid "CiStatusLabel|pending" +msgstr "pendiente" + +msgid "CiStatusLabel|skipped" +msgstr "omitido" + +msgid "CiStatusLabel|waiting for manual action" +msgstr "esperando acción manual" + +msgid "CiStatusText|blocked" +msgstr "bloqueado" + +msgid "CiStatusText|canceled" +msgstr "cancelado" + +msgid "CiStatusText|created" +msgstr "creado" + +msgid "CiStatusText|failed" +msgstr "fallado" + +msgid "CiStatusText|manual" +msgstr "manual" + +msgid "CiStatusText|passed" +msgstr "pasó" + +msgid "CiStatusText|pending" +msgstr "pendiente" + +msgid "CiStatusText|skipped" +msgstr "omitido" + +msgid "CiStatus|running" +msgstr "en ejecución" + msgid "Commit" msgid_plural "Commits" msgstr[0] "Cambio" msgstr[1] "Cambios" +msgid "CommitMessage|Add %{file_name}" +msgstr "Agregar %{file_name}" + +msgid "Commits" +msgstr "Cambios" + +msgid "Commits|History" +msgstr "Historial" + +msgid "Compare" +msgstr "Comparar" + +msgid "Contribution guide" +msgstr "Guía de contribución" + +msgid "Contributors" +msgstr "Contribuidores" + +msgid "Copy URL to clipboard" +msgstr "Copiar URL al portapapeles" + +msgid "Copy commit SHA to clipboard" +msgstr "Copiar SHA del cambio al portapapeles" + +msgid "Create New Directory" +msgstr "Crear Nuevo Directorio" + +msgid "Create directory" +msgstr "Crear directorio" + +msgid "Create empty bare repository" +msgstr "Crear repositorio vacío" + +msgid "Create merge request" +msgstr "Crear solicitud de fusión" + +msgid "CreateNewFork|Fork" +msgstr "Bifurcar" + +msgid "Custom notification events" +msgstr "Eventos de notificaciones personalizadas" + +msgid "Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}." +msgstr "Los niveles de notificación personalizados son los mismos que los niveles participantes. Con los niveles de notificación personalizados, también recibirá notificaciones para eventos seleccionados. Para obtener más información, consulte %{notification_link}." + +msgid "Cycle Analytics" +msgstr "Cycle Analytics" + msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgstr "Cycle Analytics ofrece una visión general de cuánto tiempo tarda en pasar de idea a producción en su proyecto." @@ -43,7 +189,6 @@ msgstr "Producción" msgid "CycleAnalyticsStage|Review" msgstr "Revisión" -#, fuzzy msgid "CycleAnalyticsStage|Staging" msgstr "Puesta en escena" @@ -55,26 +200,98 @@ msgid_plural "Deploys" msgstr[0] "Despliegue" msgstr[1] "Despliegues" +msgid "Directory name" +msgstr "Nombre del directorio" + +msgid "Don't show again" +msgstr "No mostrar de nuevo" + +msgid "Download tar" +msgstr "Descargar tar" + +msgid "Download tar.bz2" +msgstr "Descargar tar.bz2" + +msgid "Download tar.gz" +msgstr "Descargar tar.gz" + +msgid "Download zip" +msgstr "Descargar zip" + +msgid "DownloadArtifacts|Download" +msgstr "Descargar" + +msgid "DownloadSource|Download" +msgstr "Descargar" + +msgid "Files" +msgstr "Archivos" + +msgid "Find by path" +msgstr "Buscar por ruta" + +msgid "Find file" +msgstr "Buscar archivo" + msgid "FirstPushedBy|First" msgstr "Primer" msgid "FirstPushedBy|pushed by" msgstr "enviado por" +msgid "ForkedFromProjectPath|Forked from" +msgstr "Bifurcado de" + +msgid "Forks" +msgstr "Bifurcaciones" + msgid "From issue creation until deploy to production" msgstr "Desde la creación de la incidencia hasta el despliegue a producción" msgid "From merge request merge until deploy to production" msgstr "Desde la integración de la solicitud de fusión hasta el despliegue a producción" +msgid "Go to your fork" +msgstr "Ir a tu bifurcación" + +msgid "GoToYourFork|Fork" +msgstr "Bifurcación" + +msgid "Home" +msgstr "Inicio" + +msgid "Housekeeping successfully started" +msgstr "Servicio de limpieza iniciado con éxito" + +msgid "Import repository" +msgstr "Importar repositorio" + msgid "Introducing Cycle Analytics" msgstr "Introducción a Cycle Analytics" +msgid "LFSStatus|Disabled" +msgstr "Deshabilitado" + +msgid "LFSStatus|Enabled" +msgstr "Habilitado" + msgid "Last %d day" msgid_plural "Last %d days" msgstr[0] "Último %d día" msgstr[1] "Últimos %d días" +msgid "Last Update" +msgstr "Última actualización" + +msgid "Last commit" +msgstr "Último cambio" + +msgid "Leave group" +msgstr "Abandonar grupo" + +msgid "Leave project" +msgstr "Abandonar proyecto" + msgid "Limited to showing %d event at most" msgid_plural "Limited to showing %d events at most" msgstr[0] "Limitado a mostrar máximo %d evento" @@ -83,29 +300,167 @@ msgstr[1] "Limitado a mostrar máximo %d eventos" msgid "Median" msgstr "Mediana" +msgid "MissingSSHKeyWarningLink|add an SSH key" +msgstr "agregar una clave SSH" + msgid "New Issue" msgid_plural "New Issues" msgstr[0] "Nueva incidencia" msgstr[1] "Nuevas incidencias" +msgid "New branch" +msgstr "Nueva rama" + +msgid "New directory" +msgstr "Nuevo directorio" + +msgid "New file" +msgstr "Nuevo archivo" + +msgid "New issue" +msgstr "Nueva incidencia" + +msgid "New merge request" +msgstr "Nueva solicitud de fusión" + +msgid "New snippet" +msgstr "Nuevo fragmento de código" + +msgid "New tag" +msgstr "Nueva etiqueta" + +msgid "No repository" +msgstr "No hay repositorio" + msgid "Not available" msgstr "No disponible" msgid "Not enough data" msgstr "No hay suficientes datos" +msgid "Notification events" +msgstr "Eventos de notificación" + +msgid "NotificationEvent|Close issue" +msgstr "Cerrar incidencia" + +msgid "NotificationEvent|Close merge request" +msgstr "Cerrar solicitud de fusión" + +msgid "NotificationEvent|Failed pipeline" +msgstr "Pipeline fallido" + +msgid "NotificationEvent|Merge merge request" +msgstr "Integrar solicitud de fusión" + +msgid "NotificationEvent|New issue" +msgstr "Nueva incidencia" + +msgid "NotificationEvent|New merge request" +msgstr "Nueva solicitud de fusión" + +msgid "NotificationEvent|New note" +msgstr "Nueva nota" + +msgid "NotificationEvent|Reassign issue" +msgstr "Reasignar incidencia" + +msgid "NotificationEvent|Reassign merge request" +msgstr "Reasignar solicitud de fusión" + +msgid "NotificationEvent|Reopen issue" +msgstr "Reabrir incidencia" + +msgid "NotificationEvent|Successful pipeline" +msgstr "Pipeline exitoso" + +msgid "NotificationLevel|Custom" +msgstr "Personalizado" + +msgid "NotificationLevel|Disabled" +msgstr "Deshabilitado" + +msgid "NotificationLevel|Global" +msgstr "Global" + +msgid "NotificationLevel|On mention" +msgstr "Cuando me mencionan" + +msgid "NotificationLevel|Participate" +msgstr "Participación" + +msgid "NotificationLevel|Watch" +msgstr "Vigilancia" + msgid "OpenedNDaysAgo|Opened" msgstr "Abierto" msgid "Pipeline Health" msgstr "Estado del Pipeline" +msgid "Project '%{project_name}' queued for deletion." +msgstr "Proyecto ‘%{project_name}’ en cola para eliminación." + +msgid "Project '%{project_name}' was successfully created." +msgstr "Proyecto ‘%{project_name}’ fue creado satisfactoriamente." + +msgid "Project '%{project_name}' was successfully updated." +msgstr "Proyecto ‘%{project_name}’ fue actualizado satisfactoriamente." + +msgid "Project '%{project_name}' will be deleted." +msgstr "Proyecto ‘%{project_name}’ será eliminado." + +msgid "Project access must be granted explicitly to each user." +msgstr "El acceso al proyecto debe concederse explícitamente a cada usuario." + +msgid "Project export could not be deleted." +msgstr "No se pudo eliminar la exportación del proyecto." + +msgid "Project export has been deleted." +msgstr "La exportación del proyecto ha sido eliminada." + +msgid "Project export link has expired. Please generate a new export from your project settings." +msgstr "El enlace de exportación del proyecto ha caducado. Por favor, genera una nueva exportación desde la configuración del proyecto." + +msgid "Project export started. A download link will be sent by email." +msgstr "Se inició la exportación del proyecto. Se enviará un enlace de descarga por correo electrónico." + +msgid "Project home" +msgstr "Inicio del proyecto" + +msgid "ProjectFeature|Disabled" +msgstr "Deshabilitada" + +msgid "ProjectFeature|Everyone with access" +msgstr "Todos con acceso" + +msgid "ProjectFeature|Only team members" +msgstr "Solo miembros del equipo" + +msgid "ProjectFileTree|Name" +msgstr "Nombre" + +msgid "ProjectLastActivity|Never" +msgstr "Nunca" + msgid "ProjectLifecycle|Stage" msgstr "Etapa" +msgid "ProjectNetworkGraph|Graph" +msgstr "Historial gráfico" + msgid "Read more" msgstr "Leer más" +msgid "Readme" +msgstr "Readme" + +msgid "RefSwitcher|Branches" +msgstr "Ramas" + +msgid "RefSwitcher|Tags" +msgstr "Etiquetas" + msgid "Related Commits" msgstr "Cambios Relacionados" @@ -124,17 +479,67 @@ msgstr "Solicitudes de fusión Relacionadas" msgid "Related Merged Requests" msgstr "Solicitudes de fusión Relacionadas" +msgid "Remind later" +msgstr "Recordar después" + +msgid "Remove project" +msgstr "Eliminar proyecto" + +msgid "Request Access" +msgstr "Solicitar acceso" + +msgid "Search branches and tags" +msgstr "Buscar ramas y etiquetas" + +msgid "Select Archive Format" +msgstr "Seleccionar formato de archivo" + +msgid "Set a password on your account to pull or push via %{protocol}" +msgstr "Establezca una contraseña en su cuenta para actualizar o enviar a través de% {protocol}" + +msgid "Set up CI" +msgstr "Configurar CI" + +msgid "Set up Koding" +msgstr "Configurar Koding" + +msgid "Set up auto deploy" +msgstr "Configurar auto despliegue" + +msgid "SetPasswordToCloneLink|set a password" +msgstr "establecer una contraseña" + msgid "Showing %d event" msgid_plural "Showing %d events" msgstr[0] "Mostrando %d evento" msgstr[1] "Mostrando %d eventos" +msgid "Source code" +msgstr "Código fuente" + +msgid "StarProject|Star" +msgstr "Destacar" + +msgid "Switch branch/tag" +msgstr "Cambiar rama/etiqueta" + +msgid "Tag" +msgid_plural "Tags" +msgstr[0] "Etiqueta" +msgstr[1] "Etiquetas" + +msgid "Tags" +msgstr "Etiquetas" + msgid "The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request." msgstr "La etapa de desarrollo muestra el tiempo desde el primer cambio hasta la creación de la solicitud de fusión. Los datos serán automáticamente incorporados aquí una vez creada tu primera solicitud de fusión." msgid "The collection of events added to the data gathered for that stage." msgstr "La colección de eventos agregados a los datos recopilados para esa etapa." +msgid "The fork relationship has been removed." +msgstr "La relación con la bifurcación se ha eliminado." + msgid "The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage." msgstr "La etapa de incidencia muestra el tiempo que toma desde la creación de un tema hasta asignar el tema a un hito, o añadir el tema a una lista en el panel de temas. Empieza a crear temas para ver los datos de esta etapa." @@ -147,6 +552,15 @@ msgstr "La etapa de planificación muestra el tiempo desde el paso anterior hast msgid "The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle." msgstr "La etapa de producción muestra el tiempo total que tarda entre la creación de una incidencia y el despliegue del código a producción. Los datos se añadirán automáticamente una vez haya finalizado por completo el ciclo de idea a producción." +msgid "The project can be accessed by any logged in user." +msgstr "El proyecto puede ser accedido por cualquier usuario conectado." + +msgid "The project can be accessed without any authentication." +msgstr "El proyecto puede accederse sin ninguna autenticación." + +msgid "The repository for this project does not exist." +msgstr "El repositorio para este proyecto no existe." + msgid "The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request." msgstr "La etapa de revisión muestra el tiempo desde la creación de la solicitud de fusión hasta que los cambios se fusionaron. Los datos se añadirán automáticamente después de fusionar su primera solicitud de fusión." @@ -162,6 +576,9 @@ msgstr "El tiempo utilizado por cada entrada de datos obtenido por esa etapa." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgstr "El valor en el punto medio de una serie de valores observados. Por ejemplo, entre 3, 5, 9, la mediana es 5. Entre 3, 5, 7, 8, la mediana es (5 + 7) / 2 = 6." +msgid "This means you can not push code until you create an empty repository or import existing one." +msgstr "Esto significa que no puede enviar código hasta que cree un repositorio vacío o importe uno existente." + msgid "Time before an issue gets scheduled" msgstr "Tiempo antes de que una incidencia sea programada" @@ -174,6 +591,129 @@ msgstr "Tiempo entre la creación de la solicitud de fusión y la integración o msgid "Time until first merge request" msgstr "Tiempo hasta la primera solicitud de fusión" +msgid "Timeago|%s days ago" +msgstr "hace %s días" + +msgid "Timeago|%s days remaining" +msgstr "%s días restantes" + +msgid "Timeago|%s hours remaining" +msgstr "%s horas restantes" + +msgid "Timeago|%s minutes ago" +msgstr "hace %s minutos" + +msgid "Timeago|%s minutes remaining" +msgstr "%s minutos restantes" + +msgid "Timeago|%s months ago" +msgstr "hace %s meses" + +msgid "Timeago|%s months remaining" +msgstr "%s meses restantes" + +msgid "Timeago|%s seconds remaining" +msgstr "%s segundos restantes" + +msgid "Timeago|%s weeks ago" +msgstr "hace %s semanas" + +msgid "Timeago|%s weeks remaining" +msgstr "%s semanas restantes" + +msgid "Timeago|%s years ago" +msgstr "hace %s años" + +msgid "Timeago|%s years remaining" +msgstr "%s años restantes" + +msgid "Timeago|1 day remaining" +msgstr "1 día restante" + +msgid "Timeago|1 hour remaining" +msgstr "1 hora restante" + +msgid "Timeago|1 minute remaining" +msgstr "1 minuto restante" + +msgid "Timeago|1 month remaining" +msgstr "1 mes restante" + +msgid "Timeago|1 week remaining" +msgstr "1 semana restante" + +msgid "Timeago|1 year remaining" +msgstr "1 año restante" + +msgid "Timeago|Past due" +msgstr "Atrasado" + +msgid "Timeago|a day ago" +msgstr "hace un día" + +msgid "Timeago|a month ago" +msgstr "hace 1 mes" + +msgid "Timeago|a week ago" +msgstr "hace 1 semana" + +msgid "Timeago|a while" +msgstr "hace un momento" + +msgid "Timeago|a year ago" +msgstr "hace 1 año" + +msgid "Timeago|about %s hours ago" +msgstr "hace alrededor de %s horas" + +msgid "Timeago|about a minute ago" +msgstr "hace alrededor de 1 minuto" + +msgid "Timeago|about an hour ago" +msgstr "hace alrededor de 1 hora" + +msgid "Timeago|in %s days" +msgstr "en %s días" + +msgid "Timeago|in %s hours" +msgstr "en %s horas" + +msgid "Timeago|in %s minutes" +msgstr "en %s minutos" + +msgid "Timeago|in %s months" +msgstr "en %s meses" + +msgid "Timeago|in %s seconds" +msgstr "en %s segundos" + +msgid "Timeago|in %s weeks" +msgstr "en %s semanas" + +msgid "Timeago|in %s years" +msgstr "en %s años" + +msgid "Timeago|in 1 day" +msgstr "en 1 día" + +msgid "Timeago|in 1 hour" +msgstr "en 1 hora" + +msgid "Timeago|in 1 minute" +msgstr "en 1 minuto" + +msgid "Timeago|in 1 month" +msgstr "en 1 mes" + +msgid "Timeago|in 1 week" +msgstr "en 1 semana" + +msgid "Timeago|in 1 year" +msgstr "en 1 año" + +msgid "Timeago|less than a minute ago" +msgstr "hace menos de 1 minuto" + msgid "Time|hr" msgid_plural "Time|hrs" msgstr[0] "hr" @@ -193,16 +733,91 @@ msgstr "Tiempo Total" msgid "Total test time for all commits/merges" msgstr "Tiempo total de pruebas para todos los cambios o integraciones" +msgid "Unstar" +msgstr "No Destacar" + +msgid "Upload New File" +msgstr "Subir nuevo archivo" + +msgid "Upload file" +msgstr "Subir archivo" + +msgid "Use your global notification setting" +msgstr "Utiliza tu configuración de notificación global" + +msgid "VisibilityLevel|Internal" +msgstr "Interno" + +msgid "VisibilityLevel|Private" +msgstr "Privado" + +msgid "VisibilityLevel|Public" +msgstr "Público" + msgid "Want to see the data? Please ask an administrator for access." msgstr "¿Quieres ver los datos? Por favor pide acceso al administrador." msgid "We don't have enough data to show this stage." msgstr "No hay suficientes datos para mostrar en esta etapa." +msgid "Withdraw Access Request" +msgstr "Retirar Solicitud de Acceso" + +msgid "" +"You are going to remove %{project_name_with_namespace}.\n" +"Removed project CANNOT be restored!\n" +"Are you ABSOLUTELY sure?" +msgstr "" +"Va a eliminar %{project_name_with_namespace}.\n" +"¡El proyecto eliminado NO puede ser restaurado!\n" +"¿Estás TOTALMENTE seguro?" + +msgid "You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?" +msgstr "Vas a eliminar el enlace de la bifurcación con el proyecto original %{forked_from_project}. ¿Estás TOTALMENTE seguro?" + +msgid "You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?" +msgstr "Vas a transferir %{project_name_with_namespace} a otro propietario. ¿Estás TOTALMENTE seguro?" + +msgid "You can only add files when you are on a branch" +msgstr "Sólo puede agregar archivos cuando estas en una rama" + +msgid "You must sign in to star a project" +msgstr "Debes iniciar sesión para destacar un proyecto" + msgid "You need permission." msgstr "Necesitas permisos." +msgid "You will not get any notifications via email" +msgstr "No recibirás ninguna notificación por correo electrónico" + +msgid "You will only receive notifications for the events you choose" +msgstr "Solo recibirás notificaciones de los eventos que elijas" + +msgid "You will only receive notifications for threads you have participated in" +msgstr "Solo recibirás notificaciones de los temas en los que has participado" + +msgid "You will receive notifications for any activity" +msgstr "Recibirás notificaciones para cualquier actividad" + +msgid "You will receive notifications only for comments in which you were @mentioned" +msgstr "Recibirás notificaciones sólo para los comentarios en los que se te mencionó" + +msgid "You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account" +msgstr "No podrás actualizar o enviar código al proyecto a través de %{protocol} hasta que %{set_password_link} en tu cuenta" + +msgid "You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile" +msgstr "No podrás actualizar o enviar código al proyecto a través de SSH hasta que %{add_ssh_key_link} en su perfil" + +msgid "Your name" +msgstr "Tu nombre" + +msgid "committed" +msgstr "cambió" + msgid "day" msgid_plural "days" msgstr[0] "día" msgstr[1] "días" + +msgid "notification emails" +msgstr "correos electrónicos de notificación" diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 3967d40ea9e..483412baa05 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gitlab 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-04 19:24-0500\n" -"PO-Revision-Date: 2017-05-04 19:24-0500\n" +"POT-Creation-Date: 2017-06-07 17:36+0200\n" +"PO-Revision-Date: 2017-06-07 17:36+0200\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -18,14 +18,160 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +msgid "About auto deploy" +msgstr "" + +msgid "Activity" +msgstr "" + +msgid "Add Changelog" +msgstr "" + +msgid "Add Contribution guide" +msgstr "" + +msgid "Add License" +msgstr "" + +msgid "Add an SSH key to your profile to pull or push via SSH." +msgstr "" + +msgid "Add new directory" +msgstr "" + +msgid "Archived project! Repository is read-only" +msgstr "" + +msgid "Branch" +msgid_plural "Branches" +msgstr[0] "" +msgstr[1] "" + +msgid "Branch %{branch_name} was created. To set up auto deploy, choose a GitLab CI Yaml template and commit your changes. %{link_to_autodeploy_doc}" +msgstr "" + +msgid "Branches" +msgstr "" + msgid "ByAuthor|by" msgstr "" +msgid "CI configuration" +msgstr "" + +msgid "Changelog" +msgstr "" + +msgid "Charts" +msgstr "" + +msgid "CiStatusLabel|canceled" +msgstr "" + +msgid "CiStatusLabel|created" +msgstr "" + +msgid "CiStatusLabel|failed" +msgstr "" + +msgid "CiStatusLabel|manual action" +msgstr "" + +msgid "CiStatusLabel|passed" +msgstr "" + +msgid "CiStatusLabel|passed with warnings" +msgstr "" + +msgid "CiStatusLabel|pending" +msgstr "" + +msgid "CiStatusLabel|skipped" +msgstr "" + +msgid "CiStatusLabel|waiting for manual action" +msgstr "" + +msgid "CiStatusText|blocked" +msgstr "" + +msgid "CiStatusText|canceled" +msgstr "" + +msgid "CiStatusText|created" +msgstr "" + +msgid "CiStatusText|failed" +msgstr "" + +msgid "CiStatusText|manual" +msgstr "" + +msgid "CiStatusText|passed" +msgstr "" + +msgid "CiStatusText|pending" +msgstr "" + +msgid "CiStatusText|skipped" +msgstr "" + +msgid "CiStatus|running" +msgstr "" + msgid "Commit" msgid_plural "Commits" msgstr[0] "" msgstr[1] "" +msgid "CommitMessage|Add %{file_name}" +msgstr "" + +msgid "Commits" +msgstr "" + +msgid "Commits|History" +msgstr "" + +msgid "Compare" +msgstr "" + +msgid "Contribution guide" +msgstr "" + +msgid "Contributors" +msgstr "" + +msgid "Copy URL to clipboard" +msgstr "" + +msgid "Copy commit SHA to clipboard" +msgstr "" + +msgid "Create New Directory" +msgstr "" + +msgid "Create directory" +msgstr "" + +msgid "Create empty bare repository" +msgstr "" + +msgid "Create merge request" +msgstr "" + +msgid "CreateNewFork|Fork" +msgstr "" + +msgid "Custom notification events" +msgstr "" + +msgid "Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out %{notification_link}." +msgstr "" + +msgid "Cycle Analytics" +msgstr "" + msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgstr "" @@ -55,26 +201,98 @@ msgid_plural "Deploys" msgstr[0] "" msgstr[1] "" +msgid "Directory name" +msgstr "" + +msgid "Don't show again" +msgstr "" + +msgid "Download tar" +msgstr "" + +msgid "Download tar.bz2" +msgstr "" + +msgid "Download tar.gz" +msgstr "" + +msgid "Download zip" +msgstr "" + +msgid "DownloadArtifacts|Download" +msgstr "" + +msgid "DownloadSource|Download" +msgstr "" + +msgid "Files" +msgstr "" + +msgid "Find by path" +msgstr "" + +msgid "Find file" +msgstr "" + msgid "FirstPushedBy|First" msgstr "" msgid "FirstPushedBy|pushed by" msgstr "" +msgid "ForkedFromProjectPath|Forked from" +msgstr "" + +msgid "Forks" +msgstr "" + msgid "From issue creation until deploy to production" msgstr "" msgid "From merge request merge until deploy to production" msgstr "" +msgid "Go to your fork" +msgstr "" + +msgid "GoToYourFork|Fork" +msgstr "" + +msgid "Home" +msgstr "" + +msgid "Housekeeping successfully started" +msgstr "" + +msgid "Import repository" +msgstr "" + msgid "Introducing Cycle Analytics" msgstr "" +msgid "LFSStatus|Disabled" +msgstr "" + +msgid "LFSStatus|Enabled" +msgstr "" + msgid "Last %d day" msgid_plural "Last %d days" msgstr[0] "" msgstr[1] "" +msgid "Last Update" +msgstr "" + +msgid "Last commit" +msgstr "" + +msgid "Leave group" +msgstr "" + +msgid "Leave project" +msgstr "" + msgid "Limited to showing %d event at most" msgid_plural "Limited to showing %d events at most" msgstr[0] "" @@ -83,29 +301,167 @@ msgstr[1] "" msgid "Median" msgstr "" +msgid "MissingSSHKeyWarningLink|add an SSH key" +msgstr "" + msgid "New Issue" msgid_plural "New Issues" msgstr[0] "" msgstr[1] "" +msgid "New branch" +msgstr "" + +msgid "New directory" +msgstr "" + +msgid "New file" +msgstr "" + +msgid "New issue" +msgstr "" + +msgid "New merge request" +msgstr "" + +msgid "New snippet" +msgstr "" + +msgid "New tag" +msgstr "" + +msgid "No repository" +msgstr "" + msgid "Not available" msgstr "" msgid "Not enough data" msgstr "" +msgid "Notification events" +msgstr "" + +msgid "NotificationEvent|Close issue" +msgstr "" + +msgid "NotificationEvent|Close merge request" +msgstr "" + +msgid "NotificationEvent|Failed pipeline" +msgstr "" + +msgid "NotificationEvent|Merge merge request" +msgstr "" + +msgid "NotificationEvent|New issue" +msgstr "" + +msgid "NotificationEvent|New merge request" +msgstr "" + +msgid "NotificationEvent|New note" +msgstr "" + +msgid "NotificationEvent|Reassign issue" +msgstr "" + +msgid "NotificationEvent|Reassign merge request" +msgstr "" + +msgid "NotificationEvent|Reopen issue" +msgstr "" + +msgid "NotificationEvent|Successful pipeline" +msgstr "" + +msgid "NotificationLevel|Custom" +msgstr "" + +msgid "NotificationLevel|Disabled" +msgstr "" + +msgid "NotificationLevel|Global" +msgstr "" + +msgid "NotificationLevel|On mention" +msgstr "" + +msgid "NotificationLevel|Participate" +msgstr "" + +msgid "NotificationLevel|Watch" +msgstr "" + msgid "OpenedNDaysAgo|Opened" msgstr "" msgid "Pipeline Health" msgstr "" +msgid "Project '%{project_name}' queued for deletion." +msgstr "" + +msgid "Project '%{project_name}' was successfully created." +msgstr "" + +msgid "Project '%{project_name}' was successfully updated." +msgstr "" + +msgid "Project '%{project_name}' will be deleted." +msgstr "" + +msgid "Project access must be granted explicitly to each user." +msgstr "" + +msgid "Project export could not be deleted." +msgstr "" + +msgid "Project export has been deleted." +msgstr "" + +msgid "Project export link has expired. Please generate a new export from your project settings." +msgstr "" + +msgid "Project export started. A download link will be sent by email." +msgstr "" + +msgid "Project home" +msgstr "" + +msgid "ProjectFeature|Disabled" +msgstr "" + +msgid "ProjectFeature|Everyone with access" +msgstr "" + +msgid "ProjectFeature|Only team members" +msgstr "" + +msgid "ProjectFileTree|Name" +msgstr "" + +msgid "ProjectLastActivity|Never" +msgstr "" + msgid "ProjectLifecycle|Stage" msgstr "" +msgid "ProjectNetworkGraph|Graph" +msgstr "" + msgid "Read more" msgstr "" +msgid "Readme" +msgstr "" + +msgid "RefSwitcher|Branches" +msgstr "" + +msgid "RefSwitcher|Tags" +msgstr "" + msgid "Related Commits" msgstr "" @@ -124,17 +480,67 @@ msgstr "" msgid "Related Merged Requests" msgstr "" +msgid "Remind later" +msgstr "" + +msgid "Remove project" +msgstr "" + +msgid "Request Access" +msgstr "" + +msgid "Search branches and tags" +msgstr "" + +msgid "Select Archive Format" +msgstr "" + +msgid "Set a password on your account to pull or push via %{protocol}" +msgstr "" + +msgid "Set up CI" +msgstr "" + +msgid "Set up Koding" +msgstr "" + +msgid "Set up auto deploy" +msgstr "" + +msgid "SetPasswordToCloneLink|set a password" +msgstr "" + msgid "Showing %d event" msgid_plural "Showing %d events" msgstr[0] "" msgstr[1] "" +msgid "Source code" +msgstr "" + +msgid "StarProject|Star" +msgstr "" + +msgid "Switch branch/tag" +msgstr "" + +msgid "Tag" +msgid_plural "Tags" +msgstr[0] "" +msgstr[1] "" + +msgid "Tags" +msgstr "" + msgid "The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request." msgstr "" msgid "The collection of events added to the data gathered for that stage." msgstr "" +msgid "The fork relationship has been removed." +msgstr "" + msgid "The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage." msgstr "" @@ -147,6 +553,15 @@ msgstr "" msgid "The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle." msgstr "" +msgid "The project can be accessed by any logged in user." +msgstr "" + +msgid "The project can be accessed without any authentication." +msgstr "" + +msgid "The repository for this project does not exist." +msgstr "" + msgid "The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request." msgstr "" @@ -162,6 +577,9 @@ msgstr "" msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgstr "" +msgid "This means you can not push code until you create an empty repository or import existing one." +msgstr "" + msgid "Time before an issue gets scheduled" msgstr "" @@ -174,6 +592,129 @@ msgstr "" msgid "Time until first merge request" msgstr "" +msgid "Timeago|%s days ago" +msgstr "" + +msgid "Timeago|%s days remaining" +msgstr "" + +msgid "Timeago|%s hours remaining" +msgstr "" + +msgid "Timeago|%s minutes ago" +msgstr "" + +msgid "Timeago|%s minutes remaining" +msgstr "" + +msgid "Timeago|%s months ago" +msgstr "" + +msgid "Timeago|%s months remaining" +msgstr "" + +msgid "Timeago|%s seconds remaining" +msgstr "" + +msgid "Timeago|%s weeks ago" +msgstr "" + +msgid "Timeago|%s weeks remaining" +msgstr "" + +msgid "Timeago|%s years ago" +msgstr "" + +msgid "Timeago|%s years remaining" +msgstr "" + +msgid "Timeago|1 day remaining" +msgstr "" + +msgid "Timeago|1 hour remaining" +msgstr "" + +msgid "Timeago|1 minute remaining" +msgstr "" + +msgid "Timeago|1 month remaining" +msgstr "" + +msgid "Timeago|1 week remaining" +msgstr "" + +msgid "Timeago|1 year remaining" +msgstr "" + +msgid "Timeago|Past due" +msgstr "" + +msgid "Timeago|a day ago" +msgstr "" + +msgid "Timeago|a month ago" +msgstr "" + +msgid "Timeago|a week ago" +msgstr "" + +msgid "Timeago|a while" +msgstr "" + +msgid "Timeago|a year ago" +msgstr "" + +msgid "Timeago|about %s hours ago" +msgstr "" + +msgid "Timeago|about a minute ago" +msgstr "" + +msgid "Timeago|about an hour ago" +msgstr "" + +msgid "Timeago|in %s days" +msgstr "" + +msgid "Timeago|in %s hours" +msgstr "" + +msgid "Timeago|in %s minutes" +msgstr "" + +msgid "Timeago|in %s months" +msgstr "" + +msgid "Timeago|in %s seconds" +msgstr "" + +msgid "Timeago|in %s weeks" +msgstr "" + +msgid "Timeago|in %s years" +msgstr "" + +msgid "Timeago|in 1 day" +msgstr "" + +msgid "Timeago|in 1 hour" +msgstr "" + +msgid "Timeago|in 1 minute" +msgstr "" + +msgid "Timeago|in 1 month" +msgstr "" + +msgid "Timeago|in 1 week" +msgstr "" + +msgid "Timeago|in 1 year" +msgstr "" + +msgid "Timeago|less than a minute ago" +msgstr "" + msgid "Time|hr" msgid_plural "Time|hrs" msgstr[0] "" @@ -193,16 +734,88 @@ msgstr "" msgid "Total test time for all commits/merges" msgstr "" +msgid "Unstar" +msgstr "" + +msgid "Upload New File" +msgstr "" + +msgid "Upload file" +msgstr "" + +msgid "Use your global notification setting" +msgstr "" + +msgid "VisibilityLevel|Internal" +msgstr "" + +msgid "VisibilityLevel|Private" +msgstr "" + +msgid "VisibilityLevel|Public" +msgstr "" + msgid "Want to see the data? Please ask an administrator for access." msgstr "" msgid "We don't have enough data to show this stage." msgstr "" +msgid "Withdraw Access Request" +msgstr "" + +msgid "" +"You are going to remove %{project_name_with_namespace}.\n" +"Removed project CANNOT be restored!\n" +"Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You are going to remove the fork relationship to source project %{forked_from_project}. Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?" +msgstr "" + +msgid "You can only add files when you are on a branch" +msgstr "" + +msgid "You must sign in to star a project" +msgstr "" + msgid "You need permission." msgstr "" +msgid "You will not get any notifications via email" +msgstr "" + +msgid "You will only receive notifications for the events you choose" +msgstr "" + +msgid "You will only receive notifications for threads you have participated in" +msgstr "" + +msgid "You will receive notifications for any activity" +msgstr "" + +msgid "You will receive notifications only for comments in which you were @mentioned" +msgstr "" + +msgid "You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account" +msgstr "" + +msgid "You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile" +msgstr "" + +msgid "Your name" +msgstr "" + +msgid "committed" +msgstr "" + msgid "day" msgid_plural "days" msgstr[0] "" msgstr[1] "" + +msgid "notification emails" +msgstr "" diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index c66b9a34b86..b1f9eb15667 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -17,10 +17,10 @@ feature "New project", feature: true do expect(find_field("project_visibility_level_#{level}")).to be_checked end - it 'saves visibility level on validation error' do + it "saves visibility level #{level} on validation error" do visit new_project_path - choose(key) + choose(s_(key)) click_button('Create project') expect(find_field("project_visibility_level_#{level}")).to be_checked diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index 9d5f009ebe1..9ecaabc04ed 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -12,5 +12,11 @@ describe NotificationsHelper do describe 'notification_title' do it { expect(notification_title(:watch)).to match('Watch') } it { expect(notification_title(:mention)).to match('On mention') } + it { expect(notification_title(:global)).to match('Global') } + end + + describe '#notification_event_name' do + it { expect(notification_event_name(:success_pipeline)).to match('Successful pipeline') } + it { expect(notification_event_name(:failed_pipeline)).to match('Failed pipeline') } end end diff --git a/spec/javascripts/build_spec.js b/spec/javascripts/build_spec.js index 461908f3fde..4c8a48580d7 100644 --- a/spec/javascripts/build_spec.js +++ b/spec/javascripts/build_spec.js @@ -58,7 +58,7 @@ describe('Build', () => { it('displays the remove date correctly', () => { const removeDateElement = document.querySelector('.js-artifacts-remove'); - expect(removeDateElement.innerText.trim()).toBe('1 year'); + expect(removeDateElement.innerText.trim()).toBe('1 year remaining'); }); }); diff --git a/spec/javascripts/datetime_utility_spec.js b/spec/javascripts/datetime_utility_spec.js index e347c980c78..c82ad0bea48 100644 --- a/spec/javascripts/datetime_utility_spec.js +++ b/spec/javascripts/datetime_utility_spec.js @@ -2,6 +2,26 @@ import '~/lib/utils/datetime_utility'; (() => { describe('Date time utils', () => { + describe('timeFor', () => { + it('returns `past due` when in past', () => { + const date = new Date(); + date.setFullYear(date.getFullYear() - 1); + + expect( + gl.utils.timeFor(date), + ).toBe('Past due'); + }); + + it('returns remaining time when in the future', () => { + const date = new Date(); + date.setFullYear(date.getFullYear() + 1); + + expect( + gl.utils.timeFor(date), + ).toBe('1 year remaining'); + }); + }); + describe('get day name', () => { it('should return Sunday', () => { const day = gl.utils.getDayName(new Date('07/17/2016')); diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 3c566c04d6b..40298dcb723 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -115,7 +115,7 @@ describe Projects::CreateService, '#execute', services: true do stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::PUBLIC]) opts.merge!( - visibility_level: Gitlab::VisibilityLevel.options['Public'] + visibility_level: Gitlab::VisibilityLevel::PUBLIC ) end -- cgit v1.2.1 From a5c6c90a8f1bf4938d03dfb303f3768e20add610 Mon Sep 17 00:00:00 2001 From: Regis Date: Wed, 7 Jun 2017 14:48:27 -0600 Subject: Update CHANGELOG.md for 9.1.7 [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e354b2c25..28722b4302a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -223,6 +223,10 @@ entry. - Fix preemptive scroll bar on user activity calendar. - Pipeline chat notifications convert seconds to minutes and hours. +## 9.1.7 (2017-06-07) + +- No changes. + ## 9.1.6 (2017-06-02) - Fix visibility when referencing snippets. -- cgit v1.2.1 From bf601f0775d0138f30721f350f9ed3535c7e701f Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 22:49:22 +0200 Subject: Fixed spec test syntax errors --- spec/features/explore/new_menu_spec.rb | 62 +++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb index 8fc8d0e8975..eaf431f82b1 100644 --- a/spec/features/explore/new_menu_spec.rb +++ b/spec/features/explore/new_menu_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Top Plus Menu', :js, :feature do +feature 'Top Plus Menu', feature: true, js: true do let!(:user) { create :user } let!(:group) { create(:group) } let!(:public_group) { create(:group, :public) } @@ -20,7 +20,7 @@ describe 'Top Plus Menu', :js, :feature do login_as :user end - scenario 'click on New project shows new project page' + scenario 'click on New project shows new project page' do visit root_dashboard_path click_topmenuitem("New project") @@ -29,7 +29,7 @@ describe 'Top Plus Menu', :js, :feature do expect(page).to have_content('Project name') end - scenario 'click on New group shows new group page' + scenario 'click on New group shows new group page' do visit root_dashboard_path click_topmenuitem("New group") @@ -38,7 +38,7 @@ describe 'Top Plus Menu', :js, :feature do expect(page).to have_content('Group name') end - scenario 'click on New group shows new group page' + scenario 'click on New snippet shows new snippet page' do visit root_dashboard_path click_topmenuitem("New snippet") @@ -46,6 +46,60 @@ describe 'Top Plus Menu', :js, :feature do expect(page).to have_content('New Snippet') expect(page).to have_content('Title') end + + scenario 'click on New issue shows new issue page' do + visit namespace_project_path(empty_project.namespace, empty_project) + + click_topmenuitem("New issue") + + expect(page).to have_content('New Issue') + expect(page).to have_content('Title') + end + + scenario 'click on New merge request shows new merge request page' do + visit namespace_project_path(empty_project.namespace, empty_project) + + click_topmenuitem("New merge request") + + expect(page).to have_content('New Merge Request') + expect(page).to have_content('Source branch') + expect(page).to have_content('Target branch') + end + + scenario 'click on New project snippet shows new snippet page' do + visit namespace_project_path(empty_project.namespace, empty_project) + + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + find('.header-new-project-snippet a').trigger('click') + end + + expect(page).to have_content('New Snippet') + expect(page).to have_content('Title') + end + + scenario 'Click on New subgroup shows new group page' do + visit group_path(group) + + click_topmenuitem("New subgroup") + + expect(page).to have_content('Group path') + expect(page).to have_content('Group name') + end + + scenario 'Click on New project in group shows new project page' do + visit group_path(group) + + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + find('.header-new-group-project a').trigger('click') + end + + expect(page).to have_content('Project path') + expect(page).to have_content('Project name') + end end def click_topmenuitem(item_name) -- cgit v1.2.1 From f9b32e8c13e979ea8dc60681f7fa4c0b22d099cc Mon Sep 17 00:00:00 2001 From: Regis Date: Wed, 7 Jun 2017 14:52:23 -0600 Subject: Update CHANGELOG.md for 9.2.5 [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28722b4302a..abbdd8cb1e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 9.2.5 (2017-06-07) + +- No changes. + ## 9.2.4 (2017-06-02) - Fix visibility when referencing snippets. -- cgit v1.2.1 From 14e64d29661e5a25242f7c1c65d080facc5b3b8d Mon Sep 17 00:00:00 2001 From: Regis Date: Wed, 7 Jun 2017 14:58:09 -0600 Subject: Update CHANGELOG.md for 9.0.10 [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abbdd8cb1e7..e5567dc3b39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -539,6 +539,10 @@ entry. - Only send chat notifications for the default branch. - Don't fill in the default kubernetes namespace. +## 9.0.10 (2017-06-07) + +- No changes. + ## 9.0.9 (2017-06-02) - Fix visibility when referencing snippets. -- cgit v1.2.1 From 95b84a06a8aa0c771fb97974fcf845367dfe2bb0 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Wed, 7 Jun 2017 14:51:16 -0500 Subject: Remove unnecessary transition --- app/assets/stylesheets/pages/issuable.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index a321941e0c9..75e0cd6eaa6 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -756,7 +756,6 @@ position: -webkit-sticky; top: 60px; z-index: 200; - @include transition(all); } } } -- cgit v1.2.1 From 8f64a5a80a1479550fb5c5d346b1cf52865fc080 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Fri, 2 Jun 2017 11:19:33 -0500 Subject: Improve form spec --- spec/features/issues/form_spec.rb | 41 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 8949dbcb663..96d37e33f3d 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -24,37 +24,17 @@ describe 'New/edit issue', :feature, :js do visit new_namespace_project_issue_path(project.namespace, project) end - describe 'shorten users API pagination limit' do + describe 'shorten users API pagination limit (CE)' do before do + # Using `allow_any_instance_of`/`and_wrap_original`, `original` would + # somehow refer to the very block we defined to _wrap_ that method, instead of + # the original method, resulting in infinite recurison when called. + # This is likely a bug with helper modules included into dynamically generated view classes. + # To work around this, we have to hold on to and call to the original implementation manually. + original_issue_dropdown_options = FormHelper.instance_method(:issue_dropdown_options) allow_any_instance_of(FormHelper).to receive(:issue_dropdown_options).and_wrap_original do |original, *args| - has_multiple_assignees = *args[1] - - options = { - toggle_class: 'js-user-search js-assignee-search js-multiselect js-save-user-data', - title: 'Select assignee', - filter: true, - dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee', - placeholder: 'Search users', - data: { - per_page: 1, - null_user: true, - current_user: true, - project_id: project.try(:id), - field_name: "issue[assignee_ids][]", - default_label: 'Assignee', - 'max-select': 1, - 'dropdown-header': 'Assignee', - multi_select: true, - 'input-meta': 'name', - 'always-show-selectbox': true - } - } - - if has_multiple_assignees - options[:title] = 'Select assignee(s)' - options[:data][:'dropdown-header'] = 'Assignee(s)' - options[:data].delete(:'max-select') - end + options = original_issue_dropdown_options.bind(original.receiver).call(*args) + options[:data][:per_page] = 2 options end @@ -74,6 +54,7 @@ describe 'New/edit issue', :feature, :js do click_link user2.name end + find('.js-assignee-search').click find('.js-dropdown-input-clear').click page.within '.dropdown-menu-user' do @@ -83,7 +64,7 @@ describe 'New/edit issue', :feature, :js do end end - describe 'single assignee' do + describe 'single assignee (CE)' do before do click_button 'Unassigned' -- cgit v1.2.1 From 9647d2e76d05e8720bfe695918e292e57307900e Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Wed, 7 Jun 2017 23:59:25 +0200 Subject: Enhancing Spec's with negative cases --- features/explore/new_menu.feature | 55 ----------------------- features/steps/explore/new_menu.rb | 81 ---------------------------------- spec/features/explore/new_menu_spec.rb | 67 +++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 148 deletions(-) delete mode 100644 features/explore/new_menu.feature delete mode 100644 features/steps/explore/new_menu.rb diff --git a/features/explore/new_menu.feature b/features/explore/new_menu.feature deleted file mode 100644 index b920a319b80..00000000000 --- a/features/explore/new_menu.feature +++ /dev/null @@ -1,55 +0,0 @@ -@explore -Feature: New Menu -Background: - Given I sign in as "John Doe" - And "John Doe" is owner of group "Owned" - And I own project "Shop" - And I visit dashboard page - - @javascript - Scenario: I should see New Projects page - When I visit dashboard page - And I click "New project" in top right menu - Then I see "New Project" page - - @javascript - Scenario: I should see New Group page - When I visit dashboard page - And I click "New group" in top right menu - Then I see "New Group" page - - @javascript - Scenario: I should see New Snippet page - When I visit dashboard page - And I click "New snippet" in top right menu - Then I see "New Snippet" page - - @javascript - Scenario: I should see New Issue page - When I visit project "Shop" page - And I click "New issue" in top right menu - Then I see "New Issue" page - - @javascript - Scenario: I should see New Merge Request page - When I visit project "Shop" page - And I click "New merge request" in top right menu - Then I see "New Merge Request" page - - @javascript - Scenario: I should see New Project Snippet page - When I visit project "Shop" page - And I click "New project snippet" in top right menu - Then I see "New Snippet" page - - @javascript - Scenario: I should see New Group Project page - When I visit group "Owned" page - And I click "New group project" in top right menu - Then I see "New Project" page - - @javascript - Scenario: I should see New Subgroup page - When I visit group "Owned" page - And I click "New subgroup" in top right menu - Then I see "New Group" page diff --git a/features/steps/explore/new_menu.rb b/features/steps/explore/new_menu.rb deleted file mode 100644 index 17fd3a9a8ce..00000000000 --- a/features/steps/explore/new_menu.rb +++ /dev/null @@ -1,81 +0,0 @@ -class Spinach::Features::NewMenu < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedGroup - include SharedUser - - step 'I click "New project" in top right menu' do - click_topmenuitem("New project") - end - - step 'I click "New group" in top right menu' do - click_topmenuitem("New group") - end - - step 'I click "New snippet" in top right menu' do - click_topmenuitem("New snippet") - end - - step 'I click "New project snippet" in top right menu' do - page.within '.header-content' do - find('.header-new-dropdown-toggle').trigger('click') - expect(page).to have_selector('.header-new.dropdown.open', count: 1) - find('.header-new-project-snippet a').trigger('click') - end - end - - step 'I click "New issue" in top right menu' do - click_topmenuitem("New issue") - end - - step 'I click "New merge request" in top right menu' do - click_topmenuitem("New merge request") - end - - step 'I click "New subgroup" in top right menu' do - click_topmenuitem("New subgroup") - end - - step 'I click "New group project" in top right menu' do - page.within '.header-content' do - find('.header-new-dropdown-toggle').trigger('click') - expect(page).to have_selector('.header-new.dropdown.open', count: 1) - find('.header-new-group-project a').trigger('click') - end - end - - step 'I see "New Project" page' do - expect(page).to have_content('Project path') - expect(page).to have_content('Project name') - end - - step 'I see "New Group" page' do - expect(page).to have_content('Group path') - expect(page).to have_content('Group name') - end - - step 'I see "New Snippet" page' do - expect(page).to have_content('New Snippet') - expect(page).to have_content('Title') - end - - step 'I see "New Issue" page' do - expect(page).to have_content('New Issue') - expect(page).to have_content('Title') - end - - step 'I see "New Merge Request" page' do - expect(page).to have_content('New Merge Request') - expect(page).to have_content('Source branch') - expect(page).to have_content('Target branch') - end - - def click_topmenuitem(item_name) - page.within '.header-content' do - find('.header-new-dropdown-toggle').trigger('click') - expect(page).to have_selector('.header-new.dropdown.open', count: 1) - click_link item_name - end - end -end diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb index eaf431f82b1..ae65f25d48b 100644 --- a/spec/features/explore/new_menu_spec.rb +++ b/spec/features/explore/new_menu_spec.rb @@ -1,23 +1,22 @@ require 'spec_helper' feature 'Top Plus Menu', feature: true, js: true do - let!(:user) { create :user } - let!(:group) { create(:group) } - let!(:public_group) { create(:group, :public) } - let!(:private_group) { create(:group, :private) } - let!(:empty_project) { create(:empty_project, group: public_group) } + let(:user) { create :user } + let(:guest_user) { create :user} + let(:group) { create(:group) } + let(:public_group) { create(:group, :public) } + let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) } before do group.add_owner(user) + group.add_guest(guest_user) - login_as(user) - - visit explore_groups_path + project.add_guest(guest_user) end context 'used by full user' do before do - login_as :user + login_as(user) end scenario 'click on New project shows new project page' do @@ -48,7 +47,7 @@ feature 'Top Plus Menu', feature: true, js: true do end scenario 'click on New issue shows new issue page' do - visit namespace_project_path(empty_project.namespace, empty_project) + visit namespace_project_path(project.namespace, project) click_topmenuitem("New issue") @@ -57,7 +56,7 @@ feature 'Top Plus Menu', feature: true, js: true do end scenario 'click on New merge request shows new merge request page' do - visit namespace_project_path(empty_project.namespace, empty_project) + visit namespace_project_path(project.namespace, project) click_topmenuitem("New merge request") @@ -67,7 +66,7 @@ feature 'Top Plus Menu', feature: true, js: true do end scenario 'click on New project snippet shows new snippet page' do - visit namespace_project_path(empty_project.namespace, empty_project) + visit namespace_project_path(project.namespace, project) page.within '.header-content' do find('.header-new-dropdown-toggle').trigger('click') @@ -102,6 +101,45 @@ feature 'Top Plus Menu', feature: true, js: true do end end + context 'used by guest user' do + before do + login_as(guest_user) + end + + scenario 'click on New issue shows new issue page' do + visit namespace_project_path(project.namespace, project) + + click_topmenuitem("New issue") + + expect(page).to have_content('New Issue') + expect(page).to have_content('Title') + end + + scenario 'has no New merge request menu item' do + visit namespace_project_path(project.namespace, project) + + hasnot_topmenuitem("New merge request") + end + + scenario 'has no New project snippet menu item' do + visit namespace_project_path(project.namespace, project) + + expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet') + end + + scenario 'has no New subgroup menu item' do + visit group_path(group) + + hasnot_topmenuitem("New subgroup") + end + + scenario 'has no New project for group menu item' do + visit group_path(group) + + expect(find('.header-new.dropdown')).not_to have_selector('.header-new-group-project') + end + end + def click_topmenuitem(item_name) page.within '.header-content' do find('.header-new-dropdown-toggle').trigger('click') @@ -109,4 +147,9 @@ feature 'Top Plus Menu', feature: true, js: true do click_link item_name end end + + def hasnot_topmenuitem(item_name) + expect(find('.header-new.dropdown')).not_to have_content(item_name) + end + end end -- cgit v1.2.1 From 81b565ee36179561dcae8d428a712fa5fe1cc04b Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Thu, 8 Jun 2017 00:02:31 +0200 Subject: Fix End Syntax Error --- spec/features/explore/new_menu_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb index ae65f25d48b..cbd97ff74b3 100644 --- a/spec/features/explore/new_menu_spec.rb +++ b/spec/features/explore/new_menu_spec.rb @@ -149,7 +149,6 @@ feature 'Top Plus Menu', feature: true, js: true do end def hasnot_topmenuitem(item_name) - expect(find('.header-new.dropdown')).not_to have_content(item_name) - end - end + expect(find('.header-new.dropdown')).not_to have_content(item_name) + end end -- cgit v1.2.1 From 39d976cf5881c947eefeb45a2f8fe2922923eac6 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Thu, 8 Jun 2017 00:37:45 +0200 Subject: Added more negative checks for public project --- spec/features/explore/new_menu_spec.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb index cbd97ff74b3..15a6354211b 100644 --- a/spec/features/explore/new_menu_spec.rb +++ b/spec/features/explore/new_menu_spec.rb @@ -4,8 +4,8 @@ feature 'Top Plus Menu', feature: true, js: true do let(:user) { create :user } let(:guest_user) { create :user} let(:group) { create(:group) } - let(:public_group) { create(:group, :public) } let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) } + let(:public_project) { create(:project, :public) } before do group.add_owner(user) @@ -127,6 +127,24 @@ feature 'Top Plus Menu', feature: true, js: true do expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet') end + scenario 'public project has no New Issue Button' do + visit namespace_project_path(public_project.namespace, public_project) + + hasnot_topmenuitem("New issue") + end + + scenario 'public project has no New merge request menu item' do + visit namespace_project_path(public_project.namespace, public_project) + + hasnot_topmenuitem("New merge request") + end + + scenario 'public project has no New project snippet menu item' do + visit namespace_project_path(public_project.namespace, public_project) + + expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet') + end + scenario 'has no New subgroup menu item' do visit group_path(group) -- cgit v1.2.1 From b14f313c834c72bd9acc3fd2827696bb6e806afc Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Wed, 7 Jun 2017 17:07:59 -0700 Subject: update rouge to 2.1.0 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fe9d7a2b6f9..b5f9c3beca7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -655,7 +655,7 @@ GEM retriable (1.4.1) rinku (2.0.0) rotp (2.1.2) - rouge (2.0.7) + rouge (2.1.0) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) -- cgit v1.2.1 From 7a07ecebaf507632c255b7743c858a861845f4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Carlb=C3=A4cker?= Date: Thu, 8 Jun 2017 00:47:10 +0000 Subject: nil-check Repository::is_ancestor? --- app/models/repository.rb | 2 ++ spec/models/repository_spec.rb | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 07e0b3bae4f..00a0b407512 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -946,6 +946,8 @@ class Repository end def is_ancestor?(ancestor_id, descendant_id) + return false if ancestor_id.nil? || descendant_id.nil? + Gitlab::GitalyClient.migrate(:is_ancestor) do |is_enabled| if is_enabled raw_repository.is_ancestor?(ancestor_id, descendant_id) diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 718b7d5e86b..a6d4d92c450 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1905,19 +1905,43 @@ describe Repository, models: true do end describe '#is_ancestor?' do - context 'Gitaly is_ancestor feature enabled' do - let(:commit) { repository.commit } - let(:ancestor) { commit.parents.first } + let(:commit) { repository.commit } + let(:ancestor) { commit.parents.first } + context 'with Gitaly enabled' do + it 'it is an ancestor' do + expect(repository.is_ancestor?(ancestor.id, commit.id)).to eq(true) + end + + it 'it is not an ancestor' do + expect(repository.is_ancestor?(commit.id, ancestor.id)).to eq(false) + end + + it 'returns false on nil-values' do + expect(repository.is_ancestor?(nil, commit.id)).to eq(false) + expect(repository.is_ancestor?(ancestor.id, nil)).to eq(false) + expect(repository.is_ancestor?(nil, nil)).to eq(false) + end + end + + context 'with Gitaly disabled' do before do - allow(Gitlab::GitalyClient).to receive(:enabled?).and_return(true) - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) + allow(Gitlab::GitalyClient).to receive(:enabled?).and_return(false) + allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(false) end - it "asks Gitaly server if it's an ancestor" do - expect_any_instance_of(Gitlab::GitalyClient::Commit).to receive(:is_ancestor).with(ancestor.id, commit.id) + it 'it is an ancestor' do + expect(repository.is_ancestor?(ancestor.id, commit.id)).to eq(true) + end + + it 'it is not an ancestor' do + expect(repository.is_ancestor?(commit.id, ancestor.id)).to eq(false) + end - repository.is_ancestor?(ancestor.id, commit.id) + it 'returns false on nil-values' do + expect(repository.is_ancestor?(nil, commit.id)).to eq(false) + expect(repository.is_ancestor?(ancestor.id, nil)).to eq(false) + expect(repository.is_ancestor?(nil, nil)).to eq(false) end end end -- cgit v1.2.1 From c50cded96e5f6f0eaadf9e49ac98f722f09b8fa8 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Wed, 7 Jun 2017 17:49:03 -0700 Subject: remove the rouge copypasta and add notes to refactor --- lib/rouge/lexers/math.rb | 16 ++-------------- lib/rouge/lexers/plantuml.rb | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/lib/rouge/lexers/math.rb b/lib/rouge/lexers/math.rb index 80784adfd76..939b23a3421 100644 --- a/lib/rouge/lexers/math.rb +++ b/lib/rouge/lexers/math.rb @@ -1,21 +1,9 @@ module Rouge module Lexers - class Math < Lexer + class Math < PlainText title "A passthrough lexer used for LaTeX input" - desc "A boring lexer that doesn't highlight anything" - + desc "PLEASE REFACTOR - this should be handled by SyntaxHighlightFilter" tag 'math' - mimetypes 'text/plain' - - default_options token: 'Text' - - def token - @token ||= Token[option :token] - end - - def stream_tokens(string, &b) - yield self.token, string - end end end end diff --git a/lib/rouge/lexers/plantuml.rb b/lib/rouge/lexers/plantuml.rb index 7d5700b7f6d..63c461764fc 100644 --- a/lib/rouge/lexers/plantuml.rb +++ b/lib/rouge/lexers/plantuml.rb @@ -1,21 +1,9 @@ module Rouge module Lexers - class Plantuml < Lexer + class Plantuml < PlainText title "A passthrough lexer used for PlantUML input" - desc "A boring lexer that doesn't highlight anything" - + desc "PLEASE REFACTOR - this should be handled by SyntaxHighlightFilter" tag 'plantuml' - mimetypes 'text/plain' - - default_options token: 'Text' - - def token - @token ||= Token[option :token] - end - - def stream_tokens(string, &b) - yield self.token, string - end end end end -- cgit v1.2.1 From c55b4269dcae55884bcec4121fc4835b6dbf78f1 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Thu, 8 Jun 2017 01:15:40 +0000 Subject: Responsive table fixes --- .../environments/components/environment.vue | 2 +- .../components/environment_actions.vue | 2 +- .../environments/components/environment_item.vue | 10 ++++--- .../environments/components/environments_table.vue | 10 +++---- .../stylesheets/framework/responsive-tables.scss | 9 ++++--- app/assets/stylesheets/pages/environments.scss | 8 ++++-- app/views/projects/deployments/_actions.haml | 2 +- app/views/projects/deployments/_commit.html.haml | 31 +++++++++++----------- .../projects/deployments/_deployment.html.haml | 12 ++++++--- app/views/projects/environments/show.html.haml | 10 +++---- 10 files changed, 55 insertions(+), 41 deletions(-) diff --git a/app/assets/javascripts/environments/components/environment.vue b/app/assets/javascripts/environments/components/environment.vue index 28597c799df..8120ef182d4 100644 --- a/app/assets/javascripts/environments/components/environment.vue +++ b/app/assets/javascripts/environments/components/environment.vue @@ -230,7 +230,7 @@ export default { -
    +
    -