diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js index a0b600d2..3fde8106 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js @@ -1,17 +1,56 @@ import { mapState } from 'vuex' import { get } from 'lodash' +/** + * This is for backwards compatibility. We originally didn't recieve + * extra info like a reason why an instance was rejected/quarantined/etc. + * Because we didn't want to break backwards compatibility it was decided + * to add an extra "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: '' } + }) +} + const MRFTransparencyPanel = { computed: { ...mapState({ federationPolicy: state => get(state, 'instance.federationPolicy'), mrfPolicies: state => get(state, 'instance.federationPolicy.mrf_policies', []), - quarantineInstances: state => get(state, 'instance.federationPolicy.quarantined_instances', []), - acceptInstances: state => get(state, 'instance.federationPolicy.mrf_simple.accept', []), - rejectInstances: state => get(state, 'instance.federationPolicy.mrf_simple.reject', []), - ftlRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []), - mediaNsfwInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []), - mediaRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_removal', []), + quarantineInstances: state => toInstanceReasonObject( + get(state, 'instance.federationPolicy.quarantined_instances', []), + get(state, 'instance.federationPolicy.quarantined_instances_info', []), + 'quarantined_instances' + ), + acceptInstances: state => toInstanceReasonObject( + get(state, 'instance.federationPolicy.mrf_simple.accept', []), + get(state, 'instance.federationPolicy.mrf_simple_info', []), + 'accept' + ), + rejectInstances: state => toInstanceReasonObject( + get(state, 'instance.federationPolicy.mrf_simple.reject', []), + get(state, 'instance.federationPolicy.mrf_simple_info', []), + 'reject' + ), + ftlRemovalInstances: state => toInstanceReasonObject( + get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []), + get(state, 'instance.federationPolicy.mrf_simple_info', []), + 'federated_timeline_removal' + ), + mediaNsfwInstances: state => toInstanceReasonObject( + get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []), + get(state, 'instance.federationPolicy.mrf_simple_info', []), + 'media_nsfw' + ), + mediaRemovalInstances: state => toInstanceReasonObject( + get(state, 'instance.federationPolicy.mrf_simple.media_removal', []), + get(state, 'instance.federationPolicy.mrf_simple_info', []), + 'media_removal' + ), keywordsFtlRemoval: state => get(state, 'instance.federationPolicy.mrf_keyword.federated_timeline_removal', []), keywordsReject: state => get(state, 'instance.federationPolicy.mrf_keyword.reject', []), keywordsReplace: state => get(state, 'instance.federationPolicy.mrf_keyword.replace', []) diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.scss b/src/components/mrf_transparency_panel/mrf_transparency_panel.scss new file mode 100644 index 00000000..80ea01d4 --- /dev/null +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.scss @@ -0,0 +1,21 @@ +.mrf-section { + margin: 1em; + + table { + width:100%; + text-align: left; + padding-left:10px; + padding-bottom:20px; + + th, td { + width: 180px; + max-width: 360px; + overflow: hidden; + vertical-align: text-top; + } + + th+th, td+td { + width: auto; + } + } +} diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue index acdf822e..1787fa07 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue @@ -31,13 +31,24 @@
{{ $t("about.mrf.simple.accept_desc") }}
-{{ $t("about.mrf.simple.instance") }} | +{{ $t("about.mrf.simple.reason") }} | +|
---|---|---|
{{ entry.instance }} | ++ {{ $t("about.mrf.simple.not_applicable") }} + | ++ {{ entry.reason }} + | +
{{ $t("about.mrf.simple.reject_desc") }}
-{{ $t("about.mrf.simple.instance") }} | +{{ $t("about.mrf.simple.reason") }} | +|
---|---|---|
{{ entry.instance }} | ++ {{ $t("about.mrf.simple.not_applicable") }} + | ++ {{ entry.reason }} + | +
{{ $t("about.mrf.simple.quarantine_desc") }}
-{{ $t("about.mrf.simple.instance") }} | +{{ $t("about.mrf.simple.reason") }} | +|
---|---|---|
{{ entry.instance }} | ++ {{ $t("about.mrf.simple.not_applicable") }} + | ++ {{ entry.reason }} + | +
{{ $t("about.mrf.simple.ftl_removal_desc") }}
-{{ $t("about.mrf.simple.instance") }} | +{{ $t("about.mrf.simple.reason") }} | +|
---|---|---|
{{ entry.instance }} | ++ {{ $t("about.mrf.simple.not_applicable") }} + | ++ {{ entry.reason }} + | +
{{ $t("about.mrf.simple.media_nsfw_desc") }}
-{{ $t("about.mrf.simple.instance") }} | +{{ $t("about.mrf.simple.reason") }} | +|
---|---|---|
{{ entry.instance }} | ++ {{ $t("about.mrf.simple.not_applicable") }} + | ++ {{ entry.reason }} + | +
{{ $t("about.mrf.simple.media_removal_desc") }}
-{{ $t("about.mrf.simple.instance") }} | +{{ $t("about.mrf.simple.reason") }} | +|
---|---|---|
{{ entry.instance }} | ++ {{ $t("about.mrf.simple.not_applicable") }} + | ++ {{ entry.reason }} + | +