-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
69 additions
and
33 deletions.
There are no files selected for viewing
6 changes: 1 addition & 5 deletions
6
projects/ngx-explorer/src/lib/components/explorer/explorer.component.html
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 |
---|---|---|
@@ -1,6 +1,2 @@ | ||
<div> | ||
<button (click)="back()">Back</button> | ||
<button (click)="createFolder()">New Folder</button> | ||
<button (click)="refresh()">Refresh</button> | ||
</div> | ||
<nxe-menu-bar></nxe-menu-bar> | ||
<nxe-icons></nxe-icons> |
29 changes: 2 additions & 27 deletions
29
projects/ngx-explorer/src/lib/components/explorer/explorer.component.ts
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 |
---|---|---|
@@ -1,34 +1,9 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ExplorerService } from '../../services/explorer.service'; | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nxe-explorer', | ||
templateUrl: './explorer.component.html', | ||
styleUrls: ['./explorer.component.scss'] | ||
}) | ||
export class ExplorerComponent implements OnInit { | ||
|
||
constructor(private explorerService: ExplorerService) { } | ||
|
||
ngOnInit(): void { } | ||
|
||
back() { | ||
const currentNode = this.explorerService.openedNode.value; | ||
this.explorerService.openNode(currentNode.parentId); | ||
} | ||
|
||
createFolder() { | ||
const currentNode = this.explorerService.openedNode.value; | ||
|
||
// TODO: inject custom popup, inject custom text | ||
let name = prompt("Enter new folder name"); | ||
if (name) { | ||
this.explorerService.createNode(currentNode, name); | ||
} | ||
} | ||
|
||
refresh() { | ||
this.explorerService.refresh(); | ||
} | ||
|
||
export class ExplorerComponent { | ||
} |
5 changes: 5 additions & 0 deletions
5
projects/ngx-explorer/src/lib/components/menu-bar/menu-bar.component.html
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,5 @@ | ||
<div> | ||
<button (click)="back()">Back</button> | ||
<button (click)="createFolder()">New Folder</button> | ||
<button (click)="refresh()">Refresh</button> | ||
</div> |
Empty file.
25 changes: 25 additions & 0 deletions
25
projects/ngx-explorer/src/lib/components/menu-bar/menu-bar.component.spec.ts
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MenuBarComponent } from './menu-bar.component'; | ||
|
||
describe('MenuBarComponent', () => { | ||
let component: MenuBarComponent; | ||
let fixture: ComponentFixture<MenuBarComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ MenuBarComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MenuBarComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
projects/ngx-explorer/src/lib/components/menu-bar/menu-bar.component.ts
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,32 @@ | ||
import { Component } from '@angular/core'; | ||
import { ExplorerService } from '../../services/explorer.service'; | ||
|
||
@Component({ | ||
selector: 'nxe-menu-bar', | ||
templateUrl: './menu-bar.component.html', | ||
styleUrls: ['./menu-bar.component.scss'] | ||
}) | ||
export class MenuBarComponent { | ||
|
||
constructor(private explorerService: ExplorerService) { } | ||
|
||
back() { | ||
const currentNode = this.explorerService.openedNode.value; | ||
this.explorerService.openNode(currentNode.parentId); | ||
} | ||
|
||
createFolder() { | ||
const currentNode = this.explorerService.openedNode.value; | ||
|
||
// TODO: inject custom popup, inject custom text | ||
let name = prompt("Enter new folder name"); | ||
if (name) { | ||
this.explorerService.createNode(currentNode, name); | ||
} | ||
} | ||
|
||
refresh() { | ||
this.explorerService.refresh(); | ||
} | ||
|
||
} |
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