diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-31 13:07:44 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-31 13:07:56 +0300 |
| commit | d860cf0f27c63ea2c05701aac14a628eef2eae39 (patch) | |
| tree | 4e94d095717006720bf0268f4e7bbc62fdbd2e4f | |
| parent | 5137df53450f26046da7bf73fee0e8bfbc8dff9f (diff) | |
| download | gitlab-ce-d860cf0f27c63ea2c05701aac14a628eef2eae39.tar.gz | |
Show different not fount message for project labels search
Depends on if prioritised or other labels are found or no labels at all
are found, we show a corresponding message now
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| -rw-r--r-- | app/views/projects/labels/index.html.haml | 9 | ||||
| -rw-r--r-- | spec/features/projects/labels/search_labels_spec.rb | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 80d64b356df..00c40a39c81 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -28,7 +28,6 @@ - if can_admin_label %p.text-muted = _('Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.') - -# Only show it in the first page - hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1') .prioritized-labels{ class: ('hide' if hide) } @@ -54,8 +53,12 @@ - if @available_labels.any? %h5 = _('Other Labels') - .nothing-here-block - = _('No other labels with such name or description') + .nothing-here-block + = _('No other labels with such name or description') + - else + .nothing-here-block + = _('No labels with such name or description') + - else = render 'shared/empty_states/labels' diff --git a/spec/features/projects/labels/search_labels_spec.rb b/spec/features/projects/labels/search_labels_spec.rb index affd4cb9469..fef6c2cdee8 100644 --- a/spec/features/projects/labels/search_labels_spec.rb +++ b/spec/features/projects/labels/search_labels_spec.rb @@ -57,7 +57,7 @@ describe 'Search for labels', :js do end page.within('.other-labels') do - expect(page).to have_content('No labels with such name or description') + expect(page).to have_content('No other labels with such name or description') end end @@ -66,7 +66,7 @@ describe 'Search for labels', :js do find('#label-search').native.send_keys(:enter) page.within('.prioritized-labels') do - expect(page).to have_content('No labels with such name or description') + expect(page).to have_content('No prioritised labels with such name or description') end page.within('.other-labels') do |
