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
d655d138
Commit
d655d138
authored
Nov 27, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass updateEndpoint from backend
parent
02884c87
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
15 deletions
+15
-15
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+5
-4
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-0
ee/app/assets/javascripts/epics/epic_show/components/epic_show_app.vue
.../javascripts/epics/epic_show/components/epic_show_app.vue
+5
-0
spec/javascripts/epics/epic_show/components/epic_show_app_spec.js
...ascripts/epics/epic_show/components/epic_show_app_spec.js
+2
-0
spec/javascripts/epics/epic_show/mock_data.js
spec/javascripts/epics/epic_show/mock_data.js
+1
-0
spec/javascripts/issue_show/components/app_spec.js
spec/javascripts/issue_show/components/app_spec.js
+1
-11
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
d655d138
...
...
@@ -16,6 +16,10 @@ export default {
required
:
true
,
type
:
String
,
},
updateEndpoint
:
{
required
:
true
,
type
:
String
,
},
canUpdate
:
{
required
:
true
,
type
:
Boolean
,
...
...
@@ -133,9 +137,6 @@ export default {
hasUpdated
()
{
return
!!
this
.
state
.
updatedAt
;
},
updateUrl
()
{
return
`
${
this
.
endpoint
}
.json`
;
},
},
components
:
{
descriptionComponent
,
...
...
@@ -260,7 +261,7 @@ export default {
:updated-at=
"state.updatedAt"
:task-status=
"state.taskStatus"
:issuable-type=
"issuableType"
:update-url=
"update
Url
"
:update-url=
"update
Endpoint
"
/>
<edited-component
v-if=
"hasUpdated"
...
...
app/helpers/issuables_helper.rb
View file @
d655d138
...
...
@@ -213,6 +213,7 @@ module IssuablesHelper
def
issuable_initial_data
(
issuable
)
data
=
{
endpoint:
issuable_path
(
issuable
),
updateEndpoint:
"
#{
issuable_path
(
issuable
)
}
.json"
,
canUpdate:
can?
(
current_user
,
:"update_
#{
issuable
.
to_ability_name
}
"
,
issuable
),
canDestroy:
can?
(
current_user
,
:"destroy_
#{
issuable
.
to_ability_name
}
"
,
issuable
),
canAdmin:
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
issuable
),
...
...
ee/app/assets/javascripts/epics/epic_show/components/epic_show_app.vue
View file @
d655d138
...
...
@@ -12,6 +12,10 @@
type
:
String
,
required
:
true
,
},
updateEndpoint
:
{
type
:
String
,
required
:
true
,
},
canUpdate
:
{
required
:
true
,
type
:
Boolean
,
...
...
@@ -111,6 +115,7 @@
:can-update=
"canUpdate"
:can-destroy=
"canDestroy"
:endpoint=
"endpoint"
:update-endpoint=
"updateEndpoint"
:issuable-ref=
"issuableRef"
issuable-type=
"epic"
:initial-title-html=
"initialTitleHtml"
...
...
spec/javascripts/epics/epic_show/components/epic_show_app_spec.js
View file @
d655d138
...
...
@@ -34,6 +34,7 @@ describe('EpicShowApp', () => {
canUpdate
,
canDestroy
,
endpoint
,
updateEndpoint
,
initialTitleHtml
,
initialTitleText
,
startDate
,
...
...
@@ -59,6 +60,7 @@ describe('EpicShowApp', () => {
canUpdate
,
canDestroy
,
endpoint
,
updateEndpoint
,
issuableRef
:
''
,
initialTitleHtml
,
initialTitleText
,
...
...
spec/javascripts/epics/epic_show/mock_data.js
View file @
d655d138
export
const
contentProps
=
{
endpoint
:
''
,
updateEndpoint
:
gl
.
TEST_HOST
,
canAdmin
:
true
,
canUpdate
:
true
,
canDestroy
:
true
,
...
...
spec/javascripts/issue_show/components/app_spec.js
View file @
d655d138
...
...
@@ -35,6 +35,7 @@ describe('Issuable output', () => {
canUpdate
:
true
,
canDestroy
:
true
,
endpoint
:
'
/gitlab-org/gitlab-shell/issues/9/realtime_changes
'
,
updateEndpoint
:
gl
.
TEST_HOST
,
issuableRef
:
'
#1
'
,
initialTitleHtml
:
''
,
initialTitleText
:
''
,
...
...
@@ -366,15 +367,4 @@ describe('Issuable output', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.title-container .note-action-button
'
)).
toBeDefined
();
});
});
describe
(
'
update url
'
,
()
=>
{
it
(
'
sets update url in description textarea
'
,
(
done
)
=>
{
vm
.
showForm
=
true
;
vm
.
canUpdate
=
false
;
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-task-list-field
'
).
dataset
.
updateUrl
).
toEqual
(
`
${
vm
.
endpoint
}
.json`
);
done
();
});
});
});
});
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