Merge pull request #6500 from opf/fix/modal-cdref

Fix/modal cdref

[ci skip]
pull/6501/head
Oliver Günther 6 years ago committed by GitHub
commit 86addfc7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.ts
  2. 5
      frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts
  3. 5
      frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts
  4. 5
      frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts
  5. 5
      frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts
  6. 5
      frontend/src/app/components/modals/export-modal/wp-table-export.modal.ts
  7. 5
      frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.ts
  8. 5
      frontend/src/app/components/modals/save-modal/save-query.modal.ts
  9. 5
      frontend/src/app/components/modals/share-modal/query-sharing.modal.ts
  10. 5
      frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts
  11. 9
      frontend/src/app/components/op-modals/op-modal.component.ts
  12. 5
      frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.ts
  13. 2
      frontend/src/app/globals/global-listeners/link-hijacking.ts
  14. 5
      frontend/src/app/modules/common/help-texts/attribute-help-text.modal.ts

@ -28,7 +28,7 @@
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {Component, ElementRef, Inject} from "@angular/core";
import {ChangeDetectorRef, Component, ElementRef, Inject} from "@angular/core";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
@ -65,9 +65,10 @@ export class ConfirmDialogModal extends OpModalComponent {
constructor(readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
this.options = locals.options || {};
this.closeOnEscape = _.defaultTo(this.options.closeByEscape, true);

@ -28,7 +28,7 @@
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
@ -61,9 +61,10 @@ export class ChildPagesMacroModal extends OpModalComponent implements AfterViewI
constructor(readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
this.selectedPage = this.page = this.locals.page;
this.selectedIncludeParent = this.includeParent = this.locals.includeParent;

@ -28,7 +28,7 @@
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
import {WorkPackageCreateService} from "core-components/wp-new/wp-create.service";
@ -72,9 +72,10 @@ export class CodeBlockMacroModal extends OpModalComponent implements AfterViewIn
constructor(readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
this.languageClass = locals.languageClass || 'language-text';
this.content = locals.content;

@ -28,7 +28,7 @@
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
import {WorkPackageCreateService} from "core-components/wp-new/wp-create.service";
@ -62,9 +62,10 @@ export class WikiIncludePageMacroModal extends OpModalComponent implements After
constructor(readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
this.selectedPage = this.page = this.locals.page;
// We could provide an autocompleter here to get correct page names

@ -28,7 +28,7 @@
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
import {WorkPackageCreateService} from "core-components/wp-new/wp-create.service";
@ -70,9 +70,10 @@ export class WpButtonMacroModal extends OpModalComponent implements AfterViewIni
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
@Inject(IWorkPackageCreateServiceToken) protected wpCreate:WorkPackageCreateService,
protected currentProject:CurrentProjectService,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
this.selectedType = this.type = this.locals.type;
this.classes = this.locals.classes;
this.buttonStyle = this.classes === 'button';

@ -1,4 +1,4 @@
import {Component, ElementRef, Inject, OnInit} from '@angular/core';
import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from '@angular/core';
import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';
import {WorkPackageTableColumnsService} from 'core-components/wp-fast-table/state/wp-table-columns.service';
import {OpModalComponent} from 'core-components/op-modals/op-modal.component';
@ -37,8 +37,9 @@ export class WpTableExportModal extends OpModalComponent implements OnInit {
readonly elementRef:ElementRef,
readonly UrlParamsHelper:UrlParamsHelperService,
readonly tableState:TableState,
readonly cdRef:ChangeDetectorRef,
readonly wpTableColumns:WorkPackageTableColumnsService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}
ngOnInit() {

@ -26,7 +26,7 @@
// See doc/COPYRIGHT.rdoc for more details.
// ++
import {Component, ElementRef, Inject, OnDestroy, OnInit} from "@angular/core";
import {ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, OnInit} from "@angular/core";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
@ -38,9 +38,10 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";
export class DynamicContentModal extends OpModalComponent implements OnInit, OnDestroy {
constructor(readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}

@ -32,7 +32,7 @@ import {WorkPackageNotificationService} from '../../wp-edit/wp-notification.serv
import {QueryResource} from 'core-app/modules/hal/resources/query-resource';
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {QuerySharingChange} from "core-components/modals/share-modal/query-sharing-form.component";
@ -66,8 +66,9 @@ export class SaveQueryModal extends OpModalComponent {
readonly states:States,
readonly wpListService:WorkPackagesListService,
readonly wpNotificationsService:WorkPackageNotificationService,
readonly cdRef:ChangeDetectorRef,
readonly notificationsService:NotificationsService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}
public setValues(change:QuerySharingChange) {

@ -32,7 +32,7 @@ import {WorkPackageNotificationService} from '../../wp-edit/wp-notification.serv
import {QueryResource} from 'core-app/modules/hal/resources/query-resource';
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {Component, ElementRef, Inject, OnInit, ViewChild} from "@angular/core";
import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit, ViewChild} from "@angular/core";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {QuerySharingChange} from "core-components/modals/share-modal/query-sharing-form.component";
@ -62,10 +62,11 @@ export class QuerySharingModal extends OpModalComponent implements OnInit {
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly I18n:I18nService,
readonly states:States,
readonly cdRef:ChangeDetectorRef,
readonly wpListService:WorkPackagesListService,
readonly wpNotificationsService:WorkPackageNotificationService,
readonly notificationsService:NotificationsService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}
ngOnInit() {

@ -31,7 +31,7 @@ import {States} from '../../states.service';
import {WorkPackageNotificationService} from '../../wp-edit/wp-notification.service';
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";
import {OpModalComponent} from "core-components/op-modals/op-modal.component";
import {Component, ElementRef, Inject, OnInit} from "@angular/core";
import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from "@angular/core";
import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";
import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";
import {WorkPackageResource} from 'core-app/modules/hal/resources/work-package-resource';
@ -65,13 +65,14 @@ export class WpDestroyModal extends OpModalComponent implements OnInit {
readonly WorkPackageService:WorkPackageService,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly I18n:I18nService,
readonly cdRef:ChangeDetectorRef,
readonly $state:StateService,
readonly states:States,
readonly wpTableFocus:WorkPackageTableFocusService,
readonly wpListService:WorkPackagesListService,
readonly wpNotificationsService:WorkPackageNotificationService,
readonly notificationsService:NotificationsService) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}
ngOnInit() {

@ -1,4 +1,4 @@
import {ElementRef, OnDestroy, OnInit} from '@angular/core';
import {AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit} from '@angular/core';
import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';
import {OpModalService} from 'core-components/op-modals/op-modal.service';
import {EventEmitter} from '@angular/core';
@ -21,7 +21,9 @@ export abstract class OpModalComponent implements OnInit, OnDestroy {
public openingEvent = new EventEmitter<this>();
constructor(public locals:OpModalLocalsMap, readonly elementRef:ElementRef) {
constructor(public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
readonly elementRef:ElementRef) {
}
ngOnInit() {
@ -39,7 +41,7 @@ export abstract class OpModalComponent implements OnInit, OnDestroy {
* @returns {boolean}
*/
public onClose():boolean {
this.afterFocusOn.focus();
this.afterFocusOn && this.afterFocusOn.focus();
return true;
}
@ -49,6 +51,7 @@ export abstract class OpModalComponent implements OnInit, OnDestroy {
public onOpen(modalElement:JQuery) {
this.openingEvent.emit();
this.cdRef.detectChanges();
}
protected get afterFocusOn():JQuery {

@ -1,5 +1,5 @@
import {
ApplicationRef,
ApplicationRef, ChangeDetectorRef,
Component,
ComponentFactoryResolver,
ElementRef, EventEmitter,
@ -76,9 +76,10 @@ export class WpTableConfigurationModalComponent extends OpModalComponent impleme
readonly wpStatesInitialization:WorkPackageStatesInitializationService,
readonly wpNotificationsService:WorkPackageNotificationService,
readonly wpTableColumns:WorkPackageTableColumnsService,
readonly cdRef:ChangeDetectorRef,
readonly ConfigurationService:ConfigurationService,
readonly elementRef:ElementRef) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}
ngOnInit() {

@ -21,7 +21,7 @@ export function performAnchorHijacking(evt:JQueryEventObject, target:JQuery):voi
const hashPos = link.indexOf('#');
// If link is neither empty nor starts with hash, ignore it
if (link !== '' && hashPos === -1) {
if (link !== '' && hashPos !== 0) {
return;
}

@ -26,7 +26,7 @@
// See doc/COPYRIGHT.rdoc for more details.
// ++
import {Component, ElementRef, Inject} from '@angular/core';
import {ChangeDetectorRef, Component, ElementRef, Inject} from '@angular/core';
import {OpModalComponent} from 'core-components/op-modals/op-modal.component';
import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';
import {HelpTextResource} from 'core-app/modules/hal/resources/help-text-resource';
@ -53,8 +53,9 @@ export class AttributeHelpTextModal extends OpModalComponent {
constructor(@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly I18n:I18nService,
readonly cdRef:ChangeDetectorRef,
readonly elementRef:ElementRef) {
super(locals, elementRef);
super(locals, cdRef, elementRef);
}
public get helpTextLink() {

Loading…
Cancel
Save