Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
admin-fe
Commits
13aba7ea
Commit
13aba7ea
authored
5 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Fetch new data after removing a setting instead of updating it
parent
ff137f41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!77
Ability to remove settings from db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/store/modules/normalizers.js
+0
-2
0 additions, 2 deletions
src/store/modules/normalizers.js
src/store/modules/settings.js
+3
-14
3 additions, 14 deletions
src/store/modules/settings.js
with
3 additions
and
16 deletions
src/store/modules/normalizers.js
+
0
−
2
View file @
13aba7ea
...
...
@@ -245,8 +245,6 @@ const wrapValues = (settings, currentState) => {
}
else
if
(
setting
===
'
:ip
'
)
{
const
ip
=
value
.
split
(
'
.
'
).
map
(
s
=>
parseInt
(
s
,
10
))
return
{
'
tuple
'
:
[
setting
,
{
'
tuple
'
:
ip
}]
}
}
else
if
(
setting
===
'
:ssl_options
'
)
{
return
{
'
tuple
'
:
[
setting
,
wrapValues
(
value
,
currentState
)]
}
}
else
if
(
setting
===
'
:args
'
)
{
const
index
=
value
.
findIndex
(
el
=>
el
===
'
implode
'
)
const
updatedArray
=
value
.
slice
()
...
...
This diff is collapsed.
Click to expand it.
src/store/modules/settings.js
+
3
−
14
View file @
13aba7ea
...
...
@@ -51,18 +51,6 @@ const settings = {
:
{
[
key
]:
{
...
state
.
updatedSettings
[
group
][
key
],
...{
[
input
]:
[
type
,
value
]
}}}
state
.
updatedSettings
[
group
]
=
{
...
state
.
updatedSettings
[
group
],
...
updatedSetting
}
},
UPDATE_SETTINGS_AFTER_REMOVAL
:
(
state
,
{
configs
,
response
})
=>
{
if
(
!
response
)
{
const
{
[
configs
[
0
].
key
]:
value
,
...
updatedSettings
}
=
state
.
settings
[
configs
[
0
].
group
]
state
.
settings
[
configs
[
0
].
group
]
=
updatedSettings
}
else
{
const
{
group
,
key
,
value
}
=
response
const
parsedValue
=
valueHasTuples
(
key
,
value
)
?
{
value
:
parseNonTuples
(
key
,
value
)
}
:
parseTuples
(
value
,
key
)
state
.
settings
[
group
]
=
{
...
state
.
settings
[
group
],
[
key
]:
parsedValue
}
}
},
UPDATE_STATE
:
(
state
,
{
group
,
key
,
input
,
value
})
=>
{
const
updatedState
=
key
===
'
Pleroma.Emails.Mailer
'
&&
input
===
'
:adapter
'
?
{
[
key
]:
{
[
input
]:
value
}}
...
...
@@ -81,9 +69,10 @@ const settings = {
commit
(
'
SET_LOADING
'
,
false
)
},
async
RemoveSetting
({
commit
,
getters
},
configs
)
{
const
response
=
await
removeSettings
(
configs
,
getters
.
authHost
,
getters
.
token
)
await
removeSettings
(
configs
,
getters
.
authHost
,
getters
.
token
)
const
response
=
await
fetchSettings
(
getters
.
authHost
,
getters
.
token
)
const
{
group
,
key
,
subkeys
}
=
configs
[
0
]
commit
(
'
UPDATE
_SETTINGS
_AFTER_REMOVAL
'
,
{
response
:
response
.
data
.
configs
[
0
],
configs
}
)
commit
(
'
SET
_SETTINGS
'
,
response
.
data
.
configs
)
commit
(
'
REMOVE_SETTING_FROM_UPDATED
'
,
{
group
,
key
,
subkeys
:
subkeys
||
[]
})
},
async
SubmitChanges
({
getters
,
commit
,
state
})
{
...
...
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