refactor UsagePing class to ES module syntax
This commit is contained in:
parent
d30e66c9a8
commit
12efe4946f
|
@ -52,6 +52,7 @@ import UsersSelect from './users_select';
|
||||||
import RefSelectDropdown from './ref_select_dropdown';
|
import RefSelectDropdown from './ref_select_dropdown';
|
||||||
import GfmAutoComplete from './gfm_auto_complete';
|
import GfmAutoComplete from './gfm_auto_complete';
|
||||||
import ShortcutsBlob from './shortcuts_blob';
|
import ShortcutsBlob from './shortcuts_blob';
|
||||||
|
import UsagePing from './usage_ping';
|
||||||
import UsernameValidator from './username_validator';
|
import UsernameValidator from './username_validator';
|
||||||
import VersionCheckImage from './version_check_image';
|
import VersionCheckImage from './version_check_image';
|
||||||
import Wikis from './wikis';
|
import Wikis from './wikis';
|
||||||
|
@ -433,7 +434,7 @@ import OAuthRememberMe from './oauth_remember_me';
|
||||||
new Admin();
|
new Admin();
|
||||||
switch (path[1]) {
|
switch (path[1]) {
|
||||||
case 'cohorts':
|
case 'cohorts':
|
||||||
new gl.UsagePing();
|
new UsagePing();
|
||||||
break;
|
break;
|
||||||
case 'groups':
|
case 'groups':
|
||||||
new UsersSelect();
|
new UsersSelect();
|
||||||
|
|
|
@ -154,7 +154,6 @@ import './syntax_highlight';
|
||||||
import './task_list';
|
import './task_list';
|
||||||
import './todos';
|
import './todos';
|
||||||
import './tree';
|
import './tree';
|
||||||
import './usage_ping';
|
|
||||||
import './user';
|
import './user';
|
||||||
|
|
||||||
// eslint-disable-next-line global-require, import/no-commonjs
|
// eslint-disable-next-line global-require, import/no-commonjs
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function UsagePing() {
|
export default function UsagePing() {
|
||||||
const usageDataUrl = $('.usage-data').data('endpoint');
|
const usageDataUrl = $('.usage-data').data('endpoint');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -10,6 +10,3 @@ function UsagePing() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.gl = window.gl || {};
|
|
||||||
window.gl.UsagePing = UsagePing;
|
|
||||||
|
|
Loading…
Reference in New Issue