Browse Source

Ignore that error.

pull/1077/head
Sebastian Stehle 3 years ago
parent
commit
abab1523ab
  1. 2
      frontend/src/app/features/settings/pages/jobs/job.component.html
  2. 11
      frontend/src/app/features/settings/pages/jobs/job.component.scss
  3. 13
      frontend/src/app/framework/angular/forms/editors/code-editor.component.ts
  4. 2
      frontend/src/app/framework/angular/global-error-handler.ts
  5. 6
      frontend/src/app/framework/angular/stateful.component.ts
  6. 1
      frontend/src/app/framework/angular/template.directive.ts

2
frontend/src/app/features/settings/pages/jobs/job.component.html

@ -53,7 +53,7 @@
</div>
<div class="row job-dump">
<div class="col-12">
<sqx-code-editor [ngModel]="details" disabled="true" wordWrap="true" height="auto" mode="ace/mode/text"></sqx-code-editor>
<sqx-code-editor [ngModel]="details" disabled="true" wordWrap="true" height="auto" minLines="12" mode="ace/mode/text"></sqx-code-editor>
</div>
</div>
</div>

11
frontend/src/app/features/settings/pages/jobs/job.component.scss

@ -8,8 +8,7 @@
}
.job {
&-header,
&-dump {
&-header {
padding: .75rem 1.25rem;
}
@ -27,6 +26,14 @@
}
}
:host ::ng-deep {
.ace_editor {
background: none !important;
border: 0 !important;
border-radius: 0 !important;
}
}
.btn-expand.expanded::before {
bottom: -1.35rem;
}

13
frontend/src/app/framework/angular/forms/editors/code-editor.component.ts

@ -51,6 +51,9 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple
@Input({ transform: numberAttribute })
public maxLines: number | undefined;
@Input({ transform: numberAttribute })
public minLines: number | undefined;
@Input({ transform: booleanAttribute })
public singleLine = false;
@ -71,7 +74,11 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple
@Input()
public set completion(value: ScriptCompletions | undefined | null) {
if (value) {
this.completions = value.map(({ path, description, type, ...other }) => ({ value: path, name: path, description, meta: type?.toLowerCase(), path, ...other }));
this.completions = value.map(source => {
const { path, description, type, ...other } = source;
return { value: path, name: path, description, meta: type?.toLowerCase(), path, ...other };
});
} else {
this.completions = [];
}
@ -88,7 +95,7 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple
this.setMode();
}
if (changes.height || changes.maxLines || changes.singleLine || changes.snippets) {
if (changes.height || changes.maxLines || changes.minLines || changes.singleLine || changes.snippets) {
this.setOptions();
}
@ -279,7 +286,7 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple
minLines = lines;
} else if (this.height === 'auto') {
maxLines = this.maxLines || 500;
minLines = Math.min(3, maxLines);
minLines = Math.max(this.minLines || 0, Math.min(3, maxLines));
}
} else {
maxLines = 1;

2
frontend/src/app/framework/angular/global-error-handler.ts

@ -27,7 +27,5 @@ export class GlobalErrorHandler implements ErrorHandler {
});
});
}
console.error(error);
}
}

6
frontend/src/app/framework/angular/stateful.component.ts

@ -20,7 +20,11 @@ export abstract class StatefulComponent<T extends {} = object> extends State<T>
this.subscription =
this.changes.pipe(skip(1)).subscribe(() => {
this.changeDetector.detectChanges();
try {
this.changeDetector.detectChanges();
} catch {
return;
}
});
}

1
frontend/src/app/framework/angular/template.directive.ts

@ -17,6 +17,5 @@ export class SidebarMenuDirective {
constructor(
public readonly templateRef: TemplateRef<unknown>,
) {
console.log('FAsd');
}
}
Loading…
Cancel
Save