[ADF-770] upgrade to md-menu (#2060)

* upgrade to md-menu

- upgrade to md-menu
- fix issue with missing icons
- extend demo shell to show icons for actions
- fix issue with border problems in Firefox
- remove commented out samples in demo shell (there's readme for that instead)

* fix unit tests

* fix tests
This commit is contained in:
Denys Vuika
2017-07-07 16:17:26 +01:00
committed by Eugenio Romano
parent 183dd3c990
commit 3b8cf27862
6 changed files with 99 additions and 81 deletions

View File

@@ -16,7 +16,6 @@
*/
import { ModuleWithProviders, NgModule } from '@angular/core';
import { MdButtonModule, MdIconModule, MdMenuModule, MdProgressSpinnerModule } from '@angular/material';
import { CoreModule } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
@@ -28,6 +27,7 @@ import { ContentColumnComponent } from './src/components/content-column/content-
import { DocumentListComponent } from './src/components/document-list.component';
import { DocumentMenuActionComponent } from './src/components/document-menu-action.component';
import { EmptyFolderContentComponent } from './src/components/empty-folder/empty-folder-content.component';
import { MaterialModule } from './src/material.module';
import { DocumentActionsService } from './src/services/document-actions.service';
import { DocumentListService } from './src/services/document-list.service';
@@ -77,10 +77,7 @@ export const DOCUMENT_LIST_PROVIDERS: any[] = [
imports: [
CoreModule,
DataTableModule,
MdMenuModule,
MdButtonModule,
MdIconModule,
MdProgressSpinnerModule
MaterialModule
],
declarations: [
...DOCUMENT_LIST_DIRECTIVES
@@ -91,9 +88,7 @@ export const DOCUMENT_LIST_PROVIDERS: any[] = [
exports: [
DataTableModule,
...DOCUMENT_LIST_DIRECTIVES,
MdMenuModule,
MdButtonModule,
MdIconModule
MaterialModule
]
})
export class DocumentListModule {

View File

@@ -16,25 +16,25 @@
*/
import { NgZone, SimpleChange, TemplateRef } from '@angular/core';
import { DataTableComponent, DataColumn, DataRowEvent } from 'ng2-alfresco-datatable';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { CoreModule, AlfrescoTranslationService } from 'ng2-alfresco-core';
import { DocumentListComponent } from './document-list.component';
import { DocumentListService } from './../services/document-list.service';
import { ContentActionModel } from '../models/content-action.model';
import { FileNode, FolderNode } from '../assets/document-library.model.mock';
import { NodeMinimalEntry, NodeMinimal, NodePaging } from '../models/document-library.model';
import { ShareDataRow, RowFilter, ImageResolver } from './../data/share-datatable-adapter';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { DocumentMenuActionComponent } from './document-menu-action.component';
import { DataColumn, DataRowEvent, DataTableComponent } from 'ng2-alfresco-datatable';
import { Observable, Subject } from 'rxjs/Rx';
import { FileNode, FolderNode } from '../assets/document-library.model.mock';
import {
fakeNodeAnswerWithNOEntries,
fakeNodeAnswerWithEntries,
fakeNodeAnswerWithNOEntries,
fakeNodeWithCreatePermission,
fakeNodeWithNoPermission
} from '../assets/document-list.component.mock';
import { MdProgressSpinnerModule } from '@angular/material';
import { MaterialModule } from '../material.module';
import { ContentActionModel } from '../models/content-action.model';
import { NodeMinimal, NodeMinimalEntry, NodePaging } from '../models/document-library.model';
import { ImageResolver, RowFilter, ShareDataRow } from './../data/share-datatable-adapter';
import { DocumentListService } from './../services/document-list.service';
import { DocumentListComponent } from './document-list.component';
import { DocumentMenuActionComponent } from './document-menu-action.component';
declare let jasmine: any;
@@ -54,7 +54,7 @@ describe('DocumentList', () => {
imports: [
CoreModule.forRoot(),
DataTableModule.forRoot(),
MdProgressSpinnerModule
MaterialModule
],
declarations: [
DocumentListComponent,

View File

@@ -0,0 +1,34 @@
/*!
* @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 { NgModule } from '@angular/core';
import { MdButtonModule, MdIconModule, MdMenuModule, MdProgressSpinnerModule } from '@angular/material';
export function modules() {
return [
MdMenuModule,
MdButtonModule,
MdIconModule,
MdProgressSpinnerModule
];
}
@NgModule({
imports: modules(),
exports: modules()
})
export class MaterialModule {}