Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/extensions/default/Git/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ define(function (require, exports, module) {
require(modules);

// Load CSS
ExtensionUtils.loadStyleSheet(module, "styles/brackets-git.less");
ExtensionUtils.loadStyleSheet(module, "styles/fonts/octicon.less");
ExtensionUtils.loadStyleSheet(module, "styles/git-styles.less");

AppInit.appReady(function () {
Main.init().then((enabled)=>{
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/default/Git/src/Branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ define(function (require, exports) {
var MAX_LEN = 18;

const tooltip = StringUtils.format(Strings.ON_BRANCH, branchName);
const html = `<i class='octicon octicon-git-branch'></i> ${
const html = `<i class="fas fa-code-branch"></i> ${
branchName.length > MAX_LEN ? branchName.substring(0, MAX_LEN) + "\u2026" : branchName
}`;
$gitBranchName
Expand Down Expand Up @@ -491,7 +491,7 @@ define(function (require, exports) {
// Add branch name to project tree
const $html = $(`<div id='git-branch-dropdown-toggle' class='btn-alt-quiet'>
<span id='git-branch'>
<i class='octicon octicon-git-branch'></i>
<i class="fas fa-code-branch"></i>
</span>
<span class="dropdown-arrow"></span>
</div>`);
Expand Down
90 changes: 48 additions & 42 deletions src/extensions/default/Git/src/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,54 +601,60 @@ define(function (require, exports) {
let totalFiles = gitStatusResults.length,
filesDone = 0;

function showProgress() {
const $progressBar = $dialog.find('.accordion-progress-bar-inner');
if ($progressBar.length) {
$progressBar[0].style.width = `${filesDone/totalFiles*100}%`;
}
if(filesDone === totalFiles){
$dialog.find('.accordion-progress-bar').addClass("forced-inVisible");
}
const progressString = StringUtils.format(Strings.CODE_INSPECTION_DONE_FILES, filesDone, totalFiles);
$dialog.find(".lint-errors").html(progressString);
}

const codeInspectionPromises = gitStatusResults.map(function (fileObj) {
const isDeleted = fileObj.status.indexOf(Git.FILE_STATUS.DELETED) !== -1;
if(isDeleted){
filesDone++;
showProgress();
return;
}

// Do a code inspection for the file, if it was not deleted
if (!isDeleted) {
return new Promise((resolve) => {
// Delay lintFile execution to give the event loop some breathing room
setTimeout(() => {
lintFile(fileObj.file)
.catch(function () {
return [
{
provider: { name: "See console [F12] for details" },
result: {
errors: [
{
pos: { line: 0, ch: 0 },
message: "CodeInspection failed to execute for this file."
}
]
}
return new Promise((resolve) => {
// Delay lintFile execution to give the event loop some breathing room
setTimeout(() => {
lintFile(fileObj.file)
.catch(function () {
return [
{
provider: { name: "See console [F12] for details" },
result: {
errors: [
{
pos: { line: 0, ch: 0 },
message: "CodeInspection failed to execute for this file."
}
]
}
];
})
.then(function (result) {
if (result) {
lintResults.push({
filename: fileObj.file,
result: result
});
}
resolve();
}).finally(()=>{
filesDone++;
const $progressBar = $dialog.find('.accordion-progress-bar-inner');
if ($progressBar.length) {
$progressBar[0].style.width = `${filesDone/totalFiles*100}%`;
}
if(filesDone === totalFiles){
$dialog.find('.accordion-progress-bar').addClass("forced-inVisible");
}
const progressString = StringUtils.format(Strings.CODE_INSPECTION_DONE_FILES, filesDone, totalFiles);
$dialog.find(".lint-errors").html(progressString);

});
}, 0); // Delay of 0ms to defer to the next tick of the event loop
});
}
];
})
.then(function (result) {
if (result) {
lintResults.push({
filename: fileObj.file,
result: result
});
}
resolve();
}).finally(()=>{
filesDone++;
showProgress();
});
}, 0); // Delay of 0ms to defer to the next tick of the event loop
});
});

return Promise.all(_.compact(codeInspectionPromises)).then(function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="git-pull-dialog" class="git modal">
<div id="git-push-dialog" class="git modal">
<div class="modal-header">
<h1 class="dialog-title">{{Strings.DIALOG_PUSH_TITLE}} &mdash; {{config.remote}}</h1>
</div>
Expand Down
Loading
Loading