Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce SCM Plugin-Api #4279

Merged
merged 4 commits into from
May 24, 2019
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ cache:
- packages/preview/node_modules
- packages/process/node_modules
- packages/python/node_modules
- packages/scm/node_modules
- packages/search-in-workspace/node_modules
- packages/task/node_modules
- packages/terminal/node_modules
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Breaking changes:
- [preferences] refactored to integrate launch configurations as preferences
- [filesystem] extracted `FileUploadService` and refactored `FileTreeWidget` to use it [#5086](https://github.com/theia-ide/theia/pull/5086)
- moved `FileDownloadCommands.UPLOAD` to `FileSystemCommands.UPLOAD`
- [scm] added Source Control Model
- [git] bind Git UI to SCM

## v0.6.0

Expand Down
1 change: 1 addition & 0 deletions examples/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@theia/preview": "^0.6.0",
"@theia/process": "^0.6.0",
"@theia/python": "^0.6.0",
"@theia/scm": "^0.6.0",
"@theia/search-in-workspace": "^0.6.0",
"@theia/task": "^0.6.0",
"@theia/terminal": "^0.6.0",
Expand Down
8 changes: 4 additions & 4 deletions examples/browser/test/left-panel/left-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ export class LeftPanel {
this.driver.pause(300);
}

isGitContainerVisible(): boolean {
return (this.driver.isExisting('#theia-gitContainer') && this.driver.element('#theia-gitContainer').getAttribute('class').split(' ').indexOf('p-mod-hidden') === -1
isScmContainerVisible(): boolean {
return (this.driver.isExisting('#theia-scmContainer') && this.driver.element('#theia-scmContainer').getAttribute('class').split(' ').indexOf('p-mod-hidden') === -1
&& this.isPanelVisible());
}

waitForGitViewVisible(): void {
this.driver.waitForVisible('#theia-gitContainer');
waitForScmViewVisible(): void {
this.driver.waitForVisible('#theia-scmContainer');
// Wait for animations to finish
this.driver.pause(300);
}
Expand Down
15 changes: 1 addition & 14 deletions examples/browser/test/left-panel/left-panel.ui-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ before(() => {
});

describe('theia left panel', () => {
it("should show 'Explorer' and 'Git'", () => {
it("should show 'Explorer'", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vinokurig, indeed. but why?

what's the reason to not show SCM?

expect(leftPanel.doesTabExist('Explorer')).to.be.true;
expect(leftPanel.doesTabExist('Git')).to.be.true;
});

describe('files tab', () => {
Expand All @@ -49,16 +48,4 @@ describe('theia left panel', () => {
expect(leftPanel.isTabActive('Explorer')).to.be.false;
});
});

describe('git tab', () => {
it('should open/close the git tab', () => {
leftPanel.openCloseTab('Git');
expect(leftPanel.isGitContainerVisible()).to.be.true;
expect(leftPanel.isTabActive('Git')).to.be.true;

leftPanel.openCloseTab('Git');
expect(leftPanel.isGitContainerVisible()).to.be.false;
expect(leftPanel.isTabActive('Git')).to.be.false;
});
});
});
4 changes: 2 additions & 2 deletions examples/browser/test/top-panel/top-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export class TopPanel {
this.clickSubMenu('Explorer');
}

toggleGitView() {
toggleScmView() {
this.clickMenuTab('View');
this.clickSubMenu('Git');
this.clickSubMenu('Scm');
}

toggleGitHistoryView() {
Expand Down
20 changes: 10 additions & 10 deletions examples/browser/test/top-panel/top-panel.ui-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ describe('theia top panel (menubar)', () => {
});
});

describe('git view UI', () => {
describe('scm view UI', () => {
// re-enable if/when we reset workbench layout between tests
// it('should start with git view not visible', () => {
// expect(leftPanel.isGitContainerVisible()).to.be.false;
// it('should start with scm view not visible', () => {
// expect(leftPanel.isScmContainerVisible()).to.be.false;
// });
it('git view should toggle-on then toggle-off', () => {
if (!leftPanel.isGitContainerVisible()) {
topPanel.toggleGitView();
leftPanel.waitForGitViewVisible();
it('scm view should toggle-on then toggle-off', () => {
if (!leftPanel.isScmContainerVisible()) {
topPanel.toggleScmView();
leftPanel.waitForScmViewVisible();
}
expect(leftPanel.isGitContainerVisible()).to.be.true;
topPanel.toggleGitView();
expect(leftPanel.isGitContainerVisible()).to.be.false;
expect(leftPanel.isScmContainerVisible()).to.be.true;
topPanel.toggleScmView();
expect(leftPanel.isScmContainerVisible()).to.be.false;
});
});

Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/common/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export interface Command {
* A category of this command.
*/
category?: string;

// tslint:disable-next-line:no-any
props?: { [key: string]: any }
Copy link
Member

@akosyakov akosyakov May 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this one? It would be good to keep scope of changes to git/scm/plugin extensions and don't touch other extensions. The PR is big already enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it to pass additional arguments e.g. group

Copy link
Member

@akosyakov akosyakov May 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vinokurig please revert it and downcast in scm extension

}

export namespace Command {
Expand Down
1 change: 1 addition & 0 deletions packages/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@theia/filesystem": "^0.6.0",
"@theia/languages": "^0.6.0",
"@theia/navigator": "^0.6.0",
"@theia/scm": "^0.6.0",
"@theia/workspace": "^0.6.0",
"@types/diff": "^3.2.2",
"@types/fs-extra": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/git/src/browser/blame/blame-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { BlameDecorator } from './blame-decorator';
import { EditorManager, EditorKeybindingContexts, EditorWidget, EditorTextFocusContext, StrictEditorTextFocusContext } from '@theia/editor/lib/browser';
import { BlameManager } from './blame-manager';
import URI from '@theia/core/lib/common/uri';
import { EDITOR_CONTEXT_MENU_GIT } from '../git-view-contribution';
import { EDITOR_CONTEXT_MENU_GIT } from '../git-contribution';

import debounce = require('lodash.debounce');

Expand Down
Loading