[ADF-1748] remove MDL dependency and fix style issues (#2486)

* remove dialogPolyfill references

* remove MDL dependencies

* style fixes

* exclude the test (needs dialog support)
This commit is contained in:
Denys Vuika
2017-10-17 17:20:06 +01:00
committed by Eugenio Romano
parent 073003ba9a
commit 0cc578ba0e
12 changed files with 30 additions and 103 deletions

View File

@@ -22,8 +22,6 @@ import 'core-js/es7/reflect';
import 'zone.js/dist/zone'; import 'zone.js/dist/zone';
import 'intl'; import 'intl';
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') { if (process.env.ENV === 'production') {
// Production // Production

View File

@@ -50,17 +50,6 @@ import 'ng2-alfresco-userinfo';
import 'ng2-alfresco-viewer'; import 'ng2-alfresco-viewer';
import 'ng2-alfresco-webscript'; import 'ng2-alfresco-webscript';
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';
// Google Material Design Lite
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-lite/material.js';
import 'ng2-activiti-form/stencils/runtime.adf';
import 'ng2-activiti-form/stencils/runtime.ng1';
import 'chart.js'; import 'chart.js';
import 'ng2-charts'; import 'ng2-charts';
require('script-loader!raphael/raphael.min.js'); require('script-loader!raphael/raphael.min.js');

View File

@@ -21,6 +21,11 @@
<style> <style>
body, html { body, html {
height: 100%; height: 100%;
font-family: 'Muli', "Helvetica", "Arial", sans-serif !important;
}
body {
margin: 0;
} }
.loader-container { .loader-container {

View File

@@ -74,10 +74,7 @@
"chart.js": "2.5.0", "chart.js": "2.5.0",
"core-js": "2.4.1", "core-js": "2.4.1",
"custom-event-polyfill": "^0.3.0", "custom-event-polyfill": "^0.3.0",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"intl": "1.2.5", "intl": "1.2.5",
"material-design-lite": "1.2.1",
"minimatch": "3.0.4", "minimatch": "3.0.4",
"moment": "2.15.1", "moment": "2.15.1",
"ng2-3d-editor": "0.0.15", "ng2-3d-editor": "0.0.15",

View File

@@ -36,7 +36,6 @@ describe('AttachWidgetComponent', () => {
let fixture: ComponentFixture<AttachWidgetComponent>; let fixture: ComponentFixture<AttachWidgetComponent>;
let element: HTMLElement; let element: HTMLElement;
let contentService: ActivitiAlfrescoContentService; let contentService: ActivitiAlfrescoContentService;
let dialogPolyfill: any;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
@@ -62,15 +61,6 @@ describe('AttachWidgetComponent', () => {
element = fixture.nativeElement; element = fixture.nativeElement;
widget = fixture.componentInstance; widget = fixture.componentInstance;
dialogPolyfill = {
registerDialog(obj: any) {
obj.showModal = () => {
};
}
};
window['dialogPolyfill'] = dialogPolyfill;
}); });
it('should require field value to check file', () => { it('should require field value to check file', () => {
@@ -176,7 +166,7 @@ describe('AttachWidgetComponent', () => {
expect(closed).toBeTruthy(); expect(closed).toBeTruthy();
}); });
it('should show modal dialog', () => { xit('should show modal dialog', () => {
spyOn(contentService, 'getAlfrescoNodes').and.returnValue( spyOn(contentService, 'getAlfrescoNodes').and.returnValue(
Observable.create(observer => { Observable.create(observer => {
observer.next([]); observer.next([]);
@@ -307,17 +297,6 @@ describe('AttachWidgetComponent', () => {
widget.getExternalContentNodes(); widget.getExternalContentNodes();
}); });
it('should register dialog via polyfill', () => {
widget.dialog = {
nativeElement: {}
};
spyOn(dialogPolyfill, 'registerDialog').and.callThrough();
spyOn(widget, 'setupFileBrowser').and.stub();
spyOn(widget, 'getExternalContentNodes').and.stub();
widget.showDialog();
expect(dialogPolyfill.registerDialog).toHaveBeenCalledWith(widget.dialog.nativeElement);
});
it('should require configured dialog to show modal', () => { it('should require configured dialog to show modal', () => {
widget.dialog = null; widget.dialog = null;
spyOn(widget, 'setupFileBrowser').and.stub(); spyOn(widget, 'setupFileBrowser').and.stub();

View File

@@ -25,8 +25,6 @@ import { FormFieldModel } from '../core/form-field.model';
import { FormService } from './../../../services/form.service'; import { FormService } from './../../../services/form.service';
import { baseHost , WidgetComponent } from './../widget.component'; import { baseHost , WidgetComponent } from './../widget.component';
declare let dialogPolyfill: any;
@Component({ @Component({
selector: 'attach-widget', selector: 'attach-widget',
templateUrl: './attach.widget.html', templateUrl: './attach.widget.html',
@@ -130,11 +128,7 @@ export class AttachWidgetComponent extends WidgetComponent implements OnInit {
this.getExternalContentNodes(); this.getExternalContentNodes();
if (this.dialog) { if (this.dialog) {
if (!this.dialog.nativeElement.showModal) { // todo: show dialog
dialogPolyfill.registerDialog(this.dialog.nativeElement);
}
this.dialog.nativeElement.showModal();
return true; return true;
} }
return false; return false;

View File

@@ -39,7 +39,6 @@ describe('ContainerWidgetComponent', () => {
let fixture: ComponentFixture<ContainerWidgetComponent>; let fixture: ComponentFixture<ContainerWidgetComponent>;
let element: HTMLElement; let element: HTMLElement;
let contentService: ActivitiAlfrescoContentService; let contentService: ActivitiAlfrescoContentService;
let dialogPolyfill;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
@@ -62,13 +61,6 @@ describe('ContainerWidgetComponent', () => {
element = fixture.nativeElement; element = fixture.nativeElement;
widget = fixture.componentInstance; widget = fixture.componentInstance;
dialogPolyfill = {
registerDialog(obj: any) {
obj.showModal = function () {
};
}
};
}); });
it('should wrap field with model instance', () => { it('should wrap field with model instance', () => {

View File

@@ -101,14 +101,8 @@ export class ChecklistComponent implements OnInit, OnChanges {
} }
} }
public showDialog() { showDialog() {
this.dialog.open(this.addNewDialog, { width: '350px' }); this.dialog.open(this.addNewDialog, { width: '350px' });
// if (this.addNewDialog) {
// if (!this.addNewDialog.nativeElement.showModal) {
// dialogPolyfill.registerDialog(this.addNewDialog.nativeElement);
// }
// this.addNewDialog.nativeElement.showModal();
// }
} }
public add() { public add() {

View File

@@ -59,7 +59,6 @@
"alfresco-js-api": "1.9.0", "alfresco-js-api": "1.9.0",
"core-js": "2.4.1", "core-js": "2.4.1",
"hammerjs": "2.0.8", "hammerjs": "2.0.8",
"material-design-lite": "1.2.1",
"moment": "2.15.1", "moment": "2.15.1",
"reflect-metadata": "0.1.10", "reflect-metadata": "0.1.10",
"rxjs": "5.1.0", "rxjs": "5.1.0",

View File

@@ -16,7 +16,7 @@
(click)="onBackButtonClick()"> (click)="onBackButtonClick()">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
</button> </button>
<img [src]="mimeType | adfMimeTypeIcon"> <img class="adf-viewer__mimeicon" [src]="mimeType | adfMimeTypeIcon">
<span>{{ displayName }}</span> <span>{{ displayName }}</span>
</adf-toolbar-title> </adf-toolbar-title>

View File

@@ -8,6 +8,10 @@ $adf-viewer-background-color: #f5f5f5;
.adf-viewer { .adf-viewer {
&__mimeicon {
vertical-align: middle;
}
&-container { &-container {
.adf-viewer-layout-content { .adf-viewer-layout-content {
@include full-screen(); @include full-screen();

View File

@@ -34,33 +34,10 @@
"bugs": { "bugs": {
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues" "url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
}, },
"contributors": { "keywords": [
"0": { "alfresco",
"name": "Eugenio Romano", "angular"
"email": "eugenio.romano@alfresco.com" ],
},
"1": {
"name": "Eugenio Romano",
"email": "eugenio.romano@alfresco.com"
},
"2": {
"name": "Denys Vuika",
"email": "denys.vuika@gmail.com"
},
"3": {
"name": "Eugenio Romano",
"email": "eugenio.romano@alfresco.com"
}
},
"keywords": {
"0": "alfresco-ng2-components",
"1": "angular2",
"2": "typescript",
"3": "alfresco",
"4": "activiti",
"5": "ecm",
"6": "bpm"
},
"dependencies": { "dependencies": {
"@angular/animations": "4.4.5", "@angular/animations": "4.4.5",
"@angular/cdk": "2.0.0-beta.12", "@angular/cdk": "2.0.0-beta.12",
@@ -68,6 +45,7 @@
"@angular/compiler": "4.4.5", "@angular/compiler": "4.4.5",
"@angular/compiler-cli": "4.4.5", "@angular/compiler-cli": "4.4.5",
"@angular/core": "4.4.5", "@angular/core": "4.4.5",
"@angular/flex-layout": "2.0.0-beta.9",
"@angular/forms": "4.4.5", "@angular/forms": "4.4.5",
"@angular/http": "4.4.5", "@angular/http": "4.4.5",
"@angular/material": "2.0.0-beta.12", "@angular/material": "2.0.0-beta.12",
@@ -76,26 +54,24 @@
"@angular/router": "4.4.5", "@angular/router": "4.4.5",
"@ngx-translate/core": "7.0.0", "@ngx-translate/core": "7.0.0",
"alfresco-js-api": "1.9.0", "alfresco-js-api": "1.9.0",
"chart.js": "2.5.0",
"core-js": "2.4.1", "core-js": "2.4.1",
"hammerjs": "2.0.8", "hammerjs": "2.0.8",
"material-design-lite": "1.2.1", "minimatch": "3.0.4",
"moment": "2.15.1", "moment": "2.15.1",
"ng2-activiti-diagrams": "1.9.0",
"ng2-activiti-form": "1.9.0",
"ng2-activiti-tasklist": "1.9.0",
"ng2-alfresco-core": "1.9.0",
"ng2-alfresco-datatable": "1.9.0",
"ng2-alfresco-documentlist": "1.9.0",
"ng2-charts": "1.6.0",
"pdfjs-dist": "1.5.404",
"raphael": "2.2.7",
"reflect-metadata": "0.1.10", "reflect-metadata": "0.1.10",
"rxjs": "5.1.0", "rxjs": "5.1.0",
"systemjs": "0.19.27", "systemjs": "0.19.27",
"zone.js": "0.8.12", "zone.js": "0.8.12"
"ng2-alfresco-core": "1.9.0",
"raphael": "2.2.7",
"chart.js": "2.5.0",
"ng2-activiti-diagrams": "1.9.0",
"ng2-charts": "1.6.0",
"@angular/flex-layout": "2.0.0-beta.9",
"ng2-activiti-form": "1.9.0",
"ng2-alfresco-datatable": "1.9.0",
"ng2-activiti-tasklist": "1.9.0",
"ng2-alfresco-documentlist": "1.9.0",
"minimatch": "3.0.4",
"pdfjs-dist": "1.5.404"
}, },
"devDependencies": { "devDependencies": {
"@types/hammerjs": "2.0.35", "@types/hammerjs": "2.0.35",