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
f0ee82f0
Commit
f0ee82f0
authored
Aug 11, 2017
by
Jacob Schatz
Committed by
Eric Eastwood
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dropdown to visit. Make use of new perm checks
Conflicts: app/assets/javascripts/repo/stores/repo_store.js
parent
25c2dd97
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
21 deletions
+7
-21
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+0
-1
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+2
-0
app/assets/javascripts/repo/services/repo_service.js
app/assets/javascripts/repo/services/repo_service.js
+0
-8
app/assets/javascripts/repo/stores/repo_store.js
app/assets/javascripts/repo/stores/repo_store.js
+3
-10
app/views/shared/_ref_switcher.html.haml
app/views/shared/_ref_switcher.html.haml
+1
-1
app/views/shared/_target_switcher.html.haml
app/views/shared/_target_switcher.html.haml
+1
-1
No files found.
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
f0ee82f0
...
@@ -289,7 +289,6 @@ const RepoHelper = {
...
@@ -289,7 +289,6 @@ const RepoHelper = {
},
},
loadingError
(
e
)
{
loadingError
(
e
)
{
console
.
log
(
e
);
Flash
(
'
Unable to load this content at this time.
'
);
Flash
(
'
Unable to load this content at this time.
'
);
},
},
};
};
...
...
app/assets/javascripts/repo/index.js
View file @
f0ee82f0
...
@@ -34,6 +34,8 @@ function setInitialStore(data) {
...
@@ -34,6 +34,8 @@ function setInitialStore(data) {
Store
.
projectId
=
data
.
projectId
;
Store
.
projectId
=
data
.
projectId
;
Store
.
projectName
=
data
.
projectName
;
Store
.
projectName
=
data
.
projectName
;
Store
.
projectUrl
=
data
.
projectUrl
;
Store
.
projectUrl
=
data
.
projectUrl
;
Store
.
canCommit
=
data
.
canCommit
;
Store
.
onTopOfBranch
=
data
.
onTopOfBranch
;
Store
.
currentBranch
=
$
(
'
button.dropdown-menu-toggle
'
).
attr
(
'
data-ref
'
);
Store
.
currentBranch
=
$
(
'
button.dropdown-menu-toggle
'
).
attr
(
'
data-ref
'
);
Store
.
checkIsCommitable
();
Store
.
checkIsCommitable
();
}
}
...
...
app/assets/javascripts/repo/services/repo_service.js
View file @
f0ee82f0
...
@@ -12,14 +12,6 @@ const RepoService = {
...
@@ -12,14 +12,6 @@ const RepoService = {
},
},
richExtensionRegExp
:
/md/
,
richExtensionRegExp
:
/md/
,
checkCurrentBranchIsCommitable
()
{
const
url
=
Store
.
service
.
refsUrl
;
return
axios
.
get
(
url
,
{
params
:
{
ref
:
Store
.
currentBranch
,
search
:
Store
.
currentBranch
,
}
});
},
getRaw
(
url
)
{
getRaw
(
url
)
{
return
axios
.
get
(
url
,
{
return
axios
.
get
(
url
,
{
transformResponse
:
[
res
=>
res
],
transformResponse
:
[
res
=>
res
],
...
...
app/assets/javascripts/repo/stores/repo_store.js
View file @
f0ee82f0
...
@@ -7,8 +7,8 @@ const RepoStore = {
...
@@ -7,8 +7,8 @@ const RepoStore = {
monaco
:
{},
monaco
:
{},
monacoLoading
:
false
,
monacoLoading
:
false
,
service
:
''
,
service
:
''
,
editor
:
''
,
canCommit
:
false
,
sidebar
:
''
,
onTopOfBranch
:
false
,
editMode
:
false
,
editMode
:
false
,
isTree
:
false
,
isTree
:
false
,
isRoot
:
false
,
isRoot
:
false
,
...
@@ -67,14 +67,7 @@ const RepoStore = {
...
@@ -67,14 +67,7 @@ const RepoStore = {
// mutations
// mutations
checkIsCommitable
()
{
checkIsCommitable
()
{
RepoStore
.
service
.
checkCurrentBranchIsCommitable
()
RepoStore
.
isCommitable
=
RepoStore
.
onTopOfBranch
&&
RepoStore
.
canCommit
;
.
then
((
data
)
=>
{
// you shouldn't be able to make commits on commits or tags.
const
{
Branches
,
Commits
,
Tags
}
=
data
.
data
;
if
(
Branches
&&
Branches
.
length
)
RepoStore
.
isCommitable
=
true
;
if
(
Commits
&&
Commits
.
length
)
RepoStore
.
isCommitable
=
false
;
if
(
Tags
&&
Tags
.
length
)
RepoStore
.
isCommitable
=
false
;
}).
catch
(()
=>
Flash
(
'
Failed to check if branch can be committed to.
'
));
},
},
addFilesToDirectory
(
inDirectory
,
currentList
,
newList
)
{
addFilesToDirectory
(
inDirectory
,
currentList
,
newList
)
{
...
...
app/views/shared/_ref_switcher.html.haml
View file @
f0ee82f0
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
-
@options
&&
@options
.
each
do
|
key
,
value
|
-
@options
&&
@options
.
each
do
|
key
,
value
|
=
hidden_field_tag
key
,
value
,
id:
nil
=
hidden_field_tag
key
,
value
,
id:
nil
.dropdown
.dropdown
=
dropdown_toggle
dropdown_toggle_text
,
{
toggle:
"dropdown"
,
selected:
dropdown_toggle_text
,
ref:
@ref
,
refs_url:
refs_project_path
(
@project
),
field_name:
'ref'
,
submit_form_on_click:
true
},
{
toggle_class:
"js-project-refs-dropdown"
}
=
dropdown_toggle
dropdown_toggle_text
,
{
toggle:
"dropdown"
,
selected:
dropdown_toggle_text
,
ref:
@ref
,
refs_url:
refs_project_path
(
@project
),
field_name:
'ref'
,
submit_form_on_click:
true
,
visit:
true
},
{
toggle_class:
"js-project-refs-dropdown"
}
.dropdown-menu.dropdown-menu-selectable.git-revision-dropdown
{
class:
(
"dropdown-menu-align-right"
if
local_assigns
[
:align_right
])
}
.dropdown-menu.dropdown-menu-selectable.git-revision-dropdown
{
class:
(
"dropdown-menu-align-right"
if
local_assigns
[
:align_right
])
}
=
dropdown_title
_
(
"Switch branch/tag"
)
=
dropdown_title
_
(
"Switch branch/tag"
)
=
dropdown_filter
_
(
"Search branches and tags"
)
=
dropdown_filter
_
(
"Search branches and tags"
)
...
...
app/views/shared/_target_switcher.html.haml
View file @
f0ee82f0
-
dropdown_toggle_text
=
@ref
||
@project
.
default_branch
-
dropdown_toggle_text
=
@ref
||
@project
.
default_branch
=
form_tag
nil
,
method: :get
,
class:
"project-refs-target-form"
do
=
form_tag
nil
,
method: :get
,
style:
{
display:
'none'
},
class:
"project-refs-target-form"
do
=
hidden_field_tag
:destination
,
destination
=
hidden_field_tag
:destination
,
destination
-
if
defined?
(
path
)
-
if
defined?
(
path
)
=
hidden_field_tag
:path
,
path
=
hidden_field_tag
:path
,
path
...
...
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