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

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Sep 15, 2017

Added tabs to the file explorer. This allows to merge the task logs into the file explorer

fix #655
fix #689
fix #523(File size doesn't reload)

Show better message when task has not run yet
image

Tabs!
image
image

@@ -49,6 +50,7 @@ export class EditorComponent implements ControlValueAccessor, AfterViewInit, OnC
public placeholder: string;
private _value = "";
private _sub: Subscription;
private _erd: any;
Copy link
Member

Choose a reason for hiding this comment

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

what is an erd? :) maybe call it _resizeDetector, i am a firm believer of descriptive variable names. Particularly helpful for junior devs.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah was the same name in the heatmap and copied it from there. But can change it

.tablist {
height: $tab-height;
// border-bottom: 1px solid $border-color;
background: #e5e5e5;
Copy link
Member

Choose a reason for hiding this comment

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

need to put #e5e5e5 into variables. oh, its there. change to $mercuryGray

constructor(data: FileNavigator | FileSource | FileSource[]) {
this.sources = sourcesFrom(data);
this.openedFiles = this._openedFiles.asObservable();
// this.openedFolder = this._openedFolder.asObservable();
Copy link
Member

Choose a reason for hiding this comment

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

is this going to be used in the future? otherwise delete:
public openedFolder: Observable

Copy link
Member Author

Choose a reason for hiding this comment

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

forgot to remove it

public goBack() {
const path = this._currentPath.value;
if (path === "") { return; }
this.navigateTo(path.split("/").slice(0, -1).join("/"), this._currentSource.value);
Copy link
Member

Choose a reason for hiding this comment

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

you have used ".split(/[\/]/)" in the past, do we need to do that here to take into account / or \

Copy link
Member Author

Choose a reason for hiding this comment

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

the path is already suppose to be normalized in the tree though

Copy link
Member Author

Choose a reason for hiding this comment

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

but there is a util method dirname I made I should use here instead

if (this.sources.length === 1) {
return this.sources.first();
} else {
log.error("You must specify a source(FileNavigator) when using multi-source");
Copy link
Member

Choose a reason for hiding this comment

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

bit of a nitpick but this could go into a const so we only need to change it in one place if needs be.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah speaking of that I think we should look at internationalization that would make the code cleaner for long messages at least

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

Choose a reason for hiding this comment

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

variables.scss

<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.
Copy link
Member

Choose a reason for hiding this comment

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

"exist"

@Input() public jobId: string;

@Input() public taskId: string;
@Input() public task: Task;

public OutputType = OutputType;
Copy link
Member

@ascobie ascobie Sep 21, 2017

Choose a reason for hiding this comment

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

public outputType

Copy link
Member Author

Choose a reason for hiding this comment

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

no this is to pass the enum to the template. I think it is better to keep the same case

Copy link
Member

Choose a reason for hiding this comment

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

oh ok cool. if you are happy then i am happy :)

{
name: "Node files",
navigator: nodeNavigator,
openedFiles: ["stdout.txt", "stderr.txt", "wd/example-jobs/python/pi.py"],
Copy link
Member

Choose a reason for hiding this comment

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

"wd/example-jobs/python/pi.py" ?

Copy link
Member Author

Choose a reason for hiding this comment

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

oops forgot to remove that one

if (!change) { return false; }
const { previousValue, currentValue } = change;
const same = previousValue && currentValue && previousValue.id === currentValue.id;
return !same;
Copy link
Member

Choose a reason for hiding this comment

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

probably just need:

return previousValue && currentValue && previousValue.id === currentValue.id;

Copy link
Member Author

Choose a reason for hiding this comment

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

doing a ! here this would be the opposite

expect(storageServiceSpy.navigateContainerBlobs).toHaveBeenCalledOnce();
expect(storageServiceSpy.navigateContainerBlobs).toHaveBeenCalledWith("job-1", "task-1/", jasmine.anything());
}));
});
Copy link
Member

Choose a reason for hiding this comment

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

Have we make sure that the file size reloads from '-' to the actual size when the file becomes available. as per #523. if that's fixed then include this issue in the PR so it gets closed.

@timotheeguerin timotheeguerin merged commit 39f4e45 into master Sep 22, 2017
@timotheeguerin timotheeguerin deleted the feature/file-explorer-tabs branch September 22, 2017 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants