Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
de7c91b6
Commit
de7c91b6
authored
Dec 17, 2021
by
anna_vovchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed badges to Pajamas-cmopliant components
parent
79decad5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
22 deletions
+19
-22
app/helpers/admin/background_migrations_helper.rb
app/helpers/admin/background_migrations_helper.rb
+7
-7
app/views/admin/background_migrations/_migration.html.haml
app/views/admin/background_migrations/_migration.html.haml
+1
-1
app/views/admin/background_migrations/index.html.haml
app/views/admin/background_migrations/index.html.haml
+3
-6
spec/helpers/admin/background_migrations_helper_spec.rb
spec/helpers/admin/background_migrations_helper_spec.rb
+8
-8
No files found.
app/helpers/admin/background_migrations_helper.rb
View file @
de7c91b6
...
...
@@ -2,15 +2,15 @@
module
Admin
module
BackgroundMigrationsHelper
def
batched_migration_status_badge_
class_name
(
migration
)
class_name
s
=
{
'active'
=>
'badge-info'
,
'paused'
=>
'badge-warning'
,
'failed'
=>
'badge-danger'
,
'finished'
=>
'badge-success'
def
batched_migration_status_badge_
variant
(
migration
)
variant
s
=
{
'active'
=>
:info
,
'paused'
=>
:warning
,
'failed'
=>
:danger
,
'finished'
=>
:success
}
class_name
s
[
migration
.
status
]
variant
s
[
migration
.
status
]
end
# The extra logic here is needed because total_tuple_count is just
...
...
app/views/admin/background_migrations/_migration.html.haml
View file @
de7c91b6
...
...
@@ -7,7 +7,7 @@
-
else
=
_
(
'Unknown'
)
%td
{
role:
'cell'
,
data:
{
label:
_
(
'Status'
)
}
}
%span
.badge.badge-pill.gl-badge.sm
{
class:
batched_migration_status_badge_class_name
(
migration
)
}=
migration
.
status
.
humanize
=
gl_badge_tag
migration
.
status
.
humanize
,
{
size: :sm
,
variant:
batched_migration_status_badge_variant
(
migration
)
}
%td
{
role:
'cell'
,
data:
{
label:
_
(
'Action'
)
}
}
-
if
migration
.
active?
=
button_to
pause_admin_background_migration_path
(
migration
),
...
...
app/views/admin/background_migrations/index.html.haml
View file @
de7c91b6
...
...
@@ -8,18 +8,15 @@
%li
.nav-item
{
role:
'presentation'
}
%a
.nav-link.gl-tab-nav-item
{
href:
admin_background_migrations_path
,
class:
(
active_tab_classes
if
@current_tab
==
'queued'
),
role:
'tab'
}
=
_
(
'Queued'
)
%span
.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
=
limited_counter_with_delimiter
(
@relations_by_tab
[
'queued'
])
=
gl_tab_counter_badge
limited_counter_with_delimiter
(
@relations_by_tab
[
'queued'
])
%li
.nav-item
{
role:
'presentation'
}
%a
.nav-link.gl-tab-nav-item
{
href:
admin_background_migrations_path
(
tab:
'failed'
),
class:
(
active_tab_classes
if
@current_tab
==
'failed'
),
role:
'tab'
}
=
_
(
'Failed'
)
%span
.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
=
limited_counter_with_delimiter
(
@relations_by_tab
[
'failed'
])
=
gl_tab_counter_badge
limited_counter_with_delimiter
(
@relations_by_tab
[
'failed'
])
%li
.nav-item
{
role:
'presentation'
}
%a
.nav-link.gl-tab-nav-item
{
href:
admin_background_migrations_path
(
tab:
'finished'
),
class:
(
active_tab_classes
if
@current_tab
==
'finished'
),
role:
'tab'
}
=
_
(
'Finished'
)
%span
.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
=
limited_counter_with_delimiter
(
@relations_by_tab
[
'finished'
])
=
gl_tab_counter_badge
limited_counter_with_delimiter
(
@relations_by_tab
[
'finished'
])
.tab-content.gl-tab-content
.tab-pane.active
{
role:
'tabpanel'
}
...
...
spec/helpers/admin/background_migrations_helper_spec.rb
View file @
de7c91b6
...
...
@@ -3,22 +3,22 @@
require
"spec_helper"
RSpec
.
describe
Admin
::
BackgroundMigrationsHelper
do
describe
'#batched_migration_status_badge_
class_name
'
do
describe
'#batched_migration_status_badge_
variant
'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:status
,
:
class_name
)
do
:active
|
'badge-info'
:paused
|
'badge-warning'
:failed
|
'badge-danger'
:finished
|
'badge-success'
where
(
:status
,
:
variant
)
do
:active
|
:info
:paused
|
:warning
:failed
|
:danger
:finished
|
:success
end
subject
{
helper
.
batched_migration_status_badge_
class_name
(
migration
)
}
subject
{
helper
.
batched_migration_status_badge_
variant
(
migration
)
}
with_them
do
let
(
:migration
)
{
build
(
:batched_background_migration
,
status:
status
)
}
it
{
is_expected
.
to
eq
(
class_name
)
}
it
{
is_expected
.
to
eq
(
variant
)
}
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment