oip-common 0.1.8 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ {
2
+ "iframe-module": {
3
+ "iframeModule": {
4
+ "urlPlaceholder": "Site URL",
5
+ "settingSaveButtonLabel": "Save",
6
+ "emptyUrlMessage": "Site URL is not specified.",
7
+ "siteLoadingMessage": "Failed to load the site."
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "iframe-module": {
3
+ "iframeModule": {
4
+ "urlPlaceholder": "URL сайта",
5
+ "settingSaveButtonLabel": "Сохранить",
6
+ "emptyUrlMessage": "URL сайта не указан.",
7
+ "siteLoadingMessage": "Не удалось загрузить сайт."
8
+ }
9
+ }
10
+ }
@@ -39,7 +39,7 @@ import { ContextMenuModule, ContextMenu } from 'primeng/contextmenu';
39
39
  import * as i2$3 from 'primeng/dialog';
40
40
  import { DialogModule } from 'primeng/dialog';
41
41
  import * as i3$3 from 'primeng/inputtext';
42
- import { InputTextModule } from 'primeng/inputtext';
42
+ import { InputTextModule, InputText } from 'primeng/inputtext';
43
43
  import { trigger, state, transition, style, animate } from '@angular/animations';
44
44
  import * as i3$2 from 'primeng/ripple';
45
45
  import { RippleModule } from 'primeng/ripple';
@@ -1177,76 +1177,76 @@ class SecurityComponent {
1177
1177
  }
1178
1178
  }
1179
1179
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SecurityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1180
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: SecurityComponent, isStandalone: true, selector: "security", inputs: { id: "id", controller: "controller" }, usesOnChanges: true, ngImport: i0, template: `
1181
- <div class="flex flex-col md:flex-row gap-8">
1182
- <div class="md:w-1/2">
1183
- <div class="card flex flex-col gap-4">
1184
- <div class="font-semibold text-xl">
1185
- {{ 'securityComponent.security' | translate }}
1186
- </div>
1187
- @for (item of securityData; track item.name) {
1188
- <div class="flex flex-col gap-2">
1189
- <label htmlFor="oip-security-multiselect-{{ item.name }}">
1190
- {{ item.name }}
1191
- <span class="pi pi-question-circle" pTooltip="{{ item.description }}" tooltipPosition="right"></span>
1192
- </label>
1193
- <p-multiSelect
1194
- id="oip-security-multiselect-{{ item.name }}"
1195
- placeholder="{{ 'securityComponent.selectRoles' | translate }}"
1196
- [maxSelectedLabels]="10"
1197
- [options]="roles"
1198
- [(ngModel)]="item.roles" />
1199
- </div>
1200
- }
1201
- <div class="flex justify-content-end flex-wrap">
1202
- <p-button
1203
- icon="pi pi-save"
1204
- id="oip-security-save-button"
1205
- label="{{ 'securityComponent.save' | translate }}"
1206
- (click)="saveClick()"
1207
- (keydown)="saveKeyDown($event)" />
1208
- </div>
1209
- </div>
1210
- </div>
1211
- </div>
1180
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: SecurityComponent, isStandalone: true, selector: "security", inputs: { id: "id", controller: "controller" }, usesOnChanges: true, ngImport: i0, template: `
1181
+ <div class="flex flex-col md:flex-row gap-8">
1182
+ <div class="md:w-1/2">
1183
+ <div class="card flex flex-col gap-4">
1184
+ <div class="font-semibold text-xl">
1185
+ {{ 'securityComponent.security' | translate }}
1186
+ </div>
1187
+ @for (item of securityData; track item.name) {
1188
+ <div class="flex flex-col gap-2">
1189
+ <label htmlFor="oip-security-multiselect-{{ item.name }}">
1190
+ {{ item.name }}
1191
+ <span class="pi pi-question-circle" pTooltip="{{ item.description }}" tooltipPosition="right"></span>
1192
+ </label>
1193
+ <p-multiSelect
1194
+ id="oip-security-multiselect-{{ item.name }}"
1195
+ placeholder="{{ 'securityComponent.selectRoles' | translate }}"
1196
+ [maxSelectedLabels]="10"
1197
+ [options]="roles"
1198
+ [(ngModel)]="item.roles" />
1199
+ </div>
1200
+ }
1201
+ <div class="flex justify-content-end flex-wrap">
1202
+ <p-button
1203
+ icon="pi pi-save"
1204
+ id="oip-security-save-button"
1205
+ label="{{ 'securityComponent.save' | translate }}"
1206
+ (click)="saveClick()"
1207
+ (keydown)="saveKeyDown($event)" />
1208
+ </div>
1209
+ </div>
1210
+ </div>
1211
+ </div>
1212
1212
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i1.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1213
1213
  }
