Add user filter for beatmap discussions #3090
Merged
Conversation
needed to update the counts, etc.
a | ||
children: children | ||
className: classNames | ||
href: '#' |
notbakaneko
Apr 26, 2018
Author
Collaborator
need something else for this
need something else for this
@@ -183,7 +183,7 @@ class BeatmapDiscussions.Discussions extends React.PureComponent | |||
@props.mode == 'timeline' && @currentSort() == 'timeline' | |||
|
|||
|
|||
sortedDisussions: -> | |||
sortedDiscussions: (discussions) -> |
nanaya
May 7, 2018
Collaborator
parameter not used?
parameter not used?
@@ -213,6 +219,7 @@ class @BeatmapDiscussionHelper | |||
# empty path segments are '' | |||
mode: if _.includes(@MODES, mode) then mode else @DEFAULT_MODE | |||
filter: if _.includes(@FILTERS, filter) then filter else @DEFAULT_FILTER | |||
user: parseInt(url.searchParams.get('user'), 10) if url.searchParams.get('user')? |
nanaya
May 7, 2018
Collaborator
apparently there's already params
variable assigned with url.searchParams
(which isn't used =D )
apparently there's already params
variable assigned with url.searchParams
(which isn't used =D )
notbakaneko
May 8, 2018
Author
Collaborator
and into the bin it goes
and into the bin it goes
@@ -58,6 +59,11 @@ class BeatmapDiscussions.Main extends React.PureComponent | |||
$.subscribe 'beatmapsetDiscussions:update.beatmapDiscussions', @update | |||
$.subscribe 'beatmapDiscussion:jump.beatmapDiscussions', @jumpTo | |||
$.subscribe 'beatmapDiscussionPost:markRead.beatmapDiscussions', @markPostRead | |||
$.subscribe 'beatmapsetDiscussions:userFilterChanged.beatmapDiscussions', (_e, { selectedUserId }) => |
nanaya
May 7, 2018
Collaborator
or update update
function to handle user parameter? (also cache reset is already done in componentWillUpdate
)
or update update
function to handle user parameter? (also cache reset is already done in componentWillUpdate
)
notbakaneko
May 8, 2018
Author
Collaborator
might be browser just failing too
might be browser just failing too
@@ -199,7 +207,7 @@ class BeatmapDiscussions.Main extends React.PureComponent | |||
modes[mode] = {} | |||
|
|||
|
|||
for d in @state.beatmapset.discussions | |||
for d in @filterDiscussions(@state.beatmapset.discussions) |
nanaya
May 7, 2018
Collaborator
this confuses nominate button (wrong unresolved count).
this confuses nominate button (wrong unresolved count).
@@ -179,6 +186,7 @@ class BeatmapDiscussions.Main extends React.PureComponent | |||
|
|||
countsByBeatmap = {} | |||
countsByPlaymode = {} | |||
totalHype = _.filter(@state.beatmapset.discussions, message_type: 'hype', deleted_at: null).length |
nanaya
May 7, 2018
Collaborator
this can be part of the big loop...?
this can be part of the big loop...?
* along with osu!web. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
.beatmap-discussions-user-filter { |
nanaya
May 7, 2018
Collaborator
can't this be a modifier of beatmap-list
? (maybe with class name change)
can't this be a modifier of beatmap-list
? (maybe with class name change)
notbakaneko
May 8, 2018
Author
Collaborator
more like move to a more generic select-options component and use fragments to render
...which comes later
more like move to a more generic select-options component and use fragments to render
...which comes later
return if event.button != 0 | ||
event.preventDefault() | ||
|
||
selectedUserId = user.id |
nanaya
May 7, 2018
Collaborator
pass key: value
directly in the $.publish
call? ಠ_ಠ
pass key: value
directly in the $.publish
call? ಠ_ಠ
a | ||
children: children | ||
className: classNames | ||
href: "?user=#{key ? ''}" |
nanaya
May 7, 2018
Collaborator
use the helper .url
instead?
use the helper .url
instead?
&--stats { | ||
flex: none; | ||
display: flex; | ||
flex-direction: column; |
@@ -56,6 +56,30 @@ | |||
} | |||
} | |||
|
|||
&__filter-group { | |||
min-width: 0; | |||
flex: 1 1 auto; |
notbakaneko
May 8, 2018
Author
Collaborator
yes
yes
null actually has a different meaning from undefined here.
794b024
to
d941216
a | ||
children: children | ||
className: classNames | ||
href: BeatmapDiscussionHelper.url user: key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
fixes #2105
Entirely client-side.
"This will be a quick change"; and then it wasn't