Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma-fe
Commits
a6a16217
Commit
a6a16217
authored
6 years ago
by
HJ
Browse files
Options
Downloads
Patches
Plain Diff
instead of filtering nulls, let's just not have them in the first place
parent
06d39b62
No related branches found
No related tags found
2 merge requests
!1028
`master` refresh with `develop`
,
!655
Transition to MastoAPI: user data
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/users.js
+3
-3
3 additions, 3 deletions
src/modules/users.js
src/services/entity_normalizer/entity_normalizer.service.js
+7
-8
7 additions, 8 deletions
src/services/entity_normalizer/entity_normalizer.service.js
with
10 additions
and
11 deletions
src/modules/users.js
+
3
−
3
View file @
a6a16217
import
backendInteractorService
from
'
../services/backend_interactor_service/backend_interactor_service.js
'
import
{
compact
,
map
,
each
,
merge
,
find
,
omitBy
}
from
'
lodash
'
import
{
compact
,
map
,
each
,
merge
,
find
}
from
'
lodash
'
import
{
set
}
from
'
vue
'
import
{
registerPushNotifications
,
unregisterPushNotifications
}
from
'
../services/push/push.js
'
import
oauthApi
from
'
../services/new_api/oauth
'
...
...
@@ -11,7 +11,7 @@ export const mergeOrAdd = (arr, obj, item) => {
const
oldItem
=
obj
[
item
.
id
]
if
(
oldItem
)
{
// We already have this, so only merge the new info.
merge
(
oldItem
,
omitBy
(
item
,
_
=>
_
===
null
)
)
merge
(
oldItem
,
item
)
return
{
item
:
oldItem
,
new
:
false
}
}
else
{
// This is a new item, prepare it
...
...
@@ -39,7 +39,7 @@ export const mutations = {
},
setCurrentUser
(
state
,
user
)
{
state
.
lastLoginName
=
user
.
screen_name
state
.
currentUser
=
merge
(
state
.
currentUser
||
{},
omitBy
(
user
,
_
=>
_
===
null
)
)
state
.
currentUser
=
merge
(
state
.
currentUser
||
{},
user
)
},
clearCurrentUser
(
state
)
{
state
.
currentUser
=
false
...
...
This diff is collapsed.
Click to expand it.
src/services/entity_normalizer/entity_normalizer.service.js
+
7
−
8
View file @
a6a16217
...
...
@@ -39,10 +39,10 @@ export const parseUser = (data) => {
return
output
}
output
.
name
=
null
//
missing
//
output.name =
???
missing
output
.
name_html
=
data
.
display_name
output
.
description
=
null
//
missing
//
output.description =
???
missing
output
.
description_html
=
data
.
note
// Utilize avatar_static for gif avatars?
...
...
@@ -83,7 +83,7 @@ export const parseUser = (data) => {
output
.
friends_count
=
data
.
friends_count
output
.
bot
=
null
//
missing
//
output.bot =
???
missing
output
.
statusnet_profile_url
=
data
.
statusnet_profile_url
...
...
@@ -134,7 +134,7 @@ const parseAttachment = (data) => {
output
.
meta
=
data
.
meta
// not present in BE yet
}
else
{
output
.
mimetype
=
data
.
mimetype
output
.
meta
=
null
//
missing
//
output.meta =
???
missing
}
output
.
url
=
data
.
url
...
...
@@ -166,7 +166,7 @@ export const parseStatus = (data) => {
output
.
in_reply_to_user_id
=
data
.
in_reply_to_account_id
// Missing!! fix in UI?
output
.
in_reply_to_screen_name
=
null
//
output.in_reply_to_screen_name =
???
// Not exactly the same but works
output
.
statusnet_conversation_id
=
data
.
id
...
...
@@ -179,8 +179,7 @@ export const parseStatus = (data) => {
output
.
summary_html
=
data
.
spoiler_text
output
.
external_url
=
data
.
url
// FIXME missing!!
output
.
is_local
=
false
// output.is_local = ??? missing
}
else
{
output
.
favorited
=
data
.
favorited
output
.
fave_num
=
data
.
fave_num
...
...
@@ -259,7 +258,7 @@ export const parseNotification = (data) => {
if
(
masto
)
{
output
.
type
=
mastoDict
[
data
.
type
]
||
data
.
type
output
.
seen
=
null
//
missing
//
output.seen =
???
missing
output
.
status
=
parseStatus
(
data
.
status
)
output
.
action
=
output
.
status
// not sure
output
.
from_profile
=
parseUser
(
data
.
account
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment