Commit 720d26483289d35403c6f2a747029a3447214bb3

Authored by Igor Kulikov
1 parent 69e2f0c1

Use signleton marked options service. Fix popover size to not overflow viewport …

…size. Add path routing for rulenode help assets to k8s ingress configuration.
... ... @@ -424,6 +424,10 @@ spec:
424 424 backend:
425 425 serviceName: tb-node
426 426 servicePort: 8080
  427 + - path: /assets/help/.*/rulenode/.*
  428 + backend:
  429 + serviceName: tb-node
  430 + servicePort: 8080
427 431 - path: /oauth2/.*
428 432 backend:
429 433 serviceName: tb-node
... ...
... ... @@ -15,7 +15,7 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" style="padding-top: 150px;" tb-toast toastTarget="dashboardRoot"
  18 +<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" tb-toast toastTarget="dashboardRoot"
19 19 fxFlex tb-fullscreen [fullscreen]="widgetEditMode || iframeMode || forceFullscreen || isFullscreen">
20 20 <tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet>
21 21 <section class="tb-dashboard-toolbar"
... ...
... ... @@ -1355,8 +1355,9 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI
1355 1355 parentDashboard: this.widgetContext.parentDashboard ?
1356 1356 this.widgetContext.parentDashboard : this.widgetContext.dashboard
1357 1357 },
  1358 + {width: popoverWidth, height: popoverHeight},
1358 1359 popoverStyle,
1359   - {width: popoverWidth, height: popoverHeight}
  1360 + {}
1360 1361 );
1361 1362 this.widgetContext.registerPopoverComponent(component);
1362 1363 }
... ... @@ -1398,6 +1399,7 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI
1398 1399 this.dialog.open(this.embedDashboardDialogComponent, {
1399 1400 disableClose: true,
1400 1401 panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
  1402 + viewContainerRef: this.widgetContentContainer,
1401 1403 data: {
1402 1404 dashboard,
1403 1405 state: objToBase64([ stateObject ]),
... ...
... ... @@ -16,8 +16,8 @@
16 16 :host {
17 17 .tb-help-markdown {
18 18 overflow: auto;
19   - max-width: 50vw;
20   - max-height: 50vh;
  19 + max-width: 80vw;
  20 + max-height: 80vh;
21 21 margin-top: 30px;
22 22 }
23 23 }
... ...
... ... @@ -31,6 +31,8 @@ $box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0,
31 31 text-align: left;
32 32 cursor: auto;
33 33 user-select: text;
  34 + max-width: 100vw;
  35 + max-height: 100vh;
34 36
35 37 &::after {
36 38 position: absolute;
... ... @@ -74,6 +76,8 @@ $box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0,
74 76 box-shadow: $box-shadow-base;
75 77 overflow: hidden;
76 78 position: relative;
  79 + width: 100%;
  80 + height: 100%;
77 81 }
78 82
79 83 &-close-button {
... ... @@ -97,9 +101,17 @@ $box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0,
97 101 }
98 102 }
99 103
  104 + &-content {
  105 + width: 100%;
  106 + height: 100%;
  107 + }
  108 +
100 109 &-inner-content {
101 110 padding: 12px 16px;
102 111 color: rgba(0, 0, 0, 0.85);
  112 + overflow: auto;
  113 + width: 100%;
  114 + height: 100%;
103 115 }
104 116
105 117 // Arrows
... ...
... ... @@ -312,7 +312,7 @@ export class TbPopoverService {
312 312
313 313 displayPopover<T>(trigger: Element, renderer: Renderer2, hostView: ViewContainerRef,
314 314 componentType: Type<T>, preferredPlacement: PopoverPlacement = 'top', hideOnClickOutside = true,
315   - injector?: Injector, context?: any, popoverStyle: any = {}, style?: any): TbPopoverComponent {
  315 + injector?: Injector, context?: any, overlayStyle: any = {}, popoverStyle: any = {}, style?: any): TbPopoverComponent {
316 316 const componentRef = hostView.createComponent(this.componentFactory);
317 317 const component = componentRef.instance;
318 318 this.popoverWithTriggers.push({
... ... @@ -329,6 +329,7 @@ export class TbPopoverService {
329 329 component.tbComponentFactory = this.resolver.resolveComponentFactory(componentType);
330 330 component.tbComponentInjector = injector;
331 331 component.tbComponentContext = context;
  332 + component.tbOverlayStyle = overlayStyle;
332 333 component.tbPopoverInnerStyle = popoverStyle;
333 334 component.tbComponentStyle = style;
334 335 component.tbHideOnClickOutside = hideOnClickOutside;
... ... @@ -474,7 +475,7 @@ export class TbPopoverService {
474 475 </div>
475 476 <div class="tb-popover-inner" [ngStyle]="tbPopoverInnerStyle" role="tooltip">
476 477 <div class="tb-popover-close-button" (click)="closeButtonClick($event)">×</div>
477   - <div>
  478 + <div style="width: 100%; height: 100%;">
478 479 <div class="tb-popover-inner-content">
479 480 <ng-container *ngIf="tbContent">
480 481 <ng-container *tbStringTemplateOutlet="tbContent">{{ tbContent }}</ng-container>
... ...
... ... @@ -314,7 +314,8 @@ import { MarkedOptionsService } from '@shared/components/marked-options.service'
314 314 sanitize: SecurityContext.NONE,
315 315 markedOptions: {
316 316 provide: MarkedOptions,
317   - useClass: MarkedOptionsService
  317 + useFactory: (markedOptionsService: MarkedOptionsService) => markedOptionsService,
  318 + deps: [MarkedOptionsService]
318 319 }
319 320 })
320 321 ],
... ...