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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Sean King
admin-fe
Commits
3d108798
Commit
3d108798
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Add parsing Sender settings value
parent
54c8c2dd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/store/modules/normalizers.js
+24
-13
24 additions, 13 deletions
src/store/modules/normalizers.js
src/views/settings/components/inputComponents/index.js
+1
-0
1 addition, 0 deletions
src/views/settings/components/inputComponents/index.js
with
25 additions
and
13 deletions
src/store/modules/normalizers.js
+
24
−
13
View file @
3d108798
...
...
@@ -89,8 +89,8 @@ export const parseTuples = (tuples, key) => {
},
[])
}
else
if
(
item
.
tuple
[
0
]
===
'
:prune
'
)
{
accum
[
item
.
tuple
[
0
]]
=
item
.
tuple
[
1
]
===
'
:disabled
'
?
[
item
.
tuple
[
1
]]
:
item
.
tuple
[
1
].
tuple
}
else
if
(
item
.
tuple
[
0
]
===
'
:proxy_url
'
)
{
accum
[
item
.
tuple
[
0
]]
=
parse
ProxyUrl
(
item
.
tuple
[
1
])
}
else
if
(
item
.
tuple
[
0
]
===
'
:proxy_url
'
||
item
.
tuple
[
0
]
===
'
:sender
'
)
{
accum
[
item
.
tuple
[
0
]]
=
parse
StringOrTupleValue
(
item
.
tuple
[
0
],
item
.
tuple
[
1
])
}
else
if
(
item
.
tuple
[
0
]
===
'
:args
'
)
{
accum
[
item
.
tuple
[
0
]]
=
parseNonTuples
(
item
.
tuple
[
0
],
item
.
tuple
[
1
])
}
else
if
(
Array
.
isArray
(
item
.
tuple
[
1
])
&&
...
...
@@ -122,18 +122,29 @@ const parseObject = object => {
},
{})
}
const
parseProxyUrl
=
value
=>
{
if
(
value
&&
!
Array
.
isArray
(
value
)
&&
typeof
value
===
'
object
'
&&
value
.
tuple
.
length
===
3
&&
value
.
tuple
[
0
]
===
'
:socks5
'
)
{
const
[,
host
,
port
]
=
value
.
tuple
return
{
socks5
:
true
,
host
,
port
}
}
else
if
(
typeof
value
===
'
string
'
)
{
const
[
host
,
port
]
=
value
.
split
(
'
:
'
)
return
{
socks5
:
false
,
host
,
port
}
const
parseStringOrTupleValue
=
(
key
,
value
)
=>
{
if
(
key
===
'
:proxy_url
'
)
{
if
(
value
&&
!
Array
.
isArray
(
value
)
&&
typeof
value
===
'
object
'
&&
value
.
tuple
.
length
===
3
&&
value
.
tuple
[
0
]
===
'
:socks5
'
)
{
const
[,
host
,
port
]
=
value
.
tuple
return
{
socks5
:
true
,
host
,
port
}
}
else
if
(
typeof
value
===
'
string
'
)
{
const
[
host
,
port
]
=
value
.
split
(
'
:
'
)
return
{
socks5
:
false
,
host
,
port
}
}
return
{
socks5
:
false
,
host
:
null
,
port
:
null
}
}
else
if
(
key
===
'
:sender
'
)
{
if
(
typeof
value
===
'
string
'
)
{
return
{
email
:
value
}
}
else
if
(
value
&&
typeof
value
===
'
object
'
&&
value
.
tuple
.
length
===
2
)
{
const
[
nickname
,
email
]
=
value
.
tuple
return
{
nickname
,
email
}
}
}
return
{
socks5
:
false
,
host
:
null
,
port
:
null
}
}
const
prependWithСolon
=
(
type
,
value
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/views/settings/components/inputComponents/index.js
+
1
−
0
View file @
3d108798
...
...
@@ -8,4 +8,5 @@ export { default as PruneInput } from './PruneInput'
export
{
default
as
RateLimitInput
}
from
'
./RateLimitInput
'
export
{
default
as
RegInvitesInput
}
from
'
./RegInvitesInput
'
export
{
default
as
SelectInputWithReducedLabels
}
from
'
./SelectInputWithReducedLabels
'
export
{
default
as
SenderInput
}
from
'
./SenderInput
'
export
{
default
as
SpecificMultipleSelect
}
from
'
./SpecificMultipleSelect
'
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