Skip to content
Snippets Groups Projects
Commit 571de11e authored by Mike Greiling's avatar Mike Greiling
Browse files

refactor Todos class to ES module syntax

parent 4ad4efb8
No related branches found
No related tags found
No related merge requests found
Loading
@@ -51,6 +51,7 @@ import UsersSelect from './users_select';
Loading
@@ -51,6 +51,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 Todos from './todos';
import TreeView from './tree'; import TreeView from './tree';
import UsagePing from './usage_ping'; import UsagePing from './usage_ping';
import UsernameValidator from './username_validator'; import UsernameValidator from './username_validator';
Loading
@@ -166,7 +167,7 @@ import OAuthRememberMe from './oauth_remember_me';
Loading
@@ -166,7 +167,7 @@ import OAuthRememberMe from './oauth_remember_me';
new UsersSelect(); new UsersSelect();
break; break;
case 'dashboard:todos:index': case 'dashboard:todos:index':
new gl.Todos(); new Todos();
break; break;
case 'dashboard:projects:index': case 'dashboard:projects:index':
case 'dashboard:projects:starred': case 'dashboard:projects:starred':
Loading
Loading
Loading
@@ -152,7 +152,6 @@ import './subscription';
Loading
@@ -152,7 +152,6 @@ import './subscription';
import './subscription_select'; import './subscription_select';
import './syntax_highlight'; import './syntax_highlight';
import './task_list'; import './task_list';
import './todos';
import './user'; import './user';
   
// eslint-disable-next-line global-require, import/no-commonjs // eslint-disable-next-line global-require, import/no-commonjs
Loading
Loading
Loading
@@ -2,7 +2,7 @@
Loading
@@ -2,7 +2,7 @@
   
import UsersSelect from './users_select'; import UsersSelect from './users_select';
   
class Todos { export default class Todos {
constructor() { constructor() {
this.initFilters(); this.initFilters();
this.bindEvents(); this.bindEvents();
Loading
@@ -159,6 +159,3 @@ class Todos {
Loading
@@ -159,6 +159,3 @@ class Todos {
} }
} }
} }
window.gl = window.gl || {};
gl.Todos = Todos;
import '~/todos'; import Todos from '~/todos';
import '~/lib/utils/common_utils'; import '~/lib/utils/common_utils';
   
describe('Todos', () => { describe('Todos', () => {
Loading
@@ -9,7 +9,7 @@ describe('Todos', () => {
Loading
@@ -9,7 +9,7 @@ describe('Todos', () => {
loadFixtures('todos/todos.html.raw'); loadFixtures('todos/todos.html.raw');
todoItem = document.querySelector('.todos-list .todo'); todoItem = document.querySelector('.todos-list .todo');
   
return new gl.Todos(); return new Todos();
}); });
   
describe('goToTodoUrl', () => { describe('goToTodoUrl', () => {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment