Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
deaf6aee
Commit
deaf6aee
authored
Feb 02, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted protected_tag_edit.js to use axios
parent
a32065ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
app/assets/javascripts/protected_tags/protected_tag_edit.js
app/assets/javascripts/protected_tags/protected_tag_edit.js
+13
-18
No files found.
app/assets/javascripts/protected_tags/protected_tag_edit.js
View file @
deaf6aee
/* eslint-disable no-new */
import
Flash
from
'
../flash
'
;
import
flash
from
'
../flash
'
;
import
axios
from
'
../lib/utils/axios_utils
'
;
import
ProtectedTagAccessDropdown
from
'
./protected_tag_access_dropdown
'
;
export
default
class
ProtectedTagEdit
{
...
...
@@ -28,24 +28,19 @@ export default class ProtectedTagEdit {
this
.
$allowedToCreateDropdownButton
.
disable
();
$
.
ajax
({
type
:
'
POST
'
,
url
:
this
.
$wrap
.
data
(
'
url
'
),
dataType
:
'
json
'
,
data
:
{
_method
:
'
PATCH
'
,
axios
.
patch
(
this
.
$wrap
.
data
(
'
url
'
),
{
protected_tag
:
{
create_access_levels_attributes
:
[{
id
:
this
.
$allowedToCreateDropdownButton
.
data
(
'
access-level-id
'
),
access_level
:
$allowedToCreateInput
.
val
(),
}],
},
},
error
()
{
new
Flash
(
'
Failed to update tag!
'
,
'
alert
'
,
document
.
querySelector
(
'
.js-protected-tags-list
'
));
},
}).
always
(()
=>
{
}).
then
(()
=>
{
this
.
$allowedToCreateDropdownButton
.
enable
();
}).
catch
(()
=>
{
this
.
$allowedToCreateDropdownButton
.
enable
();
flash
(
'
Failed to update tag!
'
,
'
alert
'
,
document
.
querySelector
(
'
.js-protected-tags-list
'
));
});
}
}
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