diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-05-28 13:05:20 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-05-28 13:05:20 +0300 |
commit | 4df0e2599bc9bd7c50b6acea02278c1fb97d3ead (patch) | |
tree | 9ec579188c4fe083d71da187c64277e3337df22b /app/presenters | |
parent | 2d12e22299114490385693a57666d658f0909da7 (diff) |
Fix display of promote to group label
Since label presenter is used in label index view, label class
check doesn't work as expected because the class is now LabelPresenter.
Also `label.subject` doesn't work as expected now because Label's model
`subject` method is shadowed by Gitlab's presenter's method which uses
`subject` for referencing the original object.
Instead we use a presenter's method for both checks now.
`label_deletion_confirm_text` is not used anywhere so it's removed
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/label_presenter.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/presenters/label_presenter.rb b/app/presenters/label_presenter.rb index 5227ef353c3..1077bf543d9 100644 --- a/app/presenters/label_presenter.rb +++ b/app/presenters/label_presenter.rb @@ -35,6 +35,14 @@ class LabelPresenter < Gitlab::View::Presenter::Delegated issuable_subject.is_a?(Project) && label.is_a?(GroupLabel) end + def project_label? + label.is_a?(ProjectLabel) + end + + def subject_name + label.subject.name + end + private def context_subject |