updated imports
This commit is contained in:
parent
a5d2732ce9
commit
6bb4442054
14 changed files with 29 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
||||||
import * as urlUtils from '../lib/utils/url_utility';
|
import { visitUrl } from '../lib/utils/url_utility';
|
||||||
import Flash from '../flash';
|
import Flash from '../flash';
|
||||||
import FilteredSearchContainer from './container';
|
import FilteredSearchContainer from './container';
|
||||||
import RecentSearchesRoot from './recent_searches_root';
|
import RecentSearchesRoot from './recent_searches_root';
|
||||||
|
@ -567,7 +567,7 @@ class FilteredSearchManager {
|
||||||
if (this.updateObject) {
|
if (this.updateObject) {
|
||||||
this.updateObject(parameterizedUrl);
|
this.updateObject(parameterizedUrl);
|
||||||
} else {
|
} else {
|
||||||
urlUtils.visitUrl(parameterizedUrl);
|
visitUrl(parameterizedUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/* global fuzzaldrinPlus */
|
/* global fuzzaldrinPlus */
|
||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
import fuzzaldrinPlus from 'fuzzaldrin-plus';
|
import fuzzaldrinPlus from 'fuzzaldrin-plus';
|
||||||
import * as urlUtils from './lib/utils/url_utility';
|
import { visitUrl } from './lib/utils/url_utility';
|
||||||
import { isObject } from './lib/utils/type_utility';
|
import { isObject } from './lib/utils/type_utility';
|
||||||
|
|
||||||
var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote, GitLabDropdownInput;
|
var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote, GitLabDropdownInput;
|
||||||
|
@ -853,7 +853,7 @@ GitLabDropdown = (function() {
|
||||||
if ($el.length) {
|
if ($el.length) {
|
||||||
var href = $el.attr('href');
|
var href = $el.attr('href');
|
||||||
if (href && href !== '#') {
|
if (href && href !== '#') {
|
||||||
urlUtils.visitUrl(href);
|
visitUrl(href);
|
||||||
} else {
|
} else {
|
||||||
$el.trigger('click');
|
$el.trigger('click');
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import eventHub from '../event_hub';
|
||||||
import { getParameterByName } from '../../lib/utils/common_utils';
|
import { getParameterByName } from '../../lib/utils/common_utils';
|
||||||
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
|
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
|
||||||
import { COMMON_STR } from '../constants';
|
import { COMMON_STR } from '../constants';
|
||||||
import * as utils from '../../lib/utils/url_utility';
|
import { mergeUrlParams } from '../../lib/utils/url_utility';
|
||||||
import groupsComponent from './groups.vue';
|
import groupsComponent from './groups.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -93,7 +93,7 @@ export default {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
$.scrollTo(0);
|
$.scrollTo(0);
|
||||||
|
|
||||||
const currentPath = utils.mergeUrlParams({ page }, window.location.href);
|
const currentPath = mergeUrlParams({ page }, window.location.href);
|
||||||
window.history.replaceState({
|
window.history.replaceState({
|
||||||
page: currentPath,
|
page: currentPath,
|
||||||
}, document.title, currentPath);
|
}, document.title, currentPath);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import * as urlUtils from '../../lib/utils/url_utility';
|
import { visitUrl } from '../../lib/utils/url_utility';
|
||||||
import tooltip from '../../vue_shared/directives/tooltip';
|
import tooltip from '../../vue_shared/directives/tooltip';
|
||||||
import identicon from '../../vue_shared/components/identicon.vue';
|
import identicon from '../../vue_shared/components/identicon.vue';
|
||||||
import eventHub from '../event_hub';
|
import eventHub from '../event_hub';
|
||||||
|
@ -61,7 +61,7 @@ export default {
|
||||||
if (this.hasChildren) {
|
if (this.hasChildren) {
|
||||||
eventHub.$emit('toggleChildren', this.group);
|
eventHub.$emit('toggleChildren', this.group);
|
||||||
} else {
|
} else {
|
||||||
urlUtils.visitUrl(this.group.relativePath);
|
visitUrl(this.group.relativePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import Visibility from 'visibilityjs';
|
import Visibility from 'visibilityjs';
|
||||||
import * as urlUtils from '../../lib/utils/url_utility';
|
import { visitUrl } from '../../lib/utils/url_utility';
|
||||||
import Poll from '../../lib/utils/poll';
|
import Poll from '../../lib/utils/poll';
|
||||||
import eventHub from '../event_hub';
|
import eventHub from '../event_hub';
|
||||||
import Service from '../services/index';
|
import Service from '../services/index';
|
||||||
|
@ -177,7 +177,7 @@ export default {
|
||||||
.then(data => this.checkForSpam(data))
|
.then(data => this.checkForSpam(data))
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (location.pathname !== data.web_url) {
|
if (location.pathname !== data.web_url) {
|
||||||
urlUtils.visitUrl(data.web_url);
|
visitUrl(data.web_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.service.getData();
|
return this.service.getData();
|
||||||
|
@ -212,7 +212,7 @@ export default {
|
||||||
// Stop the poll so we don't get 404's with the issuable not existing
|
// Stop the poll so we don't get 404's with the issuable not existing
|
||||||
this.poll.stop();
|
this.poll.stop();
|
||||||
|
|
||||||
urlUtils.visitUrl(data.web_url);
|
visitUrl(data.web_url);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
eventHub.$emit('close.form');
|
eventHub.$emit('close.form');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
import * as urlUtils from './lib/utils/url_utility';
|
import { visitUrl } from './lib/utils/url_utility';
|
||||||
import bp from './breakpoints';
|
import bp from './breakpoints';
|
||||||
import { bytesToKiB } from './lib/utils/number_utils';
|
import { bytesToKiB } from './lib/utils/number_utils';
|
||||||
import { setCiStatusFavicon } from './lib/utils/common_utils';
|
import { setCiStatusFavicon } from './lib/utils/common_utils';
|
||||||
|
@ -210,7 +210,7 @@ export default class Job {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.status !== this.buildStatus) {
|
if (log.status !== this.buildStatus) {
|
||||||
urlUtils.visitUrl(this.pagePath);
|
visitUrl(this.pagePath);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(() => {
|
.fail(() => {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
handleLocationHash,
|
handleLocationHash,
|
||||||
isMetaClick,
|
isMetaClick,
|
||||||
} from './lib/utils/common_utils';
|
} from './lib/utils/common_utils';
|
||||||
import * as urlUtils from './lib/utils/url_utility';
|
import { getLocationHash } from './lib/utils/url_utility';
|
||||||
import initDiscussionTab from './image_diff/init_discussion_tab';
|
import initDiscussionTab from './image_diff/init_discussion_tab';
|
||||||
import Diff from './diff';
|
import Diff from './diff';
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ import Diff from './diff';
|
||||||
|
|
||||||
// Scroll any linked note into view
|
// Scroll any linked note into view
|
||||||
// Similar to `toggler_behavior` in the discussion tab
|
// Similar to `toggler_behavior` in the discussion tab
|
||||||
const hash = urlUtils.getLocationHash();
|
const hash = getLocationHash();
|
||||||
const anchor = hash && $container.find(`.note[id="${hash}"]`);
|
const anchor = hash && $container.find(`.note[id="${hash}"]`);
|
||||||
if (anchor && anchor.length > 0) {
|
if (anchor && anchor.length > 0) {
|
||||||
const notesContent = anchor.closest('.notes_content');
|
const notesContent = anchor.closest('.notes_content');
|
||||||
|
|
|
@ -16,7 +16,7 @@ import Autosize from 'autosize';
|
||||||
import 'vendor/jquery.caret'; // required by jquery.atwho
|
import 'vendor/jquery.caret'; // required by jquery.atwho
|
||||||
import 'vendor/jquery.atwho';
|
import 'vendor/jquery.atwho';
|
||||||
import AjaxCache from '~/lib/utils/ajax_cache';
|
import AjaxCache from '~/lib/utils/ajax_cache';
|
||||||
import * as urlUtils from './lib/utils/url_utility';
|
import { getLocationHash } from './lib/utils/url_utility';
|
||||||
import Flash from './flash';
|
import Flash from './flash';
|
||||||
import CommentTypeToggle from './comment_type_toggle';
|
import CommentTypeToggle from './comment_type_toggle';
|
||||||
import GLForm from './gl_form';
|
import GLForm from './gl_form';
|
||||||
|
@ -331,7 +331,7 @@ export default class Notes {
|
||||||
}
|
}
|
||||||
|
|
||||||
static updateNoteTargetSelector($note) {
|
static updateNoteTargetSelector($note) {
|
||||||
const hash = urlUtils.getLocationHash();
|
const hash = getLocationHash();
|
||||||
// Needs to be an explicit true/false for the jQuery `toggleClass(force)`
|
// Needs to be an explicit true/false for the jQuery `toggleClass(force)`
|
||||||
const addTargetClass = Boolean(hash && $note.filter(`#${hash}`).length > 0);
|
const addTargetClass = Boolean(hash && $note.filter(`#${hash}`).length > 0);
|
||||||
$note.toggleClass('target', addTargetClass);
|
$note.toggleClass('target', addTargetClass);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getParameterByName } from '~/lib/utils/common_utils';
|
import { getParameterByName } from '~/lib/utils/common_utils';
|
||||||
import * as utils from './lib/utils/url_utility';
|
import { removeParams } from './lib/utils/url_utility';
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const ENDLESS_SCROLL_BOTTOM_PX = 400;
|
const ENDLESS_SCROLL_BOTTOM_PX = 400;
|
||||||
|
@ -7,7 +7,7 @@ import * as utils from './lib/utils/url_utility';
|
||||||
|
|
||||||
const Pager = {
|
const Pager = {
|
||||||
init(limit = 0, preload = false, disable = false, prepareData = $.noop, callback = $.noop) {
|
init(limit = 0, preload = false, disable = false, prepareData = $.noop, callback = $.noop) {
|
||||||
this.url = $('.content_list').data('href') || utils.removeParams(['limit', 'offset']);
|
this.url = $('.content_list').data('href') || removeParams(['limit', 'offset']);
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
this.offset = parseInt(getParameterByName('offset'), 10) || this.limit;
|
this.offset = parseInt(getParameterByName('offset'), 10) || this.limit;
|
||||||
this.disable = disable;
|
this.disable = disable;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import * as urlUtils from '../../lib/utils/url_utility';
|
import { visitUrl } from '../../lib/utils/url_utility';
|
||||||
import flash from '../../flash';
|
import flash from '../../flash';
|
||||||
import service from '../services';
|
import service from '../services';
|
||||||
import * as types from './mutation_types';
|
import * as types from './mutation_types';
|
||||||
|
|
||||||
export const redirectToUrl = (_, url) => urlUtils.visitUrl(url);
|
export const redirectToUrl = (_, url) => visitUrl(url);
|
||||||
|
|
||||||
export const setInitialData = ({ commit }, data) => commit(types.SET_INITIAL_DATA, data);
|
export const setInitialData = ({ commit }, data) => commit(types.SET_INITIAL_DATA, data);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as urlUtils from '../../../lib/utils/url_utility';
|
import { visitUrl } from '../../../lib/utils/url_utility';
|
||||||
import { normalizeHeaders } from '../../../lib/utils/common_utils';
|
import { normalizeHeaders } from '../../../lib/utils/common_utils';
|
||||||
import flash from '../../../flash';
|
import flash from '../../../flash';
|
||||||
import service from '../../services';
|
import service from '../../services';
|
||||||
|
@ -74,7 +74,7 @@ export const clickedTreeRow = ({ commit, dispatch }, row) => {
|
||||||
} else if (row.type === 'submodule') {
|
} else if (row.type === 'submodule') {
|
||||||
commit(types.TOGGLE_LOADING, row);
|
commit(types.TOGGLE_LOADING, row);
|
||||||
|
|
||||||
urlUtils.visitUrl(row.url);
|
visitUrl(row.url);
|
||||||
} else if (row.type === 'blob' && row.opened) {
|
} else if (row.type === 'blob' && row.opened) {
|
||||||
dispatch('setFileActive', row);
|
dispatch('setFileActive', row);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as urlUtils from '../lib/utils/url_utility';
|
import { visitUrl } from '../lib/utils/url_utility';
|
||||||
import Flash from '../flash';
|
import Flash from '../flash';
|
||||||
import Service from './services/sidebar_service';
|
import Service from './services/sidebar_service';
|
||||||
import Store from './stores/sidebar_store';
|
import Store from './stores/sidebar_store';
|
||||||
|
@ -82,7 +82,7 @@ export default class SidebarMediator {
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (location.pathname !== data.web_url) {
|
if (location.pathname !== data.web_url) {
|
||||||
urlUtils.visitUrl(data.web_url);
|
visitUrl(data.web_url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* eslint-disable class-methods-use-this, no-unneeded-ternary, quote-props */
|
/* eslint-disable class-methods-use-this, no-unneeded-ternary, quote-props */
|
||||||
import * as urlUtils from './lib/utils/url_utility';
|
import { visitUrl } from './lib/utils/url_utility';
|
||||||
import UsersSelect from './users_select';
|
import UsersSelect from './users_select';
|
||||||
import { isMetaClick } from './lib/utils/common_utils';
|
import { isMetaClick } from './lib/utils/common_utils';
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ export default class Todos {
|
||||||
|
|
||||||
window.open(todoLink, windowTarget);
|
window.open(todoLink, windowTarget);
|
||||||
} else {
|
} else {
|
||||||
urlUtils.visitUrl(todoLink);
|
visitUrl(todoLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import '~/lib/utils/datetime_utility';
|
import '~/lib/utils/datetime_utility';
|
||||||
import * as urlUtils from '../../lib/utils/url_utility';
|
import { visitUrl } from '../../lib/utils/url_utility';
|
||||||
import Flash from '../../flash';
|
import Flash from '../../flash';
|
||||||
import MemoryUsage from './mr_widget_memory_usage';
|
import MemoryUsage from './mr_widget_memory_usage';
|
||||||
import StatusIcon from './mr_widget_status_icon';
|
import StatusIcon from './mr_widget_status_icon';
|
||||||
|
@ -37,7 +37,7 @@ export default {
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.redirect_url) {
|
if (res.redirect_url) {
|
||||||
urlUtils.visitUrl(res.redirect_url);
|
visitUrl(res.redirect_url);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
Loading…
Reference in a new issue