Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
3d414ac4da
commit
87f9516e78
|
|
@ -0,0 +1,116 @@
|
|||
import { GlToast } from '@gitlab/ui';
|
||||
import Vue from 'vue';
|
||||
import IssuableContext from '~/issuable/issuable_context';
|
||||
import { parseBoolean } from '~/lib/utils/common_utils';
|
||||
import Sidebar from '~/right_sidebar';
|
||||
import { getSidebarOptions } from '~/sidebar/mount_sidebar';
|
||||
import CsvImportExportButtons from './components/csv_import_export_buttons.vue';
|
||||
import IssuableByEmail from './components/issuable_by_email.vue';
|
||||
import IssuableHeaderWarnings from './components/issuable_header_warnings.vue';
|
||||
|
||||
export function initCsvImportExportButtons() {
|
||||
const el = document.querySelector('.js-csv-import-export-buttons');
|
||||
|
||||
if (!el) return null;
|
||||
|
||||
const {
|
||||
showExportButton,
|
||||
showImportButton,
|
||||
issuableType,
|
||||
issuableCount,
|
||||
email,
|
||||
exportCsvPath,
|
||||
importCsvIssuesPath,
|
||||
containerClass,
|
||||
canEdit,
|
||||
projectImportJiraPath,
|
||||
maxAttachmentSize,
|
||||
showLabel,
|
||||
} = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
provide: {
|
||||
showExportButton: parseBoolean(showExportButton),
|
||||
showImportButton: parseBoolean(showImportButton),
|
||||
issuableType,
|
||||
email,
|
||||
importCsvIssuesPath,
|
||||
containerClass,
|
||||
canEdit: parseBoolean(canEdit),
|
||||
projectImportJiraPath,
|
||||
maxAttachmentSize,
|
||||
showLabel,
|
||||
},
|
||||
render(h) {
|
||||
return h(CsvImportExportButtons, {
|
||||
props: {
|
||||
exportCsvPath,
|
||||
issuableCount: parseInt(issuableCount, 10),
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function initIssuableByEmail() {
|
||||
Vue.use(GlToast);
|
||||
|
||||
const el = document.querySelector('.js-issueable-by-email');
|
||||
|
||||
if (!el) return null;
|
||||
|
||||
const {
|
||||
initialEmail,
|
||||
issuableType,
|
||||
emailsHelpPagePath,
|
||||
quickActionsHelpPath,
|
||||
markdownHelpPath,
|
||||
resetPath,
|
||||
} = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
provide: {
|
||||
initialEmail,
|
||||
issuableType,
|
||||
emailsHelpPagePath,
|
||||
quickActionsHelpPath,
|
||||
markdownHelpPath,
|
||||
resetPath,
|
||||
},
|
||||
render(h) {
|
||||
return h(IssuableByEmail);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function initIssuableHeaderWarnings(store) {
|
||||
const el = document.getElementById('js-issuable-header-warnings');
|
||||
|
||||
if (!el) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { hidden } = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
store,
|
||||
provide: { hidden: parseBoolean(hidden) },
|
||||
render(createElement) {
|
||||
return createElement(IssuableHeaderWarnings);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function initIssuableSidebar() {
|
||||
const sidebarOptEl = document.querySelector('.js-sidebar-options');
|
||||
|
||||
if (!sidebarOptEl) return;
|
||||
|
||||
const sidebarOptions = getSidebarOptions(sidebarOptEl);
|
||||
|
||||
new IssuableContext(sidebarOptions.currentUser); // eslint-disable-line no-new
|
||||
Sidebar.initialize();
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
import Vue from 'vue';
|
||||
import { parseBoolean } from '~/lib/utils/common_utils';
|
||||
import CsvImportExportButtons from './components/csv_import_export_buttons.vue';
|
||||
|
||||
export default () => {
|
||||
const el = document.querySelector('.js-csv-import-export-buttons');
|
||||
|
||||
if (!el) return null;
|
||||
|
||||
const {
|
||||
showExportButton,
|
||||
showImportButton,
|
||||
issuableType,
|
||||
issuableCount,
|
||||
email,
|
||||
exportCsvPath,
|
||||
importCsvIssuesPath,
|
||||
containerClass,
|
||||
canEdit,
|
||||
projectImportJiraPath,
|
||||
maxAttachmentSize,
|
||||
showLabel,
|
||||
} = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
provide: {
|
||||
showExportButton: parseBoolean(showExportButton),
|
||||
showImportButton: parseBoolean(showImportButton),
|
||||
issuableType,
|
||||
email,
|
||||
importCsvIssuesPath,
|
||||
containerClass,
|
||||
canEdit: parseBoolean(canEdit),
|
||||
projectImportJiraPath,
|
||||
maxAttachmentSize,
|
||||
showLabel,
|
||||
},
|
||||
render(h) {
|
||||
return h(CsvImportExportButtons, {
|
||||
props: {
|
||||
exportCsvPath,
|
||||
issuableCount: parseInt(issuableCount, 10),
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
import { GlToast } from '@gitlab/ui';
|
||||
import Vue from 'vue';
|
||||
import IssuableByEmail from './components/issuable_by_email.vue';
|
||||
|
||||
Vue.use(GlToast);
|
||||
|
||||
export default () => {
|
||||
const el = document.querySelector('.js-issueable-by-email');
|
||||
|
||||
if (!el) return null;
|
||||
|
||||
const {
|
||||
initialEmail,
|
||||
issuableType,
|
||||
emailsHelpPagePath,
|
||||
quickActionsHelpPath,
|
||||
markdownHelpPath,
|
||||
resetPath,
|
||||
} = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
provide: {
|
||||
initialEmail,
|
||||
issuableType,
|
||||
emailsHelpPagePath,
|
||||
quickActionsHelpPath,
|
||||
markdownHelpPath,
|
||||
resetPath,
|
||||
},
|
||||
render(h) {
|
||||
return h(IssuableByEmail);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
import Vue from 'vue';
|
||||
import { parseBoolean } from '~/lib/utils/common_utils';
|
||||
import IssuableHeaderWarnings from './components/issuable_header_warnings.vue';
|
||||
|
||||
export default function issuableHeaderWarnings(store) {
|
||||
const el = document.getElementById('js-issuable-header-warnings');
|
||||
|
||||
if (!el) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { hidden } = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
store,
|
||||
provide: { hidden: parseBoolean(hidden) },
|
||||
render(createElement) {
|
||||
return createElement(IssuableHeaderWarnings);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/* eslint-disable no-new */
|
||||
|
||||
import { getSidebarOptions } from '~/sidebar/mount_sidebar';
|
||||
import IssuableContext from '~/issuable/issuable_context';
|
||||
import Sidebar from '~/right_sidebar';
|
||||
|
||||
export default () => {
|
||||
const sidebarOptEl = document.querySelector('.js-sidebar-options');
|
||||
|
||||
if (!sidebarOptEl) return;
|
||||
|
||||
const sidebarOptions = getSidebarOptions(sidebarOptEl);
|
||||
|
||||
new IssuableContext(sidebarOptions.currentUser);
|
||||
Sidebar.initialize();
|
||||
};
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import issuableInitBulkUpdateSidebar from '~/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar';
|
||||
|
||||
export default class IssuableIndex {
|
||||
constructor(pagePrefix = 'issuable_') {
|
||||
issuableInitBulkUpdateSidebar.init(pagePrefix);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import loadAwardsHandler from '~/awards_handler';
|
||||
import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable';
|
||||
import initIssuableSidebar from '~/issuable/init_issuable_sidebar';
|
||||
import { initIssuableHeaderWarnings, initIssuableSidebar } from '~/issuable';
|
||||
import { IssuableType } from '~/vue_shared/issuable/show/constants';
|
||||
import Issue from '~/issues/issue';
|
||||
import { initIncidentApp, initIncidentHeaderActions } from '~/issues/show/incident';
|
||||
|
|
@ -10,7 +10,6 @@ import initNotesApp from '~/notes';
|
|||
import { store } from '~/notes/stores';
|
||||
import initRelatedMergeRequestsApp from '~/issues/related_merge_requests';
|
||||
import initSentryErrorStackTraceApp from '~/issues/sentry_error_stack_trace';
|
||||
import initIssuableHeaderWarning from '~/issuable/init_issuable_header_warning';
|
||||
import ZenMode from '~/zen_mode';
|
||||
|
||||
export default function initShowIssue() {
|
||||
|
|
@ -33,7 +32,7 @@ export default function initShowIssue() {
|
|||
break;
|
||||
}
|
||||
|
||||
initIssuableHeaderWarning(store);
|
||||
initIssuableHeaderWarnings(store);
|
||||
initSentryErrorStackTraceApp();
|
||||
initRelatedMergeRequestsApp();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import Vue from 'vue';
|
||||
import initIssuableSidebar from '~/issuable/init_issuable_sidebar';
|
||||
import { initIssuableSidebar } from '~/issuable';
|
||||
import MergeConflictsResolverApp from './merge_conflict_resolver_app.vue';
|
||||
import { createStore } from './store';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import IssuableFilteredSearchTokenKeys from 'ee_else_ce/filtered_search/issuable_filtered_search_token_keys';
|
||||
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
|
||||
import initCsvImportExportButtons from '~/issuable/init_csv_import_export_buttons';
|
||||
import initIssuableByEmail from '~/issuable/init_issuable_by_email';
|
||||
import IssuableIndex from '~/issuable/issuable_index';
|
||||
import { initCsvImportExportButtons, initIssuableByEmail } from '~/issuable';
|
||||
import issuableInitBulkUpdateSidebar from '~/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar';
|
||||
import { mountIssuablesListApp, mountIssuesListApp, mountJiraIssuesListApp } from '~/issues_list';
|
||||
import initManualOrdering from '~/issues/manual_ordering';
|
||||
import { FILTERED_SEARCH } from '~/filtered_search/constants';
|
||||
|
|
@ -21,7 +20,7 @@ if (gon.features?.vueIssuesList) {
|
|||
useDefaultState: true,
|
||||
});
|
||||
|
||||
new IssuableIndex(ISSUABLE_INDEX.ISSUE); // eslint-disable-line no-new
|
||||
issuableInitBulkUpdateSidebar.init(ISSUABLE_INDEX.ISSUE);
|
||||
new UsersSelect(); // eslint-disable-line no-new
|
||||
|
||||
initCsvImportExportButtons();
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import addExtraTokensForMergeRequests from 'ee_else_ce/filtered_search/add_extra_tokens_for_merge_requests';
|
||||
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
|
||||
import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered_search_token_keys';
|
||||
import initCsvImportExportButtons from '~/issuable/init_csv_import_export_buttons';
|
||||
import initIssuableByEmail from '~/issuable/init_issuable_by_email';
|
||||
import IssuableIndex from '~/issuable/issuable_index';
|
||||
import { initCsvImportExportButtons, initIssuableByEmail } from '~/issuable';
|
||||
import issuableInitBulkUpdateSidebar from '~/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar';
|
||||
import { FILTERED_SEARCH } from '~/filtered_search/constants';
|
||||
import { ISSUABLE_INDEX } from '~/issuable/constants';
|
||||
import initFilteredSearch from '~/pages/search/init_filtered_search';
|
||||
import UsersSelect from '~/users_select';
|
||||
|
||||
new IssuableIndex(ISSUABLE_INDEX.MERGE_REQUEST); // eslint-disable-line no-new
|
||||
issuableInitBulkUpdateSidebar.init(ISSUABLE_INDEX.MERGE_REQUEST);
|
||||
|
||||
addExtraTokensForMergeRequests(IssuableFilteredSearchTokenKeys);
|
||||
IssuableFilteredSearchTokenKeys.removeTokensForKeys('iteration');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import VueApollo from 'vue-apollo';
|
|||
import loadAwardsHandler from '~/awards_handler';
|
||||
import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable';
|
||||
import { initPipelineCountListener } from '~/commit/pipelines/utils';
|
||||
import initIssuableSidebar from '~/issuable/init_issuable_sidebar';
|
||||
import { initIssuableSidebar } from '~/issuable';
|
||||
import StatusBox from '~/issuable/components/status_box.vue';
|
||||
import createDefaultClient from '~/lib/graphql';
|
||||
import initSourcegraph from '~/sourcegraph';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { initReviewBar } from '~/batch_comments';
|
||||
import { initIssuableHeaderWarnings } from '~/issuable';
|
||||
import initMrNotes from '~/mr_notes';
|
||||
import store from '~/mr_notes/stores';
|
||||
import initSidebarBundle from '~/sidebar/sidebar_bundle';
|
||||
import initIssuableHeaderWarning from '~/issuable/init_issuable_header_warning';
|
||||
import initShow from '../init_merge_request_show';
|
||||
|
||||
initMrNotes();
|
||||
|
|
@ -11,5 +11,5 @@ initShow();
|
|||
requestIdleCallback(() => {
|
||||
initSidebarBundle(store);
|
||||
initReviewBar();
|
||||
initIssuableHeaderWarning(store);
|
||||
initIssuableHeaderWarnings(store);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ class Gitlab::Seeder::Crm
|
|||
def seed!
|
||||
organization_ids = []
|
||||
|
||||
organizations_per_group.times do
|
||||
organizations_per_group.times do |index|
|
||||
organization_ids << ::CustomerRelations::Organization.create!(
|
||||
group_id: group.id,
|
||||
name: FFaker::Company.name
|
||||
name: "#{FFaker::Company.name}-#{index}"
|
||||
).id
|
||||
|
||||
print '.'
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
import issuableInitBulkUpdateSidebar from '~/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar';
|
||||
import IssuableIndex from '~/issuable/issuable_index';
|
||||
|
||||
describe('Issuable', () => {
|
||||
describe('initBulkUpdate', () => {
|
||||
it('should not set bulkUpdateSidebar', () => {
|
||||
new IssuableIndex('issue_'); // eslint-disable-line no-new
|
||||
|
||||
expect(issuableInitBulkUpdateSidebar.bulkUpdateSidebar).toBeNull();
|
||||
});
|
||||
|
||||
it('should set bulkUpdateSidebar', () => {
|
||||
const element = document.createElement('div');
|
||||
element.classList.add('issues-bulk-update');
|
||||
document.body.appendChild(element);
|
||||
|
||||
new IssuableIndex('issue_'); // eslint-disable-line no-new
|
||||
|
||||
expect(issuableInitBulkUpdateSidebar.bulkUpdateSidebar).toBeDefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue