Merge pull request #6003 from okriuchykhin/ok_SCI_9028

Show only default label templates when feature is disabled [SCI-9028]
This commit is contained in:
Alex Kriuchykhin 2023-08-17 16:50:00 +02:00 committed by GitHub
commit 67042ce254
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -174,7 +174,7 @@ class LabelTemplatesController < ApplicationController
end
def load_label_templates
@label_templates = LabelTemplate.where(team_id: current_team.id)
@label_templates = LabelTemplate.enabled? ? current_team.label_templates : current_team.label_templates.default
end
def load_label_template

View file

@ -15,6 +15,8 @@ class LabelTemplate < ApplicationRecord
validate :ensure_single_default_template!
scope :default, -> { where(default: true) }
def self.enabled?
ApplicationSettings.instance.values['label_templates_enabled'] == true
end