Commit 1f4595e8 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch '267501-project-monaco' into 'master'

Resolve "Follow-up from "Removed :monaco_blobs flag""

See merge request gitlab-org/gitlab!45396
parents 67c95646 b038b2b8
......@@ -2,7 +2,7 @@
import $ from 'jquery';
import NewCommitForm from '../new_commit_form';
import EditBlob from './edit_blob';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import BlobFileDropzone from '../blob/blob_file_dropzone';
import initPopover from '~/blob/suggest_gitlab_ci_yml';
import { disableButtonIfEmptyField, setCookie } from '~/lib/utils/common_utils';
......@@ -24,6 +24,18 @@ export default () => {
const commitButton = $('.js-commit-button');
const cancelLink = $('.btn.btn-cancel');
import('./edit_blob')
.then(({ default: EditBlob } = {}) => {
new EditBlob({
assetsPath: `${urlRoot}${assetsPath}`,
filePath,
currentAction,
projectId,
isMarkdown,
});
})
.catch(e => createFlash(e));
cancelLink.on('click', () => {
window.onbeforeunload = null;
});
......@@ -32,13 +44,6 @@ export default () => {
window.onbeforeunload = null;
});
new EditBlob({
assetsPath: `${urlRoot}${assetsPath}`,
filePath,
currentAction,
projectId,
isMarkdown,
});
new NewCommitForm(editBlobForm);
// returning here blocks page navigation
......
import $ from 'jquery';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
import waitForPromises from 'helpers/wait_for_promises';
import blobBundle from '~/blob_edit/blob_bundle';
import EditorLite from '~/blob_edit/edit_blob';
jest.mock('~/blob_edit/edit_blob');
describe('BlobBundle', () => {
it('does not load EditorLite by default', () => {
blobBundle();
expect(EditorLite).not.toHaveBeenCalled();
});
it('loads EditorLite for the edit screen', async () => {
setFixtures(`<div class="js-edit-blob-form"></div>`);
blobBundle();
await waitForPromises();
expect(EditorLite).toHaveBeenCalled();
});
describe('No Suggest Popover', () => {
beforeEach(() => {
setFixtures(`
......
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