1214
1214
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SecurityComponent, decorators: [{
1215
1215
  type: Component,
1216
1216
  args: [{
1217
1217
  selector: 'security',
1218
- template: `
1219
- <div class="flex flex-col md:flex-row gap-8">
1220
- <div class="md:w-1/2">
1221
- <div class="card flex flex-col gap-4">
1222
- <div class="font-semibold text-xl">
1223
- {{ 'securityComponent.security' | translate }}
1224
- </div>
1225
- @for (item of securityData; track item.name) {
1226
- <div class="flex flex-col gap-2">
1227
- <label htmlFor="oip-security-multiselect-{{ item.name }}">
1228
- {{ item.name }}
1229
- <span class="pi pi-question-circle" pTooltip="{{ item.description }}" tooltipPosition="right"></span>
1230
- </label>
1231
- <p-multiSelect
1232
- id="oip-security-multiselect-{{ item.name }}"
1233
- placeholder="{{ 'securityComponent.selectRoles' | translate }}"
1234
- [maxSelectedLabels]="10"
1235
- [options]="roles"
1236
- [(ngModel)]="item.roles" />
1237
- </div>
1238
- }
1239
- <div class="flex justify-content-end flex-wrap">
1240
- <p-button
1241
- icon="pi pi-save"
1242
- id="oip-security-save-button"
1243
- label="{{ 'securityComponent.save' | translate }}"
1244
- (click)="saveClick()"
1245
- (keydown)="saveKeyDown($event)" />
1246
- </div>
1247
- </div>
1248
- </div>
1249
- </div>
1218
+ template: `
1219
+ <div class="flex flex-col md:flex-row gap-8">
1220
+ <div class="md:w-1/2">
1221
+ <div class="card flex flex-col gap-4">
1222
+ <div class="font-semibold text-xl">
1223
+ {{ 'securityComponent.security' | translate }}
1224
+ </div>
1225
+ @for (item of securityData; track item.name) {
1226
+ <div class="flex flex-col gap-2">
1227
+ <label htmlFor="oip-security-multiselect-{{ item.name }}">
1228
+ {{ item.name }}
1229
+ <span class="pi pi-question-circle" pTooltip="{{ item.description }}" tooltipPosition="right"></span>
1230
+ </label>
1231
+ <p-multiSelect
1232
+ id="oip-security-multiselect-{{ item.name }}"
1233
+ placeholder="{{ 'securityComponent.selectRoles' | translate }}"
1234
+ [maxSelectedLabels]="10"
1235
+ [options]="roles"
1236
+ [(ngModel)]="item.roles" />
1237
+ </div>
1238
+ }
1239
+ <div class="flex justify-content-end flex-wrap">
1240
+ <p-button
1241
+ icon="pi pi-save"
1242
+ id="oip-security-save-button"
1243
+ label="{{ 'securityComponent.save' | translate }}"
1244
+ (click)="saveClick()"
1245
+ (keydown)="saveKeyDown($event)" />
1246
+ </div>
1247
+ </div>
1248
+ </div>
1249
+ </div>
1250
1250
  `,
1251
1251
  imports: [MultiSelectModule, TooltipModule, FormsModule, ButtonModule, TranslatePipe],
1252
1252
  standalone: true
@@ -2471,16 +2471,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
2471
2471
  class MenuApi extends HttpClient {
2472
2472
  constructor() {
2473
2473
  super(...arguments);
2474
- /**
2475
- * @description Retrieves the menu available to the current authenticated user.
2476
- *
2477
- * @tags Menu
2478
- * @name get
2479
- * @summary Retrieves the menu available to the current authenticated user.
2480
- * @request GET:/api/menu/get
2481
- * @secure
2482
- * @response `200` `(ModuleInstanceDto)[]` OK
2483
- */
2484
2474
  this.get = (params = {}) => this.request({
2485
2475
  path: `/api/menu/get`,
2486
2476
  method: "GET",
@@ -2488,16 +2478,6 @@ class MenuApi extends HttpClient {
2488
2478
  format: "json",
2489
2479
  ...params,
2490
2480
  });
2491
- /**
2492
- * @description Retrieves the admin-specific menu.
2493
- *
2494
- * @tags Menu
2495
- * @name getAdminMenu
2496
- * @summary Retrieves the admin-specific menu.
2497
- * @request GET:/api/menu/get-admin-menu
2498
- * @secure
2499
- * @response `200` `(ModuleInstanceDto)[]` OK
2500
- */
2501
2481
  this.getAdminMenu = (params = {}) => this.request({
2502
2482
  path: `/api/menu/get-admin-menu`,
2503
2483
  method: "GET",
@@ -2505,16 +2485,6 @@ class MenuApi extends HttpClient {
2505
2485
  format: "json",
2506
2486
  ...params,
2507
2487
  });
2508
- /**
2509
- * @description Retrieves all available modules in the system.
2510
- *
2511
- * @tags Menu
2512
- * @name getModules
2513
- * @summary Retrieves all available modules in the system.
2514
- * @request GET:/api/menu/get-modules
2515
- * @secure
2516
- * @response `200` `(IntKeyValueDto)[]` OK
2517
- */
2518
2488
  this.getModules = (params = {}) => this.request({
2519
2489
  path: `/api/menu/get-modules`,
2520
2490
  method: "GET",
@@ -2522,17 +2492,6 @@ class MenuApi extends HttpClient {
2522
2492
  format: "json",
2523
2493
  ...params,
2524
2494
  });
2525
- /**
2526
- * @description Adds a new module instance to the system.
2527
- *
2528
- * @tags Menu
2529
- * @name addModuleInstance
2530
- * @summary Adds a new module instance to the system.
2531
- * @request POST:/api/menu/add-module-instance
2532
- * @secure
2533
- * @response `200` `void` OK
2534
- * @response `500` `ApiExceptionResponse` Internal Server Error
2535
- */
2536
2495
  this.addModuleInstance = (data, params = {}) => this.request({
2537
2496
  path: `/api/menu/add-module-instance`,
2538
2497
  method: "POST",
@@ -2541,17 +2500,6 @@ class MenuApi extends HttpClient {
2541
2500
  type: ContentType.Json,
2542
2501
  ...params,
2543
2502
  });
2544
- /**
2545
- * @description Edits an existing module instance.
2546
- *
2547
- * @tags Menu
2548
- * @name editModuleInstance
2549
- * @summary Edits an existing module instance.
2550
- * @request POST:/api/menu/edit-module-instance
2551
- * @secure
2552
- * @response `200` `void` OK
2553
- * @response `500` `ApiExceptionResponse` Internal Server Error
2554
- */
2555
2503
  this.editModuleInstance = (data, params = {}) => this.request({
2556
2504
  path: `/api/menu/edit-module-instance`,
2557
2505
  method: "POST",
@@ -2560,17 +2508,6 @@ class MenuApi extends HttpClient {
2560
2508
  type: ContentType.Json,
2561
2509
  ...params,
2562
2510
  });
2563
- /**
2564
- * @description Deletes a module instance by its identifier.
2565
- *
2566
- * @tags Menu
2567
- * @name deleteModuleInstance
2568
- * @summary Deletes a module instance by its identifier.
2569
- * @request DELETE:/api/menu/delete-module-instance
2570
- * @secure
2571
- * @response `200` `void` OK
2572
- * @response `500` `ApiExceptionResponse` Internal Server Error
2573
- */
2574
2511
  this.deleteModuleInstance = (query, params = {}) => this.request({
2575
2512
  path: `/api/menu/delete-module-instance`,
2576
2513
  method: "DELETE",
@@ -2578,17 +2515,6 @@ class MenuApi extends HttpClient {
2578
2515
  secure: true,
2579
2516
  ...params,
2580
2517
  });
2581
- /**
2582
- * @description Swaps the order positions of two modules in the menu structure.
2583
- *
2584
- * @tags Menu
2585
- * @name changeOrder
2586
- * @summary Swaps the order positions of two modules in the menu structure.
2587
- * @request POST:/api/menu/change-order
2588
- * @secure
2589
- * @response `200` `void` OK
2590
- * @response `500` `ApiExceptionResponse` Internal Server Error
2591
- */
2592
2518
  this.changeOrder = (query, params = {}) => this.request({
2593
2519
  path: `/api/menu/change-order`,
2594
2520
  method: "POST",
@@ -4463,18 +4389,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
4463
4389
  class ModuleApi extends HttpClient {
4464
4390
  constructor() {
4465
4391
  super(...arguments);
4466
- /**
4467
- * @description Retrieves all modules stored in the system.
4468
- *
4469
- * @tags Module
4470
- * @name getAll
4471
- * @summary Retrieves all modules stored in the system.
4472
- * @request GET:/api/module/get-all
4473
- * @secure
4474
- * @response `200` `(ModuleDto)[]` OK
4475
- * @response `401` `ApiExceptionResponse` Unauthorized
4476
- * @response `403` `ApiExceptionResponse` Forbidden
4477
- */
4478
4392
  this.getAll = (params = {}) => this.request({
4479
4393
  path: `/api/module/get-all`,
4480
4394
  method: "GET",
@@ -4482,18 +4396,6 @@ class ModuleApi extends HttpClient {
4482
4396
  format: "json",
4483
4397
  ...params,
4484
4398
  });
4485
- /**
4486
- * @description Inserts a new module into the system.
4487
- *
4488
- * @tags Module
4489
- * @name insert
4490
- * @summary Inserts a new module into the system.
4491
- * @request POST:/api/module/insert
4492
- * @secure
4493
- * @response `200` `void` OK
4494
- * @response `401` `ApiExceptionResponse` Unauthorized
4495
- * @response `403` `ApiExceptionResponse` Forbidden
4496
- */
4497
4399
  this.insert = (data, params = {}) => this.request({
4498
4400
  path: `/api/module/insert`,
4499
4401
  method: "POST",
@@ -4502,18 +4404,6 @@ class ModuleApi extends HttpClient {
4502
4404
  type: ContentType.Json,
4503
4405
  ...params,
4504
4406
  });
4505
- /**
4506
- * @description Deletes a module by its identifier.
4507
- *
4508
- * @tags Module
4509
- * @name delete
4510
- * @summary Deletes a module by its identifier.
4511
- * @request DELETE:/api/module/delete
4512
- * @secure
4513
- * @response `200` `void` OK
4514
- * @response `401` `ApiExceptionResponse` Unauthorized
4515
- * @response `403` `ApiExceptionResponse` Forbidden
4516
- */
4517
4407
  this.delete = (data, params = {}) => this.request({
4518
4408
  path: `/api/module/delete`,
4519
4409
  method: "DELETE",
@@ -4522,18 +4412,6 @@ class ModuleApi extends HttpClient {
4522
4412
  type: ContentType.Json,
4523
4413
  ...params,
4524
4414
  });
4525
- /**
4526
- * @description Returns all registered modules and indicates whether each one is currently loaded into the application.
4527
- *
4528
- * @tags Module
4529
- * @name getModulesWithLoadStatus
4530
- * @summary Returns all registered modules and indicates whether each one is currently loaded into the application.
4531
- * @request GET:/api/module/get-modules-with-load-status
4532
- * @secure
4533
- * @response `200` `(ExistModuleDto)[]` OK
4534
- * @response `401` `ApiExceptionResponse` Unauthorized
4535
- * @response `403` `ApiExceptionResponse` Forbidden
4536
- */
4537
4415
  this.getModulesWithLoadStatus = (params = {}) => this.request({
4538
4416
  path: `/api/module/get-modules-with-load-status`,
4539
4417
  method: "GET",
@@ -6081,6 +5959,152 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
6081
5959
  args: [{ required: true }]
6082
5960
  }] } });
6083
5961
 
5962
+ class IframeModuleComponent extends BaseModuleComponent {
5963
+ constructor() {
5964
+ super();
5965
+ this.renderer = inject(Renderer2);
5966
+ this.translate = inject(TranslateService);
5967
+ this.iframeUrl = null;
5968
+ this.l10nService.loadComponentTranslations('iframe-module');
5969
+ }
5970
+ set iframeElement(element) {
5971
+ this.iframe = element;
5972
+ this.updateIframeSrc();
5973
+ }
5974
+ setIframeUrl(url) {
5975
+ const iframeUrl = url?.trim();
5976
+ if (!iframeUrl) {
5977
+ this.iframeUrl = null;
5978
+ this.updateIframeSrc();
5979
+ const message = this.translate.instant('iframe-module.iframeModule.emptyUrlMessage');
5980
+ this.msgService.warn(message);
5981
+ return;
5982
+ }
5983
+ if (!this.isAllowedIframeUrl(iframeUrl)) {
5984
+ this.iframeUrl = null;
5985
+ this.updateIframeSrc();
5986
+ const message = this.translate.instant('iframe-module.iframeModule.siteLoadingMessage');
5987
+ this.msgService.error(message);
5988
+ return;
5989
+ }
5990
+ this.iframeUrl = iframeUrl;
5991
+ this.updateIframeSrc();
5992
+ }
5993
+ isAllowedIframeUrl(url) {
5994
+ try {
5995
+ const parsedUrl = new URL(url, window.location.origin);
5996
+ return parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:';
5997
+ }
5998
+ catch {
5999
+ return false;
6000
+ }
6001
+ }
6002
+ async onModuleInstanceChange() {
6003
+ this.setIframeUrl(this.settings.url);
6004
+ }
6005
+ updateIframeSrc() {
6006
+ if (!this.iframe) {
6007
+ return;
6008
+ }
6009
+ if (!this.iframeUrl) {
6010
+ this.renderer.removeAttribute(this.iframe.nativeElement, 'src');
6011
+ return;
6012
+ }
6013
+ this.renderer.setAttribute(this.iframe.nativeElement, 'src', this.iframeUrl);
6014
+ }
6015
+ onIframeError() {
6016
+ const errorMessage = this.translate.instant('iframe-module.iframeModule.siteLoadingMessage');
6017
+ this.msgService.error(errorMessage);
6018
+ }
6019
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IframeModuleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6020
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: IframeModuleComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "iframeElement", first: true, predicate: ["iframe"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
6021
+ @if (isContent) {
6022
+ <iframe
6023
+ #iframe
6024
+ class="w-full h-screen"
6025
+ style="background-color: var(--surface-ground)"
6026
+ title="Main iframe"
6027
+ (error)="onIframeError()">
6028
+ </iframe>
6029
+ } @else if (isSettings) {
6030
+ <div class="flex flex-col md:flex-row gap-8">
6031
+ <div class="md:w-1/2">
6032
+ <div class="card flex flex-col gap-4">
6033
+ <div class="font-semibold text-xl">{{ 'baseComponent.settings' | translate }}</div>
6034
+ <div class="col-span-30 md:col-span-10 w-full">
6035
+ <input
6036
+ class="w-full"
6037
+ pInputText
6038
+ placeholder="{{ 'iframe-module.iframeModule.urlPlaceholder' | translate }}"
6039
+ qa-id="iframe-module-settings-site-url-input"
6040
+ type="text"
6041
+ [(ngModel)]="settings.url"/>
6042
+ </div>
6043
+ <div class="flex justify-end">
6044
+ <p-button
6045
+ icon="pi pi-save"
6046
+ label="{{ 'iframe-module.iframeModule.settingSaveButtonLabel' | translate }}"
6047
+ qa-id="iframe-module-settings-save-button"
6048
+ (onClick)="saveSettings(settings)">
6049
+ </p-button>
6050
+ </div>
6051
+ </div>
6052
+ </div>
6053
+ </div>
6054
+ } @else if (isSecurity) {
6055
+ <security [controller]="controller" [id]="id"/>
6056
+ }
6057
+ `, isInline: true, dependencies: [{ kind: "component", type: SecurityComponent, selector: "security", inputs: ["id", "controller"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
6058
+ }
6059
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IframeModuleComponent, decorators: [{
6060
+ type: Component,
6061
+ args: [{
6062
+ standalone: true,
6063
+ imports: [SecurityComponent, TranslatePipe, InputText, FormsModule, Button],
6064
+ template: `
6065
+ @if (isContent) {
6066
+ <iframe
6067
+ #iframe
6068
+ class="w-full h-screen"
6069
+ style="background-color: var(--surface-ground)"
6070
+ title="Main iframe"
6071
+ (error)="onIframeError()">
6072
+ </iframe>
6073
+ } @else if (isSettings) {
6074
+ <div class="flex flex-col md:flex-row gap-8">
6075
+ <div class="md:w-1/2">
6076
+ <div class="card flex flex-col gap-4">
6077
+ <div class="font-semibold text-xl">{{ 'baseComponent.settings' | translate }}</div>
6078
+ <div class="col-span-30 md:col-span-10 w-full">
6079
+ <input
6080
+ class="w-full"
6081
+ pInputText
6082
+ placeholder="{{ 'iframe-module.iframeModule.urlPlaceholder' | translate }}"
6083
+ qa-id="iframe-module-settings-site-url-input"
6084
+ type="text"
6085
+ [(ngModel)]="settings.url"/>
6086
+ </div>
6087
+ <div class="flex justify-end">
6088
+ <p-button
6089
+ icon="pi pi-save"
6090
+ label="{{ 'iframe-module.iframeModule.settingSaveButtonLabel' | translate }}"
6091
+ qa-id="iframe-module-settings-save-button"
6092
+ (onClick)="saveSettings(settings)">
6093
+ </p-button>
6094
+ </div>
6095
+ </div>
6096
+ </div>
6097
+ </div>
6098
+ } @else if (isSecurity) {
6099
+ <security [controller]="controller" [id]="id"/>
6100
+ }
6101
+ `
6102
+ }]
6103
+ }], ctorParameters: () => [], propDecorators: { iframeElement: [{
6104
+ type: ViewChild,
6105
+ args: ['iframe']
6106
+ }] } });
6107
+
6084
6108
  /**
6085
6109
  * A route guard that ensures the user is authenticated and has a valid access token.
6086
6110
  * If the access token is expired, it attempts to refresh the session.
@@ -6309,6 +6333,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
6309
6333
  }]
6310
6334
  }] });
6311
6335
 
6336
+ const appendCurrentOriginSecureRoute = (secureRoutes) => {
6337
+ const currentOriginRoute = `${window.location.origin}/`;
6338
+ return Array.from(new Set([...(secureRoutes ?? []), currentOriginRoute]));
6339
+ };
6312
6340
  /**
6313
6341
  * Load keycloak settings from backend and save to sessionStorage
6314
6342
  * @param httpClient
@@ -6335,7 +6363,7 @@ const httpLoaderAuthFactory = (httpClient) => {
6335
6363
  useRefreshToken: config.useRefreshToken,
6336
6364
  silentRenew: config.silentRenew,
6337
6365
  logLevel: config.logLevel,
6338
- secureRoutes: config.secureRoutes
6366
+ secureRoutes: appendCurrentOriginSecureRoute(config.secureRoutes)
6339
6367
  };
6340
6368
  sessionStorage.setItem(KEYCLOAK_SETTINGS_KEY, JSON.stringify(authConfig));
6341
6369
  return authConfig;
@@ -6350,5 +6378,5 @@ const httpLoaderAuthFactory = (httpClient) => {
6350
6378
  * Generated bundle index. Do not edit.
6351
6379
  */
6352
6380
 
6353
- export { APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppLayoutComponent, AppModulesComponent, AppTopbar, AuthGuardService, BaseDataService, BaseModuleComponent, ConfigComponent, ContentType, DEFAULT_OIP_FRONTEND_CONFIG, DbMigrationComponent, DiscussionComponent, ErrorComponent, FooterComponent, HttpClient, KeycloakSecurityService, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, MsgService, NotfoundComponent, NotificationService, OIP_FRONTEND_CONFIG, ProfileComponent, SecurePipe, SecurityComponent, SecurityDataService, SecurityService, SecurityStorageService, SidebarComponent, TableFilterService, TopBarService, UnauthorizedComponent, UserService, httpLoaderAuthFactory, langIntercept, mergeWithDefaults, provideAppThemes, provideLogoComponent, replaceDefaults };
6381
+ export { APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppLayoutComponent, AppModulesComponent, AppTopbar, AuthGuardService, BaseDataService, BaseModuleComponent, ConfigComponent, ContentType, DEFAULT_OIP_FRONTEND_CONFIG, DbMigrationComponent, DiscussionComponent, ErrorComponent, FooterComponent, HttpClient, IframeModuleComponent, KeycloakSecurityService, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, MsgService, NotfoundComponent, NotificationService, OIP_FRONTEND_CONFIG, ProfileComponent, SecurePipe, SecurityComponent, SecurityDataService, SecurityService, SecurityStorageService, SidebarComponent, TableFilterService, TopBarService, UnauthorizedComponent, UserService, httpLoaderAuthFactory, langIntercept, mergeWithDefaults, provideAppThemes, provideLogoComponent, replaceDefaults };
6354
6382
  //# sourceMappingURL=oip-common.mjs.map