diff --git a/demo-shell-ng2/src/app/app.module.ts b/demo-shell-ng2/src/app/app.module.ts index 3dee347c34..28a6442059 100644 --- a/demo-shell-ng2/src/app/app.module.ts +++ b/demo-shell-ng2/src/app/app.module.ts @@ -35,6 +35,7 @@ import { FileViewComponent } from './components/file-view/file-view.component'; import { WebscriptComponent } from './components/webscript/webscript.component'; import { TagComponent } from './components/tag/tag.component'; import { SocialComponent } from './components/social/social.component'; +import { VersionManagerDialogAdapterComponent } from './components/files/version-manager-dialog-adapter.component'; import { ThemePickerModule } from './components/theme-picker/theme-picker'; import { DebugAppConfigService } from './services/debug-app-config.service'; @@ -67,7 +68,8 @@ import { routing } from './app.routes'; WebscriptComponent, TagComponent, SocialComponent, - CustomSourcesComponent + CustomSourcesComponent, + VersionManagerDialogAdapterComponent ], imports: [ BrowserModule, @@ -93,6 +95,9 @@ import { routing } from './app.routes'; } } ], + entryComponents: [ + VersionManagerDialogAdapterComponent + ], bootstrap: [AppComponent] }) export class AppModule { diff --git a/demo-shell-ng2/src/app/components/files/files.component.html b/demo-shell-ng2/src/app/components/files/files.component.html index 5a8dd2cb62..c3247b2cf3 100644 --- a/demo-shell-ng2/src/app/components/files/files.component.html +++ b/demo-shell-ng2/src/app/components/files/files.component.html @@ -3,230 +3,266 @@ - -
- - {{errorMessage}} -
- - - - - - - - - - -
- - - - + {{errorMessage}}
+ + + + + + + - + - - - - - - +
+ + + + +
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ face + Please choose a document to see the versions of it. +
+
+ +
+ warning + You don't have permission to manage the versions of this content. +
+
+
+
+ diff --git a/demo-shell-ng2/src/app/components/files/files.component.scss b/demo-shell-ng2/src/app/components/files/files.component.scss index 9870b204bc..9a31f63c36 100644 --- a/demo-shell-ng2/src/app/components/files/files.component.scss +++ b/demo-shell-ng2/src/app/components/files/files.component.scss @@ -74,6 +74,45 @@ adf-document-list ::ng-deep adf-datatable tr.is-selected .image-table-cell::befo } } +.adf-manage-versions-sidebar { + width: 300px; + color: rgba(0, 0, 0, 0.87); + + .adf-manage-versions-empty, + .adf-manage-versions-no-permission { + margin: 24px; + color: grey; + text-align: justify; + + &-icon { + display: block; + font-size: 48px; + margin: 0 auto 32px auto; + } + } + + & ::ng-deep .adf-info-drawer-layout-header { + display: none; + } + + & ::ng-deep .adf-info-drawer-layout-content { + padding: 0; + + .adf-version-upload, + .adf-new-version-file-upload { + width: 100%; + + & .mat-raised-button { + width: 100%; + } + } + + .adf-new-version-uploader-container { + padding: 8px 24px 16px 24px; + } + } +} + @media (max-width: $minimumDocumentListWidth) { adf-document-list ::ng-deep adf-datatable { & ::ng-deep .adf-data-table-cell--fileSize { diff --git a/demo-shell-ng2/src/app/components/files/files.component.ts b/demo-shell-ng2/src/app/components/files/files.component.ts index ea1c0164cd..3dbbf256e7 100644 --- a/demo-shell-ng2/src/app/components/files/files.component.ts +++ b/demo-shell-ng2/src/app/components/files/files.component.ts @@ -26,6 +26,7 @@ import { } from 'ng2-alfresco-core'; import { DataColumn, DataRow } from 'ng2-alfresco-datatable'; import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist'; +import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component'; const DEFAULT_FOLDER_TO_SHOW = '-my-'; @@ -41,6 +42,7 @@ export class FilesComponent implements OnInit { errorMessage: string = null; fileNodeId: any; showViewer: boolean = false; + showVersions: boolean = false; toolbarColor = 'default'; @@ -211,6 +213,17 @@ export class FilesComponent implements OnInit { }); } + onManageVersions(event) { + const contentEntry = event.value.entry; + + if (this.contentService.hasPermission(contentEntry, 'update')) { + this.dialog.open(VersionManagerDialogAdapterComponent, { data: { contentEntry }, panelClass: 'adf-version-manager-dialog', width: '630px' }); + } else { + const translatedErrorMessage: any = this.translateService.get('OPERATION.ERROR.PERMISSION'); + this.notificationService.openSnackMessage(translatedErrorMessage.value, 4000); + } + } + getSiteContent(site: SiteModel) { this.currentFolderId = site && site.guid ? site.guid : DEFAULT_FOLDER_TO_SHOW; } @@ -223,6 +236,17 @@ export class FilesComponent implements OnInit { return selection && selection.length > 0; } + hasOneFileSelected(): boolean { + const selection: Array = this.documentList.selection; + const hasOneFileSelected = selection && selection.length === 1 && selection[0].entry.isFile; + return hasOneFileSelected; + } + + userHasPermissionToManageVersions(): boolean { + const selection: Array = this.documentList.selection; + return this.contentService.hasPermission(selection[0].entry, 'update'); + } + downloadNodes(selection: Array) { if (!selection || selection.length === 0) { return; diff --git a/demo-shell-ng2/src/app/components/files/version-manager-dialog-adapter.component.html b/demo-shell-ng2/src/app/components/files/version-manager-dialog-adapter.component.html new file mode 100644 index 0000000000..b507fcb4b8 --- /dev/null +++ b/demo-shell-ng2/src/app/components/files/version-manager-dialog-adapter.component.html @@ -0,0 +1,7 @@ +
Manage versions
+
+ +
+
+ +
\ No newline at end of file diff --git a/demo-shell-ng2/src/app/components/files/version-manager-dialog-adapter.component.ts b/demo-shell-ng2/src/app/components/files/version-manager-dialog-adapter.component.ts new file mode 100644 index 0000000000..0e66d74ad1 --- /dev/null +++ b/demo-shell-ng2/src/app/components/files/version-manager-dialog-adapter.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, Inject, ViewEncapsulation } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; +import { MinimalNodeEntryEntity } from 'alfresco-js-api'; + +@Component({ + templateUrl: './version-manager-dialog-adapter.component.html', + encapsulation: ViewEncapsulation.None +}) +export class VersionManagerDialogAdapterComponent { + + public contentEntry: MinimalNodeEntryEntity; + + constructor(@Inject(MAT_DIALOG_DATA) data: any, + private containingDialog?: MatDialogRef) { + this.contentEntry = data.contentEntry; + } + + close() { + this.containingDialog.close(); + } +} diff --git a/docs/README.md b/docs/README.md index 9642a229f5..00d2851c00 100644 --- a/docs/README.md +++ b/docs/README.md @@ -422,6 +422,7 @@ for more information about installing and using the source code. - [Document list component](document-list.component.md) - [Sites dropdown component](sites-dropdown.component.md) - [*Content node selector component](../ng2-components/ng2-alfresco-documentlist/src/components/content-node-selector/content-node-selector.component.ts) +- [Version Manager Component](version-manager.component.md) ### Models diff --git a/docs/docassets/images/version-manager.png b/docs/docassets/images/version-manager.png new file mode 100644 index 0000000000..ea4f42f3e2 Binary files /dev/null and b/docs/docassets/images/version-manager.png differ diff --git a/docs/seeAlsoGraph.json b/docs/seeAlsoGraph.json index 45a1c5484a..e769fcd18d 100644 --- a/docs/seeAlsoGraph.json +++ b/docs/seeAlsoGraph.json @@ -38,6 +38,7 @@ "nodes-api.service" ], "dropdown-breadcrumb.component": ["document-list.component", "breadcrumb.component"], + "version-manager": ["document-list.component"], "extensibility": [], "file-uploading-dialog.component": [], "folder-actions.service": ["document-actions.service"], diff --git a/docs/version-manager.component.md b/docs/version-manager.component.md new file mode 100644 index 0000000000..2416bdfaf0 --- /dev/null +++ b/docs/version-manager.component.md @@ -0,0 +1,25 @@ +# Version Manager Component + +The Version manager component displays the version history of a node with the ability to upload a new version. + +![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `This component is still in experimental phase, it has several limitations which will be resolved soon.` + +![Breadcrumb](docassets/images/version-manager.png) + +## Basic Usage + +```html + +``` + +### Properties + +| Name | Type | Description | +| --- | --- | --- | +| node | [MinimalNodeEntryEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeMinimalEntry.md) | The node you want to see the version history of. | + + + + +## See also + \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/src/services/alfresco-api.service.ts b/ng2-components/ng2-alfresco-core/src/services/alfresco-api.service.ts index 642709e384..38b24e4a86 100644 --- a/ng2-components/ng2-alfresco-core/src/services/alfresco-api.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/alfresco-api.service.ts @@ -18,7 +18,8 @@ import { Injectable } from '@angular/core'; import { AlfrescoApi, ContentApi, FavoritesApi, NodesApi, - PeopleApi, RenditionsApi, SharedlinksApi, SitesApi + PeopleApi, RenditionsApi, SharedlinksApi, SitesApi, + VersionsApi } from 'alfresco-js-api'; import * as alfrescoApi from 'alfresco-js-api'; import { AppConfigService } from './app-config.service'; @@ -65,6 +66,10 @@ export class AlfrescoApiService { return this.getInstance().search.searchApi; } + get versionsApi(): VersionsApi { + return this.getInstance().core.versionsApi; + } + constructor(private appConfig: AppConfigService, private storage: StorageService) { diff --git a/ng2-components/ng2-alfresco-documentlist/index.ts b/ng2-components/ng2-alfresco-documentlist/index.ts index 339651a37a..53b9ced5e9 100644 --- a/ng2-components/ng2-alfresco-documentlist/index.ts +++ b/ng2-components/ng2-alfresco-documentlist/index.ts @@ -16,8 +16,10 @@ */ import { NgModule } from '@angular/core'; +import { FlexLayoutModule } from '@angular/flex-layout'; import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core'; import { DataTableModule } from 'ng2-alfresco-datatable'; +import { UploadModule } from 'ng2-alfresco-upload'; import { BreadcrumbComponent } from './src/components/breadcrumb/breadcrumb.component'; import { DropdownBreadcrumbComponent } from './src/components/breadcrumb/dropdown-breadcrumb.component'; @@ -29,6 +31,9 @@ import { ContentNodeSelectorComponent } from './src/components/content-node-sele import { DocumentListComponent } from './src/components/document-list.component'; import { EmptyFolderContentDirective } from './src/components/empty-folder/empty-folder-content.directive'; import { DropdownSitesComponent } from './src/components/site-dropdown/sites-dropdown.component'; +import { VersionListComponent } from './src/components/version-manager/version-list.component'; +import { VersionManagerComponent } from './src/components/version-manager/version-manager.component'; +import { VersionUploadComponent } from './src/components/version-manager/version-upload.component'; import { MaterialModule } from './src/material.module'; import { ContentNodeSelectorService } from './src/components/content-node-selector/content-node-selector.service'; @@ -75,7 +80,10 @@ export const DOCUMENT_LIST_DIRECTIVES: any[] = [ BreadcrumbComponent, DropdownSitesComponent, DropdownBreadcrumbComponent, - ContentNodeSelectorComponent + ContentNodeSelectorComponent, + VersionListComponent, + VersionUploadComponent, + VersionManagerComponent ]; export const DOCUMENT_LIST_PROVIDERS: any[] = [ @@ -89,8 +97,10 @@ export const DOCUMENT_LIST_PROVIDERS: any[] = [ @NgModule({ imports: [ CoreModule, + UploadModule, DataTableModule, - MaterialModule + MaterialModule, + FlexLayoutModule ], declarations: [ ...DOCUMENT_LIST_DIRECTIVES diff --git a/ng2-components/ng2-alfresco-documentlist/package.json b/ng2-components/ng2-alfresco-documentlist/package.json index b3c86055cd..bdf429f1a9 100644 --- a/ng2-components/ng2-alfresco-documentlist/package.json +++ b/ng2-components/ng2-alfresco-documentlist/package.json @@ -47,6 +47,7 @@ "@angular/common": "4.4.5", "@angular/compiler": "4.4.5", "@angular/core": "4.4.5", + "@angular/flex-layout": "2.0.0-beta.9", "@angular/forms": "4.4.5", "@angular/http": "4.4.5", "@angular/material": "2.0.0-beta.12", diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts index 12e931aa75..4fa133d5e0 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts @@ -35,7 +35,6 @@ import { NodeMinimal, NodeMinimalEntry, NodePaging } from '../models/document-li import { ImageResolver } from './../data/image-resolver.model'; import { RowFilter } from './../data/row-filter.model'; - import { DocumentListService } from './../services/document-list.service'; import { DocumentListComponent } from './document-list.component'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.html b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.html new file mode 100644 index 0000000000..15a8bda858 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.html @@ -0,0 +1,23 @@ + + + insert_drive_file +

{{version.entry.name}}

+

+ {{version.entry.id}} - + {{version.entry.modifiedAt | date}} +

+

{{version.entry.versionComment}}

+ + + + + + +
+
+ + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.scss b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.scss new file mode 100644 index 0000000000..75fc565e19 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.scss @@ -0,0 +1,17 @@ +.adf-version-list { + .mat-list-item { + border-bottom:1px solid #d8d8d8; + } + + &-item-version { + font-weight: bold; + } + + &-item-date { + opacity: 0.6; + } + + &-item-comment { + opacity: 0.5; + } +} diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.spec.ts new file mode 100644 index 0000000000..02fbe4eb95 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.spec.ts @@ -0,0 +1,135 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; +import { AlfrescoApiService, CoreModule } from 'ng2-alfresco-core'; +import { MaterialModule } from '../../material.module'; +import { VersionListComponent } from './version-list.component'; + +describe('VersionListComponent', () => { + let component: VersionListComponent; + let fixture: ComponentFixture; + let element: DebugElement; + + const nodeId = 'test-id'; + const versionId = '1.0'; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + CoreModule, + MaterialModule + ], + declarations: [ + VersionListComponent + ], + providers: [ + AlfrescoApiService + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + afterEach(() => { + fixture.destroy(); + TestBed.resetTestingModule(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(VersionListComponent); + element = fixture.debugElement; + component = fixture.componentInstance; + component.id = nodeId; + }); + + describe('Version history fetching', () => { + + it('should use loading bar', () => { + let loadingProgressBar = fixture.debugElement.query(By.css('[data-automation-id="version-history-loading-bar"]')); + expect(loadingProgressBar).toBeNull(); + + component.ngOnChanges(); + fixture.detectChanges(); + + loadingProgressBar = fixture.debugElement.query(By.css('[data-automation-id="version-history-loading-bar"]')); + expect(loadingProgressBar).not.toBeNull(); + }); + + it('should load the versions for a given id', () => { + const alfrescoApiService = TestBed.get(AlfrescoApiService); + spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and.callThrough(); + + component.ngOnChanges(); + fixture.detectChanges(); + + expect(alfrescoApiService.versionsApi.listVersionHistory).toHaveBeenCalledWith(nodeId); + }); + + it('should show the versions after loading', () => { + fixture.detectChanges(); + const alfrescoApiService = TestBed.get(AlfrescoApiService); + spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and.callFake(() => { + return Promise.resolve([ + { + entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' } + } + ]); + }); + + component.ngOnChanges(); + + fixture.whenStable().then(() => { + fixture.detectChanges(); + let versionFileName = fixture.debugElement.query(By.css('.adf-version-list-item-name')).nativeElement.innerText; + let versionIdText = fixture.debugElement.query(By.css('.adf-version-list-item-version')).nativeElement.innerText; + let versionComment = fixture.debugElement.query(By.css('.adf-version-list-item-comment')).nativeElement.innerText; + + expect(versionFileName).toBe('test-file-name'); + expect(versionIdText).toBe('1.0'); + expect(versionComment).toBe('test-version-comment'); + }); + }); + }); + + describe('Version restoring', () => { + + it('should load the versions for a given id', () => { + fixture.detectChanges(); + const alfrescoApiService = TestBed.get(AlfrescoApiService); + spyOn(alfrescoApiService.versionsApi, 'revertVersion').and.callThrough(); + + component.restore(versionId); + + expect(alfrescoApiService.versionsApi.revertVersion).toHaveBeenCalledWith(nodeId, versionId, { majorVersion: true, comment: ''}); + }); + + it('should reload the version list after a version restore', () => { + fixture.detectChanges(); + const alfrescoApiService = TestBed.get(AlfrescoApiService); + spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and.callThrough(); + spyOn(alfrescoApiService.versionsApi, 'revertVersion').and.callFake(() => Promise.resolve()); + + component.restore(versionId); + + fixture.whenStable().then(() => { + expect(alfrescoApiService.versionsApi.listVersionHistory).toHaveBeenCalledTimes(1); + }); + }); + }); +}); diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.ts b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.ts new file mode 100644 index 0000000000..3d02514dbd --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-list.component.ts @@ -0,0 +1,61 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, Input, OnChanges, ViewEncapsulation } from '@angular/core'; +import { VersionsApi } from 'alfresco-js-api'; +import { AlfrescoApiService } from 'ng2-alfresco-core'; + +@Component({ + selector: 'adf-version-list', + templateUrl: './version-list.component.html', + styleUrls: ['./version-list.component.scss'], + encapsulation: ViewEncapsulation.None, + host: { + 'class': 'adf-version-list' + } +}) +export class VersionListComponent implements OnChanges { + + private versionsApi: VersionsApi; + versions: any = []; + isLoading: boolean = true; + + @Input() + id: string; + + constructor(private alfrescoApi: AlfrescoApiService) { + this.versionsApi = this.alfrescoApi.versionsApi; + } + + ngOnChanges() { + this.loadVersionHistory(); + } + + restore(versionId) { + this.versionsApi + .revertVersion(this.id, versionId, { majorVersion: true, comment: ''}) + .then(this.loadVersionHistory.bind(this)); + } + + private loadVersionHistory() { + this.isLoading = true; + this.versionsApi.listVersionHistory(this.id).then((data) => { + this.versions = data.list.entries; + this.isLoading = false; + }); + } +} diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.html b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.html new file mode 100644 index 0000000000..ea6f7d54dc --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.html @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.scss b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.scss new file mode 100644 index 0000000000..22552b9e70 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.scss @@ -0,0 +1,8 @@ +.adf-button.upload-new-version { + box-shadow: none; +} + +.adf-new-version-uploader-container { + border-bottom:1px solid #d8d8d8; + padding: 16px 0; +} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.ts b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.ts new file mode 100644 index 0000000000..a8ee77874c --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-manager.component.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, Input, ViewEncapsulation } from '@angular/core'; +import { MinimalNodeEntryEntity } from 'alfresco-js-api'; + +@Component({ + selector: 'adf-version-manager', + templateUrl: './version-manager.component.html', + styleUrls: ['./version-manager.component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class VersionManagerComponent { + + @Input() + node: MinimalNodeEntryEntity; +} diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.html b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.html new file mode 100644 index 0000000000..74111c1c3d --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.html @@ -0,0 +1,8 @@ + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.ts b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.ts new file mode 100644 index 0000000000..a0ade6da7e --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, Input, ViewEncapsulation } from '@angular/core'; +import { MinimalNodeEntryEntity } from 'alfresco-js-api'; + +@Component({ + selector: 'adf-version-upload', + templateUrl: './version-upload.component.html', + encapsulation: ViewEncapsulation.None, + host: { + 'class': 'adf-version-upload' + } +}) +export class VersionUploadComponent { + + @Input() + node: MinimalNodeEntryEntity; +} diff --git a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts index cdd52e679e..cd8a5b4073 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts @@ -20,8 +20,8 @@ import { CoreModule } from 'ng2-alfresco-core'; import { DataColumn, DataRow, DataSorting } from 'ng2-alfresco-datatable'; import { FileNode, FolderNode } from './../assets/document-library.model.mock'; import { DocumentListService } from './../services/document-list.service'; -import { ShareDataTableAdapter } from './share-datatable-adapter'; import { ShareDataRow } from './share-data-row.model'; +import { ShareDataTableAdapter } from './share-datatable-adapter'; describe('ShareDataTableAdapter', () => { diff --git a/ng2-components/ng2-alfresco-documentlist/src/material.module.ts b/ng2-components/ng2-alfresco-documentlist/src/material.module.ts index a7f4afbc45..9ccb6d52d9 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/material.module.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/material.module.ts @@ -21,6 +21,7 @@ import { MatDialogModule, MatIconModule, MatInputModule, + MatListModule, MatMenuModule, MatOptionModule, MatProgressSpinnerModule, @@ -34,6 +35,7 @@ export function modules() { MatDialogModule, MatButtonModule, MatIconModule, + MatListModule, MatInputModule, MatProgressSpinnerModule, MatSelectModule, diff --git a/ng2-components/ng2-alfresco-login/src/material.module.ts b/ng2-components/ng2-alfresco-login/src/material.module.ts index 59043547f4..62cb6ee569 100644 --- a/ng2-components/ng2-alfresco-login/src/material.module.ts +++ b/ng2-components/ng2-alfresco-login/src/material.module.ts @@ -18,9 +18,15 @@ import { NgModule } from '@angular/core'; import { MatCheckboxModule, + MatDialogModule, MatIconModule, MatInputModule, - MatProgressSpinnerModule + MatListModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSidenavModule, + MatSlideToggleModule } from '@angular/material'; export function modules() { @@ -28,7 +34,14 @@ export function modules() { MatCheckboxModule, MatIconModule, MatInputModule, - MatProgressSpinnerModule + MatProgressSpinnerModule, + MatSlideToggleModule, + MatInputModule, + MatSelectModule, + MatListModule, + MatDialogModule, + MatSidenavModule, + MatProgressBarModule ]; }