From f1a1fc39a67029acbfaaf4cc16728193b65ab774 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Wed, 7 Jun 2017 11:39:57 +0100 Subject: [PATCH] [ADF-754] toolbar component (#1938) * toolbar component - simple toolbar component (core lib) - readme updates (core lib) - update demo shell with toolbar component demo (document list) * update unit tests --- demo-shell-ng2/app/app.module.ts | 1 - .../app/components/files/files.component.ts | 18 ++++++++ ng2-components/ng2-alfresco-core/README.md | 2 +- ng2-components/ng2-alfresco-core/index.ts | 1 - .../breadcrumb/breadcrumb.component.css | 42 +++++++++++++++++++ 5 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.css diff --git a/demo-shell-ng2/app/app.module.ts b/demo-shell-ng2/app/app.module.ts index 9489b5c208..fbef11c1c8 100644 --- a/demo-shell-ng2/app/app.module.ts +++ b/demo-shell-ng2/app/app.module.ts @@ -17,7 +17,6 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { MdSlideToggleModule, MdInputModule, MdSelectModule } from '@angular/material'; import { CoreModule, AppConfigService } from 'ng2-alfresco-core'; import { SearchModule } from 'ng2-alfresco-search'; diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index f86b23a188..d4cea8f710 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -24,6 +24,8 @@ import { UploadService, FileUploadCompleteEvent } from 'ng2-alfresco-upload'; import { CreateFolderDialog } from '../../dialogs/create-folder.dialog'; +import { CreateFolderDialog } from '../../dialogs/create-folder.dialog'; + @Component({ selector: 'files-component', templateUrl: './files.component.html', @@ -142,4 +144,20 @@ export class FilesComponent implements OnInit { } }); } + + onCreateFolderClicked(event: Event) { + let dialogRef = this.dialog.open(CreateFolderDialog); + dialogRef.afterClosed().subscribe(folderName => { + if (folderName) { + this.contentService.createFolder('', folderName, this.documentList.currentFolderId).subscribe( + node => { + console.log(node); + }, + err => { + console.log(err); + } + ); + } + }); + } } diff --git a/ng2-components/ng2-alfresco-core/README.md b/ng2-components/ng2-alfresco-core/README.md index f9fce23c14..5d54353eeb 100644 --- a/ng2-components/ng2-alfresco-core/README.md +++ b/ng2-components/ng2-alfresco-core/README.md @@ -624,4 +624,4 @@ npm start ## License -[Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) +[Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE) \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/index.ts b/ng2-components/ng2-alfresco-core/index.ts index 356c6c0318..ddacba6d81 100644 --- a/ng2-components/ng2-alfresco-core/index.ts +++ b/ng2-components/ng2-alfresco-core/index.ts @@ -16,7 +16,6 @@ */ import { NgModule, ModuleWithProviders } from '@angular/core'; -import { MdSnackBarModule } from '@angular/material'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { HttpModule, Http } from '@angular/http'; import { CommonModule } from '@angular/common'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.css b/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.css new file mode 100644 index 0000000000..92e9fb5736 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.css @@ -0,0 +1,42 @@ +/* breadcrumb */ + +:host .breadcrumb { + text-align: left; + padding: 8px 15px; + list-style: none; + background-color: #fafafa; + margin: 0; +} + +:host .breadcrumb > li { + display: inline-block; + box-sizing: border-box; +} + +:host .breadcrumb > li+li:before { + content: ">\00a0"; + padding: 0 0 0 5px; + opacity: 0.54; + color: #000000; +} + +:host .breadcrumb > li > a { + text-decoration: none; + opacity: 0.54; + font-family: 'Muli', "Helvetica", "Arial", sans-serif; + font-size: 14px; + font-weight: 600; + line-height: 1.43; + letter-spacing: -0.2px; + color: #000000; +} + +:host .breadcrumb > li:hover > a, +:host .breadcrumb > .active { + opacity: 0.87; + font-size: 14px; + font-weight: 600; + line-height: 1.43; + letter-spacing: -0.2px; + color: #000000; +}