Welcome to mirror list, hosted at ThFree Co, Russian Federation.

clickup.rb « integrations « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 25287b53300f98f1a231f4762dc18795d9f47906 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true

module Integrations
  class Clickup < BaseIssueTracker
    include HasIssueTrackerFields

    validates :project_url, :issues_url, presence: true, public_url: true, if: :activated?

    def reference_pattern(*)
      @reference_pattern ||= /((#|CU-)(?<issue>[a-z0-9]+)|(?<issue>[A-Z0-9_]{2,10}-\d+))\b/
    end

    def self.title
      'ClickUp'
    end

    def self.description
      s_("IssueTracker|Use Clickup as this project's issue tracker.")
    end

    def self.help
      docs_link = ActionController::Base.helpers.link_to _('Learn more.'),
        Rails.application.routes.url_helpers.help_page_url('user/project/integrations/clickup'),
        target: '_blank',
        rel: 'noopener noreferrer'
      format(s_(
        "IssueTracker|Use ClickUp as this project's issue tracker. %{docs_link}"
      ).html_safe, docs_link: docs_link.html_safe)
    end

    def self.to_param
      'clickup'
    end

    def fields
      super.select { _1.name.in?(%w[project_url issues_url]) }
    end
  end
end