Browse Source

Fixed cf test script dialog styles

pull/12850/head
mpetrov 2 years ago
parent
commit
7e49cd9ef0
  1. 2
      ui-ngx/src/app/modules/home/components/calculated-fields/components/test-dialog/calculated-field-script-test-dialog.component.html
  2. 107
      ui-ngx/src/app/modules/home/components/calculated-fields/components/test-dialog/calculated-field-script-test-dialog.component.scss
  3. 4
      ui-ngx/src/app/modules/home/components/calculated-fields/components/test-dialog/calculated-field-script-test-dialog.component.ts

2
ui-ngx/src/app/modules/home/components/calculated-fields/components/test-dialog/calculated-field-script-test-dialog.component.html

@ -15,7 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<form #testScriptContainer class="test-dialog-container size-full" [formGroup]="calculatedFieldScriptTestFormGroup"> <form #testScriptContainer class="cf-test-dialog-container size-full" [formGroup]="calculatedFieldScriptTestFormGroup">
<mat-toolbar class="flex justify-between" color="primary"> <mat-toolbar class="flex justify-between" color="primary">
<h2>{{ 'calculated-fields.test-script-function' | translate }} ({{ 'api-usage.tbel' | translate }})</h2> <h2>{{ 'calculated-fields.test-script-function' | translate }} ({{ 'api-usage.tbel' | translate }})</h2>
<button mat-icon-button <button mat-icon-button

107
ui-ngx/src/app/modules/home/components/calculated-fields/components/test-dialog/calculated-field-script-test-dialog.component.scss

@ -13,62 +13,79 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
:host {
.test-dialog-container {
.block-label {
padding: 4px;
color: #00acc1;
background: rgba(220, 220, 220, .35);
border-radius: 5px;
}
.test-block-content { .cf-test-dialog-container {
padding-top: 5px; .gutter {
padding-left: 5px; background-color: #eee;
border: 1px solid #c0c0c0; background-repeat: no-repeat;
overflow: scroll; background-position: 50%;
} }
.block-label-container { .gutter.gutter-horizontal {
position: absolute; cursor: col-resize;
z-index: 10; background-image: url("../../../../../../../assets/split.js/grips/horizontal.png");
font-size: 12px; }
font-weight: bold;
&.left { .gutter.gutter-vertical {
right: 112px; cursor: row-resize;
top: 9px; background-image: url("../../../../../../../assets/split.js/grips/vertical.png");
} }
&.right-bottom { .block-label {
right: 40px; padding: 4px;
top: 6px; color: #00acc1;
} background: rgba(220, 220, 220, .35);
border-radius: 5px;
}
&.right-top { .test-block-content {
right: 8px; padding-top: 5px;
top: 2px; padding-left: 5px;
} border: 1px solid #c0c0c0;
} overflow: scroll;
} }
}
:host::ng-deep { .block-label-container {
.test-dialog-container { position: absolute;
.gutter { z-index: 10;
background-color: #eee; font-size: 12px;
background-repeat: no-repeat; font-weight: bold;
background-position: 50%;
&.left {
right: 112px;
top: 9px;
}
&.right-bottom {
right: 40px;
top: 6px;
} }
.gutter.gutter-horizontal { &.right-top {
cursor: col-resize; right: 8px;
background-image: url("../../../../../../../assets/split.js/grips/horizontal.png"); top: 2px;
} }
}
}
.gutter.gutter-vertical { .tb-js-func {
cursor: row-resize; .ace_tb {
background-image: url("../../../../../../../assets/split.js/grips/vertical.png"); &.ace_calculated-field {
&-ctx {
color: #C52F00;
}
&-args {
color: #185F2A;
}
&-key {
color: #c24c1a;
}
&-time-window, &-values, &-func, &-value, &-ts {
color: #7214D0;
}
&-start-ts, &-end-ts {
color: #2CAA00;
}
} }
} }
} }

4
ui-ngx/src/app/modules/home/components/calculated-fields/components/test-dialog/calculated-field-script-test-dialog.component.ts

@ -22,6 +22,7 @@ import {
Inject, Inject,
OnDestroy, OnDestroy,
ViewChild, ViewChild,
ViewEncapsulation,
} from '@angular/core'; } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
@ -49,6 +50,7 @@ import {
selector: 'tb-calculated-field-script-test-dialog', selector: 'tb-calculated-field-script-test-dialog',
templateUrl: './calculated-field-script-test-dialog.component.html', templateUrl: './calculated-field-script-test-dialog.component.html',
styleUrls: ['./calculated-field-script-test-dialog.component.scss'], styleUrls: ['./calculated-field-script-test-dialog.component.scss'],
encapsulation: ViewEncapsulation.None
}) })
export class CalculatedFieldScriptTestDialogComponent extends DialogComponent<CalculatedFieldScriptTestDialogComponent, export class CalculatedFieldScriptTestDialogComponent extends DialogComponent<CalculatedFieldScriptTestDialogComponent,
string> implements AfterViewInit, OnDestroy { string> implements AfterViewInit, OnDestroy {
@ -70,7 +72,7 @@ export class CalculatedFieldScriptTestDialogComponent extends DialogComponent<Ca
readonly ContentType = ContentType; readonly ContentType = ContentType;
readonly ScriptLanguage = ScriptLanguage; readonly ScriptLanguage = ScriptLanguage;
readonly functionArgs = Object.keys(this.data.arguments); readonly functionArgs = ['ctx', ...Object.keys(this.data.arguments)];
private testScriptResize: ResizeObserver; private testScriptResize: ResizeObserver;
private splitObjects: SplitObject[] = []; private splitObjects: SplitObject[] = [];

Loading…
Cancel
Save