-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[editor] Remove mako variables for editor id and notebooks as well as…
… the old notebooks listing page (#3657) In this commit I'm removing the editor_id and notebooks that gets set from the backend when opening the editor. The editor ID is now taken from the url parameter and notebooks isn't actually used anymore. As part of this I'm also removing the notebooks listing page which should be considered dead code as it's no longer reachable from the UI or via URL. This is part of the effort of removing inline script and our goal of moving towards CSR.
- Loading branch information
1 parent
1291cc8
commit 1f30a3a
Showing
15 changed files
with
86 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
desktop/core/src/desktop/js/apps/editor/EditorViewModel.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Licensed to Cloudera, Inc. under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. Cloudera, Inc. licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import EditorViewModel from './EditorViewModel'; | ||
import changeURLParameter from 'utils/url/changeURLParameter'; | ||
|
||
describe('EditorViewModel.js', () => { | ||
it('should load the document if opened with an ID in the "editor" url parameter', async () => { | ||
changeURLParameter('editor', '123'); | ||
const vm = new EditorViewModel({}); | ||
const spy = jest.spyOn(vm, 'openNotebook').mockImplementation(() => Promise.resolve()); | ||
|
||
await vm.init(); | ||
|
||
expect(spy).toHaveBeenCalledWith('123'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
desktop/core/src/desktop/js/apps/notebook/NotebookViewModel.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Licensed to Cloudera, Inc. under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. Cloudera, Inc. licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import NotebookViewModel from './NotebookViewModel'; | ||
import changeURLParameter from 'utils/url/changeURLParameter'; | ||
|
||
describe('NotebookViewModel.js', () => { | ||
it('should load the document if opened with an ID in the "editor" url parameter', async () => { | ||
changeURLParameter('editor', '123'); | ||
const vm = new NotebookViewModel({}); | ||
const spy = jest.spyOn(vm, 'openNotebook').mockImplementation(() => Promise.resolve()); | ||
|
||
vm.init(); | ||
|
||
expect(spy).toHaveBeenCalledWith('123'); | ||
}); | ||
|
||
it('should load the document if opened with an "editorId" option', async () => { | ||
const vm = new NotebookViewModel({ editorId: '234' }); | ||
const spy = jest.spyOn(vm, 'openNotebook').mockImplementation(() => Promise.resolve()); | ||
|
||
vm.init(); | ||
|
||
expect(spy).toHaveBeenCalledWith('234'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.