diff --git a/app/src/components/MessageListGroup.vue b/app/src/components/MessageListGroup.vue index 786054e9..5ef8622f 100644 --- a/app/src/components/MessageListGroup.vue +++ b/app/src/components/MessageListGroup.vue @@ -4,15 +4,17 @@ :class="{ 'fixed-height': fixedHeight, 'bordered': bordered }" @scroll="onScroll" > - - - + - + @@ -75,18 +77,4 @@ export default { border: $card-border-width solid $card-border-color; @include border-radius($card-border-radius); } - -.list-group-item { - font-size: $font-size-sm; - padding: $tooltip-padding-y $tooltip-padding-x; - padding-left: 1rem; -} - -.status { - position: absolute; - width: .4rem; - height: 100%; - top: 0; - left: 0; -} diff --git a/app/src/components/globals/YunoListGroupItem.vue b/app/src/components/globals/YunoListGroupItem.vue new file mode 100644 index 00000000..31d95281 --- /dev/null +++ b/app/src/components/globals/YunoListGroupItem.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/app/src/helpers/yunohostArguments.js b/app/src/helpers/yunohostArguments.js index c0e52613..74ad655d 100644 --- a/app/src/helpers/yunohostArguments.js +++ b/app/src/helpers/yunohostArguments.js @@ -18,6 +18,15 @@ const NO_VALUE_FIELDS = [ 'ButtonItem' ] +export const DEFAULT_STATUS_ICON = { + [null]: null, + danger: 'times', + error: 'times', + info: 'info', + success: 'check', + warning: 'warning' +} + /** * Tries to find a translation corresponding to the user's locale/fallback locale in a * Yunohost argument or simply return the string if it's not an object literal. diff --git a/app/src/views/diagnosis/Diagnosis.vue b/app/src/views/diagnosis/Diagnosis.vue index 48c8621d..b9f8d9a3 100644 --- a/app/src/views/diagnosis/Diagnosis.vue +++ b/app/src/views/diagnosis/Diagnosis.vue @@ -52,12 +52,12 @@ -
-

+

{{ $t('ignore') }} + {{ $t('details') }} @@ -87,7 +88,7 @@
  • - + @@ -108,6 +109,7 @@ import { mapGetters } from 'vuex' import api from '@/api' import { distanceToNow } from '@/helpers/filters/date' +import { DEFAULT_STATUS_ICON } from '@/helpers/yunohostArguments' export default { name: 'Diagnosis', @@ -127,34 +129,6 @@ export default { }, methods: { - formatReportItem (report, item) { - let issue = false - let icon = '' - const status = item.variant = item.status.toLowerCase() - - if (status === 'success') { - icon = 'check-circle' - } else if (status === 'info') { - icon = 'info-circle' - } else if (item.ignored) { - icon = status !== 'error' ? status : 'times' - item.variant = 'light' - report.ignoreds++ - } else if (status === 'warning') { - icon = status - issue = true - report.warnings++ - } else if (status === 'error') { - item.variant = 'danger' - icon = 'times' - issue = true - report.errors++ - } - - item.issue = issue - item.icon = icon - }, - onQueriesResponse (_, reportsData) { if (reportsData === null) { this.reports = null @@ -168,8 +142,23 @@ export default { report.ignoreds = 0 for (const item of report.items) { - this.formatReportItem(report, item) + const status = item.variant = item.status.toLowerCase() + item.icon = DEFAULT_STATUS_ICON[status] + item.issue = false + + if (item.ignored) { + item.variant = 'light' + report.ignoreds++ + } else if (status === 'warning') { + item.issue = true + report.warnings++ + } else if (status === 'error') { + item.variant = 'danger' + item.issue = true + report.errors++ + } } + report.noIssues = report.warnings + report.errors === 0 } this.reports = reports @@ -224,6 +213,10 @@ p.last-time-run { margin: .75rem 1rem; } +.list-group { + border-top: $list-group-border-width solid $list-group-border-color; +} + .item-button { button { min-width: 6rem;