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
3bb08565
Commit
3bb08565
authored
Jan 26, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted due_date_select to axios
parent
e63882e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
27 deletions
+21
-27
app/assets/javascripts/due_date_select.js
app/assets/javascripts/due_date_select.js
+21
-27
No files found.
app/assets/javascripts/due_date_select.js
View file @
3bb08565
/* global dateFormat */
/* global dateFormat */
import
Pikaday
from
'
pikaday
'
;
import
Pikaday
from
'
pikaday
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
parsePikadayDate
,
pikadayToString
}
from
'
./lib/utils/datefix
'
;
import
{
parsePikadayDate
,
pikadayToString
}
from
'
./lib/utils/datefix
'
;
class
DueDateSelect
{
class
DueDateSelect
{
...
@@ -125,37 +126,30 @@ class DueDateSelect {
...
@@ -125,37 +126,30 @@ class DueDateSelect {
}
}
submitSelectedDate
(
isDropdown
)
{
submitSelectedDate
(
isDropdown
)
{
return
$
.
ajax
({
const
selectedDateValue
=
this
.
datePayload
[
this
.
abilityName
].
due_date
;
type
:
'
PUT
'
,
const
displayedDateStyle
=
this
.
displayedDate
!==
'
No due date
'
?
'
bold
'
:
'
no-value
'
;
url
:
this
.
issueUpdateURL
,
data
:
this
.
datePayload
,
dataType
:
'
json
'
,
beforeSend
:
()
=>
{
const
selectedDateValue
=
this
.
datePayload
[
this
.
abilityName
].
due_date
;
const
displayedDateStyle
=
this
.
displayedDate
!==
'
No due date
'
?
'
bold
'
:
'
no-value
'
;
this
.
$loading
.
removeClass
(
'
hidden
'
).
fadeIn
();
this
.
$loading
.
removeClass
(
'
hidden
'
).
fadeIn
();
if
(
isDropdown
)
{
if
(
isDropdown
)
{
this
.
$dropdown
.
trigger
(
'
loading.gl.dropdown
'
);
this
.
$dropdown
.
trigger
(
'
loading.gl.dropdown
'
);
this
.
$selectbox
.
hide
();
this
.
$selectbox
.
hide
();
}
}
this
.
$value
.
css
(
'
display
'
,
''
);
this
.
$value
.
css
(
'
display
'
,
''
);
this
.
$valueContent
.
html
(
`<span class='
${
displayedDateStyle
}
'>
${
this
.
displayedDate
}
</span>`
);
this
.
$valueContent
.
html
(
`<span class='
${
displayedDateStyle
}
'>
${
this
.
displayedDate
}
</span>`
);
this
.
$sidebarValue
.
html
(
this
.
displayedDate
);
this
.
$sidebarValue
.
html
(
this
.
displayedDate
);
return
selectedDateValue
.
length
?
$
(
'
.js-remove-due-date-holder
'
).
toggleClass
(
'
hidden
'
,
selectedDateValue
.
length
);
$
(
'
.js-remove-due-date-holder
'
).
removeClass
(
'
hidden
'
)
:
$
(
'
.js-remove-due-date-holder
'
).
addClass
(
'
hidden
'
);
return
axios
.
put
(
this
.
issueUpdateURL
,
this
.
datePayload
)
},
.
then
(()
=>
{
}).
done
(()
=>
{
if
(
isDropdown
)
{
if
(
isDropdown
)
{
this
.
$dropdown
.
trigger
(
'
loaded.gl.dropdown
'
);
this
.
$dropdown
.
trigger
(
'
loaded.gl.dropdown
'
);
this
.
$dropdown
.
dropdown
(
'
toggle
'
);
this
.
$dropdown
.
dropdown
(
'
toggle
'
);
}
}
return
this
.
$loading
.
fadeOut
();
return
this
.
$loading
.
fadeOut
();
});
});
}
}
}
}
...
...
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