Commit ef2ff241 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'dmishunov-editor-lite-blobgid' into 'master'

Editor Lite: Set the default for blobGlobalId

See merge request gitlab-org/gitlab!46283
parents 4fbf5d4c f252fbf4
...@@ -6,6 +6,7 @@ import { registerLanguages } from '~/ide/utils'; ...@@ -6,6 +6,7 @@ import { registerLanguages } from '~/ide/utils';
import { joinPaths } from '~/lib/utils/url_utility'; import { joinPaths } from '~/lib/utils/url_utility';
import { clearDomElement } from './utils'; import { clearDomElement } from './utils';
import { EDITOR_LITE_INSTANCE_ERROR_NO_EL, URI_PREFIX } from './constants'; import { EDITOR_LITE_INSTANCE_ERROR_NO_EL, URI_PREFIX } from './constants';
import { uuids } from '~/diffs/utils/uuids';
export default class Editor { export default class Editor {
constructor(options = {}) { constructor(options = {}) {
...@@ -72,7 +73,7 @@ export default class Editor { ...@@ -72,7 +73,7 @@ export default class Editor {
el = undefined, el = undefined,
blobPath = '', blobPath = '',
blobContent = '', blobContent = '',
blobGlobalId = '', blobGlobalId = uuids()[0],
extensions = [], extensions = [],
...instanceOptions ...instanceOptions
} = {}) { } = {}) {
......
...@@ -64,7 +64,7 @@ describe('Base editor', () => { ...@@ -64,7 +64,7 @@ describe('Base editor', () => {
}); });
it('creates model to be supplied to Monaco editor', () => { it('creates model to be supplied to Monaco editor', () => {
editor.createInstance({ el: editorEl, blobPath, blobContent }); editor.createInstance({ el: editorEl, blobPath, blobContent, blobGlobalId: '' });
expect(modelSpy).toHaveBeenCalledWith(blobContent, undefined, createUri(blobPath)); expect(modelSpy).toHaveBeenCalledWith(blobContent, undefined, createUri(blobPath));
expect(setModel).toHaveBeenCalledWith(fakeModel); expect(setModel).toHaveBeenCalledWith(fakeModel);
......
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