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
80b39e38
Commit
80b39e38
authored
Aug 03, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed EE specific inline JS
parent
aef62b69
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
109 additions
and
66 deletions
+109
-66
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+37
-3
app/assets/javascripts/init_geo_info_modal.js
app/assets/javascripts/init_geo_info_modal.js
+26
-0
app/assets/javascripts/init_group_analytics.js
app/assets/javascripts/init_group_analytics.js
+34
-0
app/views/admin/licenses/new.html.haml
app/views/admin/licenses/new.html.haml
+0
-18
app/views/groups/analytics/show.html.haml
app/views/groups/analytics/show.html.haml
+7
-21
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+5
-5
app/views/projects/ee/_merge_request_settings.html.haml
app/views/projects/ee/_merge_request_settings.html.haml
+0
-3
app/views/shared/_geo_info_modal.html.haml
app/views/shared/_geo_info_modal.html.haml
+0
-16
No files found.
app/assets/javascripts/dispatcher.js
View file @
80b39e38
...
...
@@ -82,6 +82,8 @@ import initIssuableSidebar from './init_issuable_sidebar';
// EE-only
import
ApproversSelect
from
'
./approvers_select
'
;
import
AuditLogs
from
'
./audit_logs
'
;
import
initGeoInfoModal
from
'
./init_geo_info_modal
'
;
import
initGroupAnalytics
from
'
./init_group_analytics
'
;
(
function
()
{
var
Dispatcher
;
...
...
@@ -119,6 +121,19 @@ import AuditLogs from './audit_logs';
});
});
function
initBlobEE
()
{
const
dataEl
=
document
.
getElementById
(
'
js-file-lock
'
);
if
(
dataEl
)
{
const
{
toggle_path
,
path
,
}
=
JSON
.
parse
(
dataEl
.
innerHTML
);
PathLocks
.
init
(
toggle_path
,
path
);
}
}
function
initBlob
()
{
new
LineHighlighter
();
...
...
@@ -144,6 +159,8 @@ import AuditLogs from './audit_logs';
actionTextPieces
:
document
.
querySelectorAll
(
'
.js-file-fork-suggestion-section-action
'
),
})
.
init
();
initBlobEE
();
}
const
filteredSearchEnabled
=
gl
.
FilteredSearchManager
&&
document
.
querySelector
(
'
.filtered-search
'
);
...
...
@@ -347,9 +364,6 @@ import AuditLogs from './audit_logs';
shortcut_handler
=
new
ShortcutsNavigation
();
GpgBadges
.
fetch
();
break
;
case
'
projects:edit
'
:
new
UsersSelect
();
break
;
case
'
projects:imports:show
'
:
new
ProjectImport
();
break
;
...
...
@@ -362,8 +376,11 @@ import AuditLogs from './audit_logs';
if
(
$
(
'
.blob-viewer
'
).
length
)
{
new
BlobViewer
();
}
initGeoInfoModal
();
break
;
case
'
projects:edit
'
:
new
UsersSelect
();
new
GroupsSelect
();
setupProjectEdit
();
break
;
case
'
projects:pipelines:new
'
:
...
...
@@ -536,6 +553,23 @@ import AuditLogs from './audit_logs';
case
'
admin:impersonation_tokens:index
'
:
new
gl
.
DueDateSelectors
();
break
;
case
'
admin:licenses:new
'
:
const
$licenseFile
=
$
(
'
.license-file
'
);
const
$licenseKey
=
$
(
'
.license-key
'
);
const
showLicenseType
=
()
=>
{
const
$checkedFile
=
$
(
'
input[name="license_type"]:checked
'
).
val
()
===
'
file
'
;
$licenseFile
.
toggle
(
$checkedFile
);
$licenseKey
.
toggle
(
!
$checkedFile
);
};
$
(
'
input[name="license_type"]
'
).
on
(
'
change
'
,
showLicenseType
);
showLicenseType
();
break
;
case
'
groups:analytics:show
'
:
initGroupAnalytics
();
break
;
}
switch
(
path
.
first
())
{
case
'
sessions
'
:
...
...
app/assets/javascripts/init_geo_info_modal.js
0 → 100644
View file @
80b39e38
export
default
()
=>
{
const
$modal
=
$
(
'
#modal-geo-info
'
);
if
(
!
$modal
.
length
)
return
;
$modal
.
appendTo
(
'
body
'
)
.
modal
({
modal
:
true
,
show
:
false
,
})
.
on
(
'
show.bs.modal
'
,
(
e
)
=>
{
const
{
cloneUrlPrimary
,
cloneUrlSecondary
,
}
=
$
(
e
.
currentTarget
).
data
();
$
(
'
#geo-info-1
'
).
text
(
`git clone
${(
cloneUrlSecondary
||
'
<clone url for secondary repository>
'
)}
`
,
);
$
(
'
#geo-info-2
'
).
text
(
`git remote set-url --push origin
${(
cloneUrlPrimary
||
'
<clone url for primary repository>
'
)}
`
,
);
});
};
app/assets/javascripts/init_group_analytics.js
0 → 100644
View file @
80b39e38
/* global Chart */
export
default
()
=>
{
const
dataEl
=
document
.
getElementById
(
'
js-analytics-data
'
);
const
data
=
JSON
.
parse
(
dataEl
.
innerHTML
);
const
labels
=
data
.
labels
;
const
outputElIds
=
[
'
push
'
,
'
issues_closed
'
,
'
merge_requests_created
'
];
outputElIds
.
forEach
((
id
)
=>
{
const
el
=
document
.
getElementById
(
id
);
const
ctx
=
el
.
getContext
(
'
2d
'
);
const
chart
=
new
Chart
(
ctx
);
chart
.
Bar
(
{
labels
,
datasets
:
[{
fillColor
:
'
rgba(220,220,220,0.5)
'
,
strokeColor
:
'
rgba(220,220,220,1)
'
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
data
[
id
].
data
,
}],
},
{
scaleOverlay
:
true
,
responsive
:
true
,
maintainAspectRatio
:
false
,
},
);
});
$
(
'
#event-stats
'
).
tablesorter
();
};
app/views/admin/licenses/new.html.haml
View file @
80b39e38
...
...
@@ -38,21 +38,3 @@
.form-actions
=
f
.
submit
'Upload license'
,
class:
'btn btn-primary'
:javascript
function
showLicenseType
()
{
if
(
$
(
"
input[name='license_type']:checked
"
).
val
()
==
"
file
"
)
{
$
(
"
.license-file
"
).
show
();
$
(
"
.license-key
"
).
hide
();
}
else
{
$
(
"
.license-file
"
).
hide
();
$
(
"
.license-key
"
).
show
();
}
}
$
(
"
input[name='license_type']
"
).
click
(
showLicenseType
);
showLicenseType
();
app/views/groups/analytics/show.html.haml
View file @
80b39e38
...
...
@@ -121,24 +121,10 @@
%td
=
@stats
[
:total_events
][
index
]
-
[
:push
,
:issues_closed
,
:merge_requests_created
].
each
do
|
scope
|
:javascript
var
data
=
{
labels
:
#{
@users
.
map
(
&
:name
).
to_json
}
,
datasets
:
[
{
fillColor
:
"
rgba(220,220,220,0.5)
"
,
strokeColor
:
"
rgba(220,220,220,1)
"
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
#{
@stats
[
scope
].
to_json
}
}
]
}
var
ctx
=
$
(
"
##{scope}
"
).
get
(
0
).
getContext
(
"
2d
"
);
new
Chart
(
ctx
).
Bar
(
data
,{
"
scaleOverlay
"
:
true
,
responsive
:
true
,
maintainAspectRatio
:
false
});
:javascript
$
(
"
#event-stats
"
).
tablesorter
();
%script
#js-analytics-data
{
type:
"application/json"
}
-
data
=
{}
-
data
[
:labels
]
=
@users
.
map
(
&
:name
)
-
[
:push
,
:issues_closed
,
:merge_requests_created
].
each
do
|
scope
|
-
data
[
scope
]
=
{}
-
data
[
scope
][
:data
]
=
@stats
[
scope
]
=
data
.
to_json
.
html_safe
app/views/projects/blob/_header.html.haml
View file @
80b39e38
...
...
@@ -21,8 +21,8 @@
=
render
'projects/fork_suggestion'
-
if
@project
.
feature_available?
(
:file_locks
)
:javascript
PathLocks
.
init
(
'
#{
toggle_project_path_locks_path
(
@project
)
}
'
,
'
#{
@path
}
'
);
%script
#js-file-lock
{
type:
"application/json"
}
-
data
=
{}
-
data
[
:path
]
=
@path
-
data
[
:toggle_path
]
=
toggle_project_path_locks_path
(
@project
)
=
data
.
to_json
.
html_safe
app/views/projects/ee/_merge_request_settings.html.haml
View file @
80b39e38
...
...
@@ -49,6 +49,3 @@
Description parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
'user/markdown'
),
target:
'_blank'
}
.
=
render
'projects/ee/merge_request_approvals_settings'
,
project:
project
,
form:
form
:javascript
new
GroupsSelect
();
app/views/shared/_geo_info_modal.html.haml
View file @
80b39e38
...
...
@@ -27,19 +27,3 @@
%p
%strong
=
'Done.'
You can now commit and push code as you normally do, but with increased speed.
:javascript
$
(
'
#modal-geo-info
'
)
.
appendTo
(
'
body
'
)
.
modal
({
modal
:
true
,
show
:
false
})
.
on
(
'
show.bs.modal
'
,
function
()
{
var
data
=
$
(
this
).
data
();
$
(
'
#geo-info-1
'
).
text
(
'
git clone
'
+
(
data
.
cloneUrlSecondary
||
'
<clone url for secondary repository>
'
)
);
$
(
'
#geo-info-2
'
).
text
(
'
git remote set-url --push origin
'
+
(
data
.
cloneUrlPrimary
||
'
<clone url for primary repository>
'
)
);
});
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