Commit 5f6137bf authored by manojmj's avatar manojmj

Make HIPAA project template Ultimate only

This change moves the HIPAA project template
to GitLab Ultimate tier
parent 1b996ca0
......@@ -223,7 +223,7 @@ const bindEvents = () => {
},
hipaa_audit_protocol: {
text: s__('ProjectTemplates|HIPAA Audit Protocol'),
icon: '.template-option .icon-serverless_framework',
icon: '.template-option .icon-hipaa_audit_protocol',
},
};
......
......@@ -111,6 +111,7 @@ class License < ApplicationRecord
credentials_inventory
dast
dependency_scanning
enterprise_templates
group_ip_restriction
group_level_compliance_dashboard
incident_management
......
# frozen_string_literal: true
module EE
module Gitlab
module ProjectTemplate
extend ActiveSupport::Concern
ENTERPRISE_TEMPLATES_TABLE = [
::Gitlab::ProjectTemplate.new('hipaa_audit_protocol', 'HIPAA Audit Protocol', _('A project containing issues for each audit inquiry in the HIPAA Audit Protocol published by the U.S. Department of Health & Human Services'), 'https://gitlab.com/gitlab-org/project-templates/hipaa-audit-protocol')
].freeze
class_methods do
extend ::Gitlab::Utils::Override
override :all
def all
return super unless License.feature_available?(:enterprise_templates)
super + ENTERPRISE_TEMPLATES_TABLE
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::ProjectTemplate do
describe '.all' do
context 'when `enterprise_templates` feature is not licensed' do
before do
stub_licensed_features(enterprise_templates: false)
end
it 'does not contain enterprise project templates' do
expect(described_class.all).not_to include(*enterprise_templates)
end
end
context 'when `enterprise_templates` feature is licensed' do
before do
stub_licensed_features(enterprise_templates: true)
end
it 'contains enterprise project templates' do
expect(described_class.all).to include(*enterprise_templates)
end
end
end
private
def enterprise_templates
[
described_class.new('hipaa_audit_protocol', 'HIPAA Audit Protocol', _('A project containing issues for each audit inquiry in the HIPAA Audit Protocol published by the U.S. Department of Health & Human Services'), 'https://gitlab.com/gitlab-org/project-templates/hipaa-audit-protocol')
]
end
end
......@@ -56,8 +56,7 @@ module Gitlab
ProjectTemplate.new('nfgitbook', 'Netlify/GitBook', _('A GitBook site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features.'), 'https://gitlab.com/pages/nfgitbook', 'illustrations/logos/netlify.svg'),
ProjectTemplate.new('nfhexo', 'Netlify/Hexo', _('A Hexo site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features.'), 'https://gitlab.com/pages/nfhexo', 'illustrations/logos/netlify.svg'),
ProjectTemplate.new('salesforcedx', 'SalesforceDX', _('A project boilerplate for Salesforce App development with Salesforce Developer tools.'), 'https://gitlab.com/gitlab-org/project-templates/salesforcedx'),
ProjectTemplate.new('serverless_framework', 'Serverless Framework/JS', _('A basic page and serverless function that uses AWS Lambda, AWS API Gateway, and GitLab Pages'), 'https://gitlab.com/gitlab-org/project-templates/serverless-framework', 'illustrations/logos/serverless_framework.svg'),
ProjectTemplate.new('hipaa_audit_protocol', 'HIPAA Audit Protocol', _('A project containing issues for each audit inquiry in the HIPAA Audit Protocol published by the U.S. Department of Health & Human Services'), 'https://gitlab.com/gitlab-org/project-templates/hipaa-audit-protocol', 'illustrations/logos/serverless_framework.svg')
ProjectTemplate.new('serverless_framework', 'Serverless Framework/JS', _('A basic page and serverless function that uses AWS Lambda, AWS API Gateway, and GitLab Pages'), 'https://gitlab.com/gitlab-org/project-templates/serverless-framework', 'illustrations/logos/serverless_framework.svg')
].freeze
class << self
......@@ -75,3 +74,5 @@ module Gitlab
end
end
end
Gitlab::ProjectTemplate.prepend_if_ee('EE::Gitlab::ProjectTemplate')
......@@ -25,8 +25,7 @@ describe Gitlab::ProjectTemplate do
described_class.new('nfgitbook', 'Netlify/GitBook', _('A GitBook site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features.'), 'https://gitlab.com/pages/nfgitbook'),
described_class.new('nfhexo', 'Netlify/Hexo', _('A Hexo site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features.'), 'https://gitlab.com/pages/nfhexo'),
described_class.new('salesforcedx', 'SalesforceDX', _('A project boilerplate for Salesforce App development with Salesforce Developer tools.'), 'https://gitlab.com/gitlab-org/project-templates/salesforcedx'),
described_class.new('serverless_framework', 'Serverless Framework/JS', _('A basic page and serverless function that uses AWS Lambda, AWS API Gateway, and GitLab Pages'), 'https://gitlab.com/gitlab-org/project-templates/serverless-framework', 'illustrations/logos/serverless_framework.svg'),
described_class.new('hipaa_audit_protocol', 'HIPAA Audit Protocol', _('A project containing issues for each audit inquiry in the HIPAA Audit Protocol published by the U.S. Department of Health & Human Services'), 'https://gitlab.com/gitlab-org/project-templates/hipaa-audit-protocol', 'illustrations/logos/serverless_framework.svg')
described_class.new('serverless_framework', 'Serverless Framework/JS', _('A basic page and serverless function that uses AWS Lambda, AWS API Gateway, and GitLab Pages'), 'https://gitlab.com/gitlab-org/project-templates/serverless-framework', 'illustrations/logos/serverless_framework.svg')
]
expect(described_class.all).to be_an(Array)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment