From fb1b83b2c69af8a0210e8a74f2371c295778a823 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Mon, 23 Apr 2018 13:33:59 -0400 Subject: [PATCH 01/15] first pass at revamping colors to match patternfly --- .../actions/actionsRule/_rule-detail.scss | 4 +++- app/js/components/feedback/feedbackButton.jade | 2 +- .../incident/incidentLite/incidentLite.jade | 2 +- app/js/components/primary-nav/_primary-nav.scss | 1 - .../components/topbar/_topbar-insights-logo.scss | 6 ++++++ app/js/components/topbar/_topbar-utilities.scss | 3 +++ app/js/components/topbar/_topbar.scss | 6 +++--- app/js/components/topbar/topbar.jade | 2 +- app/js/states/digests/digests.jade | 2 +- app/js/states/inventory/inventory.jade | 2 +- app/js/states/maintenance/maintenance.jade | 10 +++++----- app/js/states/rules/list-rules.jade | 2 +- .../states/vulnerabilities/styles/_view-cve.scss | 3 ++- .../styles/_vulnerability-grid.scss | 3 ++- app/styles/components/_dashboard-nav.scss | 2 +- app/styles/components/_gauges.scss | 6 ++++++ app/styles/components/_materials.scss | 10 ++++++++++ app/styles/components/_page-header.scss | 15 ++++----------- app/styles/components/insights/_group-select.scss | 10 +++++++++- .../maintenance-planner/_maintenance-plan.scss | 4 ++++ app/styles/elements/_section.scss | 5 +++++ 21 files changed, 69 insertions(+), 31 deletions(-) diff --git a/app/js/components/actions/actionsRule/_rule-detail.scss b/app/js/components/actions/actionsRule/_rule-detail.scss index 357f93b2..489fb2f9 100644 --- a/app/js/components/actions/actionsRule/_rule-detail.scss +++ b/app/js/components/actions/actionsRule/_rule-detail.scss @@ -18,7 +18,9 @@ } grid-gap: $global-margin; - @include rem('margin', 0 $global-margin); + margin: 0; + @include rem('padding', 0 $global-margin); + border-bottom: 1px solid #d1d1d1; .detail, .meta { @include rem('padding', 0 $global-padding); } diff --git a/app/js/components/feedback/feedbackButton.jade b/app/js/components/feedback/feedbackButton.jade index bd7eaa41..eb1060e5 100644 --- a/app/js/components/feedback/feedbackButton.jade +++ b/app/js/components/feedback/feedbackButton.jade @@ -1,3 +1,3 @@ -a.btn.btn-feedback(ng-click="openFeedbackPage()") +a.md-button.md-button-sm.btn-feedback(ng-click="openFeedbackPage()") i.fa.fa-comments(aria-hidden="true") strong(translate) Provide feedback diff --git a/app/js/components/incident/incidentLite/incidentLite.jade b/app/js/components/incident/incidentLite/incidentLite.jade index 7c40811a..3b943315 100644 --- a/app/js/components/incident/incidentLite/incidentLite.jade +++ b/app/js/components/incident/incidentLite/incidentLite.jade @@ -1,7 +1,7 @@ .text-center(ng-if='loading') .spinner.spinner-lg -.incident-lite(ng-if='!loading') +card.card-accent.incident-lite(ng-if='!loading') .cell.icon i.fa.fa-bullseye(aria-hidden="true") diff --git a/app/js/components/primary-nav/_primary-nav.scss b/app/js/components/primary-nav/_primary-nav.scss index bb106335..f8557156 100644 --- a/app/js/components/primary-nav/_primary-nav.scss +++ b/app/js/components/primary-nav/_primary-nav.scss @@ -1,5 +1,4 @@ $primary-nav-bg: #292e34; -$primary-nav-bg: #454853; $dashboard-nav-border-color: #403b3f; $dashboard-nav-header-bg: #4d464b; $dashboard-nav-input-bg: #322e31; diff --git a/app/js/components/topbar/_topbar-insights-logo.scss b/app/js/components/topbar/_topbar-insights-logo.scss index e490d08b..f0d89b0a 100644 --- a/app/js/components/topbar/_topbar-insights-logo.scss +++ b/app/js/components/topbar/_topbar-insights-logo.scss @@ -4,9 +4,15 @@ topbar .insights-logo { @include media-query(sm){ display: inline-flex; } .home-link md-icon { + fill: #fff; @include rem('width', 120px); } + button.toggle-fullscreen md-icon{ + color: #fff; + @include font-size(20px); + } + button { border: none; } diff --git a/app/js/components/topbar/_topbar-utilities.scss b/app/js/components/topbar/_topbar-utilities.scss index 2a59030c..fab61d2f 100644 --- a/app/js/components/topbar/_topbar-utilities.scss +++ b/app/js/components/topbar/_topbar-utilities.scss @@ -1,4 +1,7 @@ .topbar-utilities { display: flex; align-items: center; + .md-button, .md-button *:hover { + color: #fff; + } } \ No newline at end of file diff --git a/app/js/components/topbar/_topbar.scss b/app/js/components/topbar/_topbar.scss index 389ae98b..6fe0fa15 100644 --- a/app/js/components/topbar/_topbar.scss +++ b/app/js/components/topbar/_topbar.scss @@ -1,5 +1,5 @@ -$topbar-bg: #F5F5F5; -$topbar-text-color: $base-color; +$topbar-bg: #1D1D1D; +$topbar-text-color: #fff; $topbar-border-color: #ddd; @@ -7,7 +7,7 @@ topbar { display: block; @include rem('padding', $global-margin); background: $topbar-bg; - border-bottom: 4px solid $topbar-border-color; + //border-bottom: 4px solid $topbar-border-color; @include media-query(sm){ @include rem('padding', 0 $global-padding 0 0); diff --git a/app/js/components/topbar/topbar.jade b/app/js/components/topbar/topbar.jade index 781d9e8e..6f9c441c 100644 --- a/app/js/components/topbar/topbar.jade +++ b/app/js/components/topbar/topbar.jade @@ -1,6 +1,6 @@ .cell.insights-logo button.toggle-fullscreen(ng-click='sidenavCollapsed = !sidenavCollapsed') - md-icon(md-font-icon="fa fa-indent") + md-icon(md-font-icon="fa fa-bars") md-button(ng-click="toggleLeft()", class="md-primary", diff --git a/app/js/states/digests/digests.jade b/app/js/states/digests/digests.jade index 8bc1a03c..e96a1e36 100644 --- a/app/js/states/digests/digests.jade +++ b/app/js/states/digests/digests.jade @@ -1,6 +1,6 @@ .digests-page page-header(title="Executive Report", icon="fa-bar-chart", ng-class="{'inactive': !expandBar, 'active': expandBar}", ng-transclude) - md-button.md-primary.pull-right( + md-button.md-primary( ng-click='downloadPdf()', ng-if="!downloading", ng-show='systemsTilTen < 1', diff --git a/app/js/states/inventory/inventory.jade b/app/js/states/inventory/inventory.jade index c7447e22..1bf7cc17 100644 --- a/app/js/states/inventory/inventory.jade +++ b/app/js/states/inventory/inventory.jade @@ -6,7 +6,7 @@ actions-select .rha-notifications - section.content + section.content.content-white .table-utilities inventory-actions diff --git a/app/js/states/maintenance/maintenance.jade b/app/js/states/maintenance/maintenance.jade index 221fde26..b72cc52e 100644 --- a/app/js/states/maintenance/maintenance.jade +++ b/app/js/states/maintenance/maintenance.jade @@ -1,6 +1,9 @@ .maintenance-page page-header(title="Maintenance Planner", icon="fa-wrench", ng-class="{'inactive': !expandBar, 'active': expandBar}", ng-transclude) - .create-plan-actions.text-right.pull-right + + table-filters + maintenance-category-select(category='category', on-select='setCategory(category, true)') + .create-plan-actions.text-right a.create-plan(ng-click='MaintenanceService.showMaintenanceModal()') span(translate)  Create a plan i.fa.fa-plus-circle @@ -8,10 +11,7 @@ small.red(translate) New suggested plan i.fa.fa-plus-circle - table-filters - maintenance-category-select(category='category', on-select='setCategory(category, true)') - - section.content + section.content.content-white .table-header search-box(ng-model='searchTerm', placeholder="{{'Search plans' | translate}}") section diff --git a/app/js/states/rules/list-rules.jade b/app/js/states/rules/list-rules.jade index 8d1c6984..89963234 100644 --- a/app/js/states/rules/list-rules.jade +++ b/app/js/states/rules/list-rules.jade @@ -1,7 +1,7 @@ section page-header(title="Rules", icon="fa-institution") rule-filter - section.content + section.content.content-white a.btn.btn-sm.btn-app.pull-right(ui-sref='app.admin-topic', ng-show='user.is_internal') Topics Admin .table-header diff --git a/app/js/states/vulnerabilities/styles/_view-cve.scss b/app/js/states/vulnerabilities/styles/_view-cve.scss index 3e896c81..b4715bb0 100644 --- a/app/js/states/vulnerabilities/styles/_view-cve.scss +++ b/app/js/states/vulnerabilities/styles/_view-cve.scss @@ -32,7 +32,8 @@ .page-header { grid-area: page-header; - margin-left: 0px; + margin-left: 0; + padding-left: 0; .page-title i { margin: 0px; } } diff --git a/app/js/states/vulnerabilities/styles/_vulnerability-grid.scss b/app/js/states/vulnerabilities/styles/_vulnerability-grid.scss index 3730ca38..78d5e421 100644 --- a/app/js/states/vulnerabilities/styles/_vulnerability-grid.scss +++ b/app/js/states/vulnerabilities/styles/_vulnerability-grid.scss @@ -20,7 +20,8 @@ .page-header { grid-area: page-header; - margin-left: 0px; + margin-left: 0; + padding-left: 0; .page-title i { margin: 0px; } } diff --git a/app/styles/components/_dashboard-nav.scss b/app/styles/components/_dashboard-nav.scss index 35e292cf..2c546b44 100644 --- a/app/styles/components/_dashboard-nav.scss +++ b/app/styles/components/_dashboard-nav.scss @@ -48,7 +48,7 @@ $dashboard-nav-input-bg: #322e31; @include rem('padding', 2px 6px); @include rem('margin-bottom', 5px); float: right; - color: #999999; + color: #fff; &:hover { color: #f0f0f0; } } diff --git a/app/styles/components/_gauges.scss b/app/styles/components/_gauges.scss index 7185ffe6..49d88a41 100644 --- a/app/styles/components/_gauges.scss +++ b/app/styles/components/_gauges.scss @@ -1,3 +1,9 @@ +.digests-page .page-header { + display: flex; + justify-content: space-between; + align-items: center; +} + .gauge.gauge-circle { width: 100px; height: 100px; diff --git a/app/styles/components/_materials.scss b/app/styles/components/_materials.scss index 02643b37..352c57b5 100644 --- a/app/styles/components/_materials.scss +++ b/app/styles/components/_materials.scss @@ -62,6 +62,16 @@ button.md-button.md-button-sm, a.md-button.md-button-sm{ // height: 20px !important; } +.md-button.fab { + border-radius: 50px; + padding: 10px; + span a.dropdown-toggle { padding: 0; } +} + +.md-button.fab + .md-button.fab { + @include rem('margin-left', 5px); +} + .md-dropdown-plain { .md-button.md-default-theme:not([disabled]).md-focused, .md-button:not([disabled]).md-focused, diff --git a/app/styles/components/_page-header.scss b/app/styles/components/_page-header.scss index 47141d17..59c1cba8 100644 --- a/app/styles/components/_page-header.scss +++ b/app/styles/components/_page-header.scss @@ -1,16 +1,9 @@ .page-header { + //display: flex; position: relative; - @include rem ('margin', 0 $global-margin); - @include rem ('padding', $global-margin 0); - border: none; - - &::before, - &::after { - content:""; - position: absolute; - bottom: 0; - left: 0; - } + margin: 0; + @include rem ('padding', $global-margin); + border-bottom: 1px solid #d1d1d1; &::before { width: 25vw; diff --git a/app/styles/components/insights/_group-select.scss b/app/styles/components/insights/_group-select.scss index a42abc94..f3ec9498 100644 --- a/app/styles/components/insights/_group-select.scss +++ b/app/styles/components/insights/_group-select.scss @@ -10,6 +10,14 @@ } } +.group-select a.link { + color: #00B7FF; +} + +#group-select .text span, #group-select .caret { + color: #fff; +} + .table-filters { select { @@ -28,7 +36,7 @@ } .group-select .add-group { - opacity: .5; + opacity: .8; transition: .2s; &:hover { diff --git a/app/styles/components/maintenance-planner/_maintenance-plan.scss b/app/styles/components/maintenance-planner/_maintenance-plan.scss index 4e79d2ba..37d022b8 100644 --- a/app/styles/components/maintenance-planner/_maintenance-plan.scss +++ b/app/styles/components/maintenance-planner/_maintenance-plan.scss @@ -658,6 +658,10 @@ $maintenance-tab-namespace: ".content-block.maintenance-plan .content-tabs"; } } +.maintenance-page .filters .create-plan-actions{ + margin-left: auto; +} + .create-plan-actions { margin-top: 0px; diff --git a/app/styles/elements/_section.scss b/app/styles/elements/_section.scss index 4ee8e98d..acbfce98 100644 --- a/app/styles/elements/_section.scss +++ b/app/styles/elements/_section.scss @@ -6,6 +6,7 @@ $bg-gray: $gray-light; section.content { width: 100%; @include rem('padding', $global-margin); + background: #F5F5F5; } section.content.content-gray { background: $gray-light; } @@ -22,6 +23,10 @@ section.content.content-gray { background: $gray-light; } // } // } +section.content.content-white { + background: #fff; +} + section.gray { background: $gray-light; @include rem('padding', $global-margin); From 441db49b69c6eafb03fdee2483f9eca687ff90bb Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Mon, 23 Apr 2018 15:02:20 -0400 Subject: [PATCH 02/15] fixing pages with tables and action sub-pages --- app/js/components/primary-nav/_primary-nav.scss | 17 +++++++++++------ .../topbar/_topbar-insights-logo.scss | 6 +++--- app/js/components/topbar/topbar.jade | 2 +- app/js/states/topics/views/topic-list.jade | 2 +- app/styles/components/_breadcrumbs.scss | 4 +++- app/styles/components/_page-header.scss | 1 + app/styles/page-templates/_actions.scss | 10 ++++++++++ 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/js/components/primary-nav/_primary-nav.scss b/app/js/components/primary-nav/_primary-nav.scss index f8557156..8a768e9c 100644 --- a/app/js/components/primary-nav/_primary-nav.scss +++ b/app/js/components/primary-nav/_primary-nav.scss @@ -21,8 +21,12 @@ $aside_anchor_hover_bg: gray; a, button { color: #fff; - font-weight: 700; + font-weight: 400; position: relative; + align-items: center; + color: #d1d1d1; + span {@include font-size(14px); } + i { @include font-size(20px); } } ul { @@ -40,7 +44,7 @@ $aside_anchor_hover_bg: gray; display: flex; flex-direction: row; margin: 0; - @include rem('padding', $global-padding $global-margin $global-padding $global-padding); + @include rem('padding', 17px 25px); text-align: center; @include font-size(14px, 1); @@ -54,8 +58,9 @@ $aside_anchor_hover_bg: gray; ul li a.current, ul li button:hover { background: rgba(255,255,255,.075); - box-shadow: inset 6px 0 0 $blue-light; - text-decoration: none; + box-shadow: inset 3px 0 0 $blue-light; + text-decoration: none; + color: #fff; } ul li a.current .fa { @@ -73,7 +78,7 @@ $aside_anchor_hover_bg: gray; //==================================================================*/ .primary-nav ul li a, -.primary-nav ul li button { @include media-query(md) { @include rem('padding', 24px 34px 24px 24px); } } +.primary-nav ul li button { @include media-query(md) { @include rem('padding', 17px 25px); } } .platform-grid.collapsed .primary-nav ul li a, button.toggle-fullscreen { @@ -101,7 +106,7 @@ topbar .toggle-fullscreen { @include rem('padding', $global-padding/2); border: none; box-shadow: none; - background: #292b31; + background: #1d1d1d; } .internal { diff --git a/app/js/components/topbar/_topbar-insights-logo.scss b/app/js/components/topbar/_topbar-insights-logo.scss index f0d89b0a..2e21f4dd 100644 --- a/app/js/components/topbar/_topbar-insights-logo.scss +++ b/app/js/components/topbar/_topbar-insights-logo.scss @@ -3,9 +3,9 @@ topbar .insights-logo { @include media-query(sm){ display: inline-flex; } - .home-link md-icon { - fill: #fff; - @include rem('width', 120px); + .home-link, .home-link md-icon { + .st0 { fill: #fff; } + @include rem('width', 180px); } button.toggle-fullscreen md-icon{ diff --git a/app/js/components/topbar/topbar.jade b/app/js/components/topbar/topbar.jade index 6f9c441c..b4464f38 100644 --- a/app/js/components/topbar/topbar.jade +++ b/app/js/components/topbar/topbar.jade @@ -9,7 +9,7 @@ a.home-link(ui-sref='app.overview') span.hidden(translate) Red Hat Insights - md-icon(md-svg-src="./static/images/l_insights.svg" aria-label="Red Hat Insights ") + md-icon(md-svg-src="./static/images/l_insights-inline.svg" aria-label="Red Hat Insights ") .cell.global-filters(ng-class='{disabled: disabled}', ng-if='isGroupsEnabled') group-select(disabled='disabled') diff --git a/app/js/states/topics/views/topic-list.jade b/app/js/states/topics/views/topic-list.jade index ab3a7a36..5d4ac3a5 100644 --- a/app/js/states/topics/views/topic-list.jade +++ b/app/js/states/topics/views/topic-list.jade @@ -16,7 +16,7 @@ total-risk-select risk-of-change-select - section.content.rule-groups + section.content.content-white.rule-groups .table-header list-type diff --git a/app/styles/components/_breadcrumbs.scss b/app/styles/components/_breadcrumbs.scss index d7c587a7..3bc1a30f 100644 --- a/app/styles/components/_breadcrumbs.scss +++ b/app/styles/components/_breadcrumbs.scss @@ -25,7 +25,9 @@ $breadcrumbs-border: #E2E2E2; } ol > li + li:before { - content: "/ "; + content: "\f054 "; + font-family: 'FontAwesome'; + @include font-size(10px); padding: 0 5px; color: #ccc; } diff --git a/app/styles/components/_page-header.scss b/app/styles/components/_page-header.scss index 59c1cba8..4e358b42 100644 --- a/app/styles/components/_page-header.scss +++ b/app/styles/components/_page-header.scss @@ -23,6 +23,7 @@ display: flex; margin: 0; @include font-size(18px, 23px); + font-weight: 400; @include media-query(md){ @include font-size(24px, 1); } diff --git a/app/styles/page-templates/_actions.scss b/app/styles/page-templates/_actions.scss index c4edfd72..ff895ec2 100644 --- a/app/styles/page-templates/_actions.scss +++ b/app/styles/page-templates/_actions.scss @@ -165,3 +165,13 @@ section.action-categories { .extra-topics { margin: auto; } + +.actions-page .topic-detail-header{ + grid-gap: 5px; + .page-header { + padding-left: 0; + padding-right: 0; + border-bottom: 0; + } + p { @include rem('margin-bottom', $global-margin); } +} From f7cc89eea6d5a291e5f7f523c60d9e77d231ae6e Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 25 Apr 2018 11:36:04 -0400 Subject: [PATCH 03/15] updating hovers in topbar, changing logo, and header styling --- app/js/components/actions/actionsRule/_rule-detail.scss | 8 ++++++++ app/js/components/pageHeader/pageHeader.jade | 2 +- app/js/components/topbar/_topbar.scss | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/js/components/actions/actionsRule/_rule-detail.scss b/app/js/components/actions/actionsRule/_rule-detail.scss index 489fb2f9..c6e31fa6 100644 --- a/app/js/components/actions/actionsRule/_rule-detail.scss +++ b/app/js/components/actions/actionsRule/_rule-detail.scss @@ -76,4 +76,12 @@ .rule-detail-summary { grid-area: rule-detail; +} + +.actions-rule { + .rule-detail-header { + border-bottom: 0; + .page-header { @include rem('padding', $global-padding*2 0); } + } + section.content { background: #fff; } } \ No newline at end of file diff --git a/app/js/components/pageHeader/pageHeader.jade b/app/js/components/pageHeader/pageHeader.jade index 16aa10e6..b07ce2c4 100644 --- a/app/js/components/pageHeader/pageHeader.jade +++ b/app/js/components/pageHeader/pageHeader.jade @@ -6,6 +6,6 @@ section.page-header(ng-transclude) a(ng-if="link.length > 0", href="{{:: link}}", target="_blank") i.fa.fa-external-link //- subtitle is an array - .page-subtitle + .page-subtitle(ng-if="subtitle") dl dd.text(ng-repeat="subtitle_part in subtitle") {{:: subtitle_part }} diff --git a/app/js/components/topbar/_topbar.scss b/app/js/components/topbar/_topbar.scss index 6fe0fa15..1d1873e3 100644 --- a/app/js/components/topbar/_topbar.scss +++ b/app/js/components/topbar/_topbar.scss @@ -59,8 +59,11 @@ topbar { .beta-switch { display: inline-block; } menu span + span { padding-left: 15px; } - menu.notifications{ + menu.notifications{ padding: 0; + .dropdown a:hover, .dropdown a:focus { + color: $blue-light; + } } .help, From ff21f9105b4dbf347d93fd3cf05853613eee7165 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Mon, 23 Apr 2018 14:19:03 -0400 Subject: [PATCH 04/15] adding space before systemsTilTen in digests (#465) --- app/js/states/digests/digests.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/js/states/digests/digests.jade b/app/js/states/digests/digests.jade index e96a1e36..896e5bb6 100644 --- a/app/js/states/digests/digests.jade +++ b/app/js/states/digests/digests.jade @@ -19,7 +19,7 @@ section.content(ng-show='!loading && systemsTilTen > 0') h1(translate) Executive Reporting requires 10 or more systems to be registered with Insights. h2(translate) Please register - span(translate, translate-n='systemsTilTen', translate-plural='{{:: $count}} more systems') {{:: systemsTilTen}} more system + span(translate, translate-n='systemsTilTen', translate-plural='{{:: $count}} more systems') {{:: systemsTilTen}}   more system |  to enable reporting for your account. section.content(ng-show='!loading && noData') From 8491dedae11c4ec33f486cce9541bb737c3b68d4 Mon Sep 17 00:00:00 2001 From: Jozef Hartinger Date: Tue, 24 Apr 2018 15:23:18 +0200 Subject: [PATCH 05/15] fix translation support (#463) (#466) * fix translation support (#463) Closes https://github.com/RedHatInsights/insights-frontend/issues/463 This line was (most likely accidentally) removed in https://github.com/RedHatInsights/insights-frontend/pull/219/commits/e0067dc61ec1d16ef8990fb8ce4c8f9ee73a9503#diff-5e8e1f6512829292f938e307682e8a92L94 * do not use :: in localized string plurals as that is not supported by gettextCatalog --- .../inventory/inventoryActions/inventoryActions.jade | 2 +- app/js/components/rule/ruleGroupCard/ruleGroupCard.jade | 6 +++--- app/js/components/topics/otherTopic/otherTopic.jade | 2 +- app/js/insights.js | 2 ++ app/js/states/actions/actions.jade | 4 ++-- app/js/states/vulnerabilities/views/view-package.jade | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/js/components/inventory/inventoryActions/inventoryActions.jade b/app/js/components/inventory/inventoryActions/inventoryActions.jade index 8d6523fa..6a3b75c1 100644 --- a/app/js/components/inventory/inventoryActions/inventoryActions.jade +++ b/app/js/components/inventory/inventoryActions/inventoryActions.jade @@ -38,7 +38,7 @@ translate) Unregister .col-xs-8.col-sm-8.text-center span(ng-hide='reloading') - h3.system-count(translate, translate-n='totalSystems()', translate-plural='{{:: $count}} Systems') 1 System + h3.system-count(translate, translate-n='totalSystems()', translate-plural='{{$count}} Systems') 1 System small.light(ng-if='checkboxes.totalChecked', translate)   ({{totalSystemsSelected}} Selected span(ng-if='allSelected && pager.perPage < totalSystems()') . a(ng-if='!reallyAllSelected', ng-click='reallySelectAll()', translate)  Select All Systems. diff --git a/app/js/components/rule/ruleGroupCard/ruleGroupCard.jade b/app/js/components/rule/ruleGroupCard/ruleGroupCard.jade index e96efe09..15e709b7 100644 --- a/app/js/components/rule/ruleGroupCard/ruleGroupCard.jade +++ b/app/js/components/rule/ruleGroupCard/ruleGroupCard.jade @@ -1,6 +1,6 @@ .card-group(ng-keypress='keyPressed($event)') header.header - .count(translate, translate-n='plugin.hitCount', translate-plural="{{:: $count}} Systems") 1 System + .count(translate, translate-n='plugin.hitCount', translate-plural="{{$count}} Systems") 1 System .row .col-sm-9 i.fa.fa-users(aria-hidden="true") @@ -11,7 +11,7 @@ | {{:: plugin.categories[0]}} span   {{:: plugin.display_name}} .col-sm-3.text-right-sm - span(translate, translate-n='plugin.rules.length', translate-plural='{{:: $count}} Rules in this group') 1 Rule in this group + span(translate, translate-n='plugin.rules.length', translate-plural='{{$count}} Rules in this group') 1 Rule in this group .content.disabled-start( ng-class='{swapping: swapping}', ng-mouseenter='setActive(true)', @@ -39,5 +39,5 @@ ng-disabled="rule.hitCount === 0", translate, translate-n='rule.hitCount', - translate-plural='View Impacted Systems ({{:: $count}})') + translate-plural='View Impacted Systems ({{$count}})') | View Impacted System (1) diff --git a/app/js/components/topics/otherTopic/otherTopic.jade b/app/js/components/topics/otherTopic/otherTopic.jade index e79478f0..32fe7d1c 100644 --- a/app/js/components/topics/otherTopic/otherTopic.jade +++ b/app/js/components/topics/otherTopic/otherTopic.jade @@ -3,7 +3,7 @@ card .card-header-title h4 {{:: topic.title}} .card-header-supporting-info - span.count(translate, translate-n='topic.affectedSystemCount', translate-plural='{{:: $count}} Systems') 1 System + span.count(translate, translate-n='topic.affectedSystemCount', translate-plural='{{$count}} Systems') 1 System card-content(ng-bind-html=':: topic.summary_html ? topic.summary_html : Xtopic.content_html | trust_html') card-footer.text-right-sm strong diff --git a/app/js/insights.js b/app/js/insights.js index aa20e30f..5077eee9 100644 --- a/app/js/insights.js +++ b/app/js/insights.js @@ -126,6 +126,8 @@ if (isPortal) { angular.module('insights').config(require('./base_routes')); } +angular.module('insights').run(require('./boot')); + // Common routes angular.module('insights').config(require('./routes')); diff --git a/app/js/states/actions/actions.jade b/app/js/states/actions/actions.jade index 8e2c4685..7c4f5ad3 100644 --- a/app/js/states/actions/actions.jade +++ b/app/js/states/actions/actions.jade @@ -50,7 +50,7 @@ .card-header-title h4 {{:: topic.title}} .card-header-supporting-info - span.count(translate, translate-n='topic.affectedSystemCount', translate-plural='{{:: $count}} Systems') 1 System + span.count(translate, translate-n='topic.affectedSystemCount', translate-plural='{{$count}} Systems') 1 System card-content(ng-bind-html=':: topic.summary_html ? topic.summary_html : Xtopic.content_html | trust_html') card-footer.text-right-sm strong @@ -70,7 +70,7 @@ .card-header-title h4 {{:: topic.title}} .card-header-supporting-info - span.count(translate, translate-n='topic.affectedSystemCount', translate-plural='{{:: $count}} Systems') 1 System + span.count(translate, translate-n='topic.affectedSystemCount', translate-plural='{{$count}} Systems') 1 System card-content(ng-bind-html=':: topic.summary_html ? topic.summary_html : Xtopic.content_html | trust_html') card-footer.text-right-sm strong diff --git a/app/js/states/vulnerabilities/views/view-package.jade b/app/js/states/vulnerabilities/views/view-package.jade index 406739b9..0c0cee0b 100644 --- a/app/js/states/vulnerabilities/views/view-package.jade +++ b/app/js/states/vulnerabilities/views/view-package.jade @@ -26,9 +26,9 @@ a(ui-sref='app.vulnerabilities-package-erratum({rhsa_id: rhsa.erratum_id, package_id: package.name, root_view: selectedView})', ng-click="$event.stopPropagation()") {{:: rhsa.erratum_id }} .cve-count - span(translate, translate-n='rhsa.cve_count', translate-plural='{{:: $count}} CVEs') 1 CVE + span(translate, translate-n='rhsa.cve_count', translate-plural='{{$count}} CVEs') 1 CVE .pipe | - span.hits(translate, translate-n='rhsa.system_count', translate-plural='{{:: $count}} systems') 1 system + span.hits(translate, translate-n='rhsa.system_count', translate-plural='{{$count}} systems') 1 system cve-summary(ng-if='selectedRHSA && selectedRHSA.cves.length', style='order: {{cveOrder}}', cves='selectedRHSA.cves') .footer From 6395dc96bf90ab21d4b52938503ffa11ee307f04 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Mon, 23 Apr 2018 11:32:22 -0400 Subject: [PATCH 06/15] adding back to first page in pagination --- app/js/components/ui-bootstrap-custom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/components/ui-bootstrap-custom.js b/app/js/components/ui-bootstrap-custom.js index df5ad73b..267e315a 100755 --- a/app/js/components/ui-bootstrap-custom.js +++ b/app/js/components/ui-bootstrap-custom.js @@ -1249,7 +1249,7 @@ angular.module('ui.bootstrap.pagination', []) itemsPerPage: 10, boundaryLinks: false, directionLinks: true, - firstText: 'First', + firstText: '‹', previousText: 'Previous', nextText: 'Next', lastText: 'Last', @@ -2287,7 +2287,7 @@ angular.module("template/pagination/pager.html", []).run(["$templateCache", func angular.module("template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("template/pagination/pagination.html", "
    \n" + - "
  • {{::getText('first')}}
  • \n" + + "
  • {{::getText('first')}}
  • \n" + "
  • {{::getText('previous')}}
  • \n" + "
  • {{page.text}}
  • \n" + "
  • {{::getText('next')}}
  • \n" + From 3f6aa9c20377beaa709b3c8acb32a60f963d35d6 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Mon, 12 Feb 2018 11:20:57 -0500 Subject: [PATCH 07/15] updating checkbox --- .../digest/_content-executive-report.scss | 5 ++++ app/js/components/digest/digestGraph.jade | 28 +++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app/js/components/digest/_content-executive-report.scss b/app/js/components/digest/_content-executive-report.scss index cf710776..5cfb2e55 100644 --- a/app/js/components/digest/_content-executive-report.scss +++ b/app/js/components/digest/_content-executive-report.scss @@ -49,4 +49,9 @@ grid-row: 3; } } +} + +.exec-dropdown { + md-menu-item md-checkbox{ margin-left: 15px; } + .md-label { margin-left: 15px; } } \ No newline at end of file diff --git a/app/js/components/digest/digestGraph.jade b/app/js/components/digest/digestGraph.jade index 48d0e1a1..98085541 100644 --- a/app/js/components/digest/digestGraph.jade +++ b/app/js/components/digest/digestGraph.jade @@ -1,14 +1,20 @@ .graph-container .graph.graph-filters(ng-if='dropDown') - .row - .col-sm-3.col-sm-offset-9 - .dropdown.full-width.show - button.btn.btn-default.dropdown-toggle(data-toggle='dropdown', role='button', aria-haspopup='true', aria-expanded='false') - div(translate) {{:: dropDown}} - span.caret - ul.dropdown-menu - li(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') - label.checkbox-inline - input(type="checkbox", name="availability", ng-model='trace.enabled', ng-click='toggleTrace(trace)') - div(translate) {{:: trace.name}} + //- .dropdown.full-width.show + //- button.btn.btn-default.dropdown-toggle(data-toggle='dropdown', role='button', aria-haspopup='true', aria-expanded='false') + //- div(translate) {{:: dropDown}} + //- span.caret + //- ul.dropdown-menu + //- li(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') + //- label.checkbox-inline + //- input(type="checkbox", name="availability", ng-model='trace.enabled', ng-click='toggleTrace(trace)') + //- div(translate) {{:: trace.name}} + + md-menu(md-offset="0 34", md-position-mode="target-right target") + md-button.md-raised.md-primary#exec-dropdown(ng-click='$mdMenu.open()') + strong(translate) Category + i.fa.fa-cog + md-menu-content.exec-dropdown(aria-labelledby="#exec-dropdown") + md-menu-item(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') + md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled', ng-click='toggleTrace(trace)') {{:: trace.name}} .digest-graph From d8e0cd6f5c55d907391b6162fabdd23ebd8d34eb Mon Sep 17 00:00:00 2001 From: Jordan Eudy Date: Mon, 12 Feb 2018 15:29:21 -0500 Subject: [PATCH 08/15] added multiple category selection dropdown --- .../digest/digestGraph.directive.js | 20 ++++++++++++++----- app/js/components/digest/digestGraph.jade | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/js/components/digest/digestGraph.directive.js b/app/js/components/digest/digestGraph.directive.js index 61aa9aa6..e4859871 100644 --- a/app/js/components/digest/digestGraph.directive.js +++ b/app/js/components/digest/digestGraph.directive.js @@ -49,11 +49,21 @@ function digestGraphController($scope) { Plotly.Plots.resize(graphNode); }); - $scope.toggleTrace = function toggleTrace(trace) { - trace.enable = !trace.enabled; - const val = trace.enabled ? true : 'legendonly'; - Plotly.restyle(graphNode, 'visible', [val], [trace.index]); - }; + $scope.$watch('traces', (newTraces, oldTraces) => { + let newTrace; + newTraces.forEach((trace, index) => { + if (trace.index === oldTraces[index].index && + trace.enabled !== oldTraces[index].enabled) { + newTrace = trace; + } + }); + + if (newTrace) { + newTrace.enable = !newTrace.enabled; + const val = newTrace.enabled ? true : 'legendonly'; + Plotly.restyle(graphNode, 'visible', [val], [newTrace.index]); + } + }, true); // THIS MUST BE AFTER THE GRAPH IS BUILT priv.initTraces($scope, graphNode); diff --git a/app/js/components/digest/digestGraph.jade b/app/js/components/digest/digestGraph.jade index 98085541..a0ef4a91 100644 --- a/app/js/components/digest/digestGraph.jade +++ b/app/js/components/digest/digestGraph.jade @@ -16,5 +16,5 @@ i.fa.fa-cog md-menu-content.exec-dropdown(aria-labelledby="#exec-dropdown") md-menu-item(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') - md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled', ng-click='toggleTrace(trace)') {{:: trace.name}} + md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') {{:: trace.name}} .digest-graph From 2d6af8885aa52a4dac5ec23b5d6033a06450f454 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 21 Feb 2018 08:47:07 -0500 Subject: [PATCH 09/15] added checkboxes to exec report filters --- .../digest/_content-executive-report.scss | 12 ++++++++---- app/js/components/digest/digestGraph.jade | 13 ++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/js/components/digest/_content-executive-report.scss b/app/js/components/digest/_content-executive-report.scss index 5cfb2e55..7f4beaf7 100644 --- a/app/js/components/digest/_content-executive-report.scss +++ b/app/js/components/digest/_content-executive-report.scss @@ -51,7 +51,11 @@ } } -.exec-dropdown { - md-menu-item md-checkbox{ margin-left: 15px; } - .md-label { margin-left: 15px; } -} \ No newline at end of file +.graph-filters { + display: flex; + justify-content: flex-end; +} + +.exec-dropdown md-checkbox .md-container { + @include rem('margin-left', $global-padding); +} diff --git a/app/js/components/digest/digestGraph.jade b/app/js/components/digest/digestGraph.jade index a0ef4a91..2607b2d5 100644 --- a/app/js/components/digest/digestGraph.jade +++ b/app/js/components/digest/digestGraph.jade @@ -1,20 +1,11 @@ .graph-container .graph.graph-filters(ng-if='dropDown') - //- .dropdown.full-width.show - //- button.btn.btn-default.dropdown-toggle(data-toggle='dropdown', role='button', aria-haspopup='true', aria-expanded='false') - //- div(translate) {{:: dropDown}} - //- span.caret - //- ul.dropdown-menu - //- li(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') - //- label.checkbox-inline - //- input(type="checkbox", name="availability", ng-model='trace.enabled', ng-click='toggleTrace(trace)') - //- div(translate) {{:: trace.name}} - md-menu(md-offset="0 34", md-position-mode="target-right target") md-button.md-raised.md-primary#exec-dropdown(ng-click='$mdMenu.open()') strong(translate) Category i.fa.fa-cog md-menu-content.exec-dropdown(aria-labelledby="#exec-dropdown") md-menu-item(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') - md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') {{:: trace.name}} + md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') + span {{:: trace.name}} .digest-graph From 5bba93fc48089c302e83c60d33d54e1fd468fd07 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 21 Feb 2018 08:53:22 -0500 Subject: [PATCH 10/15] swapping icons --- app/js/components/digest/digestGraph.jade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/js/components/digest/digestGraph.jade b/app/js/components/digest/digestGraph.jade index 2607b2d5..99e23340 100644 --- a/app/js/components/digest/digestGraph.jade +++ b/app/js/components/digest/digestGraph.jade @@ -2,8 +2,9 @@ .graph.graph-filters(ng-if='dropDown') md-menu(md-offset="0 34", md-position-mode="target-right target") md-button.md-raised.md-primary#exec-dropdown(ng-click='$mdMenu.open()') - strong(translate) Category - i.fa.fa-cog + .icon-inline + strong(translate) Category + i.fa.fa-caret-down md-menu-content.exec-dropdown(aria-labelledby="#exec-dropdown") md-menu-item(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') From 4dce624602a793c6bdad7beec2d8a6c0303016a6 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 21 Feb 2018 10:16:57 -0500 Subject: [PATCH 11/15] updating jade --- app/js/components/digest/_content-executive-report.scss | 4 ---- app/js/components/digest/digestGraph.jade | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/js/components/digest/_content-executive-report.scss b/app/js/components/digest/_content-executive-report.scss index 7f4beaf7..4a572ca2 100644 --- a/app/js/components/digest/_content-executive-report.scss +++ b/app/js/components/digest/_content-executive-report.scss @@ -55,7 +55,3 @@ display: flex; justify-content: flex-end; } - -.exec-dropdown md-checkbox .md-container { - @include rem('margin-left', $global-padding); -} diff --git a/app/js/components/digest/digestGraph.jade b/app/js/components/digest/digestGraph.jade index 99e23340..d4ecb3d7 100644 --- a/app/js/components/digest/digestGraph.jade +++ b/app/js/components/digest/digestGraph.jade @@ -7,6 +7,7 @@ i.fa.fa-caret-down md-menu-content.exec-dropdown(aria-labelledby="#exec-dropdown") md-menu-item(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') - md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') - span {{:: trace.name}} + md-button + md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') + span {{:: trace.name}} .digest-graph From 0f4693b9fefb813783b41813ef3c3b735a2d5315 Mon Sep 17 00:00:00 2001 From: Jordan Eudy Date: Wed, 21 Feb 2018 10:25:42 -0500 Subject: [PATCH 12/15] fixed multiple selection with category dropdown --- app/js/components/digest/digestGraph.jade | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/js/components/digest/digestGraph.jade b/app/js/components/digest/digestGraph.jade index d4ecb3d7..80ea7935 100644 --- a/app/js/components/digest/digestGraph.jade +++ b/app/js/components/digest/digestGraph.jade @@ -1,13 +1,12 @@ .graph-container .graph.graph-filters(ng-if='dropDown') md-menu(md-offset="0 34", md-position-mode="target-right target") - md-button.md-raised.md-primary#exec-dropdown(ng-click='$mdMenu.open()') + md-button.md-raised.md-primary#exec-dropdown(ng-click='$mdMenu.open($event)') .icon-inline strong(translate) Category i.fa.fa-caret-down md-menu-content.exec-dropdown(aria-labelledby="#exec-dropdown") - md-menu-item(ng-repeat='trace in traces track by trace.name', ng-click='$event.stopPropagation()') - md-button - md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') - span {{:: trace.name}} + md-menu-item(ng-repeat='trace in traces track by trace.name') + md-button(md-prevent-menu-close) + md-checkbox.md-accent.md-hue-1.category-checkbox(ng-model='trace.enabled') {{:: trace.name}} .digest-graph From c2d6859809fa074f0615740b3b2600c0f71867e3 Mon Sep 17 00:00:00 2001 From: Jozef Hartinger Date: Wed, 25 Apr 2018 15:58:00 +0200 Subject: [PATCH 13/15] minor VMaaS fixes (2) (#462) * minor VMaaS fixes #2 VMaaS - make it explicit that score refers to CVSS VMaaS - redirect to main vulnerability page if cve/erratum/package returns 404 VMaaS - fix date filtering VMaaS - add pagination to system modal/vulnerabilities * make smoke tests more robust * if system only has UUID, rename creates a new displayname if none present in system metadata * simplify how system name is presented in system modal --- .../daysKnownSelect.directive.js | 17 +++++++--- .../renameableProperty.jade | 6 ++-- .../systemMetadata/systemMetadata.jade | 4 +-- .../erratumCard/erratumCard.jade | 2 +- .../vulnerabilities-modal.directive.js | 34 ++++--------------- .../vulnerabilities-modal.jade | 10 +++++- app/js/constants/filters.js | 4 +-- .../controllers/view.cve.controller.js | 4 +++ .../controllers/view.erratum.controller.js | 2 +- .../controllers/vulnerabilities.controller.js | 8 +++-- .../vulnerabilities/views/view-cve.jade | 2 +- .../views/vulnerabilities.jade | 2 +- .../components/_renameable-property.scss | 3 +- app/styles/elements/_lists.scss | 9 +++-- smoketest/elements.js | 3 +- smoketest/insightsTest.js | 4 +-- static | 2 +- 17 files changed, 60 insertions(+), 56 deletions(-) diff --git a/app/js/components/filterComponents/daysKnownSelect/daysKnownSelect.directive.js b/app/js/components/filterComponents/daysKnownSelect/daysKnownSelect.directive.js index ae6d1e52..a29ef870 100644 --- a/app/js/components/filterComponents/daysKnownSelect/daysKnownSelect.directive.js +++ b/app/js/components/filterComponents/daysKnownSelect/daysKnownSelect.directive.js @@ -20,15 +20,24 @@ function daysKnownSelectCtrl($rootScope, // index for $scope.options const DEFAULT_OPTION = 'All'; + function parseUrlParam () { + const paramValue = $location.search()[Events.filters.daysKnown]; + if (paramValue) { + const found = find($scope.options, {title: paramValue}); + if (found) { + return found; + } + } + + return find($scope.options, {title: DEFAULT_OPTION}); + } + /** * Initializes days known filter by checking for the url for * the previous filter or defaults to showing all rhsas/pacakges/cves. */ (function init() { - let option = $location.search()[Events.filters.daysKnown] ? - $location.search()[Events.filters.daysKnown] : - DEFAULT_OPTION; - $scope.selected = find($scope.options, {title: option}); + $scope.selected = parseUrlParam(); $rootScope.$broadcast(Events.filters.tag, $scope.selected.tag, Events.filters.daysKnown); diff --git a/app/js/components/renameableProperty/renameableProperty.jade b/app/js/components/renameableProperty/renameableProperty.jade index b2416a7a..fafae9ac 100644 --- a/app/js/components/renameableProperty/renameableProperty.jade +++ b/app/js/components/renameableProperty/renameableProperty.jade @@ -1,6 +1,6 @@ -.renameableProperty - .name.ellipsis-overflow.editable(ng-mouseenter="editIcon=true", ng-mouseleave="editIcon=false", ng-show='!edit.value', ng-dblclick='rename(newValue)') {{edit.name}} - .edit-toggle.i.fa.fa-pencil-square-o#edit-toggle(ng-show="editIcon", ng-click='rename()') +.renameableProperty(ng-mouseenter="editIcon=true", ng-mouseleave="editIcon=false") + .name.ellipsis-overflow.editable(ng-show='!edit.value', ng-dblclick='rename(newValue)') {{edit.name}} + .edit-toggle.i.fa.fa-pencil-square-o#edit-toggle(ng-if='!edit.value', ng-show="editIcon", ng-click='rename()') input#renameable-property-input( ng-if='edit.value', type='text', diff --git a/app/js/components/systemMetadata/systemMetadata.jade b/app/js/components/systemMetadata/systemMetadata.jade index 8c5aa407..0fd6e146 100644 --- a/app/js/components/systemMetadata/systemMetadata.jade +++ b/app/js/components/systemMetadata/systemMetadata.jade @@ -6,8 +6,8 @@ i.fa.fa-server.fa-2x.md-whiteframe-3dp(ng-if="getSystemType() !== 'Virtual'", tooltip="{{:: 'Server type: Physical' | translate}}") .text - h2.name.ellipsis-overflow.editable(ng-if='!edit.value', ng-dblclick='rename()') {{ edit.name }} - renameable-property(value='system.display_name || system.hostname', update-function='rename(newValue)', allow-null='true') + h2.name.ellipsis-overflow.editable(ng-dblclick='rename()') + renameable-property(value='system.display_name || system.hostname || getUUID()', update-function='rename(newValue)', allow-null='true') .hostname.ellipsis-overflow b Hostname:  diff --git a/app/js/components/vulnerabilities/erratumCard/erratumCard.jade b/app/js/components/vulnerabilities/erratumCard/erratumCard.jade index a40aba9a..a71f283d 100644 --- a/app/js/components/vulnerabilities/erratumCard/erratumCard.jade +++ b/app/js/components/vulnerabilities/erratumCard/erratumCard.jade @@ -35,7 +35,7 @@ tr th.sortable(translate, ng-class="cveSorter.getSortClass('cve_id')", ng-click="cveSorter.sort('cve_id')") CVE th.sortable.min.fit-content(translate, ng-class="cveSorter.getSortClass('impactNum')", ng-click="cveSorter.sort('impactNum')") Impact - th.sortable.min.fit-content.text-center(translate, ng-class="cveSorter.getSortClass('score')", ng-click="cveSorter.sort('score')") Score + th.sortable.min.fit-content.text-center(translate, ng-class="cveSorter.getSortClass('score')", ng-click="cveSorter.sort('score')") CVSS Score th.sortable.min.fit-content(translate, ng-class="cveSorter.getSortClass('public_date')", ng-click="cveSorter.sort('public_date')") Public Date th.min.fit-content Details tbody diff --git a/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.directive.js b/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.directive.js index b562b496..7a1a8269 100644 --- a/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.directive.js +++ b/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.directive.js @@ -15,30 +15,8 @@ function vulnerabilitiesModalCtrl($scope, System, SystemModalTabs) { - $scope.sorter = new Utils.Sorter( - { - predicate: $location.search().sort_by || 'id', - reverse: $location.search().reverse || false - }, - order); - - function order () { - $location.search('sort_by', $scope.sorter.predicate); - $location.search('reverse', $scope.sorter.reverse); - - // TODO: use this once api is available - // getData(); - - $scope.allVulnerabilities = $filter('orderBy')( - $scope.allVulnerabilities, - [($scope.sorter.reverse ? - '-' + $scope.sorter.predicate : - $scope.sorter.predicate)]); - } - - $scope.getRuleHits = function (rhsa) { - return rhsa.rule_hits === 1 ? '1 Hit' : `${rhsa.rule_hits} Hits`; - }; + $scope.pager = new Utils.Pager(10); + $scope.loader = new Utils.Loader(); $scope.goToRule = function () { const params = $location.search(); @@ -49,9 +27,8 @@ function vulnerabilitiesModalCtrl($scope, $location.search(params); }; - getData(); - function getData() { - System.getVulnerabilities($scope.systemId, { + const getData = $scope.loader.bind(() => { + return System.getVulnerabilities($scope.systemId, { sort_by: 'severity', sort_dir: 'DESC', page_size: 1000 // TODO: paginate modal? @@ -63,8 +40,9 @@ function vulnerabilitiesModalCtrl($scope, erratum => erratum.erratum_id === $stateParams.rhsa_id ], ['desc']); }); - } + }); + getData(); $scope.$on('reload:data', getData); } diff --git a/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.jade b/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.jade index b8527704..c5586746 100644 --- a/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.jade +++ b/app/js/components/vulnerabilities/vulnerabilities-modal/vulnerabilities-modal.jade @@ -1,4 +1,12 @@ .vulnerabilities-modal .content-wrap expand-all-button.toggle-expand-right - erratum-card(ng-repeat='rhsa in ::rhsas track by rhsa.erratum_id', erratum='rhsa') + .spinner(ng-if='loader.loading') + erratum-card(ng-repeat='rhsa in rhsas | limitTo:pager.perPage:pager.offset track by rhsa.erratum_id', erratum='rhsa') + .footer + pagination.pull-right.pagination-blue( + ng-if="rhsas.length > pager.perPage", + total-items="rhsas.length", + ng-model="pager.currentPage", + items-per-page="pager.perPage", + ng-change='pager.update()') diff --git a/app/js/constants/filters.js b/app/js/constants/filters.js index 49fbc2b3..93115a83 100644 --- a/app/js/constants/filters.js +++ b/app/js/constants/filters.js @@ -128,10 +128,10 @@ constantsModule.constant('DaysKnownFilters', [ }, { title: '45', tag: 'Days Known: 45 days or older', - filter: '-45days' + filter: '45' }, { title: '90', tag: 'Days Known: 90 days or older', - filter: '-90days' + filter: '90' } ]); diff --git a/app/js/states/vulnerabilities/controllers/view.cve.controller.js b/app/js/states/vulnerabilities/controllers/view.cve.controller.js index 6bfb578f..b24edaae 100644 --- a/app/js/states/vulnerabilities/controllers/view.cve.controller.js +++ b/app/js/states/vulnerabilities/controllers/view.cve.controller.js @@ -61,6 +61,10 @@ function ViewCveCtrl($q, initPageHeader(); getRules(res.data); + }).catch(res => { + if (res.status === 404) { + $state.go('app.vulnerabilities', {root_view: 'CVEs'}); + } }); }); diff --git a/app/js/states/vulnerabilities/controllers/view.erratum.controller.js b/app/js/states/vulnerabilities/controllers/view.erratum.controller.js index 7d698eb7..739523db 100644 --- a/app/js/states/vulnerabilities/controllers/view.erratum.controller.js +++ b/app/js/states/vulnerabilities/controllers/view.erratum.controller.js @@ -67,7 +67,7 @@ function ViewErratumCtrl($filter, .then(results => $scope.cves = map(results, 'data')) .catch(res => { if (res.status === 404) { - $state.go('app.vulnerabilities', {root_view: 'RHSAs'}); + $state.go('app.vulnerabilities', {root_view: 'Errata'}); } }); }); diff --git a/app/js/states/vulnerabilities/controllers/vulnerabilities.controller.js b/app/js/states/vulnerabilities/controllers/vulnerabilities.controller.js index 7b0401dc..14950da5 100644 --- a/app/js/states/vulnerabilities/controllers/vulnerabilities.controller.js +++ b/app/js/states/vulnerabilities/controllers/vulnerabilities.controller.js @@ -120,8 +120,12 @@ function VulnerabilitiesCtrl($location, $scope.$on('reload:data', getData); $scope.$on('group:change', getData); $scope.$on(Events.filters.daysKnown, (event, selection) => { - if (params.public_date !== selection.filter) { - params.public_date = selection.filter; + const value = selection.filter ? + `lt${moment().subtract(selection.filter, 'days').format('YYYY-MM-DD')}` : + selection.filter; + + if (params.public_date !== value) { + params.public_date = value; if (!$scope.changingView) { return getData(); diff --git a/app/js/states/vulnerabilities/views/view-cve.jade b/app/js/states/vulnerabilities/views/view-cve.jade index 223912c7..7237e423 100644 --- a/app/js/states/vulnerabilities/views/view-cve.jade +++ b/app/js/states/vulnerabilities/views/view-cve.jade @@ -6,7 +6,7 @@ aside.page-header-aside.icon-inline vulnerability-severity-icon.severity(impact='cve.impact') .cve-score - span(translate) Score: + span(translate) CVSS Score: span {{cve.score}} .description section.associated-rules(ng-if='cve.insights_rules.length') diff --git a/app/js/states/vulnerabilities/views/vulnerabilities.jade b/app/js/states/vulnerabilities/views/vulnerabilities.jade index 14916732..b749c5ae 100644 --- a/app/js/states/vulnerabilities/views/vulnerabilities.jade +++ b/app/js/states/vulnerabilities/views/vulnerabilities.jade @@ -86,7 +86,7 @@ tr th.fit-content.nowrap.sortable(translate, ng-class="sorter.getSortClass('cve_id')", ng-click="sorter.sort('cve_id')") CVE Name th.fit-content.min.nowrap.sortable(translate, ng-class="sorter.getSortClass('impact')", ng-click="sorter.sort('impact')") Impact - th.text-center.fit-content.min.nowrap.sortable(translate, ng-class="sorter.getSortClass('score')", ng-click="sorter.sort('score')") Score + th.text-center.fit-content.min.nowrap.sortable(translate, ng-class="sorter.getSortClass('score')", ng-click="sorter.sort('score')") CVSS Score th.text-center.fit-content.min.nowrap.sortable(translate, ng-class="sorter.getSortClass('public_date')", ng-click="sorter.sort('public_date')") Days Known th.text-center.fit-content.min.nowrap.sortable(translate, ng-class="sorter.getSortClass('public_date')", ng-click="sorter.sort('public_date')") Public Date tbody(ng-if='loading') diff --git a/app/styles/components/_renameable-property.scss b/app/styles/components/_renameable-property.scss index 08884a9f..591f1b21 100644 --- a/app/styles/components/_renameable-property.scss +++ b/app/styles/components/_renameable-property.scss @@ -1,6 +1,7 @@ .renameableProperty{ + display: flex; .edit-toggle{ cursor: pointer; - @include rem('padding-left', 10px); + @include rem('padding-left', 5px); } } \ No newline at end of file diff --git a/app/styles/elements/_lists.scss b/app/styles/elements/_lists.scss index 3e807fe1..0f28db78 100644 --- a/app/styles/elements/_lists.scss +++ b/app/styles/elements/_lists.scss @@ -100,12 +100,11 @@ li.icon-inline { display: flex; } } ul.pre-code { - @include rem('padding', $global-padding); + @include rem('padding', 9.5px); list-style-type: none; - background: #DCDFE1; - //background: #fff; - border: 5px solid darken(#DCDFE1, 10); - //border: 5px solid #ececec; + background: #f5f5f5; + border: 1px solid #ccc; + border-radius: 5px; li { display: inline; diff --git a/smoketest/elements.js b/smoketest/elements.js index b904b091..b5e8e55e 100644 --- a/smoketest/elements.js +++ b/smoketest/elements.js @@ -59,7 +59,8 @@ const obj = { }, systemModal: { exButton: '.modal-dialog .fa.fa-close', - hostname: 'system-metadata md-card h2 .name', + displayName: 'system-metadata md-card h2 .name', + uuid: 'system-metadata md-card .uuid span', firstRule: 'rule-summary:nth-of-type(1) .title' }, nav: { diff --git a/smoketest/insightsTest.js b/smoketest/insightsTest.js index 899ba8bc..80be5a1c 100644 --- a/smoketest/insightsTest.js +++ b/smoketest/insightsTest.js @@ -50,7 +50,7 @@ module.exports = { .custom.performWithStash(function (stash, done) { client.expect.element(el.systemModal.firstRule.s).text.to.equal(`Security > ${stash.ruleNamePage3}`.trim()); - client.expect.element(el.systemModal.hostname.s).text.to.equal(stash.systemNamePage3); + client.expect.element(el.systemModal.displayName.s).text.to.equal(stash.systemNamePage3); client.custom.waitAndClick(el.systemModal.exButton).pause(125); done(); @@ -67,7 +67,7 @@ module.exports = { .custom.waitAndClick(el.inventory.firstSystemInTable) .custom.waitAll('systemModal') .custom.performWithStash(function (stash, done) { - client.expect.element(el.systemModal.hostname.s).text.to.equal(stash.systemName); + client.expect.element(el.systemModal.displayName.s).text.to.equal(stash.systemName); client.custom.waitAndClick(el.systemModal.exButton); client.custom.waitAll('nav'); done(); diff --git a/static b/static index e05de2b6..754fb47a 160000 --- a/static +++ b/static @@ -1 +1 @@ -Subproject commit e05de2b6967677be2ffa1c21be95c2cd600bf704 +Subproject commit 754fb47a58ed82c6197f09179920f509bde61e22 From 3bb5ffd9cb751c532c03d51a052e72ad095c3647 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 25 Apr 2018 11:39:53 -0400 Subject: [PATCH 14/15] rebasing and fixing conflicts --- app/js/components/topbar/_topbar-insights-logo.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/js/components/topbar/_topbar-insights-logo.scss b/app/js/components/topbar/_topbar-insights-logo.scss index 2e21f4dd..419dc8b6 100644 --- a/app/js/components/topbar/_topbar-insights-logo.scss +++ b/app/js/components/topbar/_topbar-insights-logo.scss @@ -13,6 +13,11 @@ topbar .insights-logo { @include font-size(20px); } + button.toggle-fullscreen md-icon{ + color: #fff; + @include font-size(20px); + } + button { border: none; } From 6e13830da1dce281d92e0453b47857e8f3c2f9f3 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Mon, 23 Apr 2018 15:02:20 -0400 Subject: [PATCH 15/15] fixing pages with tables and action sub-pages --- app/js/components/topbar/_topbar-insights-logo.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/js/components/topbar/_topbar-insights-logo.scss b/app/js/components/topbar/_topbar-insights-logo.scss index 419dc8b6..2e21f4dd 100644 --- a/app/js/components/topbar/_topbar-insights-logo.scss +++ b/app/js/components/topbar/_topbar-insights-logo.scss @@ -13,11 +13,6 @@ topbar .insights-logo { @include font-size(20px); } - button.toggle-fullscreen md-icon{ - color: #fff; - @include font-size(20px); - } - button { border: none; }