Commit b4f94d87 authored by Kushal Pandya's avatar Kushal Pandya Committed by Gabriel Mazetto

Update project card layout to support collapsible errors list

parent 754a8502
...@@ -178,18 +178,23 @@ ...@@ -178,18 +178,23 @@
} }
.geo-admin-projects { .geo-admin-projects {
.card-header {
.header-text-primary,
.header-text-secondary {
color: $gl-link-color;
}
.header-text-primary {
line-height: 28px;
}
}
.btn-card-header { .btn-card-header {
&:hover, &:hover,
&:focus { &:focus {
text-decoration: none; text-decoration: none;
} }
.card-collapse-icon,
.card-expand-icon {
color: $gl-text-color;
margin-right: 5px;
}
&.collapsed { &.collapsed {
.card-collapse-icon { .card-collapse-icon {
display: none; display: none;
...@@ -201,21 +206,37 @@ ...@@ -201,21 +206,37 @@
display: none; display: none;
} }
} }
}
.header-text { .card-body {
color: $gl-link-color; .project-status-content {
&.status-type-success {
&:hover { color: $gl-text-green;
color: $gl-link-hover-color;
} }
&.status-type-failure {
color: $gl-text-red;
} }
} }
.card-body {
@include media-breakpoint-down(xs) { @include media-breakpoint-down(xs) {
.project-status-container + .project-status-container { .project-status-container + .project-status-container {
margin-top: 10px; margin-top: 10px;
} }
} }
} }
.errors-list {
li + li {
margin-top: 5px;
}
.error-icon,
.error-text {
color: $gl-text-red;
}
.error-text {
line-height: 18px;
}
}
} }
- @registries.each do |project_registry| - @registries.each_with_index do |project_registry, index|
.card.project-card.prepend-top-15 .card.project-card.prepend-top-15
.card-header{id: "project-#{project_registry.project.id}-header"} .card-header{id: "project-#{project_registry.project.id}-header"}
%h5.mb-0.mt-0.p-2.d-flex .d-flex
%button.btn.btn-link.btn-card-header.d-flex.flex-fill{ type: 'button', data: { toggle: 'collapse', target: "#project-#{project_registry.project.id}" }, 'aria-expanded' => 'true', 'aria-controls' => "project-#{project_registry.project.id}" } %strong.header-text-primary.flex-fill
= sprite_icon('chevron-down', size: 18, css_class: 'card-expand-icon')
= sprite_icon('chevron-up', size: 18, css_class: 'card-collapse-icon')
%strong.header-text
= project_registry.project.name = project_registry.project.name
= link_to(resync_project_admin_geo_nodes_path(project_registry), method: :post) do = link_to(resync_project_admin_geo_nodes_path(project_registry), method: :post, class: 'btn btn-outline-primary btn-sm') do
%button.btn.btn-outline-primary.btn-sm{ type: 'button' }
Resync Resync
.collapse.show{id: "project-#{project_registry.project.id}", 'aria-labelledby' => "project-#{project_registry.project.id}-header" }
.card-body .card-body
.container .container
.row .row
.col-sm.project-status-container
.project-status-title.text-muted
Status
.project-status-content.status-type-failure
Failed
.col-sm.project-status-container .col-sm.project-status-container
.project-status-title.text-muted .project-status-title.text-muted
Next sync scheduled at Next sync scheduled at
...@@ -35,3 +35,28 @@ ...@@ -35,3 +35,28 @@
Error message Error message
.project-status-content.font-weight-bold .project-status-content.font-weight-bold
= project_registry.last_repository_sync_failure = project_registry.last_repository_sync_failure
- if index == 0 # change it to actual condition check so that this section shows up only when there are errors to show
.project-card-errors
.card-header.bg-transparent.border-bottom-0.border-top
%button.btn.btn-link.btn-card-header.collapsed.d-flex{ type: 'button',
data: { toggle: 'collapse', target: "#project-errors-#{project_registry.project.id}" },
'aria-expanded' => 'false',
'aria-controls' => "project-errors-#{project_registry.project.id}" }
= sprite_icon('chevron-down', size: 18, css_class: 'append-right-5 card-expand-icon')
= sprite_icon('chevron-up', size: 18, css_class: 'append-right-5 card-collapse-icon')
.header-text-secondary
More
.collapse{ id: "project-errors-#{project_registry.project.id}",
'aria-labelledby' => "project-#{project_registry.project.id}-header" }
.card-body
.container
%ul.unstyled-list.errors-list
%li.p-0.d-flex
= sprite_icon('warning', size: 18, css_class: 'error-icon')
%span.error-text.prepend-left-5
Synchronization failed - showing error message here
%li.p-0.d-flex
= sprite_icon('warning', size: 18, css_class: 'error-icon')
%span.error-text.prepend-left-5
Verification failed - showing error message here
...@@ -4342,6 +4342,9 @@ msgstr "" ...@@ -4342,6 +4342,9 @@ msgstr ""
msgid "Nav|Sign out and sign in with a different account" msgid "Nav|Sign out and sign in with a different account"
msgstr "" msgstr ""
msgid "Never"
msgstr ""
msgid "Network" msgid "Network"
msgstr "" msgstr ""
......
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