Fixed error when leaving the settings too early

This commit is contained in:
FinnStutzenstein 2019-02-14 13:17:59 +01:00
parent 9785f67562
commit 8904472d23
8 changed files with 25 additions and 12 deletions

View File

@ -46,7 +46,7 @@ export class OpenSlidesTranslateService extends TranslateService {
* *
* @override * @override
*/ */
public get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> { public get(key: string | string[], interpolateParams?: Object): Observable<string | any> {
try { try {
return super.get(key, interpolateParams); return super.get(key, interpolateParams);
} catch { } catch {
@ -59,7 +59,7 @@ export class OpenSlidesTranslateService extends TranslateService {
* *
* @override * @override
*/ */
public stream(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> { public stream(key: string | string[], interpolateParams?: Object): Observable<string | any> {
try { try {
return super.stream(key, interpolateParams); return super.stream(key, interpolateParams);
} catch { } catch {
@ -72,7 +72,7 @@ export class OpenSlidesTranslateService extends TranslateService {
* *
* @override * @override
*/ */
public instant(key: string | Array<string>, interpolateParams?: Object): string | any { public instant(key: string | string[], interpolateParams?: Object): string | any {
try { try {
return super.instant(key, interpolateParams); return super.instant(key, interpolateParams);
} catch { } catch {

View File

@ -284,7 +284,7 @@ export class HtmlToPdfService {
* @param styles the styles array, usually just to parse back into the `parseElement` function * @param styles the styles array, usually just to parse back into the `parseElement` function
* @returns an array of parsed children * @returns an array of parsed children
*/ */
private parseChildren(element: any, styles?: Array<string>): any { private parseChildren(element: any, styles?: string[]): any {
const childNodes = element.childNodes; const childNodes = element.childNodes;
const paragraph = []; const paragraph = [];
if (childNodes.length > 0) { if (childNodes.length > 0) {

View File

@ -288,7 +288,7 @@ export class PdfDocumentService {
const columns = []; const columns = [];
let logoContainerWidth: string; let logoContainerWidth: string;
let pageNumberPosition: string; let pageNumberPosition: string;
let logoContainerSize: Array<number>; let logoContainerSize: number[];
let logoFooterLeftUrl = this.configService.instant<any>('logo_pdf_footer_L').path; let logoFooterLeftUrl = this.configService.instant<any>('logo_pdf_footer_L').path;
let logoFooterRightUrl = this.configService.instant<any>('logo_pdf_footer_R').path; let logoFooterRightUrl = this.configService.instant<any>('logo_pdf_footer_R').path;

View File

@ -34,7 +34,7 @@ describe('SearchValueSelectorComponent', () => {
}); });
it('should create', () => { it('should create', () => {
const subjectList: Array<Selectable> = []; const subjectList: Selectable[] = [];
for (let index = 0; index < 20; index++) { for (let index = 0; index < 20; index++) {
subjectList.push(new EmptySelectable()); subjectList.push(new EmptySelectable());
} }

View File

@ -31,7 +31,7 @@ describe('SortingListComponent', () => {
}); });
it('should create', () => { it('should create', () => {
const inputList: Array<Selectable> = []; const inputList: Selectable[] = [];
for (let index = 0; index < 20; index++) { for (let index = 0; index < 20; index++) {
inputList.push(new EmptySelectable()); inputList.push(new EmptySelectable());
} }

View File

@ -34,7 +34,7 @@ export class SortingListComponent implements OnInit, OnDestroy {
/** /**
* Sorted and returned * Sorted and returned
*/ */
public array: Array<Selectable>; public array: Selectable[];
/** /**
* Declare the templateRef to coexist between parent in child * Declare the templateRef to coexist between parent in child

View File

@ -187,11 +187,24 @@ export class ConfigFieldComponent extends BaseComponent implements OnInit {
} }
this.updateSuccessIconTimeout = <any>setTimeout(() => { this.updateSuccessIconTimeout = <any>setTimeout(() => {
this.updateSuccessIcon = false; this.updateSuccessIcon = false;
if (!this.wasViewDestroyed()) {
this.cdRef.detectChanges(); this.cdRef.detectChanges();
}
}, 2000); }, 2000);
this.updateSuccessIcon = true; this.updateSuccessIcon = true;
if (!this.wasViewDestroyed()) {
this.cdRef.detectChanges(); this.cdRef.detectChanges();
} }
}
/**
* @returns true, if the veiw was destroyed. Note: This
* needs to access internal attributes from the change detection
* reference.
*/
private wasViewDestroyed(): boolean {
return (<any>this.cdRef).destroyed;
}
/** /**
* Sets the error on this field. * Sets the error on this field.

View File

@ -164,7 +164,7 @@ export class MotionPollPdfService {
* @param subtitle: second line for the ballot. * @param subtitle: second line for the ballot.
* @returns an array of content objects defining pdfMake instructions * @returns an array of content objects defining pdfMake instructions
*/ */
private getContent(title: string, subtitle: string): Array<object> { private getContent(title: string, subtitle: string): object[] {
const content = []; const content = [];
const amount = this.getBallotCount(); const amount = this.getBallotCount();
const fullpages = Math.floor(amount / 8); const fullpages = Math.floor(amount / 8);
@ -275,7 +275,7 @@ export class MotionPollPdfService {
* @param size the size of the circle * @param size the size of the circle
* @returns an array containing one circle definition for pdfMake * @returns an array containing one circle definition for pdfMake
*/ */
private drawCircle(y: number, size: number): Array<object> { private drawCircle(y: number, size: number): object[] {
return [ return [
{ {
type: 'ellipse', type: 'ellipse',