Skip to content

Commit

Permalink
feat: consolidation of flags to reduce flagspam, #8510
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit c6d0939
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 24 13:41:32 2020 -0400

    fix: more tests

commit 32f9af2
Merge: e509075 4eae927
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 24 10:53:04 2020 -0400

    Merge remote-tracking branch 'origin/master' into singleton-flags

commit e509075
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 24 10:52:46 2020 -0400

    fix: controllers-admin test

commit fd5af99
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 17:26:55 2020 -0400

    fix(tests): dummy commit to trigger travisCI

commit c452a6f
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 17:05:09 2020 -0400

    fix(openapi): openapi spec changes

commit 8089a74
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 15:48:00 2020 -0400

    fix: reversing the order of reports for display purposes

commit a099892
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 15:45:44 2020 -0400

    refactor: run all flag creation calls in a single batch

commit b249996
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 15:08:23 2020 -0400

    feat: handling multiple reporters per flag, #8510

commit 08c75c0
Author: Julian Lam <julian@nodebb.org>
Date:   Thu Jul 16 20:53:18 2020 -0400

    feat: upgrade script for #8510
  • Loading branch information
julianlam committed Jul 24, 2020
1 parent 3761f05 commit 55b0e90
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 113 deletions.
5 changes: 2 additions & 3 deletions public/language/en-GB/flags.json
@@ -1,8 +1,7 @@
{
"state": "State",
"reporter": "Reporter",
"reported-at": "Reported At",
"description": "Description",
"reports": "Reports",
"first-reported": "First Reported",
"no-flags": "Hooray! No flags found.",
"assignee": "Assignee",
"update": "Update",
Expand Down
107 changes: 48 additions & 59 deletions public/openapi/read.yaml
Expand Up @@ -3089,6 +3089,9 @@ paths:
type: boolean
downvoted:
type: boolean
flagId:
type: number
description: The flag identifier, if this particular post has been flagged before
"/api/topic/tid/{id}":
get:
tags:
Expand Down Expand Up @@ -3735,6 +3738,9 @@ paths:
type: boolean
display_post_menu:
type: boolean
flagId:
type: number
description: The flag identifier, if this particular post has been flagged before
category:
$ref: components/schemas/CategoryObject.yaml#/CategoryObject
tagWhitelist:
Expand Down Expand Up @@ -4788,6 +4794,9 @@ paths:
properties:
state:
type: string
heat:
type: number
description: The number of reports that make up this flag
flagId:
type: number
type:
Expand All @@ -4796,34 +4805,8 @@ paths:
oneOf:
- type: string
- type: number
description:
type: string
uid:
type: number
description: A user identifier
datetime:
type: number
reporter:
type: object
properties:
username:
type: string
description: A friendly name for a given user account
picture:
nullable: true
type: string
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with
`icon:text` for the user's auto-generated
icon
example: "#f44336"
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users without
an avatar
labelClass:
type: string
target_readable:
Expand Down Expand Up @@ -4886,11 +4869,6 @@ paths:
type: string
targetId:
type: number
description:
type: string
uid:
type: number
description: A user identifier
datetime:
type: number
datetimeISO:
Expand Down Expand Up @@ -5006,34 +4984,45 @@ paths:
`icon:text` for the user's auto-generated
icon
example: "#f44336"
reporter:
type: object
properties:
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
reputation:
type: number
uid:
type: number
description: A user identifier
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users without an
avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with `icon:text` for
the user's auto-generated icon
example: "#f44336"
reports:
type: array
items:
type: object
properties:
value:
type: string
timestamp:
type: number
timestampISO:
type: string
reporter:
type: object
properties:
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
reputation:
type: number
uid:
type: number
description: A user identifier
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users without an
avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with `icon:text` for
the user's auto-generated icon
example: "#f44336"
type_path:
type: string
assignees:
Expand Down
5 changes: 5 additions & 0 deletions public/src/client/flags/list.js
Expand Up @@ -6,6 +6,11 @@ define('forum/flags/list', ['components', 'Chart'], function (components, Chart)
Flags.init = function () {
Flags.enableFilterForm();

components.get('flags/list').on('click', '[data-flag-id]', function () {
var flagId = this.getAttribute('data-flag-id');
ajaxify.go('flags/' + flagId);
});

var graphWrapper = $('#flags-daily-wrapper');
var graphFooter = graphWrapper.siblings('.panel-footer');
$('#flags-daily-wrapper').one('shown.bs.collapse', function () {
Expand Down

0 comments on commit 55b0e90

Please sign in to comment.