Commit 1be54d9e authored by Coung Ngo's avatar Coung Ngo

Shorten JS `~/lib` import paths

Shorten paths for better readability
parent d204f91d
import Mousetrap from 'mousetrap';
import { visitUrl, constructWebIDEPath } from '~/lib/utils/url_utility';
import findAndFollowLink from '../../lib/utils/navigation_utility';
import findAndFollowLink from '~/lib/utils/navigation_utility';
import {
keysFor,
GO_TO_PROJECT_OVERVIEW,
......
import Mousetrap from 'mousetrap';
import findAndFollowLink from '../../lib/utils/navigation_utility';
import findAndFollowLink from '~/lib/utils/navigation_utility';
import { keysFor, EDIT_WIKI_PAGE } from './keybindings';
import ShortcutsNavigation from './shortcuts_navigation';
......
......@@ -11,9 +11,9 @@ import {
} from '~/performance/constants';
import { performanceMarkAndMeasure } from '~/performance/utils';
import { fixTitle } from '~/tooltips';
import axios from '../../lib/utils/axios_utils';
import { handleLocationHash } from '../../lib/utils/common_utils';
import eventHub from '../../notes/event_hub';
import axios from '~/lib/utils/axios_utils';
import { handleLocationHash } from '~/lib/utils/common_utils';
import eventHub from '~/notes/event_hub';
const loadRichBlobViewer = (type) => {
switch (type) {
......
......@@ -18,7 +18,7 @@ import Tracking from '~/tracking';
import { formatDate } from '~/lib/utils/datetime_utility';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import listQuery from 'ee_else_ce/boards/graphql/board_lists_deferred.query.graphql';
import AccessorUtilities from '../../lib/utils/accessor';
import AccessorUtilities from '~/lib/utils/accessor';
import { inactiveId, LIST, ListType, toggleFormEventPrefix } from '../constants';
import eventHub from '../eventhub';
import ItemCount from './item_count.vue';
......
import { parseBoolean } from '../../../lib/utils/common_utils';
import { parseBoolean } from '~/lib/utils/common_utils';
export default (initialState = {}) => {
return {
......
import axios from '../../lib/utils/axios_utils';
import axios from '~/lib/utils/axios_utils';
export default class ClusterService {
constructor(options = {}) {
......
import { parseBoolean } from '../../lib/utils/common_utils';
import { parseBoolean } from '~/lib/utils/common_utils';
export default class ClusterStore {
constructor() {
......
......@@ -2,7 +2,7 @@
import { GlTooltipDirective, GlIcon, GlLink, GlButtonGroup, GlButton, GlSprintf } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex';
import { __ } from '~/locale';
import { setUrlParams } from '../../lib/utils/url_utility';
import { setUrlParams } from '~/lib/utils/url_utility';
import { EVT_EXPAND_ALL_FILES } from '../constants';
import eventHub from '../event_hub';
import CompareDropdownLayout from './compare_dropdown_layout.vue';
......
import AccessorUtilities from '../../lib/utils/accessor';
import AccessorUtilities from '~/lib/utils/accessor';
const GL_EMOJI_VERSION = '0.2.0';
......
......@@ -4,7 +4,7 @@
* Components need to have `scope`, `page` and `requestData`
*/
import { validateParams } from '~/pipelines/utils';
import { historyPushState, buildUrlWithCurrentLocation } from '../../lib/utils/common_utils';
import { historyPushState, buildUrlWithCurrentLocation } from '~/lib/utils/common_utils';
export default {
methods: {
......
import AccessorUtilities from '../../lib/utils/accessor';
import AccessorUtilities from '~/lib/utils/accessor';
import RecentSearchesServiceError from './recent_searches_service_error';
class RecentSearchesService {
......
<script>
import PaginationLinks from '~/vue_shared/components/pagination_links.vue';
import { getParameterByName } from '../../lib/utils/url_utility';
import { getParameterByName } from '~/lib/utils/url_utility';
import eventHub from '../event_hub';
export default {
......
import { parseBoolean } from '../../lib/utils/common_utils';
import { parseBoolean } from '~/lib/utils/common_utils';
/**
* Adds the line number property
......
<script>
import { GlDropdown, GlDropdownItem, GlDropdownDivider } from '@gitlab/ui';
import { mapGetters, mapActions } from 'vuex';
import { getLocationHash, doesHashExistInUrl } from '../../lib/utils/url_utility';
import { getLocationHash, doesHashExistInUrl } from '~/lib/utils/url_utility';
import {
DISCUSSION_FILTERS_DEFAULT_VALUE,
HISTORY_ONLY_FILTER_VALUE,
......
......@@ -9,7 +9,7 @@ import { __, sprintf } from '~/locale';
import eventHub from '~/sidebar/event_hub';
import UserAccessRoleBadge from '~/vue_shared/components/user_access_role_badge.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { splitCamelCase } from '../../lib/utils/text_utility';
import { splitCamelCase } from '~/lib/utils/text_utility';
import ReplyButton from './note_actions/reply_button.vue';
export default {
......
......@@ -6,12 +6,12 @@ import { __ } from '~/locale';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import OrderedLayout from '~/vue_shared/components/ordered_layout.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import draftNote from '../../batch_comments/components/draft_note.vue';
import { getLocationHash, doesHashExistInUrl } from '../../lib/utils/url_utility';
import placeholderNote from '../../vue_shared/components/notes/placeholder_note.vue';
import placeholderSystemNote from '../../vue_shared/components/notes/placeholder_system_note.vue';
import skeletonLoadingContainer from '../../vue_shared/components/notes/skeleton_note.vue';
import systemNote from '../../vue_shared/components/notes/system_note.vue';
import draftNote from '~/batch_comments/components/draft_note.vue';
import { getLocationHash, doesHashExistInUrl } from '~/lib/utils/url_utility';
import placeholderNote from '~/vue_shared/components/notes/placeholder_note.vue';
import placeholderSystemNote from '~/vue_shared/components/notes/placeholder_system_note.vue';
import skeletonLoadingContainer from '~/vue_shared/components/notes/skeleton_note.vue';
import systemNote from '~/vue_shared/components/notes/system_note.vue';
import * as constants from '../constants';
import eventHub from '../event_hub';
import commentForm from './comment_form.vue';
......
import $ from 'jquery';
import { s__ } from '~/locale';
import Autosave from '../../autosave';
import { capitalizeFirstCharacter } from '../../lib/utils/text_utility';
import Autosave from '~/autosave';
import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';
export default {
methods: {
......
import { mapGetters, mapActions, mapState } from 'vuex';
import { scrollToElementWithContext, scrollToElement } from '~/lib/utils/common_utils';
import { updateHistory } from '../../lib/utils/url_utility';
import { updateHistory } from '~/lib/utils/url_utility';
import eventHub from '../event_hub';
/**
......
......@@ -9,14 +9,14 @@ import { __, sprintf } from '~/locale';
import { confidentialWidget } from '~/sidebar/components/confidential/sidebar_confidentiality_widget.vue';
import updateIssueLockMutation from '~/sidebar/components/lock/mutations/update_issue_lock.mutation.graphql';
import updateMergeRequestLockMutation from '~/sidebar/components/lock/mutations/update_merge_request_lock.mutation.graphql';
import loadAwardsHandler from '../../awards_handler';
import { isInViewport, scrollToElement, isInMRPage } from '../../lib/utils/common_utils';
import Poll from '../../lib/utils/poll';
import { create } from '../../lib/utils/recurrence';
import { mergeUrlParams } from '../../lib/utils/url_utility';
import sidebarTimeTrackingEventHub from '../../sidebar/event_hub';
import TaskList from '../../task_list';
import mrWidgetEventHub from '../../vue_merge_request_widget/event_hub';
import loadAwardsHandler from '~/awards_handler';
import { isInViewport, scrollToElement, isInMRPage } from '~/lib/utils/common_utils';
import Poll from '~/lib/utils/poll';
import { create } from '~/lib/utils/recurrence';
import { mergeUrlParams } from '~/lib/utils/url_utility';
import sidebarTimeTrackingEventHub from '~/sidebar/event_hub';
import TaskList from '~/task_list';
import mrWidgetEventHub from '~/vue_merge_request_widget/event_hub';
import * as constants from '../constants';
import eventHub from '../event_hub';
import * as types from './mutation_types';
......
import { isEqual } from 'lodash';
import { isInMRPage } from '../../lib/utils/common_utils';
import { isInMRPage } from '~/lib/utils/common_utils';
import * as constants from '../constants';
import * as types from './mutation_types';
import * as utils from './utils';
......
import $ from 'jquery';
import { parseBoolean } from '~/lib/utils/common_utils';
import { truncate } from '../../../lib/utils/text_utility';
import { truncate } from '~/lib/utils/text_utility';
const MAX_MESSAGE_LENGTH = 500;
const MESSAGE_CELL_SELECTOR = '.abuse-reports .message';
......
import $ from 'jquery';
import { refreshCurrentPage } from '../../lib/utils/url_utility';
import { refreshCurrentPage } from '~/lib/utils/url_utility';
export default function adminInit() {
$('input#user_force_random_password').on('change', function randomPasswordClick() {
......
import { parseBoolean } from '~/lib/utils/common_utils';
import axios from '../../lib/utils/axios_utils';
import axios from '~/lib/utils/axios_utils';
export default class PerformanceBarService {
static interceptor = null;
......
import Api from '~/api';
import axios from '../../lib/utils/axios_utils';
import axios from '~/lib/utils/axios_utils';
import { validateParams } from '../utils';
export default class PipelinesService {
......
import { parseIntPagination, normalizeHeaders } from '../../lib/utils/common_utils';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
export default class PipelinesStore {
constructor() {
......
import Visibility from 'visibilityjs';
import axios from '../../../lib/utils/axios_utils';
import httpStatusCodes from '../../../lib/utils/http_status';
import Poll from '../../../lib/utils/poll';
import axios from '~/lib/utils/axios_utils';
import httpStatusCodes from '~/lib/utils/http_status';
import Poll from '~/lib/utils/poll';
import * as types from './mutation_types';
export const setPaths = ({ commit }, paths) => commit(types.SET_PATHS, paths);
......
import AccessorUtilities from '../../lib/utils/accessor';
import AccessorUtilities from '~/lib/utils/accessor';
import { MAX_FREQUENT_ITEMS, MAX_FREQUENCY, SIDEBAR_PARAMS } from './constants';
function extractKeys(object, keyList) {
......
......@@ -3,7 +3,7 @@ import { GlButton, GlSkeletonLoader } from '@gitlab/ui';
import createFlash from '~/flash';
import { __ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import simplePoll from '../../../lib/utils/simple_poll';
import simplePoll from '~/lib/utils/simple_poll';
import eventHub from '../../event_hub';
import mergeRequestQueryVariablesMixin from '../../mixins/merge_request_query_variables';
import rebaseQuery from '../../queries/states/rebase.query.graphql';
......
import { normalizeHeaders } from '~/lib/utils/common_utils';
import axios from '../../lib/utils/axios_utils';
import axios from '~/lib/utils/axios_utils';
export default class MRWidgetService {
constructor(endpoints) {
......
......@@ -31,7 +31,7 @@ import { __ } from '~/locale';
import initMRPopovers from '~/mr_popover/';
import noteHeader from '~/notes/components/note_header.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { spriteIcon } from '../../../lib/utils/common_utils';
import { spriteIcon } from '~/lib/utils/common_utils';
import TimelineEntryItem from './timeline_entry_item.vue';
const MAX_VISIBLE_COMMIT_LIST_COUNT = 3;
......
......@@ -2,7 +2,7 @@
import { GlTooltipDirective } from '@gitlab/ui';
import timeagoMixin from '../mixins/timeago';
import '../../lib/utils/datetime_utility';
import '~/lib/utils/datetime_utility';
/**
* Port of ruby helper time_ago_with_tooltip
......
import { formatDate, getTimeago } from '../../lib/utils/datetime_utility';
import { formatDate, getTimeago } from '~/lib/utils/datetime_utility';
/**
* Mixin with time ago methods used in some vue components
......
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