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
Wiki
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
Angelina Filippova
admin-fe
Commits
b9558982
Commit
b9558982
authored
5 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused ability to upload media
parent
13aba7ea
No related branches found
No related tags found
No related merge requests found
Pipeline
#21963
passed
5 years ago
Stage: lint
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/settings.js
+0
-12
0 additions, 12 deletions
src/api/settings.js
src/store/modules/settings.js
+1
-8
1 addition, 8 deletions
src/store/modules/settings.js
with
1 addition
and
20 deletions
src/api/settings.js
+
0
−
12
View file @
b9558982
...
...
@@ -40,16 +40,4 @@ export async function removeSettings(configs, authHost, token) {
})
}
export
async
function
uploadMedia
(
file
,
authHost
,
token
)
{
const
formData
=
new
FormData
()
formData
.
append
(
'
file
'
,
file
)
return
await
request
({
baseURL
:
baseName
(
authHost
),
url
:
`/api/v1/media`
,
method
:
'
post
'
,
headers
:
authHeaders
(
token
),
data
:
formData
})
}
const
authHeaders
=
(
token
)
=>
token
?
{
'
Authorization
'
:
`Bearer
${
getToken
()}
`
}
:
{}
This diff is collapsed.
Click to expand it.
src/store/modules/settings.js
+
1
−
8
View file @
b9558982
import
{
fetchDescription
,
fetchSettings
,
removeSettings
,
updateSettings
,
uploadMedia
}
from
'
@/api/settings
'
import
{
fetchDescription
,
fetchSettings
,
removeSettings
,
updateSettings
}
from
'
@/api/settings
'
import
{
checkPartialUpdate
,
parseNonTuples
,
parseTuples
,
valueHasTuples
,
wrapUpdatedSettings
}
from
'
./normalizers
'
import
_
from
'
lodash
'
...
...
@@ -99,13 +99,6 @@ const settings = {
key
?
commit
(
'
UPDATE_STATE
'
,
{
group
,
key
,
input
,
value
})
:
commit
(
'
UPDATE_STATE
'
,
{
group
,
key
:
input
,
input
:
'
value
'
,
value
})
},
async
UploadMedia
({
dispatch
,
getters
,
state
},
{
file
,
tab
,
inputName
,
childName
})
{
const
response
=
await
uploadMedia
(
file
,
getters
.
authHost
,
getters
.
token
)
const
updatedValue
=
childName
?
{
...
state
.
settings
[
tab
][
inputName
],
...{
[
childName
]:
response
.
data
.
url
}}
:
response
.
data
.
url
dispatch
(
'
UpdateSettings
'
,
{
tab
,
data
:
{
[
inputName
]:
updatedValue
}})
}
}
}
...
...
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