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
This commit is contained in:
parent
c3ddd0c832
commit
6cf98da91e
3 changed files with 41 additions and 10 deletions
|
@ -7,12 +7,12 @@ import { get } from 'lodash'
|
||||||
* Because we didn't want to break backwards compatibility it was decided
|
* Because we didn't want to break backwards compatibility it was decided
|
||||||
* to add an extra "info" key.
|
* to add an extra "info" key.
|
||||||
*/
|
*/
|
||||||
function toInstanceReasonObject (instances, info, key) {
|
const toInstanceReasonObject = (instances, info, key) => {
|
||||||
return instances.map(instance => {
|
return instances.map(instance => {
|
||||||
if (info[key] && info[key][instance] && info[key][instance]['reason']) {
|
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: '' }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,12 @@
|
||||||
:key="entry"
|
:key="entry"
|
||||||
>
|
>
|
||||||
<td>{{ entry.instance }}</td>
|
<td>{{ entry.instance }}</td>
|
||||||
<td>{{ entry.reason }}</td>
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.no_reason_available") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,7 +66,12 @@
|
||||||
:key="entry"
|
:key="entry"
|
||||||
>
|
>
|
||||||
<td>{{ entry.instance }}</td>
|
<td>{{ entry.instance }}</td>
|
||||||
<td>{{ entry.reason }}</td>
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.no_reason_available") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,7 +91,12 @@
|
||||||
:key="entry"
|
:key="entry"
|
||||||
>
|
>
|
||||||
<td>{{ entry.instance }}</td>
|
<td>{{ entry.instance }}</td>
|
||||||
<td>{{ entry.reason }}</td>
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.no_reason_available") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -101,7 +116,12 @@
|
||||||
:key="entry"
|
:key="entry"
|
||||||
>
|
>
|
||||||
<td>{{ entry.instance }}</td>
|
<td>{{ entry.instance }}</td>
|
||||||
<td>{{ entry.reason }}</td>
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.no_reason_available") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -121,7 +141,12 @@
|
||||||
:key="entry"
|
:key="entry"
|
||||||
>
|
>
|
||||||
<td>{{ entry.instance }}</td>
|
<td>{{ entry.instance }}</td>
|
||||||
<td>{{ entry.reason }}</td>
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.no_reason_available") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -137,11 +162,16 @@
|
||||||
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr
|
<tr
|
||||||
v-for="entry in mediaNsfwInstances"
|
v-for="entry in mediaRemovalInstances"
|
||||||
:key="entry"
|
:key="entry"
|
||||||
>
|
>
|
||||||
<td>{{ entry.instance }}</td>
|
<td>{{ entry.instance }}</td>
|
||||||
<td>{{ entry.reason }}</td>
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.no_reason_available") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
"simple_policies": "Instance-specific Policies",
|
"simple_policies": "Instance-specific Policies",
|
||||||
"instance": "Instance",
|
"instance": "Instance",
|
||||||
"reason": "Reason",
|
"reason": "Reason",
|
||||||
|
"no_reason_available": "N/A",
|
||||||
"accept": "Accept",
|
"accept": "Accept",
|
||||||
"accept_desc": "This instance only accepts messages from the following instances:",
|
"accept_desc": "This instance only accepts messages from the following instances:",
|
||||||
"reject": "Reject",
|
"reject": "Reject",
|
||||||
|
|
Loading…
Add table
Reference in a new issue