Skip to content
Snippets Groups Projects
Commit 95b07bad authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

WS-1002: modified editor component to allow the button to be disabled

parent 62714e72
No related branches found
No related tags found
1 merge request!897WS-1002: modified editor component to allow the button to be disabled
Pipeline #4896 passed
......@@ -2,7 +2,7 @@
<div *ngIf="capabilityVersion.files.length > 0; else noFilesMessage">
<div class="row my-2" *ngFor="let file of capabilityVersion.files">
<div class="col">
<app-editor [customStyle]="true" [modalTitleText]="'Editing ' + file.filename" [textToEdit]="decodeContent(file.content)" (newEditEvent)="catchEditEventFromEditor(file.filename, $event)" (editorOpenEvent)="catchOpenEditorEvent($event)">
<app-editor [shouldDisable]="capabilityVersion.sealed" [customStyle]="true" [modalTitleText]="'Editing ' + file.filename" [textToEdit]="decodeContent(file.content)" (newEditEvent)="catchEditEventFromEditor(file.filename, $event)" (editorOpenEvent)="catchOpenEditorEvent($event)">
<span class="rounded-pill px-2 py-1 filename">
{{ file.filename }}
<span class="fas fa-edit"></span>
......
......@@ -2,6 +2,7 @@
id="open-editor-modal-button"
type="button"
[ngClass]="customStyle ? 'btn' : 'btn btn-primary'"
[disabled]="shouldDisable"
(click)="open(editor)"
>
<ng-content></ng-content>
......
......@@ -29,6 +29,7 @@ export class EditorComponent implements OnInit {
@Input() buttonText = "";
@Input() customStyle: boolean = false
@Input() shouldDisable: boolean = false
// Set original data only when we're ready
@Input() set textToEdit(data: string) {
this._textToEdit = data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment