OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
New version 2.1
Tey, Benjamin88613af014ae
diff --git a/README.md b/README.mdindex 68e36731198..21d9fe0b6d4 100644--- a/README.md+++ b/README.md@@ -1,19 +1,17 @@# openproject-gitlab-integration-## NEW VERSION 2.0.9 GA+## NEW VERSION 2.0.6 GA-Based on the current Github integration (OpenProject 12), this plugin offers the same functionalities as the current plugin for Github. This version includes changes to the DB and a new view similar to the current Github tab. Only the management of "pipelines" is pending an open issue in Gitlab (https://gitlab.com/gitlab-org/gitlab/-/issues/345028).+Based on the current Github integration (OpenProject 12), this plugin offers the same functionalities as the current plugin for Github (and something else). This version includes changes to the DB and a new view similar to the current Github tab. Only the management of "pipelines" is pending an open issue in Gitlab (https://gitlab.com/gitlab-org/gitlab/-/issues/345028).-<img width="559" alt="preview" src="https://user-images.githubusercontent.com/14983519/225098893-a8753955-ef14-4494-b06b-673267cbda7e.png">++This 2.x version includes a UI with all linked MRs, their status, their labels and the last pipeline *(pending the Gitlab issue)*.## IntroductionOpenProject module for integration with Gitlab:-* Latest Gitlab release tested: **15.9**-* Latest OpenProject release tested: **12.5.1**- * for OpenProject versions earlier than 12.4.5 use v2.0.8- * for OpenProject versions earlier than 12.2.0 use v2.0.5- * for OpenProject versions earlier than 12.1.0 use v2.0.4+* Latest Gitlab release tested: **15.3.1**+* Latest OpenProject release tested: **12.2.1** (for OpenProject versions earlier than 12.2.0 use v2.0.5, and for version earlier than 12.1.0 use v2.0.4)This plugin is based on the current [plugin to integrate Github with OpenProject](https://www.openproject.org/docs/system-admin-guide/integrations/github-integration/).@@ -159,7 +157,7 @@ Add the following in **Gemfile.lock**:PATHremote: modules/gitlab_integrationspecs:- openproject-gitlab_integration (2.0.9)+ openproject-gitlab_integration (2.0.6)openproject-webhooks```@@ -210,10 +208,10 @@ In Gitlab you have to set up a webhook in each repository to be integrated withYou need to configure just two things in the webhook:-1. The URL must point to your OpenProject server’s Gitlab webhook endpoint (/webhooks/gitlab). Append it to the URL as a simple GET parameter named key with previouslly generated token as value. In the end the URL should look something like this:+1. The URL must point to your OpenProject server’s Gitlab webhook endpoint (/webhooks/gitlab). Append it to the URL as a simple GET parameter named key. In the end the URL should look something like this:```- http://openproject-url.com/webhooks/gitlab?key=generated_access_token+ http://openproject-url.com/webhooks/gitlab?key=ae278268```2. Enable the required triggers:diff --git a/app/models/gitlab_issue.rb b/app/models/gitlab_issue.rbnew file mode 100644index 00000000000..d7fe501a8a4--- /dev/null+++ b/app/models/gitlab_issue.rb@@ -0,0 +1,86 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#++++class GitlabIssue < ApplicationRecord+ LABEL_KEYS = %w[color title].freeze++ has_and_belongs_to_many :work_packages+ belongs_to :gitlab_user, optional: true++ enum state: {+ opened: 'opened',+ closed: 'closed'+ }++ validates_presence_of :gitlab_html_url,+ :number,+ :repository,+ :state,+ :title,+ :gitlab_updated_at+ validates_presence_of :body,+ unless: :partial?+ validate :validate_labels_schema++ scope :without_work_package, -> { left_outer_joins(:work_packages).where(work_packages: { id: nil }) }++ def self.find_by_gitlab_identifiers(id: nil, url: nil, initialize: false)+ raise ArgumentError, "needs an id or an url" if id.nil? && url.blank?++ found = where(gitlab_id: id).or(where(gitlab_html_url: url)).take++ if found+ found+ elsif initialize+ new(gitlab_id: id, gitlab_html_url: url)+ end+ end++ def partial?+ [body].all?(&:nil?)+ end++ private++ def validate_labels_schema+ return if labels.nil?+ return if labels.all? { |label| label.keys.sort == LABEL_KEYS }++ errors.add(:labels, 'invalid schema')+ end++ def with_logging+ yield if block_given?+ rescue StandardError => e+ Rails.logger.error "Error at gitlab issue: #{e} #{e.message}"+ raise e+ end+enddiff --git a/app/models/gitlab_merge_request.rb b/app/models/gitlab_merge_request.rbindex ca99e18eb59..4449e85810b 100644--- a/app/models/gitlab_merge_request.rb+++ b/app/models/gitlab_merge_request.rb@@ -34,7 +34,6 @@ class GitlabMergeRequest < ApplicationRecordhas_and_belongs_to_many :work_packageshas_many :gitlab_pipelines, dependent: :destroy- has_many :github_check_runs, dependent: :destroybelongs_to :gitlab_user, optional: truebelongs_to :merged_by, optional: true, class_name: 'GitlabUser'diff --git a/app/models/gitlab_pipeline.rb b/app/models/gitlab_pipeline.rbindex 4433ad3e840..24b4c163312 100644--- a/app/models/gitlab_pipeline.rb+++ b/app/models/gitlab_pipeline.rb@@ -34,15 +34,25 @@ class GitlabPipeline < ApplicationRecord# TODO: confirm with the gitlab documentation what are the different statuses.enum status: {- completed: 'completed',- in_progress: 'in_progress',+ created: 'created',+ running: 'running',success: 'success',- queued: 'queued'+ waiting: 'waiting',+ preparing: 'preparing',+ failed: 'failed',+ pending: 'pending',+ canceled: 'canceled',+ skipped: 'skipped',+ manual: 'manual',+ scheduled: 'scheduled'}validates_presence_of :gitlab_user_avatar_url,:gitlab_html_url,:gitlab_id,:status,- :name+ :name,+ :ci_details,+ :commit_id,+ :usernameenddiff --git a/config/locales/crowdin/js-ar.yml b/config/locales/crowdin/js-ar.ymlindex 3e2028a64cb..f575fa9efb7 100644--- a/config/locales/crowdin/js-ar.yml+++ b/config/locales/crowdin/js-ar.yml@@ -31,7 +31,9 @@ ar:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ ar:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-bg.yml b/config/locales/crowdin/js-bg.ymlindex 3cd8fa468f3..78c2bb6ec51 100644--- a/config/locales/crowdin/js-bg.yml+++ b/config/locales/crowdin/js-bg.yml@@ -31,7 +31,9 @@ bg:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ bg:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-ca.yml b/config/locales/crowdin/js-ca.ymlindex c0204c42e06..723b26e95bc 100644--- a/config/locales/crowdin/js-ca.yml+++ b/config/locales/crowdin/js-ca.yml@@ -31,7 +31,9 @@ ca:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ ca:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-cs.yml b/config/locales/crowdin/js-cs.ymlindex a5d495518c2..a8905380a2b 100644--- a/config/locales/crowdin/js-cs.yml+++ b/config/locales/crowdin/js-cs.yml@@ -31,7 +31,9 @@ cs:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ cs:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-da.yml b/config/locales/crowdin/js-da.ymlindex eac4cb5ec5c..c168aaeb6d5 100644--- a/config/locales/crowdin/js-da.yml+++ b/config/locales/crowdin/js-da.yml@@ -31,7 +31,9 @@ da:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ da:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-de.yml b/config/locales/crowdin/js-de.ymlindex b194a00b07c..066a3896891 100644--- a/config/locales/crowdin/js-de.yml+++ b/config/locales/crowdin/js-de.yml@@ -31,7 +31,9 @@ de:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ de:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-el.yml b/config/locales/crowdin/js-el.ymlindex cb195d5a8e6..6ae410420ed 100644--- a/config/locales/crowdin/js-el.yml+++ b/config/locales/crowdin/js-el.yml@@ -31,7 +31,9 @@ el:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ el:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-es.yml b/config/locales/crowdin/js-es.ymlindex bcd3948614f..4955957a802 100644--- a/config/locales/crowdin/js-es.yml+++ b/config/locales/crowdin/js-es.yml@@ -31,7 +31,9 @@ es:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ es:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-fi.yml b/config/locales/crowdin/js-fi.ymlindex cc7472c9b9b..00706809048 100644--- a/config/locales/crowdin/js-fi.yml+++ b/config/locales/crowdin/js-fi.yml@@ -31,7 +31,9 @@ fi:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ fi:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-fil.yml b/config/locales/crowdin/js-fil.ymlindex 8ec030ecc1d..5df29891722 100644--- a/config/locales/crowdin/js-fil.yml+++ b/config/locales/crowdin/js-fil.yml@@ -31,7 +31,9 @@ fil:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ fil:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-fr.yml b/config/locales/crowdin/js-fr.ymlindex 1a8b5fa42d9..a4cc350aacd 100644--- a/config/locales/crowdin/js-fr.yml+++ b/config/locales/crowdin/js-fr.yml@@ -31,7 +31,9 @@ fr:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ fr:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-hr.yml b/config/locales/crowdin/js-hr.ymlindex 4a7ba75de54..cb34ab81c26 100644--- a/config/locales/crowdin/js-hr.yml+++ b/config/locales/crowdin/js-hr.yml@@ -31,7 +31,9 @@ hr:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ hr:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-hu.yml b/config/locales/crowdin/js-hu.ymlindex 1dc122fadd7..b584ba1d94d 100644--- a/config/locales/crowdin/js-hu.yml+++ b/config/locales/crowdin/js-hu.yml@@ -31,7 +31,9 @@ hu:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ hu:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-id.yml b/config/locales/crowdin/js-id.ymlindex 87355960b03..922c5bf1d2d 100644--- a/config/locales/crowdin/js-id.yml+++ b/config/locales/crowdin/js-id.yml@@ -31,7 +31,9 @@ id:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ id:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-it.yml b/config/locales/crowdin/js-it.ymlindex c8a86bffd99..f1c7409c29b 100644--- a/config/locales/crowdin/js-it.yml+++ b/config/locales/crowdin/js-it.yml@@ -31,7 +31,9 @@ it:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ it:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-ja.yml b/config/locales/crowdin/js-ja.ymlindex 153e3ef8a0d..40a8e5fb36c 100644--- a/config/locales/crowdin/js-ja.yml+++ b/config/locales/crowdin/js-ja.yml@@ -31,7 +31,9 @@ ja:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ ja:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-ko.yml b/config/locales/crowdin/js-ko.ymlindex 183450ed5cf..3f58d75b880 100644--- a/config/locales/crowdin/js-ko.yml+++ b/config/locales/crowdin/js-ko.yml@@ -31,7 +31,9 @@ ko:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ ko:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-lt.yml b/config/locales/crowdin/js-lt.ymlindex 8e71278d579..b612d1be67d 100644--- a/config/locales/crowdin/js-lt.yml+++ b/config/locales/crowdin/js-lt.yml@@ -31,7 +31,9 @@ lt:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ lt:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-nl.yml b/config/locales/crowdin/js-nl.ymlindex ff8213d5df6..b0c8d39b54b 100644--- a/config/locales/crowdin/js-nl.yml+++ b/config/locales/crowdin/js-nl.yml@@ -31,7 +31,9 @@ nl:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ nl:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-no.yml b/config/locales/crowdin/js-no.ymlindex e5e6a941c5e..d8983e51a0c 100644--- a/config/locales/crowdin/js-no.yml+++ b/config/locales/crowdin/js-no.yml@@ -31,7 +31,9 @@gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-pl.yml b/config/locales/crowdin/js-pl.ymlindex 43b90e42366..35e9c52f07b 100644--- a/config/locales/crowdin/js-pl.yml+++ b/config/locales/crowdin/js-pl.yml@@ -31,7 +31,9 @@ pl:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ pl:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-pt.yml b/config/locales/crowdin/js-pt.ymlindex e61df0b657b..b265a3a11bc 100644--- a/config/locales/crowdin/js-pt.yml+++ b/config/locales/crowdin/js-pt.yml@@ -31,7 +31,9 @@ pt:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ pt:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-ro.yml b/config/locales/crowdin/js-ro.ymlindex 9e134ca512d..fc8bbb0003e 100644--- a/config/locales/crowdin/js-ro.yml+++ b/config/locales/crowdin/js-ro.yml@@ -31,7 +31,9 @@ ro:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ ro:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-ru.yml b/config/locales/crowdin/js-ru.ymlindex a51af8892da..a71c435d49d 100644--- a/config/locales/crowdin/js-ru.yml+++ b/config/locales/crowdin/js-ru.yml@@ -31,7 +31,9 @@ ru:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ ru:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-sk.yml b/config/locales/crowdin/js-sk.ymlindex 5e52f2533ea..2899069e371 100644--- a/config/locales/crowdin/js-sk.yml+++ b/config/locales/crowdin/js-sk.yml@@ -31,7 +31,9 @@ sk:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ sk:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-sl.yml b/config/locales/crowdin/js-sl.ymlindex fa126147b63..3cbbfd9a641 100644--- a/config/locales/crowdin/js-sl.yml+++ b/config/locales/crowdin/js-sl.yml@@ -31,7 +31,9 @@ sl:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ sl:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-sv.yml b/config/locales/crowdin/js-sv.ymlindex 589944e7527..48f132e8991 100644--- a/config/locales/crowdin/js-sv.yml+++ b/config/locales/crowdin/js-sv.yml@@ -31,7 +31,9 @@ sv:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ sv:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-tr.yml b/config/locales/crowdin/js-tr.ymlindex 1d2bff4723b..c5e59b0d466 100644--- a/config/locales/crowdin/js-tr.yml+++ b/config/locales/crowdin/js-tr.yml@@ -31,7 +31,9 @@ tr:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ tr:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-uk.yml b/config/locales/crowdin/js-uk.ymlindex a594075b427..b3088532bdd 100644--- a/config/locales/crowdin/js-uk.yml+++ b/config/locales/crowdin/js-uk.yml@@ -31,7 +31,9 @@ uk:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ uk:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-vi.yml b/config/locales/crowdin/js-vi.ymlindex 96ff09725bb..e1dffccfdeb 100644--- a/config/locales/crowdin/js-vi.yml+++ b/config/locales/crowdin/js-vi.yml@@ -31,7 +31,9 @@ vi:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ vi:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-zh-CN.yml b/config/locales/crowdin/js-zh-CN.ymlindex 356106c814d..59d1d96f023 100644--- a/config/locales/crowdin/js-zh-CN.yml+++ b/config/locales/crowdin/js-zh-CN.yml@@ -31,7 +31,9 @@ zh-CN:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ zh-CN:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/crowdin/js-zh-TW.yml b/config/locales/crowdin/js-zh-TW.ymlindex f25cb2161f9..2b5dddb91aa 100644--- a/config/locales/crowdin/js-zh-TW.yml+++ b/config/locales/crowdin/js-zh-TW.yml@@ -31,7 +31,9 @@ zh-TW:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -46,6 +48,9 @@ zh-TW:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:- empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> in the MR title/description or create a new MR.- gitlab_actions: Actions+ empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.+ gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex dd2d881a919..fac3b06a28f 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -32,7 +32,9 @@ en:gitlab_integration:work_packages:tab_name: "GitLab"- tab_header:+ tab_header_issue:+ title: "Issues"+ tab_header_mr:title: "Merge requests"create_mr:label: Create MR@@ -47,6 +49,9 @@ en:title: Quick snippets for Gitcopy_success: ✅ Copied!copy_error: ❌ Copy failed!+ tab_issue:+ empty: There are no issues linked yet. Link an existing issue by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the issue title/description or create a new issue.tab_mrs:empty: There are no merge requests linked yet. Link an existing MR by using the code <code>OP#%{wp_id}</code> (or <code>PP#%{wp_id}</code> for private links) in the MR title/description or create a new MR.gitlab_pipelines: Pipelines+ updated_on: Updated ondiff --git a/db/migrate/20211015110001_add_username_commit_to_pipelines.rb b/db/migrate/20211015110001_add_username_commit_to_pipelines.rbnew file mode 100644index 00000000000..2b621fa742d--- /dev/null+++ b/db/migrate/20211015110001_add_username_commit_to_pipelines.rb@@ -0,0 +1,36 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#++++class AddUsernameCommitToPipelines < ActiveRecord::Migration[7.0]+ def change+ add_column :gitlab_pipelines, :username, :text++ add_column :gitlab_pipelines, :commit_id, :text+ end+enddiff --git a/db/migrate/20211015110002_add_gitlab_issues.rb b/db/migrate/20211015110002_add_gitlab_issues.rbnew file mode 100644index 00000000000..2e046b29d5c--- /dev/null+++ b/db/migrate/20211015110002_add_gitlab_issues.rb@@ -0,0 +1,56 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#+++class AddGitlabIssues < ActiveRecord::Migration[7.0]+ # rubocop:disable Metrics/AbcSize+ def change+ create_table :gitlab_issues do |t|+ t.references :gitlab_user++ t.bigint :gitlab_id, unique: true+ t.integer :number, null: false+ t.string :gitlab_html_url, null: false, unique: true+ t.string :state, null: false+ t.string :repository, null: false+ t.datetime :gitlab_updated_at+ t.string :title+ t.text :body+ t.json :labels # [{name, color}]+ t.timestamps+ end++ create_join_table :gitlab_issues, :work_packages do |t|+ t.index :gitlab_issue_id, name: 'gitlab_issues_wp_issue_id'+ t.index %i[gitlab_issue_id work_package_id],+ unique: true,+ name: "unique_index_gl_issues_wps_on_gl_issue_id_and_wp_id"+ end++ end+ # rubocop:enable Metrics/AbcSize+enddiff --git a/frontend/module/git-actions-menu/git-actions-menu.component.ts b/frontend/module/git-actions-menu/git-actions-menu.component.tsindex 80ecfe7b0f7..a4130a90878 100644--- a/frontend/module/git-actions-menu/git-actions-menu.component.ts+++ b/frontend/module/git-actions-menu/git-actions-menu.component.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -51,11 +51,11 @@ export class GitActionsMenuComponent extends OPContextMenuComponent {@Input() public workPackage:WorkPackageResource;public text = {- title: this.I18n.t('js.gitlab_integration.tab_header.git_actions.title'),- copyButtonHelpText: this.I18n.t('js.gitlab_integration.tab_header.git_actions.copy_button_help'),+ title: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.title'),+ copyButtonHelpText: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.copy_button_help'),copyResult: {- success: this.I18n.t('js.gitlab_integration.tab_header.git_actions.copy_success'),- error: this.I18n.t('js.gitlab_integration.tab_header.git_actions.copy_error')+ success: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.copy_success'),+ error: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.copy_error')}};@@ -66,17 +66,17 @@ export class GitActionsMenuComponent extends OPContextMenuComponent {public snippets:ISnippet[] = [{id: 'branch',- name: this.I18n.t('js.gitlab_integration.tab_header.git_actions.branch_name'),+ name: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.branch_name'),textToCopy: () => this.gitActions.branchName(this.workPackage)},{id: 'message',- name: this.I18n.t('js.gitlab_integration.tab_header.git_actions.commit_message'),+ name: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.commit_message'),textToCopy: () => this.gitActions.commitMessage(this.workPackage)},{id: 'command',- name: this.I18n.t('js.gitlab_integration.tab_header.git_actions.cmd'),+ name: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.cmd'),textToCopy: () => this.gitActions.gitCommand(this.workPackage)},];diff --git a/frontend/module/git-actions-menu/git-actions-menu.directive.ts b/frontend/module/git-actions-menu/git-actions-menu.directive.tsindex 62e54b0d74f..d20b2fc1861 100644--- a/frontend/module/git-actions-menu/git-actions-menu.directive.ts+++ b/frontend/module/git-actions-menu/git-actions-menu.directive.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/git-actions-menu/styles/git-actions-menu.sass b/frontend/module/git-actions-menu/styles/git-actions-menu.sassindex 4ad86811140..b502c7bcd3a 100644--- a/frontend/module/git-actions-menu/styles/git-actions-menu.sass+++ b/frontend/module/git-actions-menu/styles/git-actions-menu.sass@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/git-actions/git-actions.service.ts b/frontend/module/git-actions/git-actions.service.tsindex 7a86e1a05ba..1c87adb9c1f 100644--- a/frontend/module/git-actions/git-actions.service.ts+++ b/frontend/module/git-actions/git-actions.service.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/gitlab-tab/gitlab-tab.component.sass b/frontend/module/gitlab-tab/gitlab-tab.component.sassnew file mode 100644index 00000000000..06056041ad2--- /dev/null+++ b/frontend/module/gitlab-tab/gitlab-tab.component.sass@@ -0,0 +1,36 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++@import "helpers"++:host,+.gitlab-header+ position: sticky+ top: 0+ z-index: 850 // Ensure the header is above other contentdiff --git a/frontend/module/gitlab-tab/gitlab-tab.component.ts b/frontend/module/gitlab-tab/gitlab-tab.component.tsindex bcd36c1a093..c7f28a1a253 100644--- a/frontend/module/gitlab-tab/gitlab-tab.component.ts+++ b/frontend/module/gitlab-tab/gitlab-tab.component.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -35,7 +35,10 @@ import { PathHelperService } from "core-app/core/path-helper/path-helper.service@Component({selector: 'gitlab-tab',- templateUrl: './gitlab-tab.template.html'+ templateUrl: './gitlab-tab.template.html',+ styleUrls: [+ './gitlab-tab.component.sass',+ ]})export class GitlabTabComponent implements TabComponent {@Input() public workPackage:WorkPackageResource;diff --git a/frontend/module/gitlab-tab/gitlab-tab.template.html b/frontend/module/gitlab-tab/gitlab-tab.template.htmlindex 7bbfd3bd4bc..a7c04a6dfc1 100644--- a/frontend/module/gitlab-tab/gitlab-tab.template.html+++ b/frontend/module/gitlab-tab/gitlab-tab.template.html@@ -1,2 +1,136 @@-<tab-header [workPackage]="workPackage"></tab-header>+<tab-header-issue class="gitlab-header" [workPackage]="workPackage"></tab-header-issue>+<tab-issue [workPackage]="workPackage"></tab-issue>+<tab-header-mr class="gitlab-header" [workPackage]="workPackage"></tab-header-mr><tab-mrs [workPackage]="workPackage"></tab-mrs>++<script>+document.addEventListener('DOMContentLoaded', function () {+ // Your Intersection Observer code and any other JavaScript/TypeScript logic+ const sectionHeaders = document.querySelectorAll('gitlab-header');++ const observer = new IntersectionObserver(entries => {+ entries.forEach(entry => {+ const sectionHeader = entry.target;++ if (entry.isIntersecting) {+ sectionHeader.classList.add('sticky');+ } else {+ sectionHeader.classList.remove('sticky');+ }+ });+ }, { threshold: 1 });++ sectionHeaders.forEach(sectionHeader => {+ observer.observe(sectionHeader);+ });++ const initialIssueLabelsElements = document.querySelectorAll('.op-issue--labels');+ initialIssueLabelsElements.forEach(function (element) {+ element.style.display = 'none';+ });++ const initialMRLabelsElements = document.querySelectorAll('.op-merge-request--labels');+ initialMRLabelsElements.forEach(function (element) {+ element.style.display = 'none';+ });+});+</script>++<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">+ <symbol viewBox="0 0 16 16" id="issue_open" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3 2.5h6a.5.5 0 0 1 .5.5v10a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5zM1 3a2 2 0 0 1 2-2h6a2 2 0 0 1 1.97 1.658l2.913 1.516a1.75 1.75 0 0 1 .744 2.36l-3.878 7.45a.753.753 0 0 1-.098.145c-.36.526-.965.871-1.651.871H3a2 2 0 0 1-2-2V3zm10 7.254l2.297-4.413a.25.25 0 0 0-.106-.337L11 4.364v5.89z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="issue_closed" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9 2.5H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5zM3 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h6a2 2 0 0 0 1.651-.87.753.753 0 0 0 .098-.145l3.878-7.45a1.75 1.75 0 0 0-.744-2.361l-2.912-1.516A2 2 0 0 0 9 1H3zm10.297 4.841L11 10.254v-5.89l2.19 1.14a.25.25 0 0 1 .107.337zM8.28 7.281A.75.75 0 0 0 7.22 6.22L5.25 8.19l-.47-.47a.75.75 0 0 0-1.06 1.06l1 1a.75.75 0 0 0 1.06 0l2.5-2.5z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_open" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.34 1.22a.75.75 0 0 0-1.06 0L7.53 2.97 7 3.5l.53.53 1.75 1.75a.75.75 0 1 0 1.06-1.06l-.47-.47h.63c.69 0 1.25.56 1.25 1.25v4.614a2.501 2.501 0 1 0 1.5 0V5.5a2.75 2.75 0 0 0-2.75-2.75h-.63l.47-.47a.75.75 0 0 0 0-1.06zM13.5 12.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-9 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm1.5 0a2.5 2.5 0 1 1-3.25-2.386V5.886a2.501 2.501 0 1 1 1.5 0v4.228A2.501 2.501 0 0 1 6 12.5zm-1.5-9a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_ready" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.34 1.22a.75.75 0 0 0-1.06 0L7.53 2.97 7 3.5l.53.53 1.75 1.75a.75.75 0 1 0 1.06-1.06l-.47-.47h.63c.69 0 1.25.56 1.25 1.25v4.614a2.501 2.501 0 1 0 1.5 0V5.5a2.75 2.75 0 0 0-2.75-2.75h-.63l.47-.47a.75.75 0 0 0 0-1.06zM13.5 12.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-9 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm1.5 0a2.5 2.5 0 1 1-3.25-2.386V5.886a2.501 2.501 0 1 1 1.5 0v4.228A2.501 2.501 0 0 1 6 12.5zm-1.5-9a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_closed" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.22 1.22a.75.75 0 0 1 1.06 0L3.5 2.44l1.22-1.22a.75.75 0 0 1 1.06 1.06L4.56 3.5l1.22 1.22a.75.75 0 0 1-1.06 1.06L3.5 4.56 2.28 5.78a.75.75 0 0 1-1.06-1.06L2.44 3.5 1.22 2.28a.75.75 0 0 1 0-1.06zM7.5 3.5a.75.75 0 0 1 .75-.75h2.25a2.75 2.75 0 0 1 2.75 2.75v4.614a2.501 2.501 0 1 1-1.5 0V5.5c0-.69-.56-1.25-1.25-1.25H8.25a.75.75 0 0 1-.75-.75zm5 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-8-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm1.5 0a2.5 2.5 0 1 1-3.25-2.386V7.75a.75.75 0 0 1 1.5 0v2.364A2.501 2.501 0 0 1 6 12.5z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_merged" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 3.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.044 2.31a2.5 2.5 0 1 0-1.706.076v4.228a2.501 2.501 0 1 0 1.5 0V8.373a5.735 5.735 0 0 0 3.86 1.864 2.501 2.501 0 1 0 .01-1.504 4.254 4.254 0 0 1-3.664-2.922zM11.5 10.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-6 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="labels" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.427.512A1.75 1.75 0 0 1 7.664 0H13v3h3v5.335c0 .465-.185.91-.513 1.239L9.573 15.48a1.75 1.75 0 0 1-2.473 0l-2.293-2.293-1.293-1.293-3-3a1.75 1.75 0 0 1 0-2.475L6.428.512zM11.5 1.5V3h-.836a1.75 1.75 0 0 0-1.237.512L3.514 9.419c-.06.06-.115.123-.165.19L1.574 7.833a.25.25 0 0 1 0-.353l5.913-5.907a.25.25 0 0 1 .177-.073H11.5zM5.866 12.126l-1.292-1.293a.25.25 0 0 1 0-.353l5.913-5.907a.25.25 0 0 1 .177-.073H14.5v3.835a.25.25 0 0 1-.073.177L8.513 14.42a.25.25 0 0 1-.353 0l-2.294-2.293zM12 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-success" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M6.278 7.697L5.045 6.464a.296.296 0 0 0-.42-.002l-.613.614a.298.298 0 0 0 .002.42l1.91 1.909a.5.5 0 0 0 .703.005l.265-.265L9.997 6.04a.291.291 0 0 0-.009-.408l-.614-.614a.29.29 0 0 0-.408-.009L6.278 7.697z"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-failed" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M7 5.969L5.599 4.568a.29.29 0 0 0-.413.004l-.614.614a.294.294 0 0 0-.004.413L5.968 7l-1.4 1.401a.29.29 0 0 0 .004.413l.614.614c.113.114.3.117.413.004L7 8.032l1.401 1.4a.29.29 0 0 0 .413-.004l.614-.614a.294.294 0 0 0 .004-.413L8.032 7l1.4-1.401a.29.29 0 0 0-.004-.413l-.614-.614a.294.294 0 0 0-.413-.004L7 5.968z"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-running" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M7 3c2.2 0 4 1.8 4 4s-1.8 4-4 4c-1.3 0-2.5-.7-3.3-1.7L7 7V3"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-created" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <circle cx="7" cy="7" r="3.25"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 12 12" id="pipeline-status-waiting" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0 2A6 6 0 1 0 6 0a6 6 0 0 0 0 12z"/>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-preparing" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <g fill-rule="nonzero">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path fill="var(--svg-status-bg, #fff)" d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z"/>+ </g>+ <circle cx="7" cy="7" r="1"/>+ <circle cx="10" cy="7" r="1"/>+ <circle cx="4" cy="7" r="1"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-pending" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M4.7 5.3c0-.2.1-.3.3-.3h.9c.2 0 .3.1.3.3v3.4c0 .2-.1.3-.3.3H5c-.2 0-.3-.1-.3-.3V5.3m3 0c0-.2.1-.3.3-.3h.9c.2 0 .3.1.3.3v3.4c0 .2-.1.3-.3.3H8c-.2 0-.3-.1-.3-.3V5.3"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-canceled" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M5.2 3.8l4.9 4.9c.2.2.2.5 0 .7l-.7.7c-.2.2-.5.2-.7 0L3.8 5.2c-.2-.2-.2-.5 0-.7l.7-.7c.2-.2.5-.2.7 0"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-skipped" xmlns="http://www.w3.org/2000/svg">+ <path d="M7 14A7 7 0 1 1 7 0a7 7 0 0 1 0 14z"/>+ <path d="M7 13A6 6 0 1 0 7 1a6 6 0 0 0 0 12z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M6.415 7.04L4.579 5.203a.295.295 0 0 1 .004-.416l.349-.349a.29.29 0 0 1 .416-.004l2.214 2.214a.289.289 0 0 1 .019.021l.132.133c.11.11.108.291 0 .398L5.341 9.573a.282.282 0 0 1-.398 0l-.331-.331a.285.285 0 0 1 0-.399L6.415 7.04zm2.54 0L7.119 5.203a.295.295 0 0 1 .004-.416l.349-.349a.29.29 0 0 1 .416-.004l2.214 2.214a.289.289 0 0 1 .019.021l.132.133c.11.11.108.291 0 .398L7.881 9.573a.282.282 0 0 1-.398 0l-.331-.331a.285.285 0 0 1 0-.399L8.955 7.04z"/>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-manual" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M10.5 7.63V6.37l-.787-.13c-.044-.175-.132-.349-.263-.61l.481-.652-.918-.913-.657.478a2.346 2.346 0 0 0-.612-.26L7.656 3.5H6.388l-.132.783c-.219.043-.394.13-.612.26l-.657-.478-.918.913.437.652c-.131.218-.175.392-.262.61l-.744.086v1.261l.787.13c.044.218.132.392.263.61l-.438.651.92.913.655-.434c.175.086.394.173.613.26l.131.783h1.313l.131-.783c.219-.043.394-.13.613-.26l.656.478.918-.913-.48-.652c.13-.218.218-.435.262-.61l.656-.13zM7 8.283a1.285 1.285 0 0 1-1.313-1.305c0-.739.57-1.304 1.313-1.304.744 0 1.313.565 1.313 1.304 0 .74-.57 1.305-1.313 1.305z"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-scheduled" xmlns="http://www.w3.org/2000/svg">+ <path d="M7 14A7 7 0 1 0 7 0a7 7 0 0 0 0 14z"/>+ <path d="M7 13A6 6 0 1 0 7 1a6 6 0 0 0 0 12z" fill="#fff"/>+ <path d="M6.995 10.64a3.645 3.645 0 1 1 0-7.29 3.645 3.645 0 0 1 0 7.29zm0-1.042a2.603 2.603 0 1 0 0-5.206 2.603 2.603 0 0 0 0 5.206z"/>+ <path d="M7.033 4.92h-.065a.488.488 0 0 0-.488.488v1.627c0 .27.218.488.488.488h.065c.27 0 .488-.218.488-.488V5.408a.488.488 0 0 0-.488-.488z"/>+ <path d="M8.075 6.48H6.968a.488.488 0 0 0-.488.488v.065c0 .27.218.488.488.488h1.107c.27 0 .488-.218.488-.488v-.065a.488.488 0 0 0-.488-.488z"/>+ </symbol>+</svg>diff --git a/frontend/module/hal/resources/gitlab-pipelines-resource.ts b/frontend/module/hal/resources/gitlab-issue-resource.tssimilarity index 94%rename from frontend/module/hal/resources/gitlab-pipelines-resource.tsrename to frontend/module/hal/resources/gitlab-issue-resource.tsindex 7e01eb4ccb6..f095a717e93 100644--- a/frontend/module/hal/resources/gitlab-pipelines-resource.ts+++ b/frontend/module/hal/resources/gitlab-issue-resource.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -29,7 +29,7 @@import { HalResource } from "core-app/features/hal/resources/hal-resource";-export class GitlabPipelineResource extends HalResource {+export class GitlabIssueResource extends HalResource {public get state() {return this.states.projects.get(this.id!) as any;}diff --git a/frontend/module/hal/resources/gitlab-merge-request-resource.ts b/frontend/module/hal/resources/gitlab-merge-request-resource.tsindex 23163b38f0b..49a6c510a67 100644--- a/frontend/module/hal/resources/gitlab-merge-request-resource.ts+++ b/frontend/module/hal/resources/gitlab-merge-request-resource.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/hal/resources/gitlab-user-resource.ts b/frontend/module/hal/resources/gitlab-user-resource.tsindex 3a18da80ba5..c729a5b82d7 100644--- a/frontend/module/hal/resources/gitlab-user-resource.ts+++ b/frontend/module/hal/resources/gitlab-user-resource.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/icons/gitlab-icons.svg b/frontend/module/icons/gitlab-icons.svgnew file mode 100644index 00000000000..13acb8a8da1--- /dev/null+++ b/frontend/module/icons/gitlab-icons.svg@@ -0,0 +1,99 @@+<?xml version="1.0" encoding="utf-8"?>+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">+ <symbol viewBox="0 0 16 16" id="issue_open" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3 2.5h6a.5.5 0 0 1 .5.5v10a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5zM1 3a2 2 0 0 1 2-2h6a2 2 0 0 1 1.97 1.658l2.913 1.516a1.75 1.75 0 0 1 .744 2.36l-3.878 7.45a.753.753 0 0 1-.098.145c-.36.526-.965.871-1.651.871H3a2 2 0 0 1-2-2V3zm10 7.254l2.297-4.413a.25.25 0 0 0-.106-.337L11 4.364v5.89z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="issue_closed" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9 2.5H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5zM3 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h6a2 2 0 0 0 1.651-.87.753.753 0 0 0 .098-.145l3.878-7.45a1.75 1.75 0 0 0-.744-2.361l-2.912-1.516A2 2 0 0 0 9 1H3zm10.297 4.841L11 10.254v-5.89l2.19 1.14a.25.25 0 0 1 .107.337zM8.28 7.281A.75.75 0 0 0 7.22 6.22L5.25 8.19l-.47-.47a.75.75 0 0 0-1.06 1.06l1 1a.75.75 0 0 0 1.06 0l2.5-2.5z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_open" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.34 1.22a.75.75 0 0 0-1.06 0L7.53 2.97 7 3.5l.53.53 1.75 1.75a.75.75 0 1 0 1.06-1.06l-.47-.47h.63c.69 0 1.25.56 1.25 1.25v4.614a2.501 2.501 0 1 0 1.5 0V5.5a2.75 2.75 0 0 0-2.75-2.75h-.63l.47-.47a.75.75 0 0 0 0-1.06zM13.5 12.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-9 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm1.5 0a2.5 2.5 0 1 1-3.25-2.386V5.886a2.501 2.501 0 1 1 1.5 0v4.228A2.501 2.501 0 0 1 6 12.5zm-1.5-9a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_ready" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.34 1.22a.75.75 0 0 0-1.06 0L7.53 2.97 7 3.5l.53.53 1.75 1.75a.75.75 0 1 0 1.06-1.06l-.47-.47h.63c.69 0 1.25.56 1.25 1.25v4.614a2.501 2.501 0 1 0 1.5 0V5.5a2.75 2.75 0 0 0-2.75-2.75h-.63l.47-.47a.75.75 0 0 0 0-1.06zM13.5 12.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-9 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm1.5 0a2.5 2.5 0 1 1-3.25-2.386V5.886a2.501 2.501 0 1 1 1.5 0v4.228A2.501 2.501 0 0 1 6 12.5zm-1.5-9a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_closed" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.22 1.22a.75.75 0 0 1 1.06 0L3.5 2.44l1.22-1.22a.75.75 0 0 1 1.06 1.06L4.56 3.5l1.22 1.22a.75.75 0 0 1-1.06 1.06L3.5 4.56 2.28 5.78a.75.75 0 0 1-1.06-1.06L2.44 3.5 1.22 2.28a.75.75 0 0 1 0-1.06zM7.5 3.5a.75.75 0 0 1 .75-.75h2.25a2.75 2.75 0 0 1 2.75 2.75v4.614a2.501 2.501 0 1 1-1.5 0V5.5c0-.69-.56-1.25-1.25-1.25H8.25a.75.75 0 0 1-.75-.75zm5 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-8-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm1.5 0a2.5 2.5 0 1 1-3.25-2.386V7.75a.75.75 0 0 1 1.5 0v2.364A2.501 2.501 0 0 1 6 12.5z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="merge-request_merged" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 3.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.044 2.31a2.5 2.5 0 1 0-1.706.076v4.228a2.501 2.501 0 1 0 1.5 0V8.373a5.735 5.735 0 0 0 3.86 1.864 2.501 2.501 0 1 0 .01-1.504 4.254 4.254 0 0 1-3.664-2.922zM11.5 10.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-6 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>+ </symbol>+ <symbol viewBox="0 0 16 16" id="labels" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.427.512A1.75 1.75 0 0 1 7.664 0H13v3h3v5.335c0 .465-.185.91-.513 1.239L9.573 15.48a1.75 1.75 0 0 1-2.473 0l-2.293-2.293-1.293-1.293-3-3a1.75 1.75 0 0 1 0-2.475L6.428.512zM11.5 1.5V3h-.836a1.75 1.75 0 0 0-1.237.512L3.514 9.419c-.06.06-.115.123-.165.19L1.574 7.833a.25.25 0 0 1 0-.353l5.913-5.907a.25.25 0 0 1 .177-.073H11.5zM5.866 12.126l-1.292-1.293a.25.25 0 0 1 0-.353l5.913-5.907a.25.25 0 0 1 .177-.073H14.5v3.835a.25.25 0 0 1-.073.177L8.513 14.42a.25.25 0 0 1-.353 0l-2.294-2.293zM12 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-success" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M6.278 7.697L5.045 6.464a.296.296 0 0 0-.42-.002l-.613.614a.298.298 0 0 0 .002.42l1.91 1.909a.5.5 0 0 0 .703.005l.265-.265L9.997 6.04a.291.291 0 0 0-.009-.408l-.614-.614a.29.29 0 0 0-.408-.009L6.278 7.697z"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-failed" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M7 5.969L5.599 4.568a.29.29 0 0 0-.413.004l-.614.614a.294.294 0 0 0-.004.413L5.968 7l-1.4 1.401a.29.29 0 0 0 .004.413l.614.614c.113.114.3.117.413.004L7 8.032l1.401 1.4a.29.29 0 0 0 .413-.004l.614-.614a.294.294 0 0 0 .004-.413L8.032 7l1.4-1.401a.29.29 0 0 0-.004-.413l-.614-.614a.294.294 0 0 0-.413-.004L7 5.968z"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-running" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M7 3c2.2 0 4 1.8 4 4s-1.8 4-4 4c-1.3 0-2.5-.7-3.3-1.7L7 7V3"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-created" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <circle cx="7" cy="7" r="3.25"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 12 12" id="pipeline-status-waiting" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0 2A6 6 0 1 0 6 0a6 6 0 0 0 0 12z"/>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-preparing" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <g fill-rule="nonzero">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path fill="var(--svg-status-bg, #fff)" d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z"/>+ </g>+ <circle cx="7" cy="7" r="1"/>+ <circle cx="10" cy="7" r="1"/>+ <circle cx="4" cy="7" r="1"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-pending" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M4.7 5.3c0-.2.1-.3.3-.3h.9c.2 0 .3.1.3.3v3.4c0 .2-.1.3-.3.3H5c-.2 0-.3-.1-.3-.3V5.3m3 0c0-.2.1-.3.3-.3h.9c.2 0 .3.1.3.3v3.4c0 .2-.1.3-.3.3H8c-.2 0-.3-.1-.3-.3V5.3"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-canceled" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M5.2 3.8l4.9 4.9c.2.2.2.5 0 .7l-.7.7c-.2.2-.5.2-.7 0L3.8 5.2c-.2-.2-.2-.5 0-.7l.7-.7c.2-.2.5-.2.7 0"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-skipped" xmlns="http://www.w3.org/2000/svg">+ <path d="M7 14A7 7 0 1 1 7 0a7 7 0 0 1 0 14z"/>+ <path d="M7 13A6 6 0 1 0 7 1a6 6 0 0 0 0 12z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M6.415 7.04L4.579 5.203a.295.295 0 0 1 .004-.416l.349-.349a.29.29 0 0 1 .416-.004l2.214 2.214a.289.289 0 0 1 .019.021l.132.133c.11.11.108.291 0 .398L5.341 9.573a.282.282 0 0 1-.398 0l-.331-.331a.285.285 0 0 1 0-.399L6.415 7.04zm2.54 0L7.119 5.203a.295.295 0 0 1 .004-.416l.349-.349a.29.29 0 0 1 .416-.004l2.214 2.214a.289.289 0 0 1 .019.021l.132.133c.11.11.108.291 0 .398L7.881 9.573a.282.282 0 0 1-.398 0l-.331-.331a.285.285 0 0 1 0-.399L8.955 7.04z"/>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-manual" xmlns="http://www.w3.org/2000/svg">+ <g fill-rule="evenodd">+ <path d="M0 7a7 7 0 1 1 14 0A7 7 0 0 1 0 7z"/>+ <path d="M13 7A6 6 0 1 0 1 7a6 6 0 0 0 12 0z" fill="var(--svg-status-bg, #fff)"/>+ <path d="M10.5 7.63V6.37l-.787-.13c-.044-.175-.132-.349-.263-.61l.481-.652-.918-.913-.657.478a2.346 2.346 0 0 0-.612-.26L7.656 3.5H6.388l-.132.783c-.219.043-.394.13-.612.26l-.657-.478-.918.913.437.652c-.131.218-.175.392-.262.61l-.744.086v1.261l.787.13c.044.218.132.392.263.61l-.438.651.92.913.655-.434c.175.086.394.173.613.26l.131.783h1.313l.131-.783c.219-.043.394-.13.613-.26l.656.478.918-.913-.48-.652c.13-.218.218-.435.262-.61l.656-.13zM7 8.283a1.285 1.285 0 0 1-1.313-1.305c0-.739.57-1.304 1.313-1.304.744 0 1.313.565 1.313 1.304 0 .74-.57 1.305-1.313 1.305z"/>+ </g>+ </symbol>+ <symbol viewBox="0 0 14 14" id="pipeline-status-scheduled" xmlns="http://www.w3.org/2000/svg">+ <path d="M7 14A7 7 0 1 0 7 0a7 7 0 0 0 0 14z"/>+ <path d="M7 13A6 6 0 1 0 7 1a6 6 0 0 0 0 12z" fill="#fff"/>+ <path d="M6.995 10.64a3.645 3.645 0 1 1 0-7.29 3.645 3.645 0 0 1 0 7.29zm0-1.042a2.603 2.603 0 1 0 0-5.206 2.603 2.603 0 0 0 0 5.206z"/>+ <path d="M7.033 4.92h-.065a.488.488 0 0 0-.488.488v1.627c0 .27.218.488.488.488h.065c.27 0 .488-.218.488-.488V5.408a.488.488 0 0 0-.488-.488z"/>+ <path d="M8.075 6.48H6.968a.488.488 0 0 0-.488.488v.065c0 .27.218.488.488.488h1.107c.27 0 .488-.218.488-.488v-.065a.488.488 0 0 0-.488-.488z"/>+ </symbol>+</svg>\ No newline at end of filediff --git a/frontend/module/issue/issue.component.html b/frontend/module/issue/issue.component.htmlnew file mode 100644index 00000000000..284db7059d5--- /dev/null+++ b/frontend/module/issue/issue.component.html@@ -0,0 +1,51 @@+<div+ class='op-issue--title'+ [textContent]="gitlabIssue.title"+></div>++<span class='op-issue--state' [ngClass]="'op-issue--state_' + state">+ <svg class="op-issue--iconsize"><use [attr.xlink:href]="'#issue_' + state" /></svg>+ {{state}} |+ <a+ [ngClass]="'op-issue--link_' + state"+ [href]="gitlabIssue.htmlUrl"+ target="blank"+ [textContent]="gitlabIssue.repository + '#' + gitlabIssue.number"+ ></a>+</span>++<button *ngIf="gitlabIssue.labels && gitlabIssue.labels.length > 0" (click)="toggleLabels(gitlabIssue.number)" class='op-issue--label_icon' title="Show/Hide labels">+ <svg class="op-issue--iconsize op-issue--label_icon_style"><use xlink:href="#labels" /></svg>+</button>++<div class="op-issue--info_created">+ {{ text.label_created_by }}+ <!-- <img+ alt='Issue author avatar'+ class='op-issue--avatar op-avatar op-avatar_mini'+ [src]="gitlabIssue.gitlabUser.avatarUrl"+ *ngIf="gitlabIssue.gitlabUser"+ /> -->+ <span class='op-issue--user'>+ <a+ [href]="'mailto:' + gitlabIssue.gitlabUser.email"+ class='op-issue--username'+ [textContent]="gitlabIssue.gitlabUser.login"+ *ngIf="gitlabIssue.gitlabUser"+ ></a>.+ </span>+ <span class='op-issue--date'>+ {{ text.label_last_updated_on }}+ <op-date-time [dateTimeValue]="gitlabIssue.gitlabUpdatedAt"></op-date-time>+ </span>.+</div>++<div+ class="op-issue--labels"+ [ngClass]="'op-issue--labels-' + gitlabIssue.number" style="display: none;">+ <span *ngFor="let label of gitlabIssue.labels">+ <span class='op-issue--label' [ngStyle]="{'background-color': label.color}" >+ {{label.title}}+ </span>+ </span>+</div>diff --git a/frontend/module/issue/issue.component.sass b/frontend/module/issue/issue.component.sassnew file mode 100644index 00000000000..9d3e946adf6--- /dev/null+++ b/frontend/module/issue/issue.component.sass@@ -0,0 +1,151 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++@import "helpers"++:host,+.op-issue+ display: grid+ grid-template-columns: minmax(270px, auto) auto 1fr+ grid-template-areas: "title title title" "info_created info_created info_created" "state label_icon label_icon" "label label label"+ margin-bottom: 5px+ margin-top: 5px+ padding-bottom: 4px+ padding-top: 4px+ border-bottom: 1px solid #dddddd++ &:last-child+ border-bottom: none++ &--iconsize+ width: 16px+ height: 16px+ vertical-align: -3px++ &--title+ @include text-shortener+ font-weight: bold+ grid-area: title+ line-height: 22px+ margin-right: 20px++ &--avatar+ grid-area: info++ &--info_created+ @include text-shortener+ display: block+ grid-area: info_created+ font-size: 0.75rem+ color: var(--gray-dark)+ margin-bottom: 3px++ &--info_updated+ @include text-shortener+ display: block+ grid-area: info_updated+ font-size: 0.75rem+ color: var(--gray-dark)+ margin-top: -4px++ &--username+ color: var(--gray-dark)+ text-decoration: none++ &--labels+ display: none+ grid-area: label+ font-size: 0.9rem+ color: var(--gray-dark)+ margin-top: 10px++ &--label+ display: inline-block+ padding: 2px 0.5rem 2px 0.5rem+ border-radius: 10rem+ border: 1px solid #fff+ color: #fff+ font-size: 0.8rem++ &--link+ font-size: 0.8rem+ text-decoration: none++ &_open+ background-color: #c3e6cd+ color: #24663b+ fill: #24663b++ &_closed+ background-color: #cbe2f9+ color: #0b5cad+ fill: #0b5cad++ &--label_icon+ grid-area: label_icon+ display: inline-block+ padding: 4px 6px+ border-radius: 10rem+ font-size: 0.8rem+ font-weight: 400+ align-self: center+ width: fit-content+ margin-right: 6px+ border: 1px solid #cecdd4+ background-color: #f3f3f3++ &:hover+ border: 1px solid #b6b5ba+ background-color: #e4e4e4++ &_style+ fill: #737278++ &--state+ grid-area: state+ display: inline-block+ padding: 5px 0.6rem 5px 0.6rem+ border-radius: 10rem+ font-size: 0.8rem+ font-weight: 400+ text-transform: capitalize+ align-self: center+ white-space: nowrap+ width: fit-content+ margin-right: 6px++ &_open+ background-color: #c3e6cd+ color: #24663b+ fill: #24663b++ &_closed+ background-color: #cbe2f9+ color: #0b5cad+ fill: #0b5caddiff --git a/frontend/module/issue/issue.component.ts b/frontend/module/issue/issue.component.tsnew file mode 100644index 00000000000..3c260b8186d--- /dev/null+++ b/frontend/module/issue/issue.component.ts@@ -0,0 +1,72 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++import { Component, Input } from '@angular/core';+import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';+import { I18nService } from 'core-app/core/i18n/i18n.service';+import {IGitlabIssueResource} from 'core-app/features/plugins/linked/openproject-gitlab_integration/typings';++@Component({+ selector: 'gitlab-issue',+ templateUrl: './issue.component.html',+ styleUrls: [+ './issue.component.sass',+ ],+ host: { class: 'op-issue' }+})++export class IssueComponent {+ @Input() public gitlabIssue:IGitlabIssueResource;++ public text = {+ label_created_by: this.I18n.t('js.label_created_by'),+ label_last_updated_on: this.I18n.t('js.gitlab_integration.updated_on'),+ label_details: this.I18n.t('js.label_details'),+ };++ constructor(readonly PathHelper:PathHelperService,+ readonly I18n:I18nService) {+ }++ get state() {++ if (this.gitlabIssue.state === 'opened') {+ return ('open');+ } else {+ return('closed');+ }+ }++ toggleLabels(identifier: string) {+ const labelsElement = document.querySelector(`.op-issue--labels-${identifier}`) as HTMLElement;++ // Check the current display property and toggle it+ labelsElement.style.display = labelsElement.style.display === 'none' ? 'block' : 'none';+ }+}diff --git a/frontend/module/main.ts b/frontend/module/main.tsindex 30da5019e64..a694e4d3b1e 100644--- a/frontend/module/main.ts+++ b/frontend/module/main.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -34,26 +34,38 @@ import { WorkPackageTabsService } from 'core-app/features/work-packages/componenimport { GitlabTabComponent } from './gitlab-tab/gitlab-tab.component';-import { TabHeaderComponent } from './tab-header/tab-header.component';+import { TabHeaderMrsComponent } from './tab-header-mr/tab-header-mr.component';+import { TabHeaderIssueComponent } from './tab-header-issue/tab-header-issue.component';import { TabMrsComponent } from './tab-mrs/tab-mrs.component';+import { TabIssueComponent } from './tab-issue/tab-issue.component';import { GitActionsMenuDirective } from './git-actions-menu/git-actions-menu.directive';import { GitActionsMenuComponent } from './git-actions-menu/git-actions-menu.component';import { WorkPackagesGitlabMrsService } from './tab-mrs/wp-gitlab-mrs.service';+import { WorkPackagesGitlabIssueService } from './tab-issue/wp-gitlab-issue.service';import { MergeRequestComponent } from './merge-request/merge-request.component';+import { IssueComponent } from './issue/issue.component';import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';-import { Observable } from 'rxjs';+import { Observable, combineLatest } from 'rxjs';import { map } from 'rxjs/operators';-export function workPackageGitlabMrsCount(+export function workPackageGitlabCount(workPackage:WorkPackageResource,injector:Injector,):Observable<number> {const gitlabMrsService = injector.get(WorkPackagesGitlabMrsService);- return gitlabMrsService- .requireAndStream(workPackage)- .pipe(- map((mrs) => mrs.length),- );+ const gitlabIssueService = injector.get(WorkPackagesGitlabIssueService);++ const mrsObservable = gitlabMrsService.requireAndStream(workPackage).pipe(+ map((mrs) => mrs.length),+ );++ const issuesObservable = gitlabIssueService.requireAndStream(workPackage).pipe(+ map((issues) => issues.length),+ );++ return combineLatest([mrsObservable, issuesObservable]).pipe(+ map(([mrsCount, issuesCount]) => mrsCount + issuesCount),+ );}export function initializeGitlabIntegrationPlugin(injector:Injector) {@@ -63,7 +75,7 @@ export function initializeGitlabIntegrationPlugin(injector:Injector) {name: I18n.t('js.gitlab_integration.work_packages.tab_name'),id: 'gitlab',displayable: (workPackage) => !!workPackage.gitlab,- count: workPackageGitlabMrsCount,+ count: workPackageGitlabCount,});}@@ -75,19 +87,25 @@ export function initializeGitlabIntegrationPlugin(injector:Injector) {],providers: [WorkPackagesGitlabMrsService,+ WorkPackagesGitlabIssueService,],declarations: [GitlabTabComponent,- TabHeaderComponent,+ TabHeaderMrsComponent,+ TabHeaderIssueComponent,TabMrsComponent,+ TabIssueComponent,GitActionsMenuDirective,GitActionsMenuComponent,MergeRequestComponent,+ IssueComponent,],exports: [GitlabTabComponent,- TabHeaderComponent,+ TabHeaderMrsComponent,+ TabHeaderIssueComponent,TabMrsComponent,+ TabIssueComponent,GitActionsMenuDirective,GitActionsMenuComponent,],diff --git a/frontend/module/merge-request/merge-request.component.html b/frontend/module/merge-request/merge-request.component.htmlindex 94a4d9ad769..b3507161a0b 100644--- a/frontend/module/merge-request/merge-request.component.html+++ b/frontend/module/merge-request/merge-request.component.html@@ -1,69 +1,57 @@-<a- class='op-merge-request--link'- [href]="mergeRequest.htmlUrl"- target="blank"- [textContent]="mergeRequest.repository + '#' + mergeRequest.number"-></a>-<divclass='op-merge-request--title'[textContent]="mergeRequest.title"></div>-<div class="op-merge-request--info">+<span class='op-merge-request--state' [ngClass]="'op-merge-request--state_' + state">+ <svg class="op-merge-request--iconsize"><use [attr.xlink:href]="'#merge-request_' + state" /></svg>+ {{state}} |+ <a+ [ngClass]="'op-merge-request--link_' + state"+ [href]="mergeRequest.htmlUrl"+ target="blank"+ [textContent]="mergeRequest.repository + '#' + mergeRequest.number"+ ></a>+</span>++<button *ngIf="mergeRequest.labels && mergeRequest.labels.length > 0" (click)="toggleLabels(mergeRequest.number)" class='op-merge-request--label_icon' title="Show/Hide labels">+ <svg class="op-merge-request--iconsize op-merge-request--label_icon_style"><use xlink:href="#labels" /></svg>+</button>++<span *ngIf="mergeRequest.pipelines && mergeRequest.pipelines.length > 0" class='op-merge-request--pipeline-icon'+ [ngClass]="'op-merge-request--pipeline-icon_bg_' + mergeRequest.pipelines[0].status">+ <svg [ngClass]="'op-merge-request--pipeline-icon_' + mergeRequest.pipelines[0].status"><use [attr.xlink:href]="'#pipeline-status-' + mergeRequest.pipelines[0].status" /></svg>+ <span class='op-merge-request--pipeline-label' [ngClass]="'op-merge-request--pipeline-label_' + mergeRequest.pipelines[0].status"> {{ mergeRequest.pipelines[0].status }} </span>+</span>++<div class="op-merge-request--info_created">{{ text.label_created_by }}- <img+ <!-- <imgalt='MR author avatar'class='op-merge-request--avatar op-avatar op-avatar_mini'[src]="mergeRequest.gitlabUser.avatarUrl"*ngIf="mergeRequest.gitlabUser"- />- <span class='op-merge-request--user'>+ /> -->+ <span class='op-merge-request--user'><a[href]="'mailto:' + mergeRequest.gitlabUser.email"+ class='op-merge-request--username'[textContent]="mergeRequest.gitlabUser.login"*ngIf="mergeRequest.gitlabUser"></a>.</span>-<span class='op-merge-request--date'>{{ text.label_last_updated_on }}<op-date-time [dateTimeValue]="mergeRequest.gitlabUpdatedAt"></op-date-time></span>.</div>-<span class='op-merge-request--state' [ngClass]="'op-merge-request--state_' + state">- <op-icon icon-classes="button--icon icon-merge-branch"></op-icon>- {{state}}-</span>--<div class="op-merge-request--labels">+<div+ class="op-merge-request--labels"+ [ngClass]="'op-merge-request--labels-' + mergeRequest.number" style="display: none;"><span *ngFor="let label of mergeRequest.labels"><span class='op-merge-request--label' [ngStyle]="{'background-color': label.color}" >{{label.title}}</span></span></div>--<!-- <span class="op-merge-request--pipeline-label" *ngIf="mergeRequest.pipelines?.length">{{ text.label_pipelines }}</span>--<ul [attr.aria-label]="text.label_pipelines" class='op-merge-request--pipeline' *ngIf="mergeRequest.pipelines?.length">- <li class='op-mr-pipeline' *ngFor="let pipeline of mergeRequest.pipelines">- <span class='op-mr-pipeline--state-icon' [ngClass]="'op-mr-pipeline--state-icon_' + pipelineState(pipeline)">- <op-icon icon-classes="icon-{{ pipelineStateIcon(pipeline) }}"- [icon-title]="pipelineStateText(pipeline)"></op-icon>- </span>- <span class='op-mr-pipeline--avatar'><img alt='user owner avatar' [src]="pipeline.userAvatarUrl" /></span>-- <span class='op-mr-pipeline--info'>- <span class='op-mr-pipeline--name' [textContent]="pipeline.name"></span>- <span class='op-mr-pipeline--state' [textContent]="pipelineStateText(pipeline)"></span>- </span>-- <span class='op-mr-pipeline--details'>- <a [href]="pipeline.detailsUrl">- {{ text.label_details }}- </a>- </span>- </li>-</ul> -->diff --git a/frontend/module/merge-request/merge-request.component.sass b/frontend/module/merge-request/merge-request.component.sassindex c7d2a642259..ef13e6c9f5c 100644--- a/frontend/module/merge-request/merge-request.component.sass+++ b/frontend/module/merge-request/merge-request.component.sass@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -32,96 +32,291 @@:host,.op-merge-requestdisplay: grid- grid-template-columns: auto 1fr auto auto- grid-template-areas: "link link link link" "title title title state" "info info info info" "pipeline-label pipeline-label pipeline-label pipeline-label" "pipeline pipeline pipeline pipeline"- margin-bottom: 11px- padding-bottom: 11px+ grid-template-columns: minmax(270px, auto) auto auto 1fr+ grid-template-areas: "title title title title" "info_created info_created info_created info_created" "state label_icon pipe_icon pipe_icon" "label label label label"+ margin-bottom: 5px+ margin-top: 5px+ padding-bottom: 4px+ padding-top: 4pxborder-bottom: 1px solid #dddddd&:last-childborder-bottom: none+ &--iconsize+ width: 16px+ height: 16px+ vertical-align: -3px++ &--iconwidth+ min-width: 100px+&--title@include text-shortenerfont-weight: boldgrid-area: title- // have the same line height as the status "button" next to it- line-height: 32px+ line-height: 22pxmargin-right: 20px&--avatargrid-area: info- &--info+ &--info_created+ @include text-shortenerdisplay: block- grid-area: info+ grid-area: info_created+ font-size: 0.75rem+ color: var(--gray-dark)margin-bottom: 3px- font-size: 0.9rem- grid-area: info++ &--info_updated+ @include text-shortener+ display: block+ grid-area: info_updated+ font-size: 0.75remcolor: var(--gray-dark)- // The mini avatar is much higher than the text line. Compensate it.margin-top: -4px+ &--username+ color: var(--gray-dark)+ text-decoration: none+&--labels- display: block- grid-area: info- margin-bottom: 3px+ display: none+ grid-area: labelfont-size: 0.9rem- grid-area: infocolor: var(--gray-dark)- margin-top: 20px+ margin-top: 10px&--labeldisplay: inline-block- padding: 6px 9px- border-radius: 16px+ padding: 2px 0.5rem 2px 0.5rem+ border-radius: 10remborder: 1px solid #fffcolor: #ffffont-size: 0.8rem- text-transform: capitalize-- &--date- grid-area: info&--link- grid-area: link- margin-top: 6px- font-size: 0.9rem+ font-size: 0.8rem+ text-decoration: none++ &_open+ background-color: #c3e6cd+ color: #24663b+ fill: #24663b++ &_ready+ background-color: #c3e6cd+ color: #24663b+ fill: #24663b++ &_merged+ background-color: #cbe2f9+ color: #0b5cad+ fill: #0b5cad++ &_closed+ background-color: #fdd4cd+ color: #ae1800+ fill: #ae1800++ &--label_icon+ grid-area: label_icon+ display: inline-block+ padding: 4px 6px+ border-radius: 10rem+ font-size: 0.8rem+ font-weight: 400+ align-self: center+ width: fit-content+ margin-right: 6px+ border: 1px solid #cecdd4+ background-color: #f3f3f3++ &:hover+ border: 1px solid #b6b5ba+ background-color: #e4e4e4++ &_style+ fill: #737278&--stategrid-area: statedisplay: inline-block- padding: 6px 10px+ padding: 5px 0.6rem 5px 0.6remborder-radius: 10rem- border: 3px solid #fff- color: #ffffont-size: 0.8rem- font-weight: 600+ font-weight: 400text-transform: capitalize+ align-self: center+ white-space: nowrap+ width: fit-content+ margin-right: 6px&_openbackground-color: #c3e6cdcolor: #24663b+ fill: #24663b&_readybackground-color: #c3e6cdcolor: #24663b+ fill: #24663b&_mergedbackground-color: #cbe2f9color: #0b5cad+ fill: #0b5cad&_closedbackground-color: #fdd4cdcolor: #ae1800+ fill: #ae1800++ &--pipeline-icon+ grid-area: pipe_icon+ padding: 0.25rem+ border-radius: 10rem+ font-size: 0.8rem+ font-weight: 400+ align-self: center+ margin-right: 6px+ width: fit-content+ height: 28px+ align-items: center+ display: inline-flex++ &_failed+ fill: #dd2b0e+ width: 20px+ height: 20px++ &_bg_failed+ background-color: #fdd4cd++ &_success+ fill: #108548+ width: 20px+ height: 20px++ &_bg_success+ background-color: #c3e6cd++ &_running+ fill: #367ad1+ width: 20px+ height: 20px++ &_bg_running+ background-color: #cddffd++ &_created+ fill: #737278+ width: 20px+ height: 20px++ &_bg_created+ background-color: #ececef++ &_waiting+ fill: #737278+ width: 20px+ height: 20px++ &_bg_waiting+ background-color: #ececef++ &_preparing+ fill: #737278+ width: 20px+ height: 20px++ &_bg_preparing+ background-color: #ececef++ &_pending+ fill: #737278+ width: 20px+ height: 20px++ &_bg_pending+ background-color: #ececef++ &_canceled+ fill: #737278+ width: 20px+ height: 20px++ &_bg_canceled+ background-color: #ececef++ &_skipped+ fill: #737278+ width: 20px+ height: 20px++ &_bg_skipped+ background-color: #ececef++ &_manual+ fill: #737278+ width: 20px+ height: 20px++ &_bg_manual+ background-color: #ececef++ &_scheduled+ fill: #737278+ width: 20px+ height: 20px++ &_bg_scheduled+ background-color: #ececef&--pipeline-label- grid-area: pipeline-label- margin-top: 12px- font-size: 0.9rem- font-weight: bold+ font-size: 0.8rem+ font-weight: 400+ margin-left: 4px+ margin-right: 5px+ text-transform: capitalize++ &_failed+ color: #ae1800++ &_success+ color: #24663b++ &_running+ color: #4782d0++ &_created+ color: #737278++ &_waiting+ color: #737278++ &_preparing+ color: #737278++ &_pending+ color: #737278++ &_canceled+ color: #737278++ &_skipped+ color: #737278++ &_manual+ color: #737278++ &_scheduled+ color: #737278&--pipelinemargin-top: 12px+ margin-bottom: 12pxmargin-left: 0grid-area: pipeline+diff --git a/frontend/module/merge-request/merge-request.component.ts b/frontend/module/merge-request/merge-request.component.tsindex bbd469e442f..1deaddff62e 100644--- a/frontend/module/merge-request/merge-request.component.ts+++ b/frontend/module/merge-request/merge-request.component.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -28,7 +28,6 @@//++import { Component, Input } from '@angular/core';-import { GitlabPipelineResource } from '../hal/resources/gitlab-pipelines-resource';import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';import { I18nService } from 'core-app/core/i18n/i18n.service';import {IGitlabMergeRequestResource} from 'core-app/features/plugins/linked/openproject-gitlab_integration/typings';@@ -48,7 +47,7 @@ export class MergeRequestComponent {public text = {label_created_by: this.I18n.t('js.label_created_by'),- label_last_updated_on: this.I18n.t('js.label_last_updated_on'),+ label_last_updated_on: this.I18n.t('js.gitlab_integration.updated_on'),label_details: this.I18n.t('js.label_details'),label_pipelines: this.I18n.t('js.gitlab_integration.gitlab_pipelines'),};@@ -66,52 +65,11 @@ export class MergeRequestComponent {}}- public pipelineStateText(pipeline:GitlabPipelineResource) {- /* Github apps can *optionally* add an output object (and a title) which is the most relevant information to display.- If that is not present, we can display the conclusion (which is present only on finished runs).- If that is not present, we can always fall back to the status. */- return(pipeline.status);- }+ toggleLabels(identifier: string) {+ const labelsElement = document.querySelector(`.op-merge-request--labels-${identifier}`) as HTMLElement;- public pipelineState(pipeline:GitlabPipelineResource) {- return(pipeline.status);+ // Check the current display property and toggle it+ labelsElement.style.display = labelsElement.style.display === 'none' ? 'block' : 'none';}- public pipelineStateIcon(pipeline:GitlabPipelineResource) {- switch (this.pipelineState(pipeline)) {- case 'success': {- return 'checkmark'- }- case 'queued': {- return 'getting-started'- }- case 'in_progress': {- return 'loading1'- }- case 'failure': {- return 'cancel'- }- case 'timed_out': {- return 'reminder'- }- case 'action_required': {- return 'warning'- }- case 'stale': {- return 'not-supported'- }- case 'skipped': {- return 'redo'- }- case 'neutral': {- return 'minus1'- }- case 'cancelled': {- return 'minus1'- }- default: {- return 'not-supported'- }- }- }}diff --git a/frontend/module/merge-request/mr-pipeline.component.sass b/frontend/module/merge-request/mr-pipeline.component.sassindex a346c9a5bdf..fb773b1dcc2 100644--- a/frontend/module/merge-request/mr-pipeline.component.sass+++ b/frontend/module/merge-request/mr-pipeline.component.sass@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -29,13 +29,13 @@.op-mr-pipelinedisplay: gridgrid-row: span 4- grid-template-columns: 28px 33px 1fr auto- grid-template-areas: "pipeline-state-icon pipeline-avatar pipeline-info pipeline-details"+ grid-template-columns: 28px 1fr auto // auto+ grid-template-areas: "pipeline-state-icon pipeline-info pipeline-avatar" // pipeline-details"list-style-type: none- border: 1px solid #dddddd+ border: 1px solid #e4e4e4padding: 0.3rem 1rem- background: rgba(0, 0, 0, 0.05)- font-size: 0.9rem+ // background: rgba(0, 0, 0, 0.05)+ font-size: 0.84rem&:first-childborder-top-right-radius: 5px@@ -67,13 +67,13 @@&_queuedcolor: cadetblue- &_in_progress+ &_runningcolor: orange&_successcolor: green- &_failure,+ &_failed,&_timed_out,&_action_required,&_stalediff --git a/frontend/module/tab-header/styles/tab-header.sass b/frontend/module/tab-header-issue/styles/tab-header-issue.sasssimilarity index 90%rename from frontend/module/tab-header/styles/tab-header.sassrename to frontend/module/tab-header-issue/styles/tab-header-issue.sassindex f8c45ecd06f..e5eb014b830 100644--- a/frontend/module/tab-header/styles/tab-header.sass+++ b/frontend/module/tab-header-issue/styles/tab-header-issue.sass@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -27,20 +27,24 @@// See docs/COPYRIGHT.rdoc for more details.//++-.gitlab-mr-header+.gitlab-issue-headerdisplay: flexflex-wrap: wrap-reversejustify-content: flex-endborder-bottom: 1px solid #ddd-+ background-color: var(--body-background).titleflex: 1 1 autoborder-bottom: 0margin: 0- padding: 0+ padding: 0 0 0 4pxfont-weight: boldfont-size: 1remline-height: 32pxtext-transform: uppercase++ .s16x32+ width: 16px+ height: 32pxdiff --git a/frontend/module/tab-header-issue/tab-header-issue.component.ts b/frontend/module/tab-header-issue/tab-header-issue.component.tsnew file mode 100644index 00000000000..447a44c7ad3--- /dev/null+++ b/frontend/module/tab-header-issue/tab-header-issue.component.ts@@ -0,0 +1,50 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++import { Component, Input } from '@angular/core';+import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource";+import { I18nService } from "core-app/core/i18n/i18n.service";++@Component({+ selector: 'tab-header-issue',+ templateUrl: './tab-header-issue.template.html',+ styleUrls: [+ './styles/tab-header-issue.sass'+ ]+})+export class TabHeaderIssueComponent {+ @Input() public workPackage:WorkPackageResource;++ public text = {+ title: this.I18n.t('js.gitlab_integration.tab_header_issue.title'),+ };++ constructor(readonly I18n:I18nService) {+ }+}diff --git a/frontend/module/tab-header-issue/tab-header-issue.template.html b/frontend/module/tab-header-issue/tab-header-issue.template.htmlnew file mode 100644index 00000000000..1fc5efe1023--- /dev/null+++ b/frontend/module/tab-header-issue/tab-header-issue.template.html@@ -0,0 +1,6 @@+<div class="gitlab-issue-header">+ <svg class="s16x32"><use xlink:href="#issue_open" /></svg>+ <h3 class="title">+ {{text.title}}+ </h3>+</div>diff --git a/frontend/module/tab-header-mr/styles/tab-header-mr.sass b/frontend/module/tab-header-mr/styles/tab-header-mr.sassnew file mode 100644index 00000000000..1613363e759--- /dev/null+++ b/frontend/module/tab-header-mr/styles/tab-header-mr.sass@@ -0,0 +1,51 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++.gitlab-mr-header+ display: flex+ flex-wrap: wrap-reverse+ justify-content: flex-end++ border-bottom: 1px solid #ddd+ background-color: var(--body-background)++ .title+ flex: 1 1 auto+ border-bottom: 0+ margin: 0+ padding: 0 0 0 4px+ font-weight: bold+ font-size: 1rem+ line-height: 32px+ text-transform: uppercase+ align-self: baseline++ .s16x32+ width: 16px+ height: 32pxdiff --git a/frontend/module/tab-header/tab-header.component.ts b/frontend/module/tab-header-mr/tab-header-mr.component.tssimilarity index 83%rename from frontend/module/tab-header/tab-header.component.tsrename to frontend/module/tab-header-mr/tab-header-mr.component.tsindex 3be83881047..dc208c5a55c 100644--- a/frontend/module/tab-header/tab-header.component.ts+++ b/frontend/module/tab-header-mr/tab-header-mr.component.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -32,21 +32,21 @@ import { WorkPackageResource } from "core-app/features/hal/resources/work-packagimport { I18nService } from "core-app/core/i18n/i18n.service";@Component({- selector: 'tab-header',- templateUrl: './tab-header.template.html',+ selector: 'tab-header-mr',+ templateUrl: './tab-header-mr.template.html',styleUrls: [- './styles/tab-header.sass'+ './styles/tab-header-mr.sass']})-export class TabHeaderComponent {+export class TabHeaderMrsComponent {@Input() public workPackage:WorkPackageResource;public text = {- title: this.I18n.t('js.gitlab_integration.tab_header.title'),+ title: this.I18n.t('js.gitlab_integration.tab_header_mr.title'),// createPrButtonLabel: this.I18n.t('js.gitlab_integration.tab_header.create_mr.label'),// createPrButtonDescription: this.I18n.t('js.gitlab_integration.tab_header.create_mr.description'),- gitMenuLabel: this.I18n.t('js.gitlab_integration.tab_header.copy_menu.label'),- gitMenuDescription: this.I18n.t('js.gitlab_integration.tab_header.copy_menu.description'),+ gitMenuLabel: this.I18n.t('js.gitlab_integration.tab_header_mr.copy_menu.label'),+ gitMenuDescription: this.I18n.t('js.gitlab_integration.tab_header_mr.copy_menu.description'),};constructor(readonly I18n:I18nService) {diff --git a/frontend/module/tab-header/tab-header.template.html b/frontend/module/tab-header-mr/tab-header-mr.template.htmlsimilarity index 91%rename from frontend/module/tab-header/tab-header.template.htmlrename to frontend/module/tab-header-mr/tab-header-mr.template.htmlindex d35fa831736..031b3c52a57 100644--- a/frontend/module/tab-header/tab-header.template.html+++ b/frontend/module/tab-header-mr/tab-header-mr.template.html@@ -1,6 +1,6 @@<div class="gitlab-mr-header">+ <svg class="s16x32"><use xlink:href="#merge-request_open" /></svg><h3 class="title">- <op-icon icon-classes="button--icon icon-merge-branch"></op-icon>{{text.title}}</h3><ul class="toolbar-items hide-when-print">diff --git a/frontend/module/tab-issue/tab-issue.component.ts b/frontend/module/tab-issue/tab-issue.component.tsnew file mode 100644index 00000000000..28c96b44f79--- /dev/null+++ b/frontend/module/tab-issue/tab-issue.component.ts@@ -0,0 +1,70 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';+import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource";+import { HalResourceService } from "core-app/features/hal/services/hal-resource.service";+import { CollectionResource } from "core-app/features/hal/resources/collection-resource";+import { I18nService } from "core-app/core/i18n/i18n.service";+import {IGitlabIssueResource} from "core-app/features/plugins/linked/openproject-gitlab_integration/typings";+import {ApiV3Service} from "core-app/core/apiv3/api-v3.service";++@Component({+ selector: 'tab-issue',+ templateUrl: './tab-issue.template.html',+ host: { class: 'op-issue' }+})+export class TabIssueComponent implements OnInit {+ @Input() public workPackage:WorkPackageResource;++ public gitlabIssues:IGitlabIssueResource[] = [];++ constructor(+ readonly I18n:I18nService,+ readonly apiV3Service:ApiV3Service,+ readonly halResourceService:HalResourceService,+ readonly changeDetector:ChangeDetectorRef,+ ) {}++ ngOnInit(): void {+ const basePath = this.apiV3Service.work_packages.id(this.workPackage.id as string).path;+ const gitlabIssuePath = `${basePath}/gitlab_issues`;++ this.halResourceService+ .get<CollectionResource<IGitlabIssueResource>>(gitlabIssuePath)+ .subscribe((value) => {+ this.gitlabIssues = value.elements;+ this.changeDetector.detectChanges();+ });+ }++ public getEmptyText() {+ return this.I18n.t('js.gitlab_integration.tab_issue.empty',{ wp_id: this.workPackage.id });+ }+}diff --git a/frontend/module/tab-issue/tab-issue.template.html b/frontend/module/tab-issue/tab-issue.template.htmlnew file mode 100644index 00000000000..ce4a51d334e--- /dev/null+++ b/frontend/module/tab-issue/tab-issue.template.html@@ -0,0 +1,5 @@+<ng-container *ngIf="gitlabIssues.length === 0">+ <p [innerHTML]="getEmptyText()"></p>+</ng-container>++<gitlab-issue [gitlabIssue]="gitlabIssue" *ngFor="let gitlabIssue of gitlabIssues"></gitlab-issue>diff --git a/frontend/module/tab-issue/wp-gitlab-issue.service.ts b/frontend/module/tab-issue/wp-gitlab-issue.service.tsnew file mode 100644index 00000000000..7898eba0076--- /dev/null+++ b/frontend/module/tab-issue/wp-gitlab-issue.service.ts@@ -0,0 +1,52 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2023 Ben Tey+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+//++++import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource";+import { HalResource } from "core-app/features/hal/resources/hal-resource";+import { Injectable } from '@angular/core';+import { ConfigurationService } from "core-app/core/config/configuration.service";+import { WorkPackageLinkedResourceCache } from 'core-app/features/work-packages/components/wp-single-view-tabs/wp-linked-resource-cache.service';++@Injectable()+export class WorkPackagesGitlabIssueService extends WorkPackageLinkedResourceCache<HalResource[]> {++ constructor(public ConfigurationService:ConfigurationService) {+ super();+ }++ protected load(workPackage:WorkPackageResource):Promise<HalResource[]> {+ return workPackage.gitlab_issues.$update().then((data:any) => {+ return this.sortList(data.elements);+ });+ }++ protected sortList(gitlabIssue:HalResource[], attr = 'createdAt'):HalResource[] {+ return _.sortBy(_.flatten(gitlabIssue), attr);+ }+}diff --git a/frontend/module/tab-mrs/tab-mrs.component.ts b/frontend/module/tab-mrs/tab-mrs.component.tsindex 4700980decc..dc425412817 100644--- a/frontend/module/tab-mrs/tab-mrs.component.ts+++ b/frontend/module/tab-mrs/tab-mrs.component.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/tab-mrs/wp-gitlab-mrs.service.ts b/frontend/module/tab-mrs/wp-gitlab-mrs.service.tsindex 1e17b490f0a..aed4c23bea0 100644--- a/frontend/module/tab-mrs/wp-gitlab-mrs.service.ts+++ b/frontend/module/tab-mrs/wp-gitlab-mrs.service.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.diff --git a/frontend/module/typings.d.ts b/frontend/module/typings.d.tsindex 19bce8a38d5..f790de805c7 100644--- a/frontend/module/typings.d.ts+++ b/frontend/module/typings.d.ts@@ -1,6 +1,6 @@//-- copyright// OpenProject is an open source project management software.-// Copyright (C) 2021 Ben Tey+// Copyright (C) 2023 Ben Tey//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License version 3.@@ -36,6 +36,25 @@ export interface ISnippet {textToCopy:()=>string}+export interface IGitlabIssueResource extends HalResourceClass {+ body?:{+ format?:string;+ raw?:string;+ html?:string;+ },+ createdAt?:string;+ gitlabUpdatedAt?:string;+ htmlUrl?:string;+ id?:number;+ labels?:string[];+ number?:number;+ repository?:string;+ state?:string;+ title?:string;+ updatedAt?:string;+ gitlabUser?:IGitlabUserResource;+}+export interface IGitlabMergeRequestResource extends HalResourceClass {body?:{format?:string;@@ -74,4 +93,7 @@ export interface IGitlabPipelineResource {name:string;startedAt:string;status:string;+ ci_details:string[];+ username:string;+ commitId:string;}\ No newline at end of filediff --git a/lib/api/v3/gitlab_issues/gitlab_issue_collection_representer.rb b/lib/api/v3/gitlab_issues/gitlab_issue_collection_representer.rbnew file mode 100644index 00000000000..f3285a4c62d--- /dev/null+++ b/lib/api/v3/gitlab_issues/gitlab_issue_collection_representer.rb@@ -0,0 +1,40 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#++++module API+ module V3+ module GitlabIssues+ class GitlabIssueCollectionRepresenter < ::API::Decorators::Collection+ self.to_eager_load = ::API::V3::GitlabIssues::GitlabIssueRepresenter.to_eager_load+ end+ end+ end+enddiff --git a/lib/api/v3/gitlab_issues/gitlab_issue_representer.rb b/lib/api/v3/gitlab_issues/gitlab_issue_representer.rbnew file mode 100644index 00000000000..f0043d47551--- /dev/null+++ b/lib/api/v3/gitlab_issues/gitlab_issue_representer.rb@@ -0,0 +1,90 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#++++require 'roar/decorator'+require 'roar/json/hal'++module API+ module V3+ module GitlabIssues+ class GitlabIssueRepresenter < ::API::Decorators::Single+ include API::Caching::CachedRepresenter+ include API::Decorators::DateProperty+ include API::Decorators::FormattableProperty+ include API::Decorators::LinkedResource++ def initialize(model, current_user:, **_opts)+ # We force `embed_links` so that github_user and github_check_runs+ # are embedded and we can avoid having separate endpoints.+ super(model, current_user: current_user, embed_links: true)+ end++ cached_representer key_parts: %i[gitlab_user]++ property :id++ property :number++ property :gitlab_html_url, as: :htmlUrl++ property :state,+ render_nil: true++ property :repository,+ render_nil: true++ date_time_property :gitlab_updated_at,+ render_nil: true,+ setter: ->(*) { nil }++ property :title,+ render_nil: true++ formattable_property :body,+ render_nil: true++ property :labels++ associated_resource :gitlab_user,+ representer: ::API::V3::GitlabIssues::GitlabUserRepresenter,+ link_title_attribute: :gitlab_name++ date_time_property :created_at++ date_time_property :updated_at++ def _type+ 'GitlabIssue'+ end++ self.to_eager_load = %i[gitlab_user]+ end+ end+ end+enddiff --git a/lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rb b/lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rbnew file mode 100644index 00000000000..b715058e424--- /dev/null+++ b/lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rb@@ -0,0 +1,53 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#++++module API+ module V3+ module GitlabIssues+ class GitlabIssuesByWorkPackageAPI < ::API::OpenProjectAPI+ after_validation do+ authorize(:show_gitlab_content, context: @work_package.project)+ @gitlab_issues = @work_package.gitlab_issues+ end++ resources :gitlab_issues do+ get do+ path = api_v3_paths.gitlab_issues_by_work_package(@work_package.id)+ GitlabIssueCollectionRepresenter.new(@gitlab_issues,+ @gitlab_issues.count,+ self_link: path,+ current_user: current_user)+ end+ end+ end+ end+ end+enddiff --git a/lib/api/v3/gitlab_issues/gitlab_user_representer.rb b/lib/api/v3/gitlab_issues/gitlab_user_representer.rbnew file mode 100644index 00000000000..46627d1b173--- /dev/null+++ b/lib/api/v3/gitlab_issues/gitlab_user_representer.rb@@ -0,0 +1,52 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2023 Ben Tey+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#++++require 'roar/decorator'+require 'roar/json/hal'++module API+ module V3+ module GitlabIssues+ class GitlabUserRepresenter < ::API::Decorators::Single+ include API::Caching::CachedRepresenter++ self_link id_attribute: :id,+ title_getter: ->(*) { nil }++ property :gitlab_name, as: :login+ property :gitlab_email, as: :email+ property :gitlab_avatar_url, as: :avatarUrl++ def _type+ 'GitlabUser'+ end+ end+ end+ end+enddiff --git a/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rb b/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rbindex 0236f90a934..fc3aab2bf24 100644--- a/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rb+++ b/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rb@@ -46,6 +46,8 @@ module APIproperty :statusproperty :details_urlproperty :ci_details+ property :username+ property :commit_id, as: :commitIddate_time_property :started_atdate_time_property :completed_atdiff --git a/lib/open_project/gitlab_integration/engine.rb b/lib/open_project/gitlab_integration/engine.rbindex 08da552a24b..4daf619f8fc 100644--- a/lib/open_project/gitlab_integration/engine.rb+++ b/lib/open_project/gitlab_integration/engine.rb@@ -76,6 +76,10 @@ module OpenProject::GitlabIntegration"#{work_package(id)}/gitlab_merge_requests"end+ add_api_path :gitlab_issues_by_work_package do |id|+ "#{work_package(id)}/gitlab_issues"+ end+add_api_path :gitlab_user do |id|"gitlab_users/#{id}"end@@ -87,6 +91,10 @@ module OpenProject::GitlabIntegrationadd_api_endpoint 'API::V3::WorkPackages::WorkPackagesAPI', :id domount ::API::V3::GitlabMergeRequests::GitlabMergeRequestsByWorkPackageAPIend++ add_api_endpoint 'API::V3::WorkPackages::WorkPackagesAPI', :id do+ mount ::API::V3::GitlabIssues::GitlabIssuesByWorkPackageAPI+ endconfig.to_prepare do# Register the cron job to clean up old gitlab merge requestsdiff --git a/lib/open_project/gitlab_integration/notification_handler/issue_hook.rb b/lib/open_project/gitlab_integration/notification_handler/issue_hook.rbindex 8f41dfdc258..0c5cabcc360 100644--- a/lib/open_project/gitlab_integration/notification_handler/issue_hook.rb+++ b/lib/open_project/gitlab_integration/notification_handler/issue_hook.rb@@ -41,6 +41,7 @@ module OpenProject::GitlabIntegrationwork_packages = find_mentioned_work_packages(text, user)notes = generate_notes(payload)comment_on_referenced_work_packages(work_packages, user, notes)+ upsert_issue(work_packages)endprivate@@ -66,6 +67,19 @@ module OpenProject::GitlabIntegration:gitlab_user => payload.user.name,:gitlab_user_url => payload.user.avatar_url)end++ def gitlab_issue+ @gitlab_issue ||= GitlabIssue+ .where(gitlab_id: payload.object_attributes.iid)+ .or(GitlabIssue.where(gitlab_html_url: payload.object_attributes.url))+ .take+ end++ def upsert_issue(work_packages)+ return if work_packages.empty? && gitlab_issue.nil?+ OpenProject::GitlabIntegration::Services::UpsertIssue.new.call(payload,+ work_packages: work_packages)+ endendendend\ No newline at end of filediff --git a/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb b/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rbindex fff9432bee6..c4e65d05572 100644--- a/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb+++ b/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb@@ -33,7 +33,7 @@ module OpenProject::GitlabIntegration# Handles Gitlab merge request notifications.class MergeRequestHookinclude OpenProject::GitlabIntegration::NotificationHandler::Helper-+def process(payload_params)update_status_on_new_mr = false # true if you only reference one merge by work_package, else false.update_status_on_merged = false # true if you only reference one merge by work_package, else false.@@ -48,10 +48,10 @@ module OpenProject::GitlabIntegrationreturn unless (accepted_actions.include? payload.object_attributes.action) || (accepted_states.include? payload.object_attributes.state)user = User.find_by_id(payload.open_project_user_id)- text = payload.object_attributes.title+ text = payload.object_attributes.title + ' - ' + payload.object_attributes.descriptionwork_packages = find_mentioned_work_packages(text, user)notes = generate_notes(payload)-+if (accepted_actions_for_comments.include? payload.object_attributes.action) || (accepted_states.include? payload.object_attributes.state)comment_on_referenced_work_packages(work_packages, user, notes)if payload.object_attributes.state == 'opened' && update_status_on_new_mr@@ -76,7 +76,7 @@ module OpenProject::GitlabIntegration'edited' => 'referenced','referenced' => 'referenced'}[payload.object_attributes.state]-+key_action = {'reopen' => 'reopened'}[payload.object_attributes.action]@@ -108,4 +108,4 @@ module OpenProject::GitlabIntegrationendend-end\ No newline at end of file+enddiff --git a/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rb b/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rbindex baf7ca8db2b..1c14b01fb17 100644--- a/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rb+++ b/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rb@@ -42,10 +42,10 @@ module OpenProject::GitlabIntegrationreturn unless merge_request# disabled until gitlab issue resolution- # OpenProject::GitlabIntegration::Services::UpsertPipeline.new.call(- # payload,- # merge_request: merge_request- # )+ OpenProject::GitlabIntegration::Services::UpsertPipeline.new.call(+ payload,+ merge_request: merge_request+ )endprivatediff --git a/lib/open_project/gitlab_integration/patches/api/work_package_representer.rb b/lib/open_project/gitlab_integration/patches/api/work_package_representer.rbindex 7a67f36f5d5..0c2a8cf1c09 100644--- a/lib/open_project/gitlab_integration/patches/api/work_package_representer.rb+++ b/lib/open_project/gitlab_integration/patches/api/work_package_representer.rb@@ -52,6 +52,15 @@ module OpenProject::GitlabIntegrationtitle: "Gitlab merge requests"}end++ link :gitlab_issues do+ next if represented.new_record?++ {+ href: api_v3_paths.gitlab_issues_by_work_package(represented.id),+ title: "Gitlab Issues"+ }+ endendendenddiff --git a/lib/open_project/gitlab_integration/patches/work_package_patch.rb b/lib/open_project/gitlab_integration/patches/work_package_patch.rbindex eabf7ea5d07..833b51b908a 100644--- a/lib/open_project/gitlab_integration/patches/work_package_patch.rb+++ b/lib/open_project/gitlab_integration/patches/work_package_patch.rb@@ -5,6 +5,7 @@ module OpenProject::GitlabIntegrationincluded dohas_and_belongs_to_many :gitlab_merge_requests+ has_and_belongs_to_many :gitlab_issuesendendenddiff --git a/lib/open_project/gitlab_integration/services/upsert_issue.rb b/lib/open_project/gitlab_integration/services/upsert_issue.rbnew file mode 100644index 00000000000..402e6bee5c0--- /dev/null+++ b/lib/open_project/gitlab_integration/services/upsert_issue.rb@@ -0,0 +1,84 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See docs/COPYRIGHT.rdoc for more details.+#+++module OpenProject::GitlabIntegration::Services+ ##+ # Takes merge request data coming from Gitlab webhook data and stores+ # them as a `GitlabMergeRequest`.+ # If the `GitlabMergeRequest` already exists, it is updated.+ #+ # Returns the upserted `GitlabMergeRequest`.+ class UpsertIssue+ def call(payload, work_packages: [])+ find_or_initialize(payload).tap do |issue|+ issue.update!(work_packages: issue.work_packages | work_packages, **extract_params(payload))+ end+ end++ private++ def find_or_initialize(payload)+ GitlabIssue.find_by_gitlab_identifiers(id: payload.object_attributes.iid,+ url: payload.object_attributes.url,+ initialize: true)+ end++ # Receives the input from the gitlab webhook and translates them+ # to our internal representation.+ # rubocop:disable Metrics/AbcSize+ def extract_params(payload)+ {+ gitlab_id: payload.object_attributes.iid,+ gitlab_user: gitlab_user_id(payload.user),+ number: payload.object_attributes.iid,+ gitlab_html_url: payload.object_attributes.url,+ gitlab_updated_at: payload.object_attributes.updated_at,+ state: payload.object_attributes.state,+ title: payload.object_attributes.title,+ body: payload.object_attributes.description,+ repository: payload.repository.name,+ labels: payload.labels.map { |values| extract_label_values(values) }+ }+ end+ # rubocop:enable Metrics/AbcSize++ def extract_label_values(payload)+ {+ title: payload['title'],+ color: payload['color']+ }+ end++ def gitlab_user_id(payload)+ return if payload.blank?++ ::OpenProject::GitlabIntegration::Services::UpsertGitlabUser.new.call(payload)+ end+ end+enddiff --git a/lib/open_project/gitlab_integration/services/upsert_pipeline.rb b/lib/open_project/gitlab_integration/services/upsert_pipeline.rbindex fdca7fc2a1e..ed91fce2190 100644--- a/lib/open_project/gitlab_integration/services/upsert_pipeline.rb+++ b/lib/open_project/gitlab_integration/services/upsert_pipeline.rb@@ -36,7 +36,7 @@ module OpenProject::GitlabIntegration::Services# Returns the upserted `GitlabPipeline`.class UpsertPipelinedef call(payload, merge_request:)- GitlabPipelines.find_or_initialize_by(gitlab_id: payload.object_attributes.id)+ GitlabPipeline.find_or_initialize_by(gitlab_id: payload.object_attributes.iid).tap do |pipeline|pipeline.update!(gitlab_merge_request: merge_request, **extract_params(payload))end@@ -48,14 +48,16 @@ module OpenProject::GitlabIntegration::Services# to our internal representation.def extract_params(payload){- gitlab_id: payload.object_attributes.id,- gitlab_html_url: payload.project.web_url + "-/pipelines/" + payload.object_attributes.id,+ gitlab_id: payload.object_attributes.iid,+ gitlab_html_url: "#{payload.project.web_url}/-/pipelines/#{payload.object_attributes.iid}",project_id: payload.project.id,gitlab_user_avatar_url: payload.user.avatar_url,- name: payload.object_attributes.status,+ name: payload.object_attributes.iid,status: payload.object_attributes.status,- details_url: payload.project.web_url + "-/pipelines/" + payload.object_attributes.id,- # ci_details: pending until resolution of the gitlab issue,+ details_url: "#{payload.project.web_url}/-/commit/#{payload.object_attributes.sha[0..7]}",+ commit_id: payload.object_attributes.sha[0..7],+ username: payload.user.name,+ ci_details: payload.builds,started_at: payload.object_attributes.created_at,completed_at: payload.object_attributes.finished_at}diff --git a/openproject-gitlab_integration.gemspec b/openproject-gitlab_integration.gemspecindex 41ddb2632a4..013dae3603e 100644--- a/openproject-gitlab_integration.gemspec+++ b/openproject-gitlab_integration.gemspec@@ -1,5 +1,5 @@# encoding: UTF-8-#+##-- copyright# OpenProject is an open source project management software.# Copyright (C) 2023 Ben Tey@@ -31,7 +31,7 @@Gem::Specification.new do |s|s.name = "openproject-gitlab_integration"- s.version = '2.0.9'+ s.version = '2.1's.authors = "Ben Tey"s.email = "[email protected]"s.homepage = "https://github.com/btey/openproject-gitlab-integration"