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

Feature: file explorer tabs #701

Merged
merged 29 commits into from
Sep 22, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
50c68f1
Show tabs and swtich working
timotheeguerin Sep 14, 2017
08cd2ea
Working
timotheeguerin Sep 14, 2017
6cb0110
Added close tabs
timotheeguerin Sep 14, 2017
88035f9
Style tweak
timotheeguerin Sep 14, 2017
055e943
Tweak style
timotheeguerin Sep 15, 2017
4a800e5
Don't show file if task is active of preparing
timotheeguerin Sep 15, 2017
c55ba88
File not found
timotheeguerin Sep 15, 2017
7a72569
Fix close style bugt
timotheeguerin Sep 15, 2017
bbf007e
Cleanup
timotheeguerin Sep 15, 2017
9c36a0c
wip
timotheeguerin Sep 15, 2017
b898a1b
Fix
timotheeguerin Sep 15, 2017
cd7760f
Fix middle click scrolling
timotheeguerin Sep 15, 2017
3105ecf
context menu
timotheeguerin Sep 15, 2017
300c9d5
Reneable load all for task
timotheeguerin Sep 15, 2017
6792414
Access tabs with keyboard
timotheeguerin Sep 15, 2017
0749c87
Don't focus on click
timotheeguerin Sep 15, 2017
8f09870
navigator
timotheeguerin Sep 18, 2017
c6164e8
refactor
timotheeguerin Sep 18, 2017
3ec5540
Fix loading folder
timotheeguerin Sep 18, 2017
48f8033
Remove
timotheeguerin Sep 18, 2017
b651c90
Added task outputs test
timotheeguerin Sep 18, 2017
3aabc2d
remove console.log
timotheeguerin Sep 18, 2017
caeb22c
Merge master
timotheeguerin Sep 21, 2017
f43fa22
Tweaks
timotheeguerin Sep 21, 2017
47bad04
SHow open folder icon
timotheeguerin Sep 21, 2017
90b8ee5
fix cr comments
timotheeguerin Sep 21, 2017
9726ee3
Show
timotheeguerin Sep 22, 2017
47cfe9e
Preemted color
timotheeguerin Sep 22, 2017
09564f6
Tree view expand current folder
timotheeguerin Sep 22, 2017
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
Prev Previous commit
Next Next commit
fix cr comments
  • Loading branch information
timotheeguerin committed Sep 21, 2017
commit 90b8ee59287cf48eab6d62c45f17873281af1bea
8 changes: 4 additions & 4 deletions app/components/base/editor/editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class EditorComponent implements ControlValueAccessor, AfterViewInit, OnC
public placeholder: string;
private _value = "";
private _sub: Subscription;
private _erd: any;
private _resizeDetector: any;

get value() { return this._value; }

Expand All @@ -68,11 +68,11 @@ export class EditorComponent implements ControlValueAccessor, AfterViewInit, OnC
}
}
public ngAfterViewInit() {
this._erd = elementResizeDetectorMaker({
this._resizeDetector = elementResizeDetectorMaker({
strategy: "scroll",
});

this._erd.listenTo(this.elementRef.nativeElement, (element) => {
this._resizeDetector.listenTo(this.elementRef.nativeElement, (element) => {
this.instance.refresh();
});

Expand All @@ -86,7 +86,7 @@ export class EditorComponent implements ControlValueAccessor, AfterViewInit, OnC

public ngOnDestroy() {
this._sub.unsubscribe();
this._erd.uninstall(this.elementRef.nativeElement);
this._resizeDetector.uninstall(this.elementRef.nativeElement);
}

public codemirrorInit(config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ bl-file-explorer-tabs {
display: block;
.tablist {
height: $tab-height;
// border-bottom: 1px solid $border-color;
background: #e5e5e5;
background: $mercury-grey;
display: flex;

> .tab {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileLoader, FileNavigator, FileTreeNode } from "app/services/file";
import { log } from "app/utils";
import { CloudPathUtils, log } from "app/utils";
import { BehaviorSubject, Observable } from "rxjs";

export interface FileSource {
Expand Down Expand Up @@ -35,19 +35,16 @@ export interface CurrentNode {
export class FileExplorerWorkspace {
public sources: FileSource[];
public openedFiles: Observable<OpenedFile[]>;
// public openedFolder: Observable<any>;
public currentSource: Observable<FileSource>;
public currentNode: Observable<CurrentNode>;

private _currentSource = new BehaviorSubject<FileSource>(null);
private _currentPath = new BehaviorSubject("");
private _openedFiles = new BehaviorSubject<OpenedFile[]>([]);
// private _openedFolder = new BehaviorSubject<any>(null);

constructor(data: FileNavigator | FileSource | FileSource[]) {
this.sources = sourcesFrom(data);
this.openedFiles = this._openedFiles.asObservable();
// this.openedFolder = this._openedFolder.asObservable();
this.currentSource = this._currentSource.asObservable();
this._currentSource.next(this.sources.first());

Expand Down Expand Up @@ -87,7 +84,7 @@ export class FileExplorerWorkspace {
public goBack() {
const path = this._currentPath.value;
if (path === "") { return; }
this.navigateTo(path.split("/").slice(0, -1).join("/"), this._currentSource.value);
this.navigateTo(CloudPathUtils.dirname(path), this._currentSource.value);
}

public isFileOpen(path: string, source?: FileSource): boolean {
Expand Down Expand Up @@ -146,8 +143,9 @@ export class FileExplorerWorkspace {
if (this.sources.length === 1) {
return this.sources.first();
} else {
log.error("You must specify a source(FileNavigator) when using multi-source");
throw Error("You must specify a source(FileNavigator) when using multi-source");
const message = "You must specify a source(FileNavigator) when using multi-source";
log.error(message);
throw Error(message);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
</bl-clickable>
</div>
<div *ngIf="expanded" class="tree-view-content">
<div *ngIf="fileNavigator.error">
{{fileNavigator.error.message}}
</div>
<div *ngIf="fileNavigator.error" class="tree-view-error">{{fileNavigator.error.message}}</div>
<div class="tree-rows-container"
[class.drop-target]="dropTargetPath === ''"
(dragenter)="dragEnterRow($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@ bl-file-tree-view {

> .file-icon {
> .fa-folder, > .fa-folder-open {
color: #f8d979;
color: $folder-color;
}

> .fa-file {
color: $dove-grey;
}
}
}

.tree-view-error {
white-space: pre;
}
}

.toggle-children-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<bl-file-content [fileLoader]="fileLoader" *ngIf="fileLoader"></bl-file-content>
</div>
<div *ngIf="fileNotFound" class="info-overlay file-not-found">
File <span class="highlight">&nbsp;{{filename}}&nbsp;</span> doesn't exists.
File <span class="highlight">&nbsp;{{filename}}&nbsp;</span> doesn't exist.
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class TaskOutputsComponent implements OnChanges, OnDestroy {
{
name: "Node files",
navigator: nodeNavigator,
openedFiles: ["stdout.txt", "stderr.txt", "wd/example-jobs/python/pi.py"],
openedFiles: ["stdout.txt", "stderr.txt"],
},
{ name: "Persisted output", navigator: taskOutputNavigator },
]);
Expand Down
2 changes: 2 additions & 0 deletions app/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ $link-color-hover : map-get($primary, 800);
$validation-error-color : map-get($danger, 500);
$label-text : $dusty-grey;

$folder-color: #f8d979;

$baseFontSize : 13px;
$baseLineHeight : 1.4em;

Expand Down