Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
185
Issues
185
List
Boards
Labels
Service Desk
Milestones
Merge Requests
32
Merge Requests
32
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
59e50c27
Commit
59e50c27
authored
1 day ago
by
Guy Thouret
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat) Split state change view to separate views for increasing and decreasing user state -
#589
parent
42e5591b
feat/588-state-on-user
1 merge request
!285
WIP: Reward Factors for User Activity
Pipeline
#73232898
failed with stages
in 3 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
UpdateUserState.php
Core/Analytics/Delegates/UpdateUserState.php
+14
-13
UserState.php
Core/Analytics/UserStates/UserState.php
+1
-1
No files found.
Core/Analytics/Delegates/UpdateUserState.php
View file @
59e50c27
...
...
@@ -26,10 +26,8 @@ class UpdateUserState
public
function
update
()
:
void
{
if
(
$this
->
user
->
getUserState
()
!==
$this
->
userState
->
getState
())
{
$this
->
updateUserEntity
();
$this
->
sendStateChangeNotification
();
}
$this
->
updateUserEntity
();
$this
->
sendStateChangeNotification
();
}
private
function
updateUserEntity
()
:
void
...
...
@@ -41,14 +39,17 @@ class UpdateUserState
private
function
sendStateChangeNotification
()
:
void
{
Dispatcher
::
trigger
(
'notification'
,
'reward'
,
[
'to'
=>
[
$this
->
userState
->
getUserGuid
()
],
'from'
=>
Notification
::
SYSTEM_ENTITY
,
'notification_view'
=>
'rewards_state_change'
,
'params'
=>
$this
->
userState
->
export
()
]);
if
(
$this
->
userState
->
getStateChange
()
!==
0
)
{
$notificationView
=
(
$this
->
userState
->
getStateChange
()
>
0
)
?
'reward_state_increase'
:
'reward_state_decrease'
;
Dispatcher
::
trigger
(
'notification'
,
'reward'
,
[
'to'
=>
[
$this
->
userState
->
getUserGuid
()
],
'from'
=>
Notification
::
SYSTEM_ENTITY
,
'notification_view'
=>
$notificationView
,
'params'
=>
$this
->
userState
->
export
()
]);
}
}
}
This diff is collapsed.
Click to expand it.
Core/Analytics/UserStates/UserState.php
View file @
59e50c27
...
...
@@ -23,7 +23,7 @@ use Minds\Traits\MagicAttributes;
* @method UserState setActivityPercentage(float $activityPercentage)
* @method float getActivityPercentage()
* @method UserState setStateChange(int $stateChange)
* @method int get
UserStat
e()
* @method int get
StateChang
e()
*/
class
UserState
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment