From 72c46ab8b2def7ec0d7027fb1a3436c21532c263 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 14:01:28 +0000 Subject: [PATCH 1/4] #930 fix dialogs for IE/Safari - fix: People, comment and checklist dialogs do not appear (IE, Safari) --- .../ng2-activiti-tasklist/.gitignore | 1 + .../activiti-checklist.component.ts | 8 ++++---- .../components/activiti-comments.component.ts | 8 ++++---- .../components/activiti-people.component.ts | 8 ++++---- .../src/declarations.d.ts | 19 +++++++++++++++++++ 5 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 ng2-components/ng2-activiti-tasklist/src/declarations.d.ts diff --git a/ng2-components/ng2-activiti-tasklist/.gitignore b/ng2-components/ng2-activiti-tasklist/.gitignore index 13324e66b9..5253e5db68 100644 --- a/ng2-components/ng2-activiti-tasklist/.gitignore +++ b/ng2-components/ng2-activiti-tasklist/.gitignore @@ -7,6 +7,7 @@ dist src/**/*.js src/**/*.js.map src/**/*.d.ts +!src/declarations.d.ts demo/**/*.js demo/**/*.js.map demo/**/*.d.ts diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts index 46987e8ac3..dab4a8825b 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts @@ -19,10 +19,7 @@ import { Component, Input, OnInit, ViewChild, OnChanges, SimpleChanges } from '@ import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core'; import { ActivitiTaskListService } from './../services/activiti-tasklist.service'; import { TaskDetailsModel } from '../models/task-details.model'; -import { Observer } from 'rxjs/Observer'; -import { Observable } from 'rxjs/Observable'; - -declare let componentHandler: any; +import { Observer, Observable } from 'rxjs/Rx'; @Component({ selector: 'activiti-checklist', @@ -95,6 +92,9 @@ export class ActivitiChecklist implements OnInit, OnChanges { public showDialog() { if (this.dialog) { + if (!this.dialog.nativeElement.showModal) { + dialogPolyfill.registerDialog(this.dialog.nativeElement); + } this.dialog.nativeElement.showModal(); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts index 4d5ee36750..a2be327c5b 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts @@ -19,10 +19,7 @@ import { Component, Input, OnInit, ViewChild, OnChanges, SimpleChanges } from '@ import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core'; import { ActivitiTaskListService } from './../services/activiti-tasklist.service'; import { Comment } from '../models/comment.model'; -import { Observer } from 'rxjs/Observer'; -import { Observable } from 'rxjs/Observable'; - -declare let componentHandler: any; +import { Observer, Observable } from 'rxjs/Rx'; @Component({ selector: 'activiti-comments', @@ -97,6 +94,9 @@ export class ActivitiComments implements OnInit, OnChanges { public showDialog() { if (this.dialog) { + if (!this.dialog.nativeElement.showModal) { + dialogPolyfill.registerDialog(this.dialog.nativeElement); + } this.dialog.nativeElement.showModal(); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts index f444cc8167..7ce00fc1a3 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts @@ -18,10 +18,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core'; import { User } from '../models/user.model'; -import { Observer } from 'rxjs/Observer'; -import { Observable } from 'rxjs/Observable'; - -declare let componentHandler: any; +import { Observer, Observable } from 'rxjs/Rx'; @Component({ selector: 'activiti-people', @@ -62,6 +59,9 @@ export class ActivitiPeople implements OnInit { public showDialog() { if (this.dialog) { + if (!this.dialog.nativeElement.showModal) { + dialogPolyfill.registerDialog(this.dialog.nativeElement); + } this.dialog.nativeElement.showModal(); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/declarations.d.ts b/ng2-components/ng2-activiti-tasklist/src/declarations.d.ts new file mode 100644 index 0000000000..6ea5002752 --- /dev/null +++ b/ng2-components/ng2-activiti-tasklist/src/declarations.d.ts @@ -0,0 +1,19 @@ +/*! + * @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. + */ + +declare let componentHandler: any; +declare let dialogPolyfill: any; From 8e1a716477e109a9d5cefc99d419f30df3cbc980 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 14:32:29 +0000 Subject: [PATCH 2/4] #930 additional polyfills for IE - fix: IE-related polyfills to fix DatePicker issues --- demo-shell-ng2/index.html | 2 ++ demo-shell-ng2/package.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index 93ac0bfd52..cb8e5f1fbc 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -26,6 +26,8 @@ + + diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index 299117bde3..b2323df59b 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -93,7 +93,8 @@ "ng2-activiti-processlist": "0.3.3", "ng2-alfresco-webscript": "0.3.2", "ng2-alfresco-tag": "0.3.2", - "dialog-polyfill": "^0.4.3" + "dialog-polyfill": "^0.4.3", + "element.scrollintoviewifneeded-polyfill": "^1.0.1" }, "devDependencies": { "@types/core-js": "^0.9.32", From be6a00549f7e82cfbadc28c04422726834871a67 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 14:45:33 +0000 Subject: [PATCH 3/4] #930 compatibility polyfills for PDFjs (Viewer component) - fix: PDF viewer for FF/IE11 --- demo-shell-ng2/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index cb8e5f1fbc..32474b2d74 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -35,6 +35,7 @@ + From e93ee7093603fde71de9d37fea25e8fa6ecbef49 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 16:16:14 +0000 Subject: [PATCH 4/4] #930 upload widget fixes - fix: detecting changed files for upload widget (Safari, FF, IE) refs #930 refs #802 --- .../src/components/widgets/upload/upload.widget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts index 39bac28b9b..2dc1868e5b 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts @@ -59,7 +59,7 @@ export class UploadWidget extends WidgetComponent implements OnInit { } onFileChanged(event: any) { - let files = event.srcElement.files; + let files = event.target.files; if (files && files.length > 0) { let file = files[0];