Commit 49d16fd2 authored by Coung Ngo's avatar Coung Ngo Committed by Jacques Erasmus

Move labels code to ~/labels

parent f8382631
...@@ -4,7 +4,7 @@ import $ from 'jquery'; ...@@ -4,7 +4,7 @@ import $ from 'jquery';
import { property } from 'lodash'; import { property } from 'lodash';
import issueableEventHub from '~/issues_list/eventhub'; import issueableEventHub from '~/issues_list/eventhub';
import LabelsSelect from '~/labels_select'; import LabelsSelect from '~/labels/labels_select';
import MilestoneSelect from '~/milestones/milestone_select'; import MilestoneSelect from '~/milestones/milestone_select';
import initIssueStatusSelect from './init_issue_status_select'; import initIssueStatusSelect from './init_issue_status_select';
import IssuableBulkUpdateActions from './issuable_bulk_update_actions'; import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
......
/* eslint-disable func-names */ /* eslint-disable func-names */
import $ from 'jquery'; import $ from 'jquery';
import Api from './api'; import Api from '~/api';
import { humanize } from './lib/utils/text_utility'; import { humanize } from '~/lib/utils/text_utility';
export default class CreateLabelDropdown { export default class CreateLabelDropdown {
constructor($el, namespacePath, projectPath) { constructor($el, namespacePath, projectPath) {
......
import $ from 'jquery'; import $ from 'jquery';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { fixTitle, hide } from '~/tooltips'; import { fixTitle, hide } from '~/tooltips';
import createFlash from './flash'; import createFlash from '~/flash';
import axios from './lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
const tooltipTitles = { const tooltipTitles = {
group: __('Unsubscribe at group level'), group: __('Unsubscribe at group level'),
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
import $ from 'jquery'; import $ from 'jquery';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
import { dispose } from '~/tooltips'; import { dispose } from '~/tooltips';
import createFlash from './flash'; import createFlash from '~/flash';
import axios from './lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { __ } from './locale'; import { __ } from '~/locale';
export default class LabelManager { export default class LabelManager {
constructor({ togglePriorityButton, prioritizedLabels, otherLabels } = {}) { constructor({ togglePriorityButton, prioritizedLabels, otherLabels } = {}) {
......
...@@ -6,10 +6,10 @@ import { difference, isEqual, escape, sortBy, template, union } from 'lodash'; ...@@ -6,10 +6,10 @@ import { difference, isEqual, escape, sortBy, template, union } from 'lodash';
import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown';
import IssuableBulkUpdateActions from '~/issuable_bulk_update_sidebar/issuable_bulk_update_actions'; import IssuableBulkUpdateActions from '~/issuable_bulk_update_sidebar/issuable_bulk_update_actions';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { sprintf, __ } from '~/locale';
import CreateLabelDropdown from './create_label'; import CreateLabelDropdown from './create_label';
import createFlash from './flash';
import axios from './lib/utils/axios_utils';
import { sprintf, __ } from './locale';
export default class LabelsSelect { export default class LabelsSelect {
constructor(els, options = {}) { constructor(els, options = {}) {
......
import $ from 'jquery'; import $ from 'jquery';
import { fixTitle } from '~/tooltips'; import { fixTitle } from '~/tooltips';
import createFlash from './flash'; import createFlash from '~/flash';
import axios from './lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { __ } from './locale'; import { __ } from '~/locale';
const tooltipTitles = { const tooltipTitles = {
group: { group: {
......
import Labels from '../../../../labels'; import Labels from '~/labels/labels';
new Labels(); // eslint-disable-line no-new new Labels(); // eslint-disable-line no-new
import Labels from '../../../../labels'; import Labels from '~/labels/labels';
new Labels(); // eslint-disable-line no-new new Labels(); // eslint-disable-line no-new
import Labels from 'ee_else_ce/labels'; import Labels from 'ee_else_ce/labels/labels';
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Labels(); new Labels();
import initDeleteLabelModal from '~/delete_label_modal'; import initDeleteLabelModal from '~/labels/delete_label_modal';
import initLabels from '~/init_labels'; import initLabels from '~/labels/init_labels';
initLabels(); initLabels();
initDeleteLabelModal(); initDeleteLabelModal();
import Labels from 'ee_else_ce/labels'; import Labels from 'ee_else_ce/labels/labels';
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Labels(); new Labels();
...@@ -6,7 +6,7 @@ import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; ...@@ -6,7 +6,7 @@ import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import GLForm from '~/gl_form'; import GLForm from '~/gl_form';
import initSuggestions from '~/issues/suggestions'; import initSuggestions from '~/issues/suggestions';
import initIssuableTypeSelector from '~/issues/type_selector'; import initIssuableTypeSelector from '~/issues/type_selector';
import LabelsSelect from '~/labels_select'; import LabelsSelect from '~/labels/labels_select';
import MilestoneSelect from '~/milestones/milestone_select'; import MilestoneSelect from '~/milestones/milestone_select';
import IssuableTemplateSelectors from '~/templates/issuable_template_selectors'; import IssuableTemplateSelectors from '~/templates/issuable_template_selectors';
......
import Labels from 'ee_else_ce/labels'; import Labels from 'ee_else_ce/labels/labels';
new Labels(); // eslint-disable-line no-new new Labels(); // eslint-disable-line no-new
import Vue from 'vue'; import Vue from 'vue';
import initDeleteLabelModal from '~/delete_label_modal'; import initDeleteLabelModal from '~/labels/delete_label_modal';
import initLabels from '~/init_labels'; import initLabels from '~/labels/init_labels';
import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
import PromoteLabelModal from '../components/promote_label_modal.vue'; import PromoteLabelModal from '../components/promote_label_modal.vue';
......
import Labels from 'ee_else_ce/labels'; import Labels from 'ee_else_ce/labels/labels';
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Labels(); new Labels();
...@@ -5,7 +5,7 @@ import IssuableForm from 'ee_else_ce/issuable_form'; ...@@ -5,7 +5,7 @@ import IssuableForm from 'ee_else_ce/issuable_form';
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import Diff from '~/diff'; import Diff from '~/diff';
import GLForm from '~/gl_form'; import GLForm from '~/gl_form';
import LabelsSelect from '~/labels_select'; import LabelsSelect from '~/labels/labels_select';
import MilestoneSelect from '~/milestones/milestone_select'; import MilestoneSelect from '~/milestones/milestone_select';
import IssuableTemplateSelectors from '~/templates/issuable_template_selectors'; import IssuableTemplateSelectors from '~/templates/issuable_template_selectors';
......
import $ from 'jquery'; import $ from 'jquery';
import Labels from '~/labels'; import Labels from '~/labels/labels';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
class LabelsEE extends Labels { class LabelsEE extends Labels {
......
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import initDeleteLabelModal from '~/delete_label_modal'; import initDeleteLabelModal from '~/labels/delete_label_modal';
describe('DeleteLabelModal', () => { describe('DeleteLabelModal', () => {
const buttons = [ const buttons = [
......
import $ from 'jquery'; import $ from 'jquery';
import LabelsSelect from '~/labels_select'; import LabelsSelect from '~/labels/labels_select';
const mockUrl = '/foo/bar/url'; const mockUrl = '/foo/bar/url';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment