refactoring
This commit is contained in:
parent
d3fa7d9124
commit
d9807e797b
@ -18,7 +18,7 @@
|
|||||||
<div class="tb-form-panel no-border no-padding padding-top" [formGroup]="serverConfigFormGroup">
|
<div class="tb-form-panel no-border no-padding padding-top" [formGroup]="serverConfigFormGroup">
|
||||||
<div class="server-settings">
|
<div class="server-settings">
|
||||||
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
||||||
<div class="fixed-title-width" translate>gateway.server-url</div>
|
<div class="fixed-title-width" tbTruncateTooltip translate>gateway.server-url</div>
|
||||||
<div class="tb-flex no-gap">
|
<div class="tb-flex no-gap">
|
||||||
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
||||||
<input matInput name="value" formControlName="url" placeholder="{{ 'gateway.set' | translate }}"/>
|
<input matInput name="value" formControlName="url" placeholder="{{ 'gateway.set' | translate }}"/>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
||||||
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'gateway.hints.opcua-timeout' | translate }}">
|
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'gateway.hints.opcua-timeout' | translate }}">
|
||||||
{{ 'gateway.timeout' | translate }}
|
<div tbTruncateTooltip>{{ 'gateway.timeout' | translate }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-flex no-gap">
|
<div class="tb-flex no-gap">
|
||||||
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
||||||
@ -55,7 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
||||||
<div class="fixed-title-width" translate>gateway.security</div>
|
<div class="fixed-title-width" tbTruncateTooltip translate>gateway.security</div>
|
||||||
<div class="tb-flex no-gap">
|
<div class="tb-flex no-gap">
|
||||||
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
||||||
<mat-select formControlName="security">
|
<mat-select formControlName="security">
|
||||||
@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
||||||
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'gateway.hints.scan-period' | translate }}">
|
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'gateway.hints.scan-period' | translate }}">
|
||||||
{{ 'gateway.scan-period' | translate }}
|
<div tbTruncateTooltip>{{ 'gateway.scan-period' | translate }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-flex no-gap">
|
<div class="tb-flex no-gap">
|
||||||
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
||||||
@ -87,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
<div class="tb-form-row column-xs" fxLayoutAlign="space-between center">
|
||||||
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'gateway.hints.sub-check-period' | translate }}">
|
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'gateway.hints.sub-check-period' | translate }}">
|
||||||
{{ 'gateway.sub-check-period' | translate }}
|
<div tbTruncateTooltip>{{ 'gateway.sub-check-period' | translate }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-flex no-gap">
|
<div class="tb-flex no-gap">
|
||||||
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
|
||||||
@ -110,7 +110,7 @@
|
|||||||
<div class="tb-form-row" fxLayoutAlign="space-between center">
|
<div class="tb-form-row" fxLayoutAlign="space-between center">
|
||||||
<mat-slide-toggle class="mat-slide" formControlName="enableSubscriptions">
|
<mat-slide-toggle class="mat-slide" formControlName="enableSubscriptions">
|
||||||
<mat-label tb-hint-tooltip-icon="{{ 'gateway.hints.enable-subscription' | translate }}">
|
<mat-label tb-hint-tooltip-icon="{{ 'gateway.hints.enable-subscription' | translate }}">
|
||||||
{{ 'gateway.enable-subscription' | translate }}
|
<div tbTruncateTooltip>{{ 'gateway.enable-subscription' | translate }}</div>
|
||||||
</mat-label>
|
</mat-label>
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -36,6 +36,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { SecurityConfigComponent } from '@home/components/widget/lib/gateway/connectors-configuration/public-api';
|
import { SecurityConfigComponent } from '@home/components/widget/lib/gateway/connectors-configuration/public-api';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { TooltipDirective } from '@shared/directives/public-api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-server-config',
|
selector: 'tb-server-config',
|
||||||
@ -59,6 +60,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
SecurityConfigComponent,
|
SecurityConfigComponent,
|
||||||
|
TooltipDirective,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ServerConfigComponent implements ControlValueAccessor, Validator, OnDestroy {
|
export class ServerConfigComponent implements ControlValueAccessor, Validator, OnDestroy {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<div class="tb-hint-tooltip">
|
<div class="tb-hint-tooltip">
|
||||||
<div class="tb-hint-tooltip-content" tbTruncateTooltip>
|
<div class="tb-hint-tooltip-content">
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
<tb-icon class="tb-hint-tooltip-icon tb-mat-18"
|
<tb-icon class="tb-hint-tooltip-icon tb-mat-18"
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
&-content {
|
&-content {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
max-width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-icon {
|
&-icon {
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
/// limitations under the License.
|
/// limitations under the License.
|
||||||
///
|
///
|
||||||
|
|
||||||
import { Component, HostBinding, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { TooltipPosition } from '@angular/material/tooltip';
|
import { TooltipPosition } from '@angular/material/tooltip';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -24,7 +24,6 @@ import { TooltipPosition } from '@angular/material/tooltip';
|
|||||||
})
|
})
|
||||||
export class HintTooltipIconComponent {
|
export class HintTooltipIconComponent {
|
||||||
|
|
||||||
@HostBinding('class.tb-hint-tooltip')
|
|
||||||
@Input('tb-hint-tooltip-icon') tooltipText: string;
|
@Input('tb-hint-tooltip-icon') tooltipText: string;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import {
|
|||||||
AfterViewInit,
|
AfterViewInit,
|
||||||
Directive,
|
Directive,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
inject,
|
|
||||||
Input,
|
Input,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
@ -39,18 +38,20 @@ export class TooltipDirective implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
@Input() tooltipEnabled = true;
|
@Input() tooltipEnabled = true;
|
||||||
@Input() position: TooltipPosition = 'above';
|
@Input() position: TooltipPosition = 'above';
|
||||||
|
|
||||||
private elementRef = inject(ElementRef);
|
|
||||||
private renderer = inject(Renderer2);
|
|
||||||
private tooltip = inject(MatTooltip);
|
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private elementRef: ElementRef,
|
||||||
|
private renderer: Renderer2,
|
||||||
|
private tooltip: MatTooltip
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.observeMouseEvents();
|
this.observeMouseEvents();
|
||||||
|
this.applyTruncationStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.applyTruncationStyles();
|
|
||||||
|
|
||||||
if (!this.text) {
|
if (!this.text) {
|
||||||
this.text = this.elementRef.nativeElement.innerText;
|
this.text = this.elementRef.nativeElement.innerText;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -219,7 +219,6 @@ import { ImageGalleryDialogComponent } from '@shared/components/image/image-gall
|
|||||||
import { RuleChainSelectPanelComponent } from '@shared/components/rule-chain/rule-chain-select-panel.component';
|
import { RuleChainSelectPanelComponent } from '@shared/components/rule-chain/rule-chain-select-panel.component';
|
||||||
import { WidgetButtonComponent } from '@shared/components/button/widget-button.component';
|
import { WidgetButtonComponent } from '@shared/components/button/widget-button.component';
|
||||||
import { HexInputComponent } from '@shared/components/color-picker/hex-input.component';
|
import { HexInputComponent } from '@shared/components/color-picker/hex-input.component';
|
||||||
import { TooltipDirective } from '@shared/directives/public-api';
|
|
||||||
|
|
||||||
export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) {
|
export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) {
|
||||||
return markedOptionsService;
|
return markedOptionsService;
|
||||||
@ -473,7 +472,6 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
|
|||||||
DndModule,
|
DndModule,
|
||||||
NgxFlowModule,
|
NgxFlowModule,
|
||||||
NgxFlowchartModule,
|
NgxFlowchartModule,
|
||||||
TooltipDirective,
|
|
||||||
// ngx-markdown
|
// ngx-markdown
|
||||||
MarkdownModule.forRoot({
|
MarkdownModule.forRoot({
|
||||||
sanitize: SecurityContext.NONE,
|
sanitize: SecurityContext.NONE,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user