From 6cf98da91ede74743f4ef95fc444ee70c57284b3 Mon Sep 17 00:00:00 2001 From: Ilja Date: Sat, 28 Nov 2020 11:59:40 +0100 Subject: [PATCH] Fix for code review * js object keys aren't quoted any more * when no reason is given, it will be shown in the FE (and is localised) * the js function I wrote * is now of the form `const name = (e) => {}` instead of `function name(e) {}` * doesn't use an extra `else` nesting any more --- .../mrf_transparency_panel.js | 6 +-- .../mrf_transparency_panel.vue | 44 ++++++++++++++++--- src/i18n/en.json | 1 + 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js index a3353728..3fde8106 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js @@ -7,12 +7,12 @@ import { get } from 'lodash' * Because we didn't want to break backwards compatibility it was decided * to add an extra "info" key. */ -function toInstanceReasonObject (instances, info, key) { +const toInstanceReasonObject = (instances, info, key) => { return instances.map(instance => { if (info[key] && info[key][instance] && info[key][instance]['reason']) { - return { 'instance': instance, 'reason': info[key][instance]['reason'] } + return { instance: instance, reason: info[key][instance]['reason'] } } - return { 'instance': instance, 'reason': '' } + return { instance: instance, reason: '' } }) } diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue index c6548f51..feed56b7 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue @@ -41,7 +41,12 @@ :key="entry" > {{ entry.instance }} - {{ entry.reason }} + + {{ $t("about.mrf.simple.no_reason_available") }} + + + {{ entry.reason }} + @@ -61,7 +66,12 @@ :key="entry" > {{ entry.instance }} - {{ entry.reason }} + + {{ $t("about.mrf.simple.no_reason_available") }} + + + {{ entry.reason }} + @@ -81,7 +91,12 @@ :key="entry" > {{ entry.instance }} - {{ entry.reason }} + + {{ $t("about.mrf.simple.no_reason_available") }} + + + {{ entry.reason }} + @@ -101,7 +116,12 @@ :key="entry" > {{ entry.instance }} - {{ entry.reason }} + + {{ $t("about.mrf.simple.no_reason_available") }} + + + {{ entry.reason }} + @@ -121,7 +141,12 @@ :key="entry" > {{ entry.instance }} - {{ entry.reason }} + + {{ $t("about.mrf.simple.no_reason_available") }} + + + {{ entry.reason }} + @@ -137,11 +162,16 @@ {{ $t("about.mrf.simple.reason") }} {{ entry.instance }} - {{ entry.reason }} + + {{ $t("about.mrf.simple.no_reason_available") }} + + + {{ entry.reason }} + diff --git a/src/i18n/en.json b/src/i18n/en.json index 317ffdb0..91a2f556 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -15,6 +15,7 @@ "simple_policies": "Instance-specific Policies", "instance": "Instance", "reason": "Reason", + "no_reason_available": "N/A", "accept": "Accept", "accept_desc": "This instance only accepts messages from the following instances:", "reject": "Reject",