This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[REVIEW ONLY] Split View Refactoring #8045
Closed
Closed
Changes from 2 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
4dadcb3
Merge branch 'master' of https://github.com/adobe/brackets
JeffryBooher e99c6ee
initial checkin
JeffryBooher 3d0092e
rename panel manager
JeffryBooher ede4942
WorkingSetView => PaneListView
JeffryBooher beec3fa
workingsetsort -> panelistsort, panelistview -> panelistview
JeffryBooher d17d923
resolve conflicts
JeffryBooher 61bef43
refactor sort command handler
JeffryBooher 51c0894
rename automaticSort
JeffryBooher 3cda537
workingSet -> paneList renames
JeffryBooher 3628f6f
rename FILE.ADD_TO_WORKINGSET
JeffryBooher 243f1de
rename working set command
JeffryBooher 3749812
SORT_WORKINGSET_AUTO => SORT_PANEWLIST_AUTO
JeffryBooher 703b9b1
cleanup/deprecate workingSetSort commands
JeffryBooher cf2e104
update strings
JeffryBooher 4e52024
formatting
JeffryBooher 2bbf790
rename working set menus
JeffryBooher 9420ecd
string change
JeffryBooher de1d7f7
start moving working set apis
JeffryBooher c88d71f
first api successfully migrated
JeffryBooher 129ec66
fix reset and a few other things. All tests passing
JeffryBooher 52c0dd4
deprecate events
JeffryBooher e30121a
paneview -> paneListView
JeffryBooher df70d5e
cleanup and doc
JeffryBooher 4787f80
move removeApis, fix a few issues
JeffryBooher 919314d
move more removeApis, fix issues
JeffryBooher 863eba4
move workingsetsort
JeffryBooher 5abf892
paneListView drag&drop, sort events
JeffryBooher 33d5ed6
paneListView traversing
JeffryBooher 0714cf6
refactor notifyPathDeleted
JeffryBooher 8269392
panelist serialization
JeffryBooher fad6511
move editor events into MainViewManager
JeffryBooher 1082ee7
first change successful
JeffryBooher 3e54f88
wip:working
JeffryBooher 3a4b246
wip:more working
JeffryBooher 3f0d5cc
cleanup
JeffryBooher 302937e
final fixes and cleanup
JeffryBooher c257052
on more final cleanup
JeffryBooher dec81ef
Merge pull request #7942 from adobe/jeff/splitview-cd2
JeffryBooher 503c03a
merge with master
JeffryBooher f781944
merge with master
JeffryBooher d268ce6
fix autosort on startup
JeffryBooher 21ca74c
deprecating WorkingSetView and PanelManager in favor of new MainViewM…
bchintx fcf1996
next pass at deprecating API calls
bchintx 66cd45b
deprecating a few more API calls based on a Find in Files search
bchintx 65cf5f5
removing extra require statement
bchintx f64eada
merge with master
JeffryBooher 0a1c18c
deprecate PanelManager.createBottomPanel
JeffryBooher cc908aa
fix lint and warn once
JeffryBooher 36308f8
fix test failures
JeffryBooher 4e980bd
fix close others test failure
JeffryBooher eb9cb9d
fix deprecation warning
JeffryBooher cd5464d
migrate sort pref / fix type sort
JeffryBooher d4674a6
update test
JeffryBooher f7f3e59
update test
JeffryBooher fae4177
Remove scaffolding stubs and Deprecated APIs that aren't used accordi…
JeffryBooher f04df19
re-add removeListFromWorkingSet used by newly added vim extension
JeffryBooher 681a027
fix broken menus and panels for extensions
JeffryBooher f810efc
lint
JeffryBooher e9a483f
adding PaneViewListSort unit tests
bchintx d44ad46
cleanup
JeffryBooher 32fe3f4
Merge branch 'jeff/splitview-merge' of https://github.com/adobe/brack…
JeffryBooher 31cce39
solve legacy event order dependency for eextensions
JeffryBooher adfa5f5
fixes and changes from self review
JeffryBooher 2ec8d36
merge with master
JeffryBooher d6c9036
roll language changes back
JeffryBooher 11c54ea
formatting
JeffryBooher dc3a2f8
add 'EXTENSIONS_READY appInit so deprecated events can be registered,…
JeffryBooher 6c32741
update docs
JeffryBooher f792ef9
RTC:Fix some jsDoc stuff
JeffryBooher 9e68817
fixes lint
JeffryBooher 751684d
fix command handler
JeffryBooher b56e852
respond to comments
JeffryBooher 6b338d0
more JSDoc fixes
JeffryBooher f65f1f5
more JSDoc fixes
JeffryBooher 1f9cae7
update jsdoc
JeffryBooher 62032a2
update
JeffryBooher 0157d11
unit test upgrades
JeffryBooher bff8717
one more test for close others extension
JeffryBooher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,200 @@ | ||
/* | ||
* Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
|
||
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */ | ||
/*global $, define, describe, it, expect, waitsFor, runs, beforeFirst, afterLast */ | ||
|
||
define(function (require, exports, module) { | ||
"use strict"; | ||
|
||
var CommandManager, // Load from brackets.test | ||
Commands, // Load from brackets.test | ||
DocumentManager, // Load from brackets.test | ||
FileViewController, // Load from brackets.test | ||
MainViewManager, // Load from brackets.test | ||
SpecRunnerUtils = require("spec/SpecRunnerUtils"); | ||
|
||
|
||
describe("PaneViewListSort", function () { | ||
|
||
this.category = "integration"; | ||
|
||
var testPath = SpecRunnerUtils.getTestPath("/spec/PaneViewListView-test-files"), | ||
testWindow, | ||
workingSetCount = 0; | ||
|
||
function openAndMakeDirty(path) { | ||
var doc, didOpen = false, gotError = false; | ||
|
||
// open file | ||
runs(function () { | ||
FileViewController.openAndSelectDocument(path, FileViewController.PROJECT_MANAGER) | ||
.done(function () { didOpen = true; }) | ||
.fail(function () { gotError = true; }); | ||
}); | ||
waitsFor(function () { return didOpen && !gotError; }, "FILE_OPEN on file timeout", 1000); | ||
|
||
// change editor content to make doc dirty which adds it to the working set | ||
runs(function () { | ||
doc = DocumentManager.getCurrentDocument(); | ||
doc.setText("dirty document"); | ||
}); | ||
} | ||
|
||
function createTestWindow(spec, loadProject) { | ||
SpecRunnerUtils.createTestWindowAndRun(spec, function (w) { | ||
testWindow = w; | ||
|
||
// Load module instances from brackets.test | ||
CommandManager = testWindow.brackets.test.CommandManager; | ||
Commands = testWindow.brackets.test.Commands; | ||
DocumentManager = testWindow.brackets.test.DocumentManager; | ||
FileViewController = testWindow.brackets.test.FileViewController; | ||
MainViewManager = testWindow.brackets.test.MainViewManager; | ||
|
||
// Open a directory | ||
if (loadProject) { | ||
SpecRunnerUtils.loadProjectInTestWindow(testPath); | ||
} | ||
}); | ||
|
||
runs(function () { | ||
// Initialize: register listeners | ||
testWindow.$(MainViewManager).on("paneViewListAdd", function (event, addedFile) { | ||
workingSetCount++; | ||
}); | ||
}); | ||
} | ||
|
||
function closeTestWindow() { | ||
testWindow = null; | ||
CommandManager = null; | ||
Commands = null; | ||
DocumentManager = null; | ||
FileViewController = null; | ||
SpecRunnerUtils.closeTestWindow(); | ||
} | ||
|
||
beforeFirst(function () { | ||
createTestWindow(this, true); | ||
|
||
workingSetCount = 0; | ||
|
||
openAndMakeDirty(testPath + "/file_four.html"); | ||
openAndMakeDirty(testPath + "/file_zero.css"); | ||
openAndMakeDirty(testPath + "/file_two.js"); | ||
|
||
// Wait for both files to be added to the working set | ||
waitsFor(function () { return workingSetCount === 3; }, "workingSetCount to equal 3", 1000); | ||
}); | ||
|
||
afterLast(function () { | ||
testWindow.closeAllFiles(); | ||
closeTestWindow(); | ||
}); | ||
|
||
it("should sort list by name", function () { | ||
// sort list by name | ||
CommandManager.execute(Commands.CMD_SORT_PANE_VIEW_LIST_BY_NAME); | ||
|
||
// confirm files sorted correctly | ||
var $listItems = testWindow.$("#open-files-container > ul").children(); | ||
expect($listItems.length).toBe(workingSetCount); | ||
expect($listItems.find("a").get(0).text === "file_four.html").toBeTruthy(); | ||
expect($listItems.find("a").get(1).text === "file_two.js").toBeTruthy(); | ||
expect($listItems.find("a").get(2).text === "file_zero.css").toBeTruthy(); | ||
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount); | ||
}); | ||
|
||
it("should sort list as added", function () { | ||
// sort list as added | ||
CommandManager.execute(Commands.CMD_SORT_PANE_VIEW_LIST_BY_ADDED); | ||
|
||
// confirm files sorted correctly | ||
var $listItems = testWindow.$("#open-files-container > ul").children(); | ||
expect($listItems.length).toBe(workingSetCount); | ||
expect($listItems.find("a").get(0).text === "file_two.js").toBeTruthy(); | ||
expect($listItems.find("a").get(1).text === "file_zero.css").toBeTruthy(); | ||
expect($listItems.find("a").get(2).text === "file_four.html").toBeTruthy(); | ||
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount); | ||
}); | ||
|
||
it("should sort list by type", function () { | ||
// sort list by type | ||
CommandManager.execute(Commands.CMD_SORT_PANE_VIEW_LIST_BY_TYPE); | ||
|
||
// confirm files sorted correctly | ||
var $listItems = testWindow.$("#open-files-container > ul").children(); | ||
expect($listItems.length).toBe(workingSetCount); | ||
expect($listItems.find("a").get(0).text === "file_zero.css").toBeTruthy(); | ||
expect($listItems.find("a").get(1).text === "file_four.html").toBeTruthy(); | ||
expect($listItems.find("a").get(2).text === "file_two.js").toBeTruthy(); | ||
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount); | ||
}); | ||
|
||
it("should sort list by type automatically", function () { | ||
// toggle the auto sort on | ||
CommandManager.execute(Commands.CMD_TOGGLE_AUTO_SORT); | ||
|
||
// open another file, which should be added and auto-sorted into the list | ||
openAndMakeDirty(testPath + "/file_one.js"); | ||
|
||
waitsFor(function () { return workingSetCount === 4; }, "workingSetCount to equal 4", 5000); | ||
|
||
runs(function () { | ||
// confirm files sorted correctly | ||
var $listItems = testWindow.$("#open-files-container > ul").children(); | ||
expect($listItems.length).toBe(workingSetCount); | ||
expect($listItems.find("a").get(0).text === "file_zero.css").toBeTruthy(); | ||
expect($listItems.find("a").get(1).text === "file_four.html").toBeTruthy(); | ||
expect($listItems.find("a").get(2).text === "file_one.js").toBeTruthy(); | ||
expect($listItems.find("a").get(3).text === "file_two.js").toBeTruthy(); | ||
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount); | ||
}); | ||
}); | ||
|
||
it("should not sort list by type automatically", function () { | ||
// toggle the auto sort off | ||
CommandManager.execute(Commands.CMD_TOGGLE_AUTO_SORT); | ||
|
||
// open another file, which should not be added and auto-sorted into the list | ||
openAndMakeDirty(testPath + "/file_three.js"); | ||
|
||
waitsFor(function () { return workingSetCount === 5; }, "workingSetCount to equal 5", 5000); | ||
|
||
runs(function () { | ||
// confirm files sorted correctly | ||
var $listItems = testWindow.$("#open-files-container > ul").children(); | ||
expect($listItems.length).toBe(workingSetCount); | ||
expect($listItems.find("a").get(0).text === "file_zero.css").toBeTruthy(); | ||
expect($listItems.find("a").get(1).text === "file_four.html").toBeTruthy(); | ||
expect($listItems.find("a").get(2).text === "file_one.js").toBeTruthy(); | ||
expect($listItems.find("a").get(3).text === "file_two.js").toBeTruthy(); | ||
expect($listItems.find("a").get(4).text === "file_three.js").toBeTruthy(); | ||
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount); | ||
}); | ||
}); | ||
|
||
}); | ||
}); |
Empty file.
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing: