Skip to content

Commit

Permalink
add formio readonly form
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeyro committed Feb 19, 2024
1 parent 0b9fa28 commit 742e40d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ <h3><em style="color: #337ab7;">{{ translateState(appInstanceStatus?.state) }}</
{{'APP_INSTANCE.UPGRADE_BUTTON' | translate}}
</a>
</li>
<li >
<a role="button" (click)="openShowConfigModal()">
{{'APP_INSTANCE.SHOW_CONFIG_BUTTON' | translate}}
</a>
</li>
<li *roles="['ROLE_SYSTEM_ADMIN' ]">
<a role="button" (click)="this.openVersionUpdateModal()">
{{'APP_INSTANCES.MANUAL_UPDATE.HEADER' | translate}}
Expand Down Expand Up @@ -252,6 +257,33 @@ <h4>{{'UPDATE_CONFIG_MODAL.HEADER' | translate}}</h4>
</div>
</nmaas-modal>

<nmaas-modal styleModal="info" #showConfig>
<div class="nmaas-modal-header">
<h4 style="text-align: center">{{'APP_INSTANCE.CONFIGURATION.HEADER' | translate}}</h4>
</div>
<div class="nmaas-modal-body">
<div class="col-xs-12">
<p *ngIf="appInstance !== undefined && configurationTemplate !== undefined && app?.applicationBase.nmaasDocumentationUrl">
{{ 'APP_INSTANCE.CONFIGURATION.DOCUMENTATION_INFO' | translate }}
<a href="{{app.applicationBase.nmaasDocumentationUrl}}"
target="_blank">{{ 'APP_INSTANCE.CONFIGURATION.NMAAS_TOOLS' | translate}}</a>.
</p>
<hr>
<formio *ngIf="appInstance !== undefined && configurationTemplate !== undefined"
[form]="configurationTemplate"
[options]='{"alerts": {"submitMessage": "Configuration applied"}, "errors": {"message": "Invalid configuration"}}'
[refresh]="refreshForm"
(formLoad)="changeForm()"
[readOnly]="true">
</formio>
</div>
</div>
<div class="nmaas-modal-footer">
<button type="button" class="btn btn-primary"
(click)="this.applyConfig.hide()">{{'UNDEPLOY_MODAL.CANCEL_BUTTON' | translate}}</button>
</div>
</nmaas-modal>

<!-- Installation step description text -->
<div id="app-progress-info" style="font-size: 16px;" class="col-xs-12">
<div id="app-progress-info-sub alert"
Expand Down
11 changes: 11 additions & 0 deletions src/app/appmarket/appinstance/appinstance/appinstance.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export class AppInstanceComponent implements OnInit, OnDestroy {
@ViewChild('manualUpdateModal')
public manualUpdateModal: ModalComponent;

@ViewChild('showConfig')
public showConfig: ModalComponent;

app: ApplicationDTO;


Expand Down Expand Up @@ -618,5 +621,13 @@ export class AppInstanceComponent implements OnInit, OnDestroy {

}

public openShowConfigModal() {
this.showConfig.show()
}

public closeShowConfigModal() {
this.showConfig.hide()
}


}

0 comments on commit 742e40d

Please sign in to comment